(self, *inputs, **kwargs)
| 133 | return HookHandler(self._forward_hooks, hook) |
| 134 | |
| 135 | def __call__(self, *inputs, **kwargs): |
| 136 | AutoNaming.push_scope(self.name if self.name is not None else self._short_name) |
| 137 | for hook in self._forward_pre_hooks.values(): |
| 138 | modified_inputs = hook(self, inputs) |
| 139 | if modified_inputs is not None: |
| 140 | if not isinstance(modified_inputs, tuple): |
| 141 | modified_inputs = (modified_inputs,) |
| 142 | inputs = modified_inputs |
| 143 | |
| 144 | outputs = self.forward(*inputs, **kwargs) |
| 145 | |
| 146 | for hook in self._forward_hooks.values(): |
| 147 | modified_outputs = hook(self, inputs, outputs) |
| 148 | if modified_outputs is not None: |
| 149 | outputs = modified_outputs |
| 150 | AutoNaming.pop_scope() |
| 151 | return outputs |
| 152 | |
| 153 | def _flatten( |
| 154 | self, |
nothing calls this directly
no test coverage detected