【发布时间】:2019-03-13 22:03:27
【问题描述】:
无论张量的形状如何,我都在尝试更新一整列,列的索引也可以是形状范围内的任何内容。
tensor = tf.Variable(tf.ones((5,5)))
我正在尝试实现这个 numpy 操作:
tensor[:,2] = 0
[ 1 1 0 1 1 ]
[ 1 1 0 1 1 ]
[ 1 1 0 1 1 ]
[ 1 1 0 1 1 ]
[ 1 1 0 1 1 ]
我尝试使用 tf.scatter_update 但没有成功。
【问题讨论】:
标签: python numpy tensorflow