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

Method forward

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

Source from the content-addressed store, hash-verified

137 self.cross_entropy_loss = torch.nn.CrossEntropyLoss()
138
139 def forward(self, x, y):
140 hidden_dim = x
141 hidden_dim = self.linear(hidden_dim)
142 output, _, _ = self.linear2(hidden_dim)
143 output, _, _ = self.linear3(output)
144 hidden_dim = hidden_dim + output
145 sentence_embed = hidden_dim.mean(1)
146 return self.cross_entropy_loss(sentence_embed, y)
147
148
149class UnusedParametersModel(SimpleModel):

Callers

nothing calls this directly

Calls 1

meanMethod · 0.45

Tested by

no test coverage detected