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

Method __init__

tests/unit/multi_output_model.py:12–16  ·  view source on GitHub ↗
(self, hidden_dim, weight_value)

Source from the content-addressed store, hash-verified

10class MultiOutputModel(torch.nn.Module):
11
12 def __init__(self, hidden_dim, weight_value):
13 super(MultiOutputModel, self).__init__()
14 self.linear = torch.nn.Linear(hidden_dim, hidden_dim, bias=False)
15 self.linear.weight.data.fill_(weight_value)
16 self.cross_entropy_loss = torch.nn.CrossEntropyLoss()
17
18 def forward(self, inputs, targets):
19 losses = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected