Skip to content
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