Re-initialization of torch.jit.script module

Hi,

I have a torch.jit.script module saved in Python and I load it in C++ for training. There are certain parameters which are passed to the init() of this module class, which I understand, are a part of the torch.jit.script module. Is there any way of changing these module class parameters after loading the module in CPP?

Note: If I create an api for modifying a class parameter, and if that parameter is being used by the forward api, then I get a runtime error while creating a torch.jit.script module of that class.

1 Like