import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_0(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, xnumel, rnumel,
    XBLOCK: tl.constexpr):
    xnumel = 256
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x0 = xindex
    r1 = rindex
    tmp0 = tl.load(in_ptr0 + x0 % 64, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (r1 + 16 * x0), xmask, other=0.0)
    tmp26 = tl.load(in_ptr2 + x0 % 64, xmask, eviction_policy='evict_last')
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tl.where(xmask, tmp2, 0)
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp5, 0)
    tmp8 = tl.sum(tmp7, 1)[:, None]
    tmp9 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 / tmp10
    tmp12 = tmp2 - tmp11
    tmp13 = tmp12 * tmp12
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK, RBLOCK])
    tmp16 = tl.where(xmask, tmp14, 0)
    tmp17 = tl.sum(tmp16, 1)[:, None]
    tmp18 = tmp1 - tmp11
    tmp19 = 16.0
    tmp20 = tmp17 / tmp19
    tmp21 = 1e-05
    tmp22 = tmp20 + tmp21
    tmp23 = libdevice.rsqrt(tmp22)
    tmp24 = tmp18 * tmp23
    tmp25 = tmp24 * tmp0
    tmp27 = tmp25 + tmp26
    tmp28 = 0.0
    tmp29 = tmp27 > tmp28
    tmp30 = 0.2
    tmp31 = tmp27 * tmp30
    tmp32 = tl.where(tmp29, tmp27, tmp31)
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tl.store(in_out_ptr0 + (r1 + 16 * x0), tmp32, xmask)
    tl.store(out_ptr3 + x0, tmp23, xmask)
    tl.store(out_ptr1 + x0, tmp11, xmask)


@triton.jit
def triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_1(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, xnumel, rnumel,
    XBLOCK: tl.constexpr):
    xnumel = 512
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x0 = xindex
    r1 = rindex
    tmp0 = tl.load(in_ptr0 + x0 % 128, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (r1 + 16 * x0), xmask, other=0.0)
    tmp26 = tl.load(in_ptr2 + x0 % 128, xmask, eviction_policy='evict_last')
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tl.where(xmask, tmp2, 0)
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp5, 0)
    tmp8 = tl.sum(tmp7, 1)[:, None]
    tmp9 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 / tmp10
    tmp12 = tmp2 - tmp11
    tmp13 = tmp12 * tmp12
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK, RBLOCK])
    tmp16 = tl.where(xmask, tmp14, 0)
    tmp17 = tl.sum(tmp16, 1)[:, None]
    tmp18 = tmp1 - tmp11
    tmp19 = 16.0
    tmp20 = tmp17 / tmp19
    tmp21 = 1e-05
    tmp22 = tmp20 + tmp21
    tmp23 = libdevice.rsqrt(tmp22)
    tmp24 = tmp18 * tmp23
    tmp25 = tmp24 * tmp0
    tmp27 = tmp25 + tmp26
    tmp28 = 0.0
    tmp29 = tmp27 > tmp28
    tmp30 = 0.2
    tmp31 = tmp27 * tmp30
    tmp32 = tl.where(tmp29, tmp27, tmp31)
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tl.store(in_out_ptr0 + (r1 + 16 * x0), tmp32, xmask)
    tl.store(out_ptr3 + x0, tmp23, xmask)
    tl.store(out_ptr1 + x0, tmp11, xmask)


@triton.jit
def triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_2(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, xnumel, rnumel,
    XBLOCK: tl.constexpr):
    xnumel = 256
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x0 = xindex
    r1 = rindex
    tmp0 = tl.load(in_ptr0 + x0 % 64, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (r1 + 64 * x0), xmask, other=0.0)
    tmp26 = tl.load(in_ptr2 + x0 % 64, xmask, eviction_policy='evict_last')
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tl.where(xmask, tmp2, 0)
    tmp5 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp7 = tl.where(xmask, tmp5, 0)
    tmp8 = tl.sum(tmp7, 1)[:, None]
    tmp9 = tl.full([XBLOCK, 1], 64, tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 / tmp10
    tmp12 = tmp2 - tmp11
    tmp13 = tmp12 * tmp12
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK, RBLOCK])
    tmp16 = tl.where(xmask, tmp14, 0)
    tmp17 = tl.sum(tmp16, 1)[:, None]
    tmp18 = tmp1 - tmp11
    tmp19 = 64.0
    tmp20 = tmp17 / tmp19
    tmp21 = 1e-05
    tmp22 = tmp20 + tmp21
    tmp23 = libdevice.rsqrt(tmp22)
    tmp24 = tmp18 * tmp23
    tmp25 = tmp24 * tmp0
    tmp27 = tmp25 + tmp26
    tmp28 = 0.0
    tmp29 = tmp27 > tmp28
    tmp30 = 0.2
    tmp31 = tmp27 * tmp30
    tmp32 = tl.where(tmp29, tmp27, tmp31)
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tl.store(in_out_ptr0 + (r1 + 64 * x0), tmp32, xmask)
    tl.store(out_ptr3 + x0, tmp23, xmask)
    tl.store(out_ptr1 + x0, tmp11, xmask)


@triton.jit
def triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_3(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, xnumel, rnumel):
    XBLOCK: tl.constexpr = 1
    RBLOCK: tl.constexpr = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = tl.full([1], xoffset, tl.int32)
    tl.full([RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[:]
    tl.full([RBLOCK], True, tl.int1)
    x0 = xindex
    r1 = rindex
    tmp0 = tl.load(in_ptr0 + x0 % 32, None, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (r1 + 256 * x0), None)
    tmp23 = tl.load(in_ptr2 + x0 % 32, None, eviction_policy='evict_last')
    tmp2 = tl.broadcast_to(tmp1, [RBLOCK])
    tmp4 = tl.broadcast_to(tmp2, [RBLOCK])
    tmp6 = triton_helpers.promote_to_tensor(tl.sum(tmp4, 0))
    tmp7 = tl.full([1], 256, tl.int32)
    tmp8 = tmp7.to(tl.float32)
    tmp9 = tmp6 / tmp8
    tmp10 = tmp2 - tmp9
    tmp11 = tmp10 * tmp10
    tmp12 = tl.broadcast_to(tmp11, [RBLOCK])
    tmp14 = triton_helpers.promote_to_tensor(tl.sum(tmp12, 0))
    tmp15 = tmp1 - tmp9
    tmp16 = 256.0
    tmp17 = tmp14 / tmp16
    tmp18 = 1e-05
    tmp19 = tmp17 + tmp18
    tmp20 = libdevice.rsqrt(tmp19)
    tmp21 = tmp15 * tmp20
    tmp22 = tmp21 * tmp0
    tmp24 = tmp22 + tmp23
    tmp25 = 0.0
    tmp26 = tmp24 > tmp25
    tmp27 = 0.2
    tmp28 = tmp24 * tmp27
    tmp29 = tl.where(tmp26, tmp24, tmp28)
    tl.store(out_ptr0 + x0, tmp0, None)
    tl.store(in_out_ptr0 + (r1 + 256 * x0), tmp29, None)
    tl.store(out_ptr3 + x0, tmp20, None)
    tl.store(out_ptr1 + x0, tmp9, None)


@triton.jit
def triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_4(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, xnumel, rnumel):
    XBLOCK: tl.constexpr = 1
    RBLOCK: tl.constexpr = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = tl.full([1], xoffset, tl.int32)
    tl.full([RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[:]
    tl.full([RBLOCK], True, tl.int1)
    x0 = xindex
    r1 = rindex
    tmp0 = tl.load(in_ptr0 + x0 % 32, None, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (r1 + 1024 * x0), None)
    tmp23 = tl.load(in_ptr2 + x0 % 32, None, eviction_policy='evict_last')
    tmp2 = tl.broadcast_to(tmp1, [RBLOCK])
    tmp4 = tl.broadcast_to(tmp2, [RBLOCK])
    tmp6 = triton_helpers.promote_to_tensor(tl.sum(tmp4, 0))
    tmp7 = tl.full([1], 1024, tl.int32)
    tmp8 = tmp7.to(tl.float32)
    tmp9 = tmp6 / tmp8
    tmp10 = tmp2 - tmp9
    tmp11 = tmp10 * tmp10
    tmp12 = tl.broadcast_to(tmp11, [RBLOCK])
    tmp14 = triton_helpers.promote_to_tensor(tl.sum(tmp12, 0))
    tmp15 = tmp1 - tmp9
    tmp16 = 1024.0
    tmp17 = tmp14 / tmp16
    tmp18 = 1e-05
    tmp19 = tmp17 + tmp18
    tmp20 = libdevice.rsqrt(tmp19)
    tmp21 = tmp15 * tmp20
    tmp22 = tmp21 * tmp0
    tmp24 = tmp22 + tmp23
    tmp25 = 0.0
    tmp26 = tmp24 > tmp25
    tmp27 = 0.2
    tmp28 = tmp24 * tmp27
    tmp29 = tl.where(tmp26, tmp24, tmp28)
    tl.store(out_ptr0 + x0, tmp0, None)
    tl.store(in_out_ptr0 + (r1 + 1024 * x0), tmp29, None)
    tl.store(out_ptr3 + x0, tmp20, None)
    tl.store(out_ptr1 + x0, tmp9, None)


@triton.jit
def triton_red_fused__native_batch_norm_legit_leaky_relu_repeat_5(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, xnumel, rnumel,
    XBLOCK: tl.constexpr, RBLOCK: tl.constexpr):
    xnumel = 64
    rnumel = 4096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0 % 16, xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tmp3_mean = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp3_m2 = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    tmp3_weight = tl.zeros([XBLOCK, RBLOCK], tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r1 = rindex
        tmp1 = tl.load(in_ptr1 + (r1 + 4096 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
        tmp3_mean_next, tmp3_m2_next, tmp3_weight_next = (triton_helpers.
            welford_reduce(tmp2, tmp3_mean, tmp3_m2, tmp3_weight, roffset == 0)
            )
        tmp3_mean = tl.where(rmask & xmask, tmp3_mean_next, tmp3_mean)
        tmp3_m2 = tl.where(rmask & xmask, tmp3_m2_next, tmp3_m2)
        tmp3_weight = tl.where(rmask & xmask, tmp3_weight_next, tmp3_weight)
    tmp3_tmp, tmp4_tmp, tmp5_tmp = triton_helpers.welford(tmp3_mean,
        tmp3_m2, tmp3_weight, 1)
    tmp3 = tmp3_tmp[:, None]
    tmp4 = tmp4_tmp[:, None]
    tmp5_tmp[:, None]
    tl.store(out_ptr1 + x0, tmp3, xmask)
    tmp15 = tl.load(in_ptr2 + x0 % 16, xmask, eviction_policy='evict_last')
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r1 = rindex
        tmp6 = tl.load(in_ptr1 + (r1 + 4096 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp7 = tmp6 - tmp3
        tmp8 = 4096.0
        tmp9 = tmp4 / tmp8
        tmp10 = 1e-05
        tmp11 = tmp9 + tmp10
        tmp12 = libdevice.rsqrt(tmp11)
        tmp13 = tmp7 * tmp12
        tmp14 = tmp13 * tmp0
        tmp16 = tmp14 + tmp15
        tmp17 = 0.0
        tmp18 = tmp16 > tmp17
        tmp19 = 0.2
        tmp20 = tmp16 * tmp19
        tmp21 = tl.where(tmp18, tmp16, tmp20)
        tl.store(in_out_ptr0 + (r1 + 4096 * x0), tmp21, rmask & xmask)
    tmp22 = 4096.0
    tmp23 = tmp4 / tmp22
    tmp24 = 1e-05
    tmp25 = tmp23 + tmp24
    tmp26 = libdevice.rsqrt(tmp25)
    tl.store(out_ptr3 + x0, tmp26, xmask)


@triton.jit
def triton_poi_fused_sigmoid_6(in_out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex
    tmp0 = tl.load(in_out_ptr0 + x0, None)
    tmp1 = tl.sigmoid(tmp0)
    tl.store(in_out_ptr0 + x0, tmp1, None)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17,
        primals_18, primals_19, primals_20, primals_21, primals_22,
        primals_23, primals_24, primals_25, primals_26) = args
    args.clear()
    assert_size_stride(primals_1, (32, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_2, (4, 32, 4, 4), (512, 16, 4, 1))
    assert_size_stride(primals_3, (64,), (1,))
    assert_size_stride(primals_4, (64,), (1,))
    assert_size_stride(primals_5, (64, 128, 3, 3), (1152, 9, 3, 1))
    assert_size_stride(primals_6, (128,), (1,))
    assert_size_stride(primals_7, (128,), (1,))
    assert_size_stride(primals_8, (128, 64, 4, 4), (1024, 16, 4, 1))
    assert_size_stride(primals_9, (64,), (1,))
    assert_size_stride(primals_10, (64,), (1,))
    assert_size_stride(primals_11, (64, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_12, (64,), (1,))
    assert_size_stride(primals_13, (64,), (1,))
    assert_size_stride(primals_14, (64, 32, 4, 4), (512, 16, 4, 1))
    assert_size_stride(primals_15, (32,), (1,))
    assert_size_stride(primals_16, (32,), (1,))
    assert_size_stride(primals_17, (32, 32, 3, 3), (288, 9, 3, 1))
    assert_size_stride(primals_18, (32,), (1,))
    assert_size_stride(primals_19, (32,), (1,))
    assert_size_stride(primals_20, (32, 32, 4, 4), (512, 16, 4, 1))
    assert_size_stride(primals_21, (32,), (1,))
    assert_size_stride(primals_22, (32,), (1,))
    assert_size_stride(primals_23, (32, 16, 4, 4), (256, 16, 4, 1))
    assert_size_stride(primals_24, (16,), (1,))
    assert_size_stride(primals_25, (16,), (1,))
    assert_size_stride(primals_26, (4, 16, 1, 1), (16, 1, 1, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_2, primals_1, stride=(1, 
            1), padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 64, 4, 4), (1024, 16, 4, 1))
        buf1 = empty_strided_cuda((256,), (1,), torch.float32)
        buf2 = empty_strided_cuda((1, 256, 1, 1), (256, 1, 256, 256), torch
            .float32)
        buf6 = empty_strided_cuda((1, 256, 4, 4), (4096, 16, 4, 1), torch.
            float32)
        buf7 = reinterpret_tensor(buf6, (4, 64, 4, 4), (1024, 16, 4, 1), 0)
        del buf6
        buf5 = empty_strided_cuda((1, 256, 1, 1), (256, 1, 256, 256), torch
            .float32)
        get_raw_stream(0)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_0[grid(256)
            ](buf7, primals_3, buf0, primals_4, buf1, buf2, buf5, 256, 16,
            XBLOCK=32, num_warps=4, num_stages=1)
        del primals_3
        del primals_4
        buf8 = extern_kernels.convolution(buf7, primals_5, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf8, (4, 128, 4, 4), (2048, 16, 4, 1))
        buf9 = empty_strided_cuda((512,), (1,), torch.float32)
        buf10 = empty_strided_cuda((1, 512, 1, 1), (512, 1, 512, 512),
            torch.float32)
        buf14 = empty_strided_cuda((1, 512, 4, 4), (8192, 16, 4, 1), torch.
            float32)
        buf15 = reinterpret_tensor(buf14, (4, 128, 4, 4), (2048, 16, 4, 1), 0)
        del buf14
        buf13 = empty_strided_cuda((1, 512, 1, 1), (512, 1, 512, 512),
            torch.float32)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_1[grid(512)
            ](buf15, primals_6, buf8, primals_7, buf9, buf10, buf13, 512, 
            16, XBLOCK=32, num_warps=4, num_stages=1)
        del primals_6
        del primals_7
        buf16 = extern_kernels.convolution(buf15, primals_8, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf16, (4, 64, 8, 8), (4096, 64, 8, 1))
        buf17 = empty_strided_cuda((256,), (1,), torch.float32)
        buf18 = empty_strided_cuda((1, 256, 1, 1), (256, 1, 256, 256),
            torch.float32)
        buf22 = empty_strided_cuda((1, 256, 8, 8), (16384, 64, 8, 1), torch
            .float32)
        buf23 = reinterpret_tensor(buf22, (4, 64, 8, 8), (4096, 64, 8, 1), 0)
        del buf22
        buf21 = empty_strided_cuda((1, 256, 1, 1), (256, 1, 256, 256),
            torch.float32)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_2[grid(256)
            ](buf23, primals_9, buf16, primals_10, buf17, buf18, buf21, 256,
            64, XBLOCK=8, num_warps=4, num_stages=1)
        del primals_10
        del primals_9
        buf24 = extern_kernels.convolution(buf23, primals_11, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf24, (4, 64, 8, 8), (4096, 64, 8, 1))
        buf25 = empty_strided_cuda((256,), (1,), torch.float32)
        buf26 = empty_strided_cuda((1, 256, 1, 1), (256, 1, 256, 256),
            torch.float32)
        buf30 = empty_strided_cuda((1, 256, 8, 8), (16384, 64, 8, 1), torch
            .float32)
        buf31 = reinterpret_tensor(buf30, (4, 64, 8, 8), (4096, 64, 8, 1), 0)
        del buf30
        buf29 = empty_strided_cuda((1, 256, 1, 1), (256, 1, 256, 256),
            torch.float32)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_2[grid(256)
            ](buf31, primals_12, buf24, primals_13, buf25, buf26, buf29, 
            256, 64, XBLOCK=8, num_warps=4, num_stages=1)
        del primals_12
        del primals_13
        buf32 = extern_kernels.convolution(buf31, primals_14, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf32, (4, 32, 16, 16), (8192, 256, 16, 1))
        buf33 = empty_strided_cuda((128,), (1,), torch.float32)
        buf34 = empty_strided_cuda((1, 128, 1, 1), (128, 1, 128, 128),
            torch.float32)
        buf38 = empty_strided_cuda((1, 128, 16, 16), (32768, 256, 16, 1),
            torch.float32)
        buf39 = reinterpret_tensor(buf38, (4, 32, 16, 16), (8192, 256, 16, 
            1), 0)
        del buf38
        buf37 = empty_strided_cuda((1, 128, 1, 1), (128, 1, 128, 128),
            torch.float32)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_3[grid(128)
            ](buf39, primals_15, buf32, primals_16, buf33, buf34, buf37, 
            128, 256, num_warps=2, num_stages=1)
        del primals_15
        del primals_16
        buf40 = extern_kernels.convolution(buf39, primals_17, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf40, (4, 32, 16, 16), (8192, 256, 16, 1))
        buf41 = empty_strided_cuda((128,), (1,), torch.float32)
        buf42 = empty_strided_cuda((1, 128, 1, 1), (128, 1, 128, 128),
            torch.float32)
        buf46 = empty_strided_cuda((1, 128, 16, 16), (32768, 256, 16, 1),
            torch.float32)
        buf47 = reinterpret_tensor(buf46, (4, 32, 16, 16), (8192, 256, 16, 
            1), 0)
        del buf46
        buf45 = empty_strided_cuda((1, 128, 1, 1), (128, 1, 128, 128),
            torch.float32)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_3[grid(128)
            ](buf47, primals_18, buf40, primals_19, buf41, buf42, buf45, 
            128, 256, num_warps=2, num_stages=1)
        del primals_18
        del primals_19
        buf48 = extern_kernels.convolution(buf47, primals_20, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf48, (4, 32, 32, 32), (32768, 1024, 32, 1))
        buf49 = empty_strided_cuda((128,), (1,), torch.float32)
        buf50 = empty_strided_cuda((1, 128, 1, 1), (128, 1, 128, 128),
            torch.float32)
        buf54 = empty_strided_cuda((1, 128, 32, 32), (131072, 1024, 32, 1),
            torch.float32)
        buf55 = reinterpret_tensor(buf54, (4, 32, 32, 32), (32768, 1024, 32,
            1), 0)
        del buf54
        buf53 = empty_strided_cuda((1, 128, 1, 1), (128, 1, 128, 128),
            torch.float32)
        triton_per_fused__native_batch_norm_legit_leaky_relu_repeat_4[grid(128)
            ](buf55, primals_21, buf48, primals_22, buf49, buf50, buf53, 
            128, 1024, num_warps=8, num_stages=1)
        del primals_21
        del primals_22
        buf56 = extern_kernels.convolution(buf55, primals_23, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf56, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf57 = empty_strided_cuda((64,), (1,), torch.float32)
        buf58 = empty_strided_cuda((1, 64, 1, 1), (64, 1, 64, 64), torch.
            float32)
        buf62 = empty_strided_cuda((1, 64, 64, 64), (262144, 4096, 64, 1),
            torch.float32)
        buf63 = reinterpret_tensor(buf62, (4, 16, 64, 64), (65536, 4096, 64,
            1), 0)
        del buf62
        buf61 = empty_strided_cuda((1, 64, 1, 1), (64, 1, 64, 64), torch.
            float32)
        triton_red_fused__native_batch_norm_legit_leaky_relu_repeat_5[grid(64)
            ](buf63, primals_24, buf56, primals_25, buf57, buf58, buf61, 64,
            4096, XBLOCK=1, RBLOCK=2048, num_warps=16, num_stages=1)
        del primals_24
        del primals_25
        buf64 = extern_kernels.convolution(buf63, primals_26, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf64, (4, 4, 64, 64), (16384, 4096, 64, 1))
        buf65 = buf64
        del buf64
        triton_poi_fused_sigmoid_6[grid(65536)](buf65, 65536, XBLOCK=512,
            num_warps=4, num_stages=1)
    return (buf65, primals_1, primals_2, primals_5, primals_8, primals_11,
        primals_14, primals_17, primals_20, primals_23, primals_26, buf0,
        buf1, reinterpret_tensor(buf5, (256,), (1,), 0), buf7, buf8, buf9,
        reinterpret_tensor(buf13, (512,), (1,), 0), buf15, buf16, buf17,
        reinterpret_tensor(buf21, (256,), (1,), 0), buf23, buf24, buf25,
        reinterpret_tensor(buf29, (256,), (1,), 0), buf31, buf32, buf33,
        reinterpret_tensor(buf37, (128,), (1,), 0), buf39, buf40, buf41,
        reinterpret_tensor(buf45, (128,), (1,), 0), buf47, buf48, buf49,
        reinterpret_tensor(buf53, (128,), (1,), 0), buf55, buf56, buf57,
        reinterpret_tensor(buf61, (64,), (1,), 0), buf63, buf65,
        reinterpret_tensor(buf58, (1, 64, 1, 1), (64, 1, 1, 1), 0),
        reinterpret_tensor(buf50, (1, 128, 1, 1), (128, 1, 1, 1), 0),
        reinterpret_tensor(buf42, (1, 128, 1, 1), (128, 1, 1, 1), 0),
        reinterpret_tensor(buf34, (1, 128, 1, 1), (128, 1, 1, 1), 0),
        reinterpret_tensor(buf26, (1, 256, 1, 1), (256, 1, 1, 1), 0),
        reinterpret_tensor(buf18, (1, 256, 1, 1), (256, 1, 1, 1), 0),
        reinterpret_tensor(buf10, (1, 512, 1, 1), (512, 1, 1, 1), 0),
        reinterpret_tensor(buf2, (1, 256, 1, 1), (256, 1, 1, 1), 0))


class INConv(nn.Module):

    def __init__(self, in_planes, out_planes, kernel_size, stride=1,
        padding=0, dilation=1, groups=1, relu=True, ins_n=True, bias=False):
        super(INConv, self).__init__()
        self.out_channels = out_planes
        self.conv = nn.Conv2d(in_planes, out_planes, kernel_size=
            kernel_size, stride=stride, padding=padding, dilation=dilation,
            groups=groups, bias=bias)
        self.ins_n = nn.InstanceNorm2d(out_planes, affine=True
            ) if ins_n else None
        self.relu = nn.ReLU(inplace=True) if relu else None

    def forward(self, x):
        x = self.conv(x)
        if self.ins_n is not None:
            x = self.ins_n(x)
        if self.relu is not None:
            x = self.relu(x)
        return x


class INDeConv(nn.Module):

    def __init__(self, in_planes, out_planes, kernel_size, stride=1,
        padding=0, out_padding=0, dilation=1, groups=1, relu=True, ins_n=
        True, bias=False):
        super(INDeConv, self).__init__()
        self.out_channels = out_planes
        self.conv = nn.ConvTranspose2d(in_planes, out_planes, kernel_size=
            kernel_size, stride=stride, padding=padding, output_padding=
            out_padding, dilation=dilation, groups=groups, bias=bias)
        self.ins_n = nn.InstanceNorm2d(out_planes, affine=True
            ) if ins_n else None
        self.relu = nn.ReLU(inplace=True) if relu else None

    def forward(self, x):
        x = self.conv(x)
        if self.ins_n is not None:
            x = self.ins_n(x)
        if self.relu is not None:
            x = self.relu(x)
        return x


class DecoderNew(nn.Module):

    def __init__(self, img_channel):
        super(DecoderNew, self).__init__()
        self.deconv1 = INDeConv(in_planes=32, out_planes=64, kernel_size=3,
            stride=1, padding=1, relu=False)
        self.activation1 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv2 = INDeConv(in_planes=64, out_planes=128, kernel_size=3,
            stride=1, padding=1, relu=False)
        self.activation2 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv3 = INDeConv(in_planes=128, out_planes=64, kernel_size=4,
            stride=2, padding=1, relu=False)
        self.activation3 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv4 = INDeConv(in_planes=64, out_planes=64, kernel_size=3,
            stride=1, padding=1, relu=False)
        self.activation4 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv5 = INDeConv(in_planes=64, out_planes=32, kernel_size=4,
            stride=2, padding=1, relu=False)
        self.activation5 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv6 = INDeConv(in_planes=32, out_planes=32, kernel_size=3,
            stride=1, padding=1, relu=False)
        self.activation6 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv7 = INDeConv(in_planes=32, out_planes=32, kernel_size=4,
            stride=2, padding=1, relu=False)
        self.activation7 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.deconv8 = INDeConv(in_planes=32, out_planes=16, kernel_size=4,
            stride=2, padding=1, relu=False)
        self.activation8 = nn.LeakyReLU(inplace=True, negative_slope=0.2)
        self.output = INConv(in_planes=16, out_planes=img_channel,
            kernel_size=1, stride=1, padding=0, ins_n=False, relu=False)
        self.activation9 = nn.Sigmoid()

    def forward(self, input_0):
        primals_1 = self.deconv1.conv.weight
        primals_3 = self.deconv1.ins_n.weight
        primals_4 = self.deconv1.ins_n.bias
        primals_5 = self.deconv2.conv.weight
        primals_6 = self.deconv2.ins_n.weight
        primals_7 = self.deconv2.ins_n.bias
        primals_8 = self.deconv3.conv.weight
        primals_9 = self.deconv3.ins_n.weight
        primals_10 = self.deconv3.ins_n.bias
        primals_11 = self.deconv4.conv.weight
        primals_12 = self.deconv4.ins_n.weight
        primals_13 = self.deconv4.ins_n.bias
        primals_14 = self.deconv5.conv.weight
        primals_15 = self.deconv5.ins_n.weight
        primals_16 = self.deconv5.ins_n.bias
        primals_17 = self.deconv6.conv.weight
        primals_18 = self.deconv6.ins_n.weight
        primals_19 = self.deconv6.ins_n.bias
        primals_20 = self.deconv7.conv.weight
        primals_21 = self.deconv7.ins_n.weight
        primals_22 = self.deconv7.ins_n.bias
        primals_23 = self.deconv8.conv.weight
        primals_24 = self.deconv8.ins_n.weight
        primals_25 = self.deconv8.ins_n.bias
        primals_26 = self.output.conv.weight
        primals_2 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9,
            primals_10, primals_11, primals_12, primals_13, primals_14,
            primals_15, primals_16, primals_17, primals_18, primals_19,
            primals_20, primals_21, primals_22, primals_23, primals_24,
            primals_25, primals_26])
        return output[0]


Measured latency_ms: 0.307968