We use
linear3(register_module("linear3",torch::nn::Linear(100,out_sz)))
to create a Linear layer. However it looks like that the default type of it is kFloat
. If x
is kDouble
type, then linear3->forward(x)
will generate an error.
Then how do we use double type data as input?