Make sure to pass the input tensor in the same data type as the layer parameters.
This error is often raised, if you’ve created the input tensor from numpy arrays, since numpy uses float64 as the default type, while PyTorch uses float32.