def __init__(self, in_channels, out_channels, activation=F.leaky_relu, sample='none', dr=None):
    super(SNResBlock, self).__init__()
    initializer = chainer.initializers.GlorotUniform()
    initializer_sc = chainer.initializers.GlorotUniform()
    self.activation = activation
    self.dr = dr
    self.sample = (_downsample if (sample == 'down') else (_upsample if (sample == 'up') else None))
    self.learnable_sc = ((in_channels != out_channels) or (sample == 'down') or (sample == 'up'))
    with self.init_scope():
        self.c1 = SNConvolution2D(in_channels, out_channels, ksize=3, pad=1, initialW=initializer)
        self.c2 = SNConvolution2D(out_channels, out_channels, ksize=3, pad=1, initialW=initializer)
        if self.learnable_sc:
            self.c_sc = SNConvolution2D(in_channels, out_channels, ksize=1, pad=0, initialW=initializer_sc)
def __init__(self, in_channels, out_channels, activation=F.leaky_relu, sample='none', dr=None):
    super(SNResBlock, self).__init__()
    initializer = chainer.initializers.GlorotUniform()
    initializer_sc = chainer.initializers.GlorotUniform()
    self.activation = activation
    self.dr = dr
    self.sample = (_downsample if (sample == 'down') else (_upsample if (sample == 'up') else None))
    self.learnable_sc = ((in_channels != out_channels) or (sample == 'down') or (sample == 'up'))
    with self.init_scope():
        self.c1 = SNConvolution2D(in_channels, out_channels, ksize=3, pad=1, initialW=initializer)
        self.c2 = SNConvolution2D(out_channels, out_channels, ksize=3, pad=1, initialW=initializer)
        if self.learnable_sc:
            self.c_sc = SNConvolution2D(in_channels, out_channels, ksize=1, pad=0, initialW=initializer_sc)