Hello,
What’s the best way to write TorchScript code which does this:
class S(torch.jit.ScriptModule):
    def __init__(self):
        self.tensor_constant = torch.ones(2)

    @torch.jit.script_method
    def forward(self):
        return self.tensor_constant + 2

S()

It fails with
attribute 'tensor_constant' of type 'Tensor' is not usable in a script method (Tensors must be added to a module as a buffer or parameter):
In other words, in TorchScript how can I use a tensor populated using a different module?
Thanks,
Omkar