|
|
|
@ -5556,6 +5556,12 @@ def reshape(x, shape, actual_shape=None, act=None, inplace=False, name=None):
|
|
|
|
|
dim = fluid.layers.fill_constant([1], "int32", 5)
|
|
|
|
|
reshaped_2 = fluid.layers.reshape(data_2, shape=[dim, 10])
|
|
|
|
|
# the shape of reshaped_2 is [5,10].
|
|
|
|
|
|
|
|
|
|
# example 3:
|
|
|
|
|
data_3 = fluid.data(
|
|
|
|
|
name="data_3", shape=[2,4,6], dtype='float32')
|
|
|
|
|
reshaped_3 = fluid.layers.reshape(x=data_3, shape=[6,8])
|
|
|
|
|
# the shape of reshaped_3 is [6,8].
|
|
|
|
|
"""
|
|
|
|
|
if in_dygraph_mode():
|
|
|
|
|
#TODO(zhiqiu): open inplace if we can.
|
|
|
|
|