Solved by Michael_Suo in post #2 
              
              
                get_method returns an IValue, which you can sort of think of as like a PyObject. You need to explicitly cast it to the C++ type you want, so you should do hidden.toTensor() to get an at::Tensor.