Thanks for the reply. I tried what you said with both kFloat64 and kDouble. However, I still get an error when I try to forward this tensor in the network:

Exception: Expected object of scalar type Double but got scalar type Float for argument #2 ‘mat2’ in call to _th_mm (checked_dense_tensor_unwrap at C:\w\1\s\windows\pytorch\aten\src\ATen/Utils.h:84)

Also, I’m not using GPU, only CPU.