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

Method __init__

beginner_source/blitz/neural_networks_tutorial.py:47–56  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45class Net(nn.Module):
46
47 def __init__(self):
48 super().__init__()
49 # 1 input image channel, 6 output channels, 5x5 square convolution
50 # kernel
51 self.conv1 = nn.Conv2d(1, 6, 5)
52 self.conv2 = nn.Conv2d(6, 16, 5)
53 # an affine operation: y = Wx + b
54 self.fc1 = nn.Linear(16 * 5 * 5, 120) # 5*5 from image dimension
55 self.fc2 = nn.Linear(120, 84)
56 self.fc3 = nn.Linear(84, 10)
57
58 def forward(self, input):
59 # Convolution layer C1: 1 input image channel, 6 output channels,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected