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

Method __init__

tests/small_model_debugging/test_model.py:17–24  ·  view source on GitHub ↗
(self, hidden_dim, empty_grad=False)

Source from the content-addressed store, hash-verified

15class SimpleModel(torch.nn.Module):
16
17 def __init__(self, hidden_dim, empty_grad=False):
18 super(SimpleModel, self).__init__()
19 self.linear = torch.nn.Linear(hidden_dim, hidden_dim, bias=True)
20 self.linear = torch.nn.Linear(hidden_dim, hidden_dim, bias=False)
21 if empty_grad:
22 self.layers2 = torch.nn.ModuleList([torch.nn.Linear(hidden_dim,
23 hidden_dim)]) #QuantizeLinear(hidden_dim, hidden_dim)
24 self.cross_entropy_loss = torch.nn.CrossEntropyLoss()
25
26 def forward(self, x, y):
27 hidden = x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected