fix bug: Reshape attr:shape may come from Gather by a scalar indices
@@ -814,6 +814,8 @@ class OpSet9():
inputs=val_shape,
output=val_shape_cast,
param_attr={'dtype': string('int32')})
+ # shape may be [], come form Gather by scalar indices
+ if len(val_shape.out_shapes[0]) > 0:
node.fluid_code.add_layer(
'reshape',
inputs=val_shape_cast,
@@ -826,6 +828,8 @@ class OpSet9():
output=node,
param_attr=attr)
else:
+ # shape may be [], come form Gather by scalar indices
+ if len(val_shape.out_shapes[0]) > 0:
node.fluid_code.add_layer(
'reshape',
inputs=val_shape,
