(module, return_dict=None)
| 321 | if self.training and self.gradient_checkpointing: |
| 322 | |
| 323 | def create_custom_forward(module, return_dict=None): |
| 324 | def custom_forward(*inputs): |
| 325 | if return_dict is not None: |
| 326 | return module(*inputs, return_dict=return_dict) |
| 327 | else: |
| 328 | return module(*inputs) |
| 329 | |
| 330 | return custom_forward |
| 331 | |
| 332 | ckpt_kwargs: Dict[str, Any] = {"use_reentrant": False} if is_torch_version(">=", "1.11.0") else {} |
| 333 | encoder_hidden_states, hidden_states = torch.utils.checkpoint.checkpoint( |
nothing calls this directly
no outgoing calls
no test coverage detected