Hi,
You should use torch.from_numpy() 129 to convert numpy arrays to Tensor before giving them to pytorch’s function to improve performances.
The error you see most certainly comes from the fact that not all numpy arrays can be represented as Tensor (arrays that were flipped in particular). You can use np.ascontiguousarray() 334 before giving your array to pytorch to make sure it will work.