def __init__(self, lib, dtype,
                 N, C, K,
                 H, W, P, Q,
                 pad_h, pad_w,
                 relu, bsum):

        super(XpropWinograd_4x4_3x3, self).__init__(lib, dtype)

        itemsize    = self.dtype.itemsize
        kernel_name = "%s_winograd_4x4_3x3_32x32" % self.clss

        if N == 1:
            shlN = 0
        elif N < 32:
            shlN = len(bin(N-1))-2
        else:
            shlN = 5

        shlY, shlX, maskY, shrY, maskX, shrX, maskN, supY, supX = {
            0 : (4, 5, 0x18, 3, 0x07, 0, 0x00, 0x203, 0x300), # 4x8  yyxxx
            1 : (4, 4, 0x18, 3, 0x06, 1, 0x01, 0x203, 0x201), # 4x4  yyxxn
            2 : (3, 4, 0x10, 4, 0x0c, 2, 0x03, 0x104, 0x202), # 2x4  yxxnn
           #3 : (3, 3, 0x10, 4, 0x08, 3, 0x07, 0x104, 0x103), # 2x2  yxnnn
            3 : (2, 4, 0x00, 0, 0x18, 3, 0x07, 0x000, 0x203), # 1x4  xxnnn
            4 : (2, 3, 0x00, 0, 0x10, 4, 0x0f, 0x000, 0x104), # 1x2  xnnnn
            5 : (2, 2, 0x00, 0, 0x00, 0, 0x1f, 0x000, 0x000), # 1x1  nnnnn
        }.get(shlN)

        R, S = 3, 3
        GYS  = _ceil_div(P, 1 << shlY)
        GXS  = _ceil_div(Q, 1 << shlX)
        GN   = _ceil_div(N, 1 << shlN)
        GK   = _ceil_div(K, 32)
        GYS2 = GYS // 2
        GXS2 = GXS  * 2
        k    = _closest_divisor(GK, 4)
        Xk   = GXS*k
        YXk  = GYS*Xk

        magic_GXS2 = _magic64(GXS2)
        magic_YXk  = _magic64(YXk)
        magic_Xk   = _magic64(Xk)
        magic_k    = _magic32(Xk, k)

        self.image_size   = itemsize*1152*C*GXS*GYS*GN
        self.image_args   = [
            ( GN, GYS*GXS, C ), (32,1,1), None, None, None,
            H, W, N, pad_h, pad_w,
            GXS, GYS2, GXS2, magic_GXS2[0], magic_GXS2[1],
            shlY, shlX, maskY, shrY, maskX, shrX, shlN, maskN,
            H*W*N, W*N, GYS*GXS*C*1152, GXS*C*1152, C*1152]

        #print GYS, GXS, GYS*GXS*GK*GN, GYS*GXS*GK*GN/24.0, k

        self.kernel = [
            kernel_name, (GYS*GXS*GK, GN, 1), (640, 1, 1), None,
            None, None, None, None, None, None, None ]
        self.kernel.extend( _flatten([
            C, K, N, YXk, Xk, k, magic_YXk, magic_Xk, magic_k,
            C*1152, GXS*C*1152, GYS*GXS*C*1152,
            P, Q, Q*N, P*Q*N, N*itemsize, Q*N*itemsize, Q*N*3*itemsize,
            max(P*Q*N - Q*N*3, 0)*itemsize, (P*Q*N*15 - Q*N*3)*itemsize,
            maskN, shlX, shlY, supX, supY ]))

        lib.set_scratch_size(self.image_size, self.filter_size)

        self.flags  = (relu and 2) + (bsum and 4)
        self.mode = ""
dataset/ETHPy150Open NervanaSystems/neon/neon/backends/winograd_conv.py/XpropWinograd_4x4_3x3.__init__/original