When converting my model to TorchScript, I am using the decorator @torch.jit.export to mark some functions besides forward() to be exported by torch.jit.script().
When loading the TorchScript model in Python, I can indeed access these functions.
My question is regarding C++: since these functions are not included in the standard module interface, I need them to appear in a header file somewhere. Is such a header generated, and if not, how does one call the exported functions from C++?
Thanks. Yes, I just found an earlier question that was asked on this (it seems to be missing from docs at the moment). My function does not take any arguments, but it looks like you still need to pass in an empty vector of IValues. For future reference, here’s what I ended up doing:
Hey I’m trying to check my torchscript model from the python REPL. When I load a jit model with torch.jit.load(), that model doesn’t seem to have a get_method function.
If I’m using python, what is the alternative to get_method