MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / forward

Method forward

tests/unit/simple_model.py:60–66  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

58 return custom
59
60 def forward(self, x, y):
61 if len(self.linears) == 1:
62 x = self.linears[0](x)
63 else:
64 for i, l in enumerate(self.linears):
65 x = self.linears[i // 2](x) + l(x)
66 return self.cross_entropy_loss(x, y)
67
68
69class SimpleMoEModel(torch.nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected