Skip to content

Commit

Permalink
fix range op (#37486) (#37611)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang authored Nov 30, 2021
1 parent 3a0c550 commit a5cf2e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/paddle/fluid/layers/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,9 @@ def range(start, end, step, dtype, name=None):
step = cast(step, dtype)

if in_dygraph_mode():
return _C_ops.range(start, end, step)
out = _C_ops.range(start, end, step)
out.stop_gradient = True
return out

out_shape = None
if not isinstance(start, Variable) and not isinstance(
Expand Down

0 comments on commit a5cf2e3

Please sign in to comment.