In the forward function we accept a Tensor of input data and we must return a Tensor of output data. We can use Modules defined in the constructor as well as arbitrary operators on Tensors.
(self, x)
| 27 | self.d = torch.nn.Parameter(torch.randn(())) |
| 28 | |
| 29 | def forward(self, x): |
| 30 | """ |
| 31 | In the forward function we accept a Tensor of input data and we must return |
| 32 | a Tensor of output data. We can use Modules defined in the constructor as |
| 33 | well as arbitrary operators on Tensors. |
| 34 | """ |
| 35 | return self.a + self.b * x + self.c * x ** 2 + self.d * x ** 3 |
| 36 | |
| 37 | def string(self): |
| 38 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected