Skip to content

Commit f380781

Browse files
Removed unnecessary .to() call since it has no effect before .cuda() (#3783)
Fixes #3782 ## Description Removed unnecessary `.to()` in the `generate_data` function. cc @williamwen42 @msaroufim @anijain2305 @angelayi Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
1 parent 3e6cc9b commit f380781

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

intermediate_source/torch_compile_full_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def timed(fn):
7979
# batch size.
8080
def generate_data(b):
8181
return (
82-
torch.randn(b, 3, 128, 128).to().cuda(),
82+
torch.randn(b, 3, 128, 128).cuda(),
8383
torch.randint(1000, (b,)).cuda(),
8484
)
8585

0 commit comments

Comments
 (0)