From e5a9f45eb028a5beab4f9c9d9f4bb9de41508892 Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Wed, 2 Sep 2026 13:30:31 -0400 Subject: [PATCH] Replace removed use_cuda profiler kwarg with use_device --- beginner_source/introyt/autogradyt_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/introyt/autogradyt_tutorial.py b/beginner_source/introyt/autogradyt_tutorial.py index 6320af08672..304890ccce0 100644 --- a/beginner_source/introyt/autogradyt_tutorial.py +++ b/beginner_source/introyt/autogradyt_tutorial.py @@ -490,7 +490,7 @@ def add_tensors2(x, y): y = torch.rand(2, 3, requires_grad=True) z = torch.ones(2, 3, requires_grad=True) -with torch.autograd.profiler.profile(use_cuda=run_on_gpu) as prf: +with torch.autograd.profiler.profile(use_device="cuda" if run_on_gpu else None) as prf: for _ in range(1000): z = (z / x) * y