维度重组
tf.reshape(tensor,shape,name=None):
tensor:输入张量;
shape:重组后张量的维度。
代码:
reshape_1 = tf.constant([[1,2,3],[4,5,6]])
print(reshape_1)
tf.reshape(reshape_1, (3,2))
输出:
维度重组
tf.reshape(tensor,shape,name=None):
tensor:输入张量;
shape:重组后张量的维度。
代码:
reshape_1 = tf.constant([[1,2,3],[4,5,6]])
print(reshape_1)
tf.reshape(reshape_1, (3,2))
输出: