def eval_graphs(my_graph, tf_graph, my_var, tf_var, n):
tf_grads = 0
if tf_graph is not None:
tf_grads = tf_graph.eval()
my_grads = my_graph()
print("---------- " + str(n) + "df w.r.t. " + str(my_var) + " ----------")
print("My_val:", my_grads)
print("Tf_val:", tf_grads)
my_val = np.broadcast_to(my_grads, my_var.shape)
tf_val = np.broadcast_to(tf_grads, my_var.shape)
arrays_allclose(my_val, tf_val)
评论列表
文章目录