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
Create two random tensors of shape (2, 3) and send them both to the GPU (you'll need access to a GPU for this). Set torch.manual_seed(1234) when creating the tensors (this doesn't have to be the GPU random seed). The output should be something like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Answer is Not matching Q6:
Create two random tensors of shape (2, 3) and send them both to the GPU (you'll need access to a GPU for this). Set torch.manual_seed(1234) when creating the tensors (this doesn't have to be the GPU random seed). The output should be something like:
ANSWER Given:
Device: cuda
(tensor([[0.0290, 0.4019, 0.2598],
[0.3666, 0.0583, 0.7006]], device='cuda:0'),
tensor([[0.0518, 0.4681, 0.6738],
[0.3315, 0.7837, 0.5631]], device='cuda:0'))
my OUTPUT:
Device: cuda
tensor([[0.1272, 0.8167, 0.5440],
[0.6601, 0.2721, 0.9737]], device='cuda:0')
tensor([[0.1272, 0.8167, 0.5440],
[0.6601, 0.2721, 0.9737]], device='cuda:0')
CODE:
RANDOM_SEED=1234 d='cuda' if torch.cuda.is_available() else 'cpu' torch.manual_seed(RANDOM_SEED) tensor_C=torch.rand(2,3,device=d) tensor_D=torch.rand(2,3,device=d) print(f'Device: {d}') print(tensor_C) print(tensor_D)Beta Was this translation helpful? Give feedback.
All reactions