You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What to write in place of the device in this code?
Additional context
Hey, I am trying to run the profiling and unable to understand that what I need to write in place of "device" in the following code.
img = torch.rand(8 if torch.cuda.is_available() else 1, 3, 320, 320).to(device)
y = model(img, profile=True)
If in case I remove the "device" from here then it throws me the following error:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-7-f21874f58c27> in <module>()
----> 1 img = torch.rand(8 if torch.cuda.is_available() else 1, 3, 320, 320).to(device)
2 y = model(img, profile=True)
NameError: name 'device' is not defined
The text was updated successfully, but these errors were encountered:
❔Question
What to write in place of the device in this code?
Additional context
Hey, I am trying to run the profiling and unable to understand that what I need to write in place of "device" in the following code.
If in case I remove the "device" from here then it throws me the following error:
The text was updated successfully, but these errors were encountered: