MCPcopy Create free account
hub / github.com/Hzfinfdu/Diffusion-BERT / create_custom_forward

Method create_custom_forward

models/modeling_bert.py:594–598  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

592 use_cache = False
593
594 def create_custom_forward(module):
595 def custom_forward(*inputs):
596 return module(*inputs, past_key_value, output_attentions)
597
598 return custom_forward
599
600 layer_outputs = torch.utils.checkpoint.checkpoint(
601 create_custom_forward(layer_module),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected