Replies: 1 comment
-
Hi, I think you forget the parentheses and there's no need for a semicolon at the end. import torch
vector = torch.tensor([7,7])
vector |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am new to coding and am following a video learning how to use Pytorch so this may be a stupid question. Does anyone know why this isn't working? I tried importing the torch class also and it threw the same error.
## Vector import torch vector = torch.tensor[(7, 7)] vector
It's throwing this error.
TypeError Traceback (most recent call last)
in <cell line: 3>()
1 ## Vector
2 import torch
----> 3 vector = torch.tensor[7, 7];
4 vector
TypeError: 'builtin_function_or_method' object is not subscriptable
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions