What is this error can anyone help please??
set (dtype= )of the tensor then run the same code snippet If you face this error again then let me know. hope this works
Hey @chakrabortyatri1999, while initializing the tensor use
2. (This creates a FloatTensor) instead of
2 (This creates a LongTensor) which might not be supported by many methods.
One more thing you can do as suggested by @lakshaysethia is
tnsr = torch.tensor([1, -1, 4], dtype=torch.float32)