MCPcopy Create free account
hub / github.com/SooLab/CGFormer / create_custom_forward

Method create_custom_forward

bert/modeling_bert.py:418–422  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

416 if getattr(self.config, "gradient_checkpointing", False):
417
418 def create_custom_forward(module):
419 def custom_forward(*inputs):
420 return module(*inputs, output_attentions)
421
422 return custom_forward
423
424 layer_outputs = torch.utils.checkpoint.checkpoint(
425 create_custom_forward(layer_module),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected