(self, x: Tensor)
| 334 | self._add_child("child2", cfg.child) |
| 335 | |
| 336 | def forward(self, x: Tensor) -> Tensor: |
| 337 | cfg = self.config |
| 338 | # It is ok to call another method of 'self' directly, if it is invoked only once in the |
| 339 | # current context. |
| 340 | self.vprint(1, "input={x}", x=x) |
| 341 | x = self.inc(x) |
| 342 | if cfg.child is not None: |
| 343 | # Can also call children directly, if each child is invoked only once. |
| 344 | x = self.child1(x) |
| 345 | x = self.child2(x) |
| 346 | self.vprint(1, "output={x}", x=x) |
| 347 | return x |
| 348 | |
| 349 | def invoke_grandchildren(self, x): |
| 350 | x = self.child1.child2(x) |
no test coverage detected