Hi,
You need to use torch.from_numpy() to have proper conversion behavior.
The error you see is because the TensorDataset expects all inputs to contain the same number of elements. In particular, here, I expect x_valid2.size(0) != y_valid2.size(0).