Skip to content

Commit

Permalink
mark step before
Browse files Browse the repository at this point in the history
  • Loading branch information
will-cromar committed May 17, 2024
1 parent ae0f791 commit 7a18a76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions torch_xla/torch_xla.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def step():
works with `xla.step` but does not follow best practices will become errors in
future releases. See https://github.com/pytorch/xla/issues/6751 for context.
"""
# Clear pending operations
xm.mark_step()

try:
yield
finally:
Expand Down

0 comments on commit 7a18a76

Please sign in to comment.