Skip to content

Commit

Permalink
2023-11-08
Browse files Browse the repository at this point in the history
  • Loading branch information
yangguohao committed Nov 8, 2023
1 parent cda1638 commit 4c14a36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion python/paddle/tensor/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,14 @@ def sqrt(x, name=None):
check_variable_and_dtype(
x,
'x',
['float16', 'uint16', 'float32', 'float64'],
[
'float16',
'uint16',
'float32',
'float64',
'complex64',
'complex128',
],
'sqrt',
)
helper = LayerHelper('sqrt', **locals())
Expand Down
4 changes: 3 additions & 1 deletion test/legacy_test/op_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,9 @@ def _dfs_grad_op(op_desc, fwd_op_desc=None):
has_infer_inplace = base.core.has_infer_inplace(op_desc.type())
has_grad_op_maker = base.core.has_grad_op_maker(op_desc.type())
has_infer_inplace_in_grad_descendants = False
if not has_grad_op_maker:
# the OP test doesn't support higher order grad
is_grad_op_desc = op_desc.type().endswith('_grad')
if not has_grad_op_maker or is_grad_op_desc:
has_infer_inplace_in_descendants = False
else:
# get grad_op_desc
Expand Down

0 comments on commit 4c14a36

Please sign in to comment.