diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index a4787e769f62ebbefd3ea6b70b402e660c02b576..56971cff43b919f946091cebf909731a23d60736 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -8479,8 +8479,7 @@ def shape(input): """ helper = LayerHelper('shape', **locals()) - out = helper.create_variable_for_type_inference( - dtype=helper.input_dtype('input')) + out = helper.create_variable_for_type_inference(dtype='int32') helper.append_op( type='shape', inputs={'Input': input}, outputs={'Out': out})