MCPcopy Create free account
hub / github.com/Tele-AI/Telechat / create_custom_forward

Method create_custom_forward

models/7B/modeling_telechat.py:700–705  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

698 if self.gradient_checkpointing and self.training:
699
700 def create_custom_forward(module):
701 def custom_forward(*inputs):
702 # None for past_key_value
703 return module(*inputs, use_cache=use_cache, output_attentions=output_attentions)
704
705 return custom_forward
706
707 outputs = torch.utils.checkpoint.checkpoint(
708 create_custom_forward(block),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected