I had a matrix saved as a numpy type, call it "X_before" (for example, its shape is 100*30).
Since I want to feed it to an AutoEncoder using Pytorch library, I converted it to torch.tensor
like this:
X_tensor = torch.from_numpy(X_before, dtype=torch)
Then, I got the following error:
expected scalar type Float but found Double
Next, I tried to make elements as "float" and then convert them torch.tensor:
X_before = X_before.astype(float)
X_tensor = torch.from_numpy(X_before)
Again, the same error happens. How should I solve this issue? How can I convert the type of elements in a torch.tensor object to another type?
Thanks in advance