def __init__(self, in_channels, out_channels, ksize=3, pad=1, activation=F.leaky_relu, mode='none', bn=False, dr=None):
    super(ResBlock, self).__init__()
    initializer = chainer.initializers.GlorotUniform()
    initializer_sc = chainer.initializers.GlorotUniform()
    self.activation = activation
    self.mode = (_downsample if (mode == 'down') else (_upsample if (mode == 'up') else None))
    self.learnable_sc = (in_channels != out_channels)
    self.dr = dr
    self.bn = bn
    with self.init_scope():
        self.c1 = L.Convolution2D(in_channels, out_channels, ksize=ksize, pad=pad, initialW=initializer, nobias=bn)
        self.c2 = L.Convolution2D(out_channels, out_channels, ksize=ksize, pad=pad, initialW=initializer, nobias=bn)
        if bn:
            self.b1 = L.BatchNormalization(out_channels)
            self.b2 = L.BatchNormalization(out_channels)
        if self.learnable_sc:
            self.c_sc = L.Convolution2D(in_channels, out_channels, ksize=1, pad=0, initialW=initializer_sc)
def __init__(self, in_channels, out_channels, ksize=3, pad=1, activation=F.leaky_relu, mode='none', bn=False, dr=None):
    super(ResBlock, self).__init__()
    initializer = chainer.initializers.GlorotUniform()
    initializer_sc = chainer.initializers.GlorotUniform()
    self.activation = activation
    self.mode = (_downsample if (mode == 'down') else (_upsample if (mode == 'up') else None))
    self.learnable_sc = (in_channels != out_channels)
    self.dr = dr
    self.bn = bn
    with self.init_scope():
        self.c1 = L.Convolution2D(in_channels, out_channels, ksize=ksize, pad=pad, initialW=initializer, nobias=bn)
        self.c2 = L.Convolution2D(out_channels, out_channels, ksize=ksize, pad=pad, initialW=initializer, nobias=bn)
        if bn:
            self.b1 = L.BatchNormalization(out_channels)
            self.b2 = L.BatchNormalization(out_channels)
        if self.learnable_sc:
            self.c_sc = L.Convolution2D(in_channels, out_channels, ksize=1, pad=0, initialW=initializer_sc)