MCPcopy Create free account
hub / github.com/huggingface/transformers / forward

Method forward

tests/test_trainer_distributed.py:54–58  ·  view source on GitHub ↗
(self, input_ids, labels=None)

Source from the content-addressed store, hash-verified

52 self.fc = nn.Linear(120, 80)
53
54 def forward(self, input_ids, labels=None):
55 if labels is not None:
56 return torch.tensor(0.0, device=input_ids.device), input_ids
57 else:
58 return input_ids
59
60
61if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected