【发布时间】:2017-04-07 18:16:41
【问题描述】:
在创建计算图期间,我有一个张量 x,例如形状为[-1, a, b, c],我想将其重塑为[-1, a*b*c]
我试着这样做:
n = functools.reduce(operator.mul, x.shape[1:], 1)
tf.reshape(x, [-1, n])
但我有一个错误:
TypeError: unsupported operand type(s) for *: 'int' and 'Dimension'
我的问题是:有 TensorFlow 做这个操作吗?
【问题讨论】:
标签: python tensorflow reshape dimension