Skip to content

Commit 287a02b

Browse files
louie-tsaimalfet
andcommitted
Update recipes_source/recipes/profiler_recipe.py
Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
1 parent a4fdf37 commit 287a02b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

recipes_source/recipes/profiler_recipe.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,7 @@
312312
# Users could switch between cpu, cuda and xpu
313313
device = 'cuda'
314314

315-
activities = [ProfilerActivity.CPU]
316-
if device == 'cuda':
317-
activities.append(ProfilerActivity.CUDA)
318-
elif device == 'xpu':
319-
activities.append(ProfilerActivity.XPU)
315+
activities = [ProfilerActivity.CPU, ProfilerActivity.CUDA, ProfilerActivity.XPU]
320316

321317
model = models.resnet18().to(device)
322318
inputs = torch.randn(5, 3, 224, 224).to(device)

0 commit comments

Comments
 (0)