Name 'Tensor' is not defined

i import Torch already, how come tensor is not defined.
also tried from torch import tensor


You might want to check a python tutorial on how to import libraries.
But if you do:

import torch

This will work.

i am sure that i corretly import all libraries.

In that file you access Tensor and not torch.Tensor. So for that to work, if you want a pytorch Tensor, you need to have from torch import Tensor (capital T) in that file.

still wont work

That is surprising. Do you delete it later?
If you have just this import and this call. This will work fine.

Use torch.tensor(1)
instead of torch.Tensor(1)