快速调试TF

(tf115) [xxxxx@macpro pai_tf_model]
$ ~/.local/bin/jupyter-console

import tensorflow as tf
A = tf.SparseTensor(indices=[[0, 0], [1, 2]], values=[1, 2], dense_shape=[3, 4])
b = tf.SparseTensor(A.indices, tf.ones_like(A.values, tf.int32), A.dense_shape)
row_count = tf.sparse_reduce_sum(b, axis=1)

sess = tf.InteractiveSession()
sess.run(row_count)
原文地址:https://www.cnblogs.com/bregman/p/13446914.html