Skip to content

Commit

Permalink
fix expand op lack of float16
Browse files Browse the repository at this point in the history
  • Loading branch information
HexToString committed Apr 13, 2021
1 parent 6e946e9 commit 80a4ee0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/paddle/fluid/layers/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10332,7 +10332,8 @@ def expand(x, expand_times, name=None):
inputs = {"X": [x]}
attrs = {}
check_variable_and_dtype(
x, 'x', ['bool', 'float32', 'float64', 'int32', 'int64'], 'expand')
x, 'x', ['bool', 'float16', 'float32', 'float64', 'int32', 'int64'],
'expand')
check_type(expand_times, 'expand_times', (list, tuple, Variable), 'expand')
if convert_dtype(x.dtype) == 'bool' and x.stop_gradient == True:
raise ValueError(
Expand Down
3 changes: 2 additions & 1 deletion python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,8 @@ def expand(x, shape, name=None):
'Elements in shape must be 1-D Tensors or integers.')

check_variable_and_dtype(
x, 'x', ['bool', 'float32', 'float64', 'int32', 'int64'], 'expand')
x, 'x', ['bool', 'float16', 'float32', 'float64', 'int32', 'int64'],
'expand')
check_type(shape, 'shape', (list, tuple, Variable), 'expand')
if convert_dtype(x.dtype) == 'bool' and x.stop_gradient == False:
raise ValueError("When the data type of input 'x' for expand is bool, "
Expand Down

1 comment on commit 80a4ee0

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.