RuntimeError: expand(torch.FloatTensor{[1, 1]}, size=[1]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)
For a custom dataset. The dataset is using TensorDataset from PyTorch, and is supplying a 1D tensor, but for some reason it fails as [1, 1].
The way I create the dataset:
...
tensor_y = torch.stack([torch.Tensor(i) for i in y]) # i is a 1D vector
return data.TensorDataset(tensor_x, tensor_y)
From the following line:
I am getting the following error:
For a custom dataset. The dataset is using
TensorDataset
from PyTorch, and is supplying a 1D tensor, but for some reason it fails as [1, 1].The way I create the dataset: