I’m trying to unpack a tuple passed in the arguments of the forward method of a ScriptModule:
@torch.jit.script_module
def forward(self, input, hidden):
x, y = hidden
but the compiler complains that a Tensor cannot be used as a tuple. Fair enough, maybe type annotations will help:
@torch.jit.script_module
def forward(self, input, hidden: tuple):
x, y = hidden
but this throws RuntimeError: Unknown type name tuple
Is there a way to get TorchScript to recognise a tuple passed in to a traced method?