In the constructor we instantiate four parameters and assign them as member parameters.
(self)
| 16 | |
| 17 | class Polynomial3(torch.nn.Module): |
| 18 | def __init__(self): |
| 19 | """ |
| 20 | In the constructor we instantiate four parameters and assign them as |
| 21 | member parameters. |
| 22 | """ |
| 23 | super().__init__() |
| 24 | self.a = torch.nn.Parameter(torch.randn(())) |
| 25 | self.b = torch.nn.Parameter(torch.randn(())) |
| 26 | self.c = torch.nn.Parameter(torch.randn(())) |
| 27 | self.d = torch.nn.Parameter(torch.randn(())) |
| 28 | |
| 29 | def forward(self, x): |
| 30 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected