Just like any class in Python, you can also define custom method on PyTorch modules
(self)
| 43 | return y |
| 44 | |
| 45 | def string(self): |
| 46 | """ |
| 47 | Just like any class in Python, you can also define custom method on PyTorch modules |
| 48 | """ |
| 49 | return f'y = {self.a.item()} + {self.b.item()} x + {self.c.item()} x^2 + {self.d.item()} x^3 + {self.e.item()} x^4 ? + {self.e.item()} x^5 ?' |
| 50 | |
| 51 | |
| 52 | # Create Tensors to hold input and outputs. |