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

Method forward

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

Source from the content-addressed store, hash-verified

105 self.cross_entropy_loss = torch.nn.CrossEntropyLoss()
106
107 def forward(self, x, y):
108 hidden_dim = self.linear1(x)
109 output, _, _ = self.moe_1(hidden_dim)
110 output = self.linear2(output)
111 output, _, _ = self.moe_2(output)
112 output = self.linear3(output)
113 hidden_dim = hidden_dim + output
114 sentence_embed = hidden_dim.mean(1)
115 return self.cross_entropy_loss(sentence_embed, y)
116
117
118class SimplePRMoEModel(torch.nn.Module):

Callers

nothing calls this directly

Calls 1

meanMethod · 0.45

Tested by

no test coverage detected