In a complicated model, I have several complex custom c++ ops that generate and receive c++ objects. (De)serializing the c++ objects into byte tensors is not a good solution as it incurs serialization overhead. This can be done in tensorflow (graph mode) by storing the c++ object as the state the the custom c++ op and forward it’s raw pointer as a tensor. How can I do similar thing in pytorch?
Thanks.