The module to serialize and execute.
| 14 | |
| 15 | |
| 16 | class ModuleAdd(torch.nn.Module): |
| 17 | """The module to serialize and execute.""" |
| 18 | |
| 19 | def __init__(self): |
| 20 | super(ModuleAdd, self).__init__() |
| 21 | |
| 22 | def forward(self, x, y): |
| 23 | return x + y |
| 24 | |
| 25 | def get_methods_to_export(self): |
| 26 | return ("forward",) |
| 27 | |
| 28 | def get_inputs(self): |
| 29 | return (torch.ones(2, 2), torch.ones(2, 2)) |
| 30 | |
| 31 | |
| 32 | class ModuleChannelsLast(torch.nn.Module): |
no outgoing calls