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

Method __init__

beginner_source/nn_tutorial.py:305–308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

303
304class Mnist_Logistic(nn.Module):
305 def __init__(self):
306 super().__init__()
307 self.weights = nn.Parameter(torch.randn(784, 10) / math.sqrt(784))
308 self.bias = nn.Parameter(torch.zeros(10))
309
310 def forward(self, xb):
311 return xb @ self.weights + self.bias

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected