MCPcopy Create free account
hub / github.com/pytorch/tutorials / __init__

Method __init__

beginner_source/introyt/modelsyt_tutorial.py:50–56  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48class TinyModel(torch.nn.Module):
49
50 def __init__(self):
51 super().__init__()
52
53 self.linear1 = torch.nn.Linear(100, 200)
54 self.activation = torch.nn.ReLU()
55 self.linear2 = torch.nn.Linear(200, 10)
56 self.softmax = torch.nn.Softmax(dim=1)
57
58 def forward(self, x):
59 x = self.linear1(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected