resnet.py [43:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.nonlinearity = nonlinearity

        if stride != 1 or in_planes != self.expansion*planes:
            self.shortcut = nn.Sequential(
                nn.Conv2d(in_planes, self.expansion*planes, kernel_size=1, stride=stride, bias=False)
            )

    def forward(self, x):
        if self.batchnorm:
            out = self.bn1(x)
        else:
            out = x
        out = self.nonlinearity(out)
        shortcut = self.shortcut(out) if hasattr(self, 'shortcut') else x
        out = self.conv1(out)
        if self.batchnorm:
            out = self.bn2(out)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



resnet.py [126:142]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.nonlinearity = nonlinearity

        if stride != 1 or in_planes != self.expansion*planes:
            self.shortcut = nn.Sequential(
                nn.Conv2d(in_planes, self.expansion*planes, kernel_size=1, stride=stride, bias=False)
            )

    def forward(self, x):
        if self.batchnorm:
            out = self.bn1(x)
        else:
            out = x
        out = self.nonlinearity(out)
        shortcut = self.shortcut(out) if hasattr(self, 'shortcut') else x
        out = self.conv1(out)
        if self.batchnorm:
            out = self.bn2(out)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



