Skip to content

Commit 7113750

Browse files
author
Mark Saroufim
committed
remove .item() call
1 parent a750cdc commit 7113750

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cuda_core/examples/pytorch_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import torch
1010

11-
from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, Stream, launch
11+
from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch
1212

1313
# SAXPY kernel - passing a as a pointer to avoid any type issues
1414
code = """
@@ -101,6 +101,6 @@ def __cuda_stream__(self):
101101
launch(s, config, ker, *ker_args)
102102

103103
# check result
104-
assert torch.allclose(out, a.item() * x + y)
104+
assert torch.allclose(out, a * x + y)
105105
print("Double precision test passed!")
106106
print("All tests passed successfully!")

0 commit comments

Comments
 (0)