diff --git a/beginner_source/basics/tensorqs_tutorial.py b/beginner_source/basics/tensorqs_tutorial.py index 30e05cb10d..3b44164583 100644 --- a/beginner_source/basics/tensorqs_tutorial.py +++ b/beginner_source/basics/tensorqs_tutorial.py @@ -111,8 +111,8 @@ # across devices can be expensive in terms of time and memory! # We move our tensor to the current accelerator if available -if torch.accelerator.is_available(): - tensor = tensor.to(torch.accelerator.current_accelerator()) +if torch.cuda.is_available(): + tensor = tensor.to("cuda") ######################################################################