(self, module: torch.nn.Module)
| 128 | return module |
| 129 | |
| 130 | def reset_state(self, module: torch.nn.Module): |
| 131 | if self._is_stateful: |
| 132 | raise NotImplementedError("This hook is stateful and needs to implement the `reset_state` method.") |
| 133 | return module |
| 134 | |
| 135 | def _set_context(self, module: torch.nn.Module, name: str) -> None: |
| 136 | # Iterate over all attributes of the hook to see if any of them have the type `StateManager`. If so, call `set_context` on them. |
no outgoing calls
no test coverage detected