【发布时间】:2023-03-18 00:55:01
【问题描述】:
我需要如下操作张量
ary = np.array([82.20674918566776, 147.55325947521865, 25.804872964169384, 85.34690767735665, 1, 0]).reshape(1,1,1,1,6)
tf_array = tf.convert_to_tensor(ary, tf.float32)
value_x = 13.0
norm_value = 416.0
tf_array[...,0:4] = tf_array[...,0:4] * (value_x / norm_value)
执行时
TypeError: 'Tensor' 对象不支持项目分配
【问题讨论】:
标签: python-3.x tensorflow