This module exists to work around torchscript typing issues list -> list
| 64 | |
| 65 | |
| 66 | class SequentialTuple(nn.Sequential): |
| 67 | """ This module exists to work around torchscript typing issues list -> list""" |
| 68 | def __init__(self, *args): |
| 69 | super(SequentialTuple, self).__init__(*args) |
| 70 | |
| 71 | def forward(self, x: Tuple[torch.Tensor, torch.Tensor]) -> Tuple[torch.Tensor, torch.Tensor]: |
| 72 | for module in self: |
| 73 | x = module(x) |
| 74 | return x |
| 75 | |
| 76 | |
| 77 | class Transformer(nn.Module): |