Modules call operator vs. forward functions

(Carsten Ditzel) #1

I am confused. In this tutorial the forward pass in the C++ frontend is invoked by simply using the call operator of the specific class, but that gives the error in the latest nightly

 error: no match for call to ‘(torch::nn::Linear) (at::Tensor&)’
     return linear(input) + another_bias;

However, using the dereference operator in conjunction with the forward member function, i.e.


works. Why is that?