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
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


@triton.jit
def triton_poi_fused_0(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    ynumel = 512
    xnumel = 9
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 16
    y1 = yindex // 16
    tmp0 = tl.load(in_ptr0 + (x2 + 9 * y3), xmask & ymask, eviction_policy=
        'evict_last')
    tl.store(out_ptr0 + (y0 + 16 * x2 + 144 * y1), tmp0, xmask & ymask)


@triton.jit
def triton_poi_fused_1(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 9
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 32
    y1 = yindex // 32
    tmp0 = tl.load(in_ptr0 + (x2 + 9 * y3), xmask, eviction_policy='evict_last'
        )
    tl.store(out_ptr0 + (y0 + 32 * x2 + 288 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_2(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK: tl.
    constexpr, XBLOCK: tl.constexpr):
    xnumel = 9
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 64
    y1 = yindex // 64
    tmp0 = tl.load(in_ptr0 + (x2 + 9 * y3), xmask, eviction_policy='evict_last'
        )
    tl.store(out_ptr0 + (y0 + 64 * x2 + 576 * y1), tmp0, xmask)


@triton.jit
def triton_poi_fused_convolution_relu_3(in_ptr0, in_ptr1, out_ptr0, ynumel,
    xnumel, YBLOCK: tl.constexpr, XBLOCK: tl.constexpr):
    ynumel = 64
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    x2 = xindex
    y3 = yindex
    y0 = yindex % 16
    y1 = yindex // 16
    tmp0 = tl.load(in_ptr0 + (x2 + 4096 * y3), ymask, eviction_policy=
        'evict_last')
    tmp1 = tl.load(in_ptr1 + y0, ymask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1, 1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(out_ptr0 + (y0 + 16 * x2 + 65536 * y1), tmp4, ymask)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_4(in_ptr0, out_ptr0, out_ptr1,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex % 16
    x1 = xindex // 16 % 32
    x2 = xindex // 512
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 32 * x1 + 2048 * x2), None)
    tmp1 = tl.load(in_ptr0 + (16 + x0 + 32 * x1 + 2048 * x2), None)
    tmp3 = tl.load(in_ptr0 + (1024 + x0 + 32 * x1 + 2048 * x2), None)
    tmp5 = tl.load(in_ptr0 + (1040 + x0 + 32 * x1 + 2048 * x2), None)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp6 = triton_helpers.maximum(tmp5, tmp4)
    tmp7 = tmp1 > tmp0
    tmp8 = tl.full([1], 1, tl.int8)
    tmp9 = tl.full([1], 0, tl.int8)
    tmp10 = tl.where(tmp7, tmp8, tmp9)
    tmp11 = tmp3 > tmp2
    tmp12 = tl.full([1], 2, tl.int8)
    tmp13 = tl.where(tmp11, tmp12, tmp10)
    tmp14 = tmp5 > tmp4
    tmp15 = tl.full([1], 3, tl.int8)
    tmp16 = tl.where(tmp14, tmp15, tmp13)
    tl.store(out_ptr0 + x3, tmp6, None)
    tl.store(out_ptr1 + x3, tmp16, None)


@triton.jit
def triton_poi_fused_convolution_relu_5(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 32
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + x2, tmp4, None)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_6(in_ptr0, out_ptr0, out_ptr1,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex % 32
    x1 = xindex // 32 % 16
    x2 = xindex // 512
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 64 * x1 + 2048 * x2), None)
    tmp1 = tl.load(in_ptr0 + (32 + x0 + 64 * x1 + 2048 * x2), None)
    tmp3 = tl.load(in_ptr0 + (1024 + x0 + 64 * x1 + 2048 * x2), None)
    tmp5 = tl.load(in_ptr0 + (1056 + x0 + 64 * x1 + 2048 * x2), None)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp6 = triton_helpers.maximum(tmp5, tmp4)
    tmp7 = tmp1 > tmp0
    tmp8 = tl.full([1], 1, tl.int8)
    tmp9 = tl.full([1], 0, tl.int8)
    tmp10 = tl.where(tmp7, tmp8, tmp9)
    tmp11 = tmp3 > tmp2
    tmp12 = tl.full([1], 2, tl.int8)
    tmp13 = tl.where(tmp11, tmp12, tmp10)
    tmp14 = tmp5 > tmp4
    tmp15 = tl.full([1], 3, tl.int8)
    tmp16 = tl.where(tmp14, tmp15, tmp13)
    tl.store(out_ptr0 + x3, tmp6, None)
    tl.store(out_ptr1 + x3, tmp16, None)


@triton.jit
def triton_poi_fused_convolution_relu_7(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 64
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + x2, tmp4, None)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_8(in_ptr0, out_ptr0, out_ptr1,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex % 64
    x1 = xindex // 64 % 4
    x2 = xindex // 256
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 256 * x1 + 4096 * x2), None)
    tmp1 = tl.load(in_ptr0 + (64 + x0 + 256 * x1 + 4096 * x2), None)
    tmp3 = tl.load(in_ptr0 + (128 + x0 + 256 * x1 + 4096 * x2), None)
    tmp5 = tl.load(in_ptr0 + (192 + x0 + 256 * x1 + 4096 * x2), None)
    tmp7 = tl.load(in_ptr0 + (1024 + x0 + 256 * x1 + 4096 * x2), None)
    tmp9 = tl.load(in_ptr0 + (1088 + x0 + 256 * x1 + 4096 * x2), None)
    tmp11 = tl.load(in_ptr0 + (1152 + x0 + 256 * x1 + 4096 * x2), None)
    tmp13 = tl.load(in_ptr0 + (1216 + x0 + 256 * x1 + 4096 * x2), None)
    tmp15 = tl.load(in_ptr0 + (2048 + x0 + 256 * x1 + 4096 * x2), None)
    tmp17 = tl.load(in_ptr0 + (2112 + x0 + 256 * x1 + 4096 * x2), None)
    tmp19 = tl.load(in_ptr0 + (2176 + x0 + 256 * x1 + 4096 * x2), None)
    tmp21 = tl.load(in_ptr0 + (2240 + x0 + 256 * x1 + 4096 * x2), None)
    tmp23 = tl.load(in_ptr0 + (3072 + x0 + 256 * x1 + 4096 * x2), None)
    tmp25 = tl.load(in_ptr0 + (3136 + x0 + 256 * x1 + 4096 * x2), None)
    tmp27 = tl.load(in_ptr0 + (3200 + x0 + 256 * x1 + 4096 * x2), None)
    tmp29 = tl.load(in_ptr0 + (3264 + x0 + 256 * x1 + 4096 * x2), None)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp6 = triton_helpers.maximum(tmp5, tmp4)
    tmp8 = triton_helpers.maximum(tmp7, tmp6)
    tmp10 = triton_helpers.maximum(tmp9, tmp8)
    tmp12 = triton_helpers.maximum(tmp11, tmp10)
    tmp14 = triton_helpers.maximum(tmp13, tmp12)
    tmp16 = triton_helpers.maximum(tmp15, tmp14)
    tmp18 = triton_helpers.maximum(tmp17, tmp16)
    tmp20 = triton_helpers.maximum(tmp19, tmp18)
    tmp22 = triton_helpers.maximum(tmp21, tmp20)
    tmp24 = triton_helpers.maximum(tmp23, tmp22)
    tmp26 = triton_helpers.maximum(tmp25, tmp24)
    tmp28 = triton_helpers.maximum(tmp27, tmp26)
    tmp30 = triton_helpers.maximum(tmp29, tmp28)
    tmp31 = tmp1 > tmp0
    tmp32 = tl.full([1], 1, tl.int8)
    tmp33 = tl.full([1], 0, tl.int8)
    tmp34 = tl.where(tmp31, tmp32, tmp33)
    tmp35 = tmp3 > tmp2
    tmp36 = tl.full([1], 2, tl.int8)
    tmp37 = tl.where(tmp35, tmp36, tmp34)
    tmp38 = tmp5 > tmp4
    tmp39 = tl.full([1], 3, tl.int8)
    tmp40 = tl.where(tmp38, tmp39, tmp37)
    tmp41 = tmp7 > tmp6
    tmp42 = tl.full([1], 4, tl.int8)
    tmp43 = tl.where(tmp41, tmp42, tmp40)
    tmp44 = tmp9 > tmp8
    tmp45 = tl.full([1], 5, tl.int8)
    tmp46 = tl.where(tmp44, tmp45, tmp43)
    tmp47 = tmp11 > tmp10
    tmp48 = tl.full([1], 6, tl.int8)
    tmp49 = tl.where(tmp47, tmp48, tmp46)
    tmp50 = tmp13 > tmp12
    tmp51 = tl.full([1], 7, tl.int8)
    tmp52 = tl.where(tmp50, tmp51, tmp49)
    tmp53 = tmp15 > tmp14
    tmp54 = tl.full([1], 8, tl.int8)
    tmp55 = tl.where(tmp53, tmp54, tmp52)
    tmp56 = tmp17 > tmp16
    tmp57 = tl.full([1], 9, tl.int8)
    tmp58 = tl.where(tmp56, tmp57, tmp55)
    tmp59 = tmp19 > tmp18
    tmp60 = tl.full([1], 10, tl.int8)
    tmp61 = tl.where(tmp59, tmp60, tmp58)
    tmp62 = tmp21 > tmp20
    tmp63 = tl.full([1], 11, tl.int8)
    tmp64 = tl.where(tmp62, tmp63, tmp61)
    tmp65 = tmp23 > tmp22
    tmp66 = tl.full([1], 12, tl.int8)
    tmp67 = tl.where(tmp65, tmp66, tmp64)
    tmp68 = tmp25 > tmp24
    tmp69 = tl.full([1], 13, tl.int8)
    tmp70 = tl.where(tmp68, tmp69, tmp67)
    tmp71 = tmp27 > tmp26
    tmp72 = tl.full([1], 14, tl.int8)
    tmp73 = tl.where(tmp71, tmp72, tmp70)
    tmp74 = tmp29 > tmp28
    tmp75 = tl.full([1], 15, tl.int8)
    tmp76 = tl.where(tmp74, tmp75, tmp73)
    tl.store(out_ptr0 + x3, tmp30, None)
    tl.store(out_ptr1 + x3, tmp76, None)


@triton.jit
def triton_poi_fused_convolution_relu_9(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 128
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + x2, tmp4, None)


@triton.jit
def triton_poi_fused_convolution_10(in_out_ptr0, in_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 2
    tmp0 = tl.load(in_out_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x2, tmp2, xmask)


@triton.jit
def triton_poi_fused_add_convolution_11(in_out_ptr0, in_ptr0, in_ptr1,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 2
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x0, None, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + x2, None)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tl.store(in_out_ptr0 + x2, tmp4, None)


@triton.jit
def triton_poi_fused_add_convolution_12(in_out_ptr0, in_ptr0, in_ptr1,
    xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x0 = xindex % 2
    tmp0 = tl.load(in_out_ptr0 + x2, None)
    tmp1 = tl.load(in_ptr0 + x2, None)
    tmp2 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tmp0 + tmp3
    tl.store(in_out_ptr0 + x2, tmp4, None)


@triton.jit
def triton_poi_fused_convolution_13(in_ptr0, out_ptr0, ynumel, xnumel,
    YBLOCK: tl.constexpr, XBLOCK: tl.constexpr):
    ynumel = 8
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, YBLOCK], True, tl.int1)
    x2 = xindex
    y0 = yindex % 2
    y1 = yindex // 2
    y3 = yindex
    tmp0 = tl.load(in_ptr0 + (y0 + 2 * x2 + 8192 * y1), ymask,
        eviction_policy='evict_last')
    tl.store(out_ptr0 + (x2 + 4096 * y3), tmp0, ymask)


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
        ) = args
    args.clear()
    assert_size_stride(primals_1, (16, 1, 5, 5), (25, 25, 5, 1))
    assert_size_stride(primals_2, (16,), (1,))
    assert_size_stride(primals_3, (4, 1, 64, 64), (4096, 4096, 64, 1))
    assert_size_stride(primals_4, (32, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_5, (32,), (1,))
    assert_size_stride(primals_6, (2, 32, 1, 1), (32, 1, 1, 1))
    assert_size_stride(primals_7, (2,), (1,))
    assert_size_stride(primals_8, (64, 32, 3, 3), (288, 9, 3, 1))
    assert_size_stride(primals_9, (64,), (1,))
    assert_size_stride(primals_10, (2, 64, 1, 1), (64, 1, 1, 1))
    assert_size_stride(primals_11, (2,), (1,))
    assert_size_stride(primals_12, (128, 64, 3, 3), (576, 9, 3, 1))
    assert_size_stride(primals_13, (128,), (1,))
    assert_size_stride(primals_14, (2, 128, 1, 1), (128, 1, 1, 1))
    assert_size_stride(primals_15, (2,), (1,))
    assert_size_stride(primals_16, (2, 1, 8, 8), (64, 64, 8, 1))
    assert_size_stride(primals_17, (2, 1, 4, 4), (16, 16, 4, 1))
    assert_size_stride(primals_18, (2, 1, 4, 4), (16, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((32, 16, 3, 3), (144, 1, 48, 16), torch.
            float32)
        get_raw_stream(0)
        triton_poi_fused_0[grid(512, 9)](primals_4, buf0, 512, 9, XBLOCK=16,
            YBLOCK=64, num_warps=4, num_stages=1)
        del primals_4
        buf1 = empty_strided_cuda((64, 32, 3, 3), (288, 1, 96, 32), torch.
            float32)
        triton_poi_fused_1[grid(2048, 9)](primals_8, buf1, 2048, 9, XBLOCK=
            16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_8
        buf2 = empty_strided_cuda((128, 64, 3, 3), (576, 1, 192, 64), torch
            .float32)
        triton_poi_fused_2[grid(8192, 9)](primals_12, buf2, 8192, 9, XBLOCK
            =16, YBLOCK=64, num_warps=4, num_stages=1)
        del primals_12
        buf3 = extern_kernels.convolution(primals_3, primals_1, stride=(1, 
            1), padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 16, 64, 64), (65536, 4096, 64, 1))
        buf4 = empty_strided_cuda((4, 16, 64, 64), (65536, 1, 1024, 16),
            torch.float32)
        triton_poi_fused_convolution_relu_3[grid(64, 4096)](buf3, primals_2,
            buf4, 64, 4096, XBLOCK=32, YBLOCK=32, num_warps=4, num_stages=1)
        del buf3
        del primals_2
        buf5 = empty_strided_cuda((4, 16, 32, 32), (16384, 1, 512, 16),
            torch.float32)
        buf6 = empty_strided_cuda((4, 16, 32, 32), (16384, 1, 512, 16),
            torch.int8)
        triton_poi_fused_max_pool2d_with_indices_4[grid(65536)](buf4, buf5,
            buf6, 65536, XBLOCK=512, num_warps=4, num_stages=1)
        buf7 = extern_kernels.convolution(buf5, buf0, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 32, 32, 32), (32768, 1, 1024, 32))
        buf8 = buf7
        del buf7
        triton_poi_fused_convolution_relu_5[grid(131072)](buf8, primals_5, 
            131072, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_5
        buf9 = extern_kernels.convolution(buf8, primals_6, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf9, (4, 2, 32, 32), (2048, 1, 64, 2))
        buf10 = empty_strided_cuda((4, 32, 16, 16), (8192, 1, 512, 32),
            torch.float32)
        buf11 = empty_strided_cuda((4, 32, 16, 16), (8192, 1, 512, 32),
            torch.int8)
        triton_poi_fused_max_pool2d_with_indices_6[grid(32768)](buf8, buf10,
            buf11, 32768, XBLOCK=256, num_warps=4, num_stages=1)
        buf12 = extern_kernels.convolution(buf10, buf1, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 64, 16, 16), (16384, 1, 1024, 64))
        buf13 = buf12
        del buf12
        triton_poi_fused_convolution_relu_7[grid(65536)](buf13, primals_9, 
            65536, XBLOCK=512, num_warps=4, num_stages=1)
        del primals_9
        buf14 = extern_kernels.convolution(buf13, primals_10, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 2, 16, 16), (512, 1, 32, 2))
        buf15 = empty_strided_cuda((4, 64, 4, 4), (1024, 1, 256, 64), torch
            .float32)
        buf16 = empty_strided_cuda((4, 64, 4, 4), (1024, 1, 256, 64), torch
            .int8)
        triton_poi_fused_max_pool2d_with_indices_8[grid(4096)](buf13, buf15,
            buf16, 4096, XBLOCK=128, num_warps=4, num_stages=1)
        buf17 = extern_kernels.convolution(buf15, buf2, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 128, 4, 4), (2048, 1, 512, 128))
        buf18 = buf17
        del buf17
        triton_poi_fused_convolution_relu_9[grid(8192)](buf18, primals_13, 
            8192, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_13
        buf19 = extern_kernels.convolution(buf18, primals_14, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf19, (4, 2, 4, 4), (32, 1, 8, 2))
        buf20 = buf19
        del buf19
        triton_poi_fused_convolution_10[grid(128)](buf20, primals_15, 128,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_15
        buf21 = extern_kernels.convolution(buf20, primals_16, stride=(4, 4),
            padding=(2, 2), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=2, bias=None)
        assert_size_stride(buf21, (4, 2, 16, 16), (512, 1, 32, 2))
        buf22 = buf14
        del buf14
        triton_poi_fused_add_convolution_11[grid(2048)](buf22, primals_11,
            buf21, 2048, XBLOCK=256, num_warps=4, num_stages=1)
        del buf21
        del primals_11
        buf23 = extern_kernels.convolution(buf22, primals_17, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=2, bias=None)
        assert_size_stride(buf23, (4, 2, 32, 32), (2048, 1, 64, 2))
        buf24 = buf23
        del buf23
        triton_poi_fused_add_convolution_12[grid(8192)](buf24, buf9,
            primals_7, 8192, XBLOCK=256, num_warps=4, num_stages=1)
        del buf9
        del primals_7
        buf25 = extern_kernels.convolution(buf24, primals_18, stride=(2, 2),
            padding=(1, 1), dilation=(1, 1), transposed=True,
            output_padding=(0, 0), groups=2, bias=None)
        assert_size_stride(buf25, (4, 2, 64, 64), (8192, 1, 128, 2))
        buf26 = empty_strided_cuda((4, 2, 64, 64), (8192, 4096, 64, 1),
            torch.float32)
        triton_poi_fused_convolution_13[grid(8, 4096)](buf25, buf26, 8, 
            4096, XBLOCK=128, YBLOCK=8, num_warps=4, num_stages=1)
        del buf25
    return (buf26, primals_1, primals_3, buf0, primals_6, buf1, primals_10,
        buf2, primals_14, primals_16, primals_17, primals_18, buf4, buf5,
        buf6, buf8, buf10, buf11, buf13, buf15, buf16, buf18, buf20, buf22,
        buf24)


class MaskNetNew(nn.Module):

    def __init__(self):
        super(MaskNetNew, self).__init__()
        self.conv1 = nn.Conv2d(in_channels=1, out_channels=16, kernel_size=
            5, stride=1, padding=2)
        self.relu1 = nn.ReLU()
        self.Pool1 = nn.MaxPool2d(kernel_size=(2, 2), stride=2)
        self.conv2 = nn.Conv2d(in_channels=16, out_channels=32, kernel_size
            =3, stride=1, padding=1)
        self.relu2 = nn.ReLU()
        self.conv2s = nn.Conv2d(in_channels=32, out_channels=2, kernel_size
            =1, stride=1, padding=0)
        self.Pool2 = nn.MaxPool2d(kernel_size=(2, 2), stride=2)
        self.conv3 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size
            =(3, 3), stride=1, padding=1)
        self.relu3 = nn.ReLU()
        self.conv3s = nn.Conv2d(in_channels=64, out_channels=2, kernel_size
            =1, stride=1, padding=0)
        self.Pool3 = nn.MaxPool2d(kernel_size=(4, 4), stride=4)
        self.conv4 = nn.Conv2d(in_channels=64, out_channels=128,
            kernel_size=(3, 3), stride=1, padding=1)
        self.relu4 = nn.ReLU()
        self.conv4s = nn.Conv2d(in_channels=128, out_channels=2,
            kernel_size=1, stride=1, padding=0)
        self.Upsample1 = nn.ConvTranspose2d(in_channels=2, out_channels=2,
            kernel_size=8, stride=4, padding=2, bias=False, groups=2)
        self.Upsample2 = nn.ConvTranspose2d(in_channels=2, out_channels=2,
            kernel_size=4, stride=2, padding=1, bias=False, groups=2)
        self.Upsample3 = nn.ConvTranspose2d(in_channels=2, out_channels=2,
            kernel_size=4, stride=2, padding=1, bias=False, groups=2)

    def forward(self, input_0):
        primals_1 = self.conv1.weight
        primals_2 = self.conv1.bias
        primals_4 = self.conv2.weight
        primals_5 = self.conv2.bias
        primals_6 = self.conv2s.weight
        primals_7 = self.conv2s.bias
        primals_8 = self.conv3.weight
        primals_9 = self.conv3.bias
        primals_10 = self.conv3s.weight
        primals_11 = self.conv3s.bias
        primals_12 = self.conv4.weight
        primals_13 = self.conv4.bias
        primals_14 = self.conv4s.weight
        primals_15 = self.conv4s.bias
        primals_16 = self.Upsample1.weight
        primals_17 = self.Upsample2.weight
        primals_18 = self.Upsample3.weight
        primals_3 = 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])
        return output[0]


Measured latency_ms: 0.277364