Skip to content

Commit

Permalink
Update tensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfeiBai committed Sep 23, 2024
1 parent 7c6ca1d commit 5490b37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions experimental/torch_xla2/torch_xla2/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ def __torch_function__(self,
return self.env.dispatch(func, types, args, kwargs)
except OperatorNotFound:
pass
if _name_of_func(func) in ('rot90'): # skip rot90 with k%4==0 due to no change
if len(args) >= 2 and type(args[1]) == int:
if ((args[1])%4 == 0):
return args[0]
return func(*args, **(kwargs or {}))


Expand Down

0 comments on commit 5490b37

Please sign in to comment.