Skip to content

Commit

Permalink
Changed LazyAwaitable.__torch_function__ to clasmethod (pytorch#2270)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#2270

This avoids the deprecation warning causing a lot of log spam.

Reviewed By: idning, yjhao, sarckk, wanchaol

Differential Revision: D60775821

fbshipit-source-id: d42ad58578cf3756e8d854db70b2877263d07602
  • Loading branch information
awgu authored and facebook-github-bot committed Aug 5, 2024
1 parent 76c7e65 commit 429ac23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torchrec/distributed/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ def _wait_async(obj: Any) -> Any:
else:
return obj

@classmethod
# pyre-ignore [2, 3]
def __torch_function__(self, func, types, args=(), kwargs=None):
def __torch_function__(cls, func, types, args=(), kwargs=None):
"""
The LazyAwaitable type has a `__torch_function__` implementation.
This means when this type is seens as an argument to a PyTorch
Expand Down

0 comments on commit 429ac23

Please sign in to comment.