| 24 | return grad_o * 10 |
| 25 | |
| 26 | class Simple(Module): |
| 27 | def __init__(self, a): |
| 28 | super().__init__() |
| 29 | self.a = Parameter(a, dtype=np.float32) |
| 30 | self.layer1 = MulFunc() |
| 31 | |
| 32 | def forward(self): |
| 33 | x = self.layer1(self.a) |
| 34 | return x |
| 35 | |
| 36 | net = Simple(av) |
| 37 | gm = ad.GradManager().attach(net.parameters()) |
no outgoing calls