models/imagenet/resnet_cnsn.py [65:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            assert cnsn_type in ['sn', 'cn', 'cnsn']

            if 'cn' in cnsn_type:
                print('using CrossNorm with crop: {}'.format(crop))
                crossnorm = CrossNorm(crop=crop, beta=beta)
            else:
                crossnorm = None

            if 'sn' in cnsn_type:
                print('using SelfNorm')
                if pos == 'pre':
                    selfnorm = SelfNorm(inplanes)
                else:
                    selfnorm = SelfNorm(planes * self.expansion)
            else:
                selfnorm = None

            self.cnsn = CNSN(crossnorm=crossnorm, selfnorm=selfnorm)

        self.pos = pos
        if pos is not None:  # for CrossNorm in image space, pos is None
            print('{} in residual module: {}'.format(cnsn_type, pos))
            assert pos in ['residual', 'pre', 'post', 'identity']

    def forward(self, x):

        identity = x
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



models/imagenet/resnet_ibn_cnsn.py [71:96]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            assert cnsn_type in ['sn', 'cn', 'cnsn']

            if 'cn' in cnsn_type:
                print('using CrossNorm with crop: {}'.format(crop))
                crossnorm = CrossNorm(crop=crop, beta=beta)
            else:
                crossnorm = None

            if 'sn' in cnsn_type:
                print('using SelfNorm')
                if pos == 'pre':
                    selfnorm = SelfNorm(inplanes)
                else:
                    selfnorm = SelfNorm(planes * self.expansion)
            else:
                selfnorm = None

            self.cnsn = CNSN(crossnorm=crossnorm, selfnorm=selfnorm)

        self.pos = pos
        if pos is not None:
            print('{} in residual module: {}'.format(cnsn_type, pos))
            assert pos in ['residual', 'pre', 'post', 'identity']

    def forward(self, x):
        identity = x
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



