MCPcopy Create free account
hub / github.com/CausalLearning/robust-unlearnable-examples / _make_layer

Method _make_layer

models/resnet.py:79–85  ·  view source on GitHub ↗
(self, block, planes, num_blocks, stride)

Source from the content-addressed store, hash-verified

77 self.linear = nn.Linear(512*block.expansion, out_dims)
78
79 def _make_layer(self, block, planes, num_blocks, stride):
80 strides = [stride] + [1]*(num_blocks-1)
81 layers = []
82 for stride in strides:
83 layers.append(block(self.in_planes, planes, stride, self.wide))
84 self.in_planes = planes * block.expansion
85 return nn.Sequential(*layers)
86
87 def forward(self, x):
88 out = F.relu(self.bn1(self.conv1(x)))

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected