How can I change the dtype of a torch::nn::Linear layer. It seems to be float32 be default because when I pass a torch::Tensor with dtype=float64 I get the following error:
libc++abi: terminating due to uncaught exception of type c10::Error: expected scalar type Double but found Float
If you know the dtype when the layer is created I would also check if the layer accepts a dtype parameter on when it is created similar to the Python API.