I wonder if register_parameter is expected to work with ScriptdModules, for example:
import torch
module = torch.jit.trace(torch.nn.Linear(10, 10), torch.randn(100, 10))
module.register_parameter("new_parameter", torch.nn.Parameter(torch.randn(10, 10)))


AttributeError: cannot assign parameter before Module.init() call

I don’t have an specific use case for this… I am implementing a ScriptModule wrapper for R’s implementation of torch and wanted to know if this is expected to wok.