Skip to content

Commit

Permalink
fix bug in amp O2 (#32343)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangxu96 authored Apr 21, 2021
1 parent 7bae5e9 commit 4be3b05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/fluid/contrib/mixed_precision/fp16_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _insert_cast_op(block, op, idx, src_dtype, dest_dtype):
if in_name not in {'X', 'Z'}:
continue
for in_var_name in op.input(in_name):
in_var = block.var(in_var_name)
in_var = block._find_var_recursive(in_var_name)
if in_var.type not in _valid_types or in_var.dtype == dest_dtype:
continue
if in_var.dtype == src_dtype:
Expand Down

0 comments on commit 4be3b05

Please sign in to comment.