I’m writing a custom op for TorchScript, and the c++ function is like
at::Tensor myforward(const at::Tensor& input0,  // input
                           const at::Tensor& input1,  // weight
                           const optional<Tensor>& input2,  // bias

because the bias may be None in python, and how to convert the optional to Tensor?
I tried input2.value_or(Tensor{}) but couldn’t be compiled.