Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FutureWarning] Resolving warnings caused by deprecated function usage. #7814

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/dgl/backend/pytorch/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __exit__(self, *args, **kargs):
# and do it only in a nested autocast context.
def _disable_autocast_if_enabled():
if th.is_autocast_enabled():
return th.cuda.amp.autocast(enabled=False)
return th.amp.autocast("cuda", enabled=False)
else:
return empty_context()

Expand All @@ -154,8 +154,8 @@ def _cast_if_autocast_enabled(*args):
if not th.is_autocast_enabled():
return args
else:
return th.cuda.amp.autocast_mode._cast(
args, th.get_autocast_gpu_dtype()
return th.amp.autocast_mode._cast(
args, "cuda", th.get_autocast_gpu_dtype()
)


Expand Down
Loading