r"""Applies function ``fn`` to all the modules within this module, including itself. Args: fn: the function to be applied on modules.
(self, fn: "Callable[[Module], Any]")
| 373 | ) |
| 374 | |
| 375 | def apply(self, fn: "Callable[[Module], Any]") -> None: |
| 376 | r"""Applies function ``fn`` to all the modules within this module, including |
| 377 | itself. |
| 378 | |
| 379 | Args: |
| 380 | fn: the function to be applied on modules. |
| 381 | """ |
| 382 | for it in self.modules(): |
| 383 | fn(it) |
| 384 | |
| 385 | @deprecated(version="1.0") |
| 386 | def zero_grad(self) -> None: |
no test coverage detected