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
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_0(in_ptr0, 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 % 32
    x1 = xindex // 32
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 128 * x1), None, eviction_policy=
        'evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 128 * x1), None, eviction_policy
        ='evict_last')
    tmp3 = tl.load(in_ptr0 + (64 + 2 * x0 + 128 * x1), None,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (65 + 2 * x0 + 128 * x1), None,
        eviction_policy='evict_last')
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp6 = triton_helpers.maximum(tmp5, tmp4)
    tl.store(out_ptr0 + x2, tmp6, None)


@triton.jit
def triton_poi_fused__to_copy_1(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = tmp3 * tmp2
    tmp5 = tmp4 - tmp2
    tmp6 = 0.0
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp7.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp8, xmask)


@triton.jit
def triton_poi_fused_add_clamp_2(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = tmp3 * tmp2
    tmp5 = tmp4 - tmp2
    tmp6 = 0.0
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp7.to(tl.int32)
    tmp9 = tl.full([1], 1, tl.int64)
    tmp10 = tmp8 + tmp9
    tmp11 = tl.full([1], 31, tl.int64)
    tmp12 = triton_helpers.minimum(tmp10, tmp11)
    tl.store(out_ptr0 + x0, tmp12, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_clamp_mul_sub_3(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = tmp3 * tmp2
    tmp5 = tmp4 - tmp2
    tmp6 = 0.0
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp7.to(tl.int32)
    tmp9 = tmp8.to(tl.float32)
    tmp10 = tmp7 - tmp9
    tmp11 = triton_helpers.maximum(tmp10, tmp6)
    tmp12 = 1.0
    tmp13 = triton_helpers.minimum(tmp11, tmp12)
    tl.store(out_ptr0 + x0, tmp13, xmask)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_4(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 7056
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 21
    x1 = xindex // 21 % 21
    x4 = xindex // 441
    x3 = xindex // 1764
    x5 = xindex % 1764
    tmp0 = tl.load(in_ptr0 + (3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (64 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (65 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (66 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (128 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (129 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (130 + 3 * x0 + 192 * x1 + 4096 * x4), xmask,
        eviction_policy='evict_last')
    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)
    tl.store(out_ptr0 + (x5 + 1792 * x3), tmp16, xmask)


@triton.jit
def triton_poi_fused__to_copy_5(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.328125
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp9, xmask)


@triton.jit
def triton_poi_fused_add_clamp_6(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.328125
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tl.full([1], 1, tl.int64)
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 20, tl.int64)
    tmp13 = triton_helpers.minimum(tmp11, tmp12)
    tl.store(out_ptr0 + x0, tmp13, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_clamp_mul_sub_7(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.328125
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 - tmp10
    tmp12 = triton_helpers.maximum(tmp11, tmp7)
    tmp13 = 1.0
    tmp14 = triton_helpers.minimum(tmp12, tmp13)
    tl.store(out_ptr0 + x0, tmp14, xmask)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_8(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 12
    x1 = xindex // 12 % 12
    x2 = xindex // 144
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (4 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (64 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (65 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (66 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (67 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (68 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr0 + (128 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr0 + (129 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr0 + (130 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr0 + (131 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr0 + (132 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (192 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr0 + (193 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr0 + (194 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr0 + (195 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr0 + (196 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr0 + (256 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr0 + (257 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr0 + (258 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr0 + (259 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (260 + 5 * x0 + 320 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    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)
    tmp32 = triton_helpers.maximum(tmp31, tmp30)
    tmp34 = triton_helpers.maximum(tmp33, tmp32)
    tmp36 = triton_helpers.maximum(tmp35, tmp34)
    tmp38 = triton_helpers.maximum(tmp37, tmp36)
    tmp40 = triton_helpers.maximum(tmp39, tmp38)
    tmp42 = triton_helpers.maximum(tmp41, tmp40)
    tmp44 = triton_helpers.maximum(tmp43, tmp42)
    tmp46 = triton_helpers.maximum(tmp45, tmp44)
    tmp48 = triton_helpers.maximum(tmp47, tmp46)
    tl.store(out_ptr0 + x3, tmp48, xmask)


@triton.jit
def triton_poi_fused__to_copy_9(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.1875
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp9, xmask)


@triton.jit
def triton_poi_fused_add_clamp_10(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.1875
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tl.full([1], 1, tl.int64)
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 11, tl.int64)
    tmp13 = triton_helpers.minimum(tmp11, tmp12)
    tl.store(out_ptr0 + x0, tmp13, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_clamp_mul_sub_11(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.1875
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 - tmp10
    tmp12 = triton_helpers.maximum(tmp11, tmp7)
    tmp13 = 1.0
    tmp14 = triton_helpers.minimum(tmp12, tmp13)
    tl.store(out_ptr0 + x0, tmp14, xmask)


@triton.jit
def triton_poi_fused__to_copy_12(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.15625
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp9, xmask)


@triton.jit
def triton_poi_fused_add_clamp_13(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.15625
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tl.full([1], 1, tl.int64)
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 9, tl.int64)
    tmp13 = triton_helpers.minimum(tmp11, tmp12)
    tl.store(out_ptr0 + x0, tmp13, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_clamp_mul_sub_14(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.15625
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 - tmp10
    tmp12 = triton_helpers.maximum(tmp11, tmp7)
    tmp13 = 1.0
    tmp14 = triton_helpers.minimum(tmp12, tmp13)
    tl.store(out_ptr0 + x0, tmp14, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_add_convolution_mul_sub_15(in_out_ptr0,
    in_out_ptr1, in_out_ptr2, in_out_ptr3, in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10,
    in_ptr11, in_ptr12, in_ptr13, in_ptr14, in_ptr15, in_ptr16, in_ptr17,
    in_ptr18, in_ptr19, in_ptr20, in_ptr21, in_ptr22, in_ptr23, in_ptr24,
    in_ptr25, in_ptr26, in_ptr27, in_ptr28, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 64 % 64
    x0 = xindex % 64
    x2 = xindex // 4096
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr3 + 0)
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK])
    tmp13 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr5 + x0, None, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr6 + x1, None, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr7 + x1, None, eviction_policy='evict_last')
    tmp38 = tl.load(in_ptr8 + x1, None, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr9 + x0, None, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr11 + x0, None, eviction_policy='evict_last')
    tmp56 = tl.load(in_ptr12 + x0, None, eviction_policy='evict_last')
    tmp59 = tl.load(in_ptr13 + x1, None, eviction_policy='evict_last')
    tmp71 = tl.load(in_ptr14 + x1, None, eviction_policy='evict_last')
    tmp74 = tl.load(in_ptr15 + x1, None, eviction_policy='evict_last')
    tmp79 = tl.load(in_ptr16 + x0, None, eviction_policy='evict_last')
    tmp85 = tl.load(in_ptr18 + x0, None, eviction_policy='evict_last')
    tmp92 = tl.load(in_ptr19 + x0, None, eviction_policy='evict_last')
    tmp95 = tl.load(in_ptr20 + x1, None, eviction_policy='evict_last')
    tmp107 = tl.load(in_ptr21 + x1, None, eviction_policy='evict_last')
    tmp110 = tl.load(in_ptr22 + x1, None, eviction_policy='evict_last')
    tmp115 = tl.load(in_ptr23 + x0, None, eviction_policy='evict_last')
    tmp121 = tl.load(in_ptr25 + x0, None, eviction_policy='evict_last')
    tmp128 = tl.load(in_ptr26 + x0, None, eviction_policy='evict_last')
    tmp131 = tl.load(in_ptr27 + x1, None, eviction_policy='evict_last')
    tmp143 = tl.load(in_ptr28 + x1, None, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK], 32, tl.int32)
    tmp2 = tmp0 + tmp1
    tmp3 = tmp0 < 0
    tmp4 = tl.where(tmp3, tmp2, tmp0)
    tmp6 = tmp5 + tmp1
    tmp7 = tmp5 < 0
    tmp8 = tl.where(tmp7, tmp6, tmp5)
    tmp9 = tl.load(in_ptr2 + (tmp8 + 32 * tmp4 + 1024 * x2), None,
        eviction_policy='evict_last')
    tmp12 = tmp9 + tmp11
    tmp14 = tmp13 + tmp1
    tmp15 = tmp13 < 0
    tmp16 = tl.where(tmp15, tmp14, tmp13)
    tmp17 = tl.load(in_ptr2 + (tmp16 + 32 * tmp4 + 1024 * x2), None,
        eviction_policy='evict_last')
    tmp18 = tmp17 + tmp11
    tmp19 = tmp18 - tmp12
    tmp21 = tmp19 * tmp20
    tmp22 = tmp12 + tmp21
    tmp24 = tmp23 + tmp1
    tmp25 = tmp23 < 0
    tmp26 = tl.where(tmp25, tmp24, tmp23)
    tmp27 = tl.load(in_ptr2 + (tmp8 + 32 * tmp26 + 1024 * x2), None,
        eviction_policy='evict_last')
    tmp28 = tmp27 + tmp11
    tmp29 = tl.load(in_ptr2 + (tmp16 + 32 * tmp26 + 1024 * x2), None,
        eviction_policy='evict_last')
    tmp30 = tmp29 + tmp11
    tmp31 = tmp30 - tmp28
    tmp32 = tmp31 * tmp20
    tmp33 = tmp28 + tmp32
    tmp34 = tmp33 - tmp22
    tmp36 = tmp34 * tmp35
    tmp37 = tmp22 + tmp36
    tmp39 = tl.full([XBLOCK], 21, tl.int32)
    tmp40 = tmp38 + tmp39
    tmp41 = tmp38 < 0
    tmp42 = tl.where(tmp41, tmp40, tmp38)
    tmp44 = tmp43 + tmp39
    tmp45 = tmp43 < 0
    tmp46 = tl.where(tmp45, tmp44, tmp43)
    tmp47 = tl.load(in_ptr10 + (tmp46 + 21 * tmp42 + 441 * x2), None,
        eviction_policy='evict_last')
    tmp48 = tmp47 + tmp11
    tmp50 = tmp49 + tmp39
    tmp51 = tmp49 < 0
    tmp52 = tl.where(tmp51, tmp50, tmp49)
    tmp53 = tl.load(in_ptr10 + (tmp52 + 21 * tmp42 + 441 * x2), None,
        eviction_policy='evict_last')
    tmp54 = tmp53 + tmp11
    tmp55 = tmp54 - tmp48
    tmp57 = tmp55 * tmp56
    tmp58 = tmp48 + tmp57
    tmp60 = tmp59 + tmp39
    tmp61 = tmp59 < 0
    tmp62 = tl.where(tmp61, tmp60, tmp59)
    tmp63 = tl.load(in_ptr10 + (tmp46 + 21 * tmp62 + 441 * x2), None,
        eviction_policy='evict_last')
    tmp64 = tmp63 + tmp11
    tmp65 = tl.load(in_ptr10 + (tmp52 + 21 * tmp62 + 441 * x2), None,
        eviction_policy='evict_last')
    tmp66 = tmp65 + tmp11
    tmp67 = tmp66 - tmp64
    tmp68 = tmp67 * tmp56
    tmp69 = tmp64 + tmp68
    tmp70 = tmp69 - tmp58
    tmp72 = tmp70 * tmp71
    tmp73 = tmp58 + tmp72
    tmp75 = tl.full([XBLOCK], 12, tl.int32)
    tmp76 = tmp74 + tmp75
    tmp77 = tmp74 < 0
    tmp78 = tl.where(tmp77, tmp76, tmp74)
    tmp80 = tmp79 + tmp75
    tmp81 = tmp79 < 0
    tmp82 = tl.where(tmp81, tmp80, tmp79)
    tmp83 = tl.load(in_ptr17 + (tmp82 + 12 * tmp78 + 144 * x2), None,
        eviction_policy='evict_last')
    tmp84 = tmp83 + tmp11
    tmp86 = tmp85 + tmp75
    tmp87 = tmp85 < 0
    tmp88 = tl.where(tmp87, tmp86, tmp85)
    tmp89 = tl.load(in_ptr17 + (tmp88 + 12 * tmp78 + 144 * x2), None,
        eviction_policy='evict_last')
    tmp90 = tmp89 + tmp11
    tmp91 = tmp90 - tmp84
    tmp93 = tmp91 * tmp92
    tmp94 = tmp84 + tmp93
    tmp96 = tmp95 + tmp75
    tmp97 = tmp95 < 0
    tmp98 = tl.where(tmp97, tmp96, tmp95)
    tmp99 = tl.load(in_ptr17 + (tmp82 + 12 * tmp98 + 144 * x2), None,
        eviction_policy='evict_last')
    tmp100 = tmp99 + tmp11
    tmp101 = tl.load(in_ptr17 + (tmp88 + 12 * tmp98 + 144 * x2), None,
        eviction_policy='evict_last')
    tmp102 = tmp101 + tmp11
    tmp103 = tmp102 - tmp100
    tmp104 = tmp103 * tmp92
    tmp105 = tmp100 + tmp104
    tmp106 = tmp105 - tmp94
    tmp108 = tmp106 * tmp107
    tmp109 = tmp94 + tmp108
    tmp111 = tl.full([XBLOCK], 10, tl.int32)
    tmp112 = tmp110 + tmp111
    tmp113 = tmp110 < 0
    tmp114 = tl.where(tmp113, tmp112, tmp110)
    tmp116 = tmp115 + tmp111
    tmp117 = tmp115 < 0
    tmp118 = tl.where(tmp117, tmp116, tmp115)
    tmp119 = tl.load(in_ptr24 + (tmp118 + 10 * tmp114 + 100 * x2), None,
        eviction_policy='evict_last')
    tmp120 = tmp119 + tmp11
    tmp122 = tmp121 + tmp111
    tmp123 = tmp121 < 0
    tmp124 = tl.where(tmp123, tmp122, tmp121)
    tmp125 = tl.load(in_ptr24 + (tmp124 + 10 * tmp114 + 100 * x2), None,
        eviction_policy='evict_last')
    tmp126 = tmp125 + tmp11
    tmp127 = tmp126 - tmp120
    tmp129 = tmp127 * tmp128
    tmp130 = tmp120 + tmp129
    tmp132 = tmp131 + tmp111
    tmp133 = tmp131 < 0
    tmp134 = tl.where(tmp133, tmp132, tmp131)
    tmp135 = tl.load(in_ptr24 + (tmp118 + 10 * tmp134 + 100 * x2), None,
        eviction_policy='evict_last')
    tmp136 = tmp135 + tmp11
    tmp137 = tl.load(in_ptr24 + (tmp124 + 10 * tmp134 + 100 * x2), None,
        eviction_policy='evict_last')
    tmp138 = tmp137 + tmp11
    tmp139 = tmp138 - tmp136
    tmp140 = tmp139 * tmp128
    tmp141 = tmp136 + tmp140
    tmp142 = tmp141 - tmp130
    tmp144 = tmp142 * tmp143
    tmp145 = tmp130 + tmp144
    tl.store(in_out_ptr0 + x3, tmp37, None)
    tl.store(in_out_ptr1 + x3, tmp73, None)
    tl.store(in_out_ptr2 + x3, tmp109, None)
    tl.store(in_out_ptr3 + x3, tmp145, None)


@triton.jit
def triton_poi_fused_cat_16(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 4096 % 8
    x0 = xindex % 4096
    x2 = xindex // 32768
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 4096 * x2), tmp4, eviction_policy=
        'evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 2, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tmp6 & tmp8
    tmp10 = tl.load(in_ptr1 + (x0 + 4096 * x2), tmp9, eviction_policy=
        'evict_last', other=0.0)
    tmp11 = tmp0 >= tmp7
    tmp12 = tl.full([1], 3, tl.int64)
    tmp13 = tmp0 < tmp12
    tmp14 = tmp11 & tmp13
    tmp15 = tl.load(in_ptr2 + (x0 + 4096 * x2), tmp14, eviction_policy=
        'evict_last', other=0.0)
    tmp16 = tmp0 >= tmp12
    tmp17 = tl.full([1], 4, tl.int64)
    tmp18 = tmp0 < tmp17
    tmp19 = tmp16 & tmp18
    tmp20 = tl.load(in_ptr3 + (x0 + 4096 * x2), tmp19, eviction_policy=
        'evict_last', other=0.0)
    tmp21 = tmp0 >= tmp17
    tl.full([1], 8, tl.int64)
    tmp24 = tl.load(in_ptr4 + (x0 + 4096 * (-4 + x1) + 16384 * x2), tmp21,
        other=0.0)
    tmp25 = tl.where(tmp19, tmp20, tmp24)
    tmp26 = tl.where(tmp14, tmp15, tmp25)
    tmp27 = tl.where(tmp9, tmp10, tmp26)
    tmp28 = tl.where(tmp4, tmp5, tmp27)
    tl.store(out_ptr0 + x3, tmp28, None)


def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 64, 64), (16384, 4096, 64, 1))
    assert_size_stride(primals_2, (1, 4, 1, 1), (4, 1, 1, 1))
    assert_size_stride(primals_3, (1,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4, 32, 32), (4096, 1024, 32, 1),
            torch.float32)
        get_raw_stream(0)
        triton_poi_fused_max_pool2d_with_indices_0[grid(16384)](primals_1,
            buf0, 16384, XBLOCK=256, num_warps=4, num_stages=1)
        buf1 = extern_kernels.convolution(buf0, primals_2, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf1, (4, 1, 32, 32), (1024, 1024, 32, 1))
        buf2 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_1[grid(64)](buf2, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf3 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_2[grid(64)](buf3, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf4 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_1[grid(64)](buf4, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf5 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_add_clamp_2[grid(64)](buf5, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf6 = empty_strided_cuda((64,), (1,), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_3[grid(64)](buf6,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf11 = empty_strided_cuda((4, 4, 21, 21), (1792, 441, 21, 1),
            torch.float32)
        triton_poi_fused_max_pool2d_with_indices_4[grid(7056)](primals_1,
            buf11, 7056, XBLOCK=128, num_warps=4, num_stages=1)
        buf12 = extern_kernels.convolution(buf11, primals_2, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 1, 21, 21), (441, 441, 21, 1))
        buf13 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_5[grid(64)](buf13, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf14 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_6[grid(64)](buf14, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf15 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_5[grid(64)](buf15, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf16 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_add_clamp_6[grid(64)](buf16, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf17 = empty_strided_cuda((64,), (1,), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_7[grid(64)](buf17,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf19 = empty_strided_cuda((64, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_7[grid(64)](buf19,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf22 = empty_strided_cuda((4, 4, 12, 12), (576, 144, 12, 1), torch
            .float32)
        triton_poi_fused_max_pool2d_with_indices_8[grid(2304)](primals_1,
            buf22, 2304, XBLOCK=128, num_warps=4, num_stages=1)
        buf23 = extern_kernels.convolution(buf22, primals_2, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf23, (4, 1, 12, 12), (144, 144, 12, 1))
        buf24 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_9[grid(64)](buf24, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf25 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_10[grid(64)](buf25, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf26 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_9[grid(64)](buf26, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf27 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_add_clamp_10[grid(64)](buf27, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf28 = empty_strided_cuda((64,), (1,), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_11[grid(64)](buf28,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf30 = empty_strided_cuda((64, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_11[grid(64)](buf30,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf33 = torch.ops.aten.max_pool2d_with_indices.default(primals_1, [
            6, 6], [6, 6])
        buf34 = buf33[0]
        del buf33
        buf36 = extern_kernels.convolution(buf34, primals_2, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf36, (4, 1, 10, 10), (100, 100, 10, 1))
        buf37 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_12[grid(64)](buf37, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf38 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_13[grid(64)](buf38, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf39 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_12[grid(64)](buf39, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf40 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_add_clamp_13[grid(64)](buf40, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf41 = empty_strided_cuda((64,), (1,), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_14[grid(64)](buf41,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf43 = empty_strided_cuda((64, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_14[grid(64)](buf43,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf8 = empty_strided_cuda((64, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_3[grid(64)](buf8,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf9 = empty_strided_cuda((4, 1, 64, 64), (4096, 16384, 64, 1),
            torch.float32)
        buf10 = reinterpret_tensor(buf9, (4, 1, 64, 64), (4096, 4096, 64, 1), 0
            )
        del buf9
        buf20 = empty_strided_cuda((4, 1, 64, 64), (4096, 16384, 64, 1),
            torch.float32)
        buf21 = reinterpret_tensor(buf20, (4, 1, 64, 64), (4096, 4096, 64, 
            1), 0)
        del buf20
        buf31 = empty_strided_cuda((4, 1, 64, 64), (4096, 16384, 64, 1),
            torch.float32)
        buf32 = reinterpret_tensor(buf31, (4, 1, 64, 64), (4096, 4096, 64, 
            1), 0)
        del buf31
        buf44 = empty_strided_cuda((4, 1, 64, 64), (4096, 16384, 64, 1),
            torch.float32)
        buf45 = reinterpret_tensor(buf44, (4, 1, 64, 64), (4096, 4096, 64, 
            1), 0)
        del buf44
        triton_poi_fused__unsafe_index_add_convolution_mul_sub_15[grid(16384)](
            buf10, buf21, buf32, buf45, buf2, buf4, buf1, primals_3, buf5,
            buf6, buf3, buf8, buf13, buf15, buf12, buf16, buf17, buf14,
            buf19, buf24, buf26, buf23, buf27, buf28, buf25, buf30, buf37,
            buf39, buf36, buf40, buf41, buf38, buf43, 16384, XBLOCK=128,
            num_warps=4, num_stages=1)
        del buf1
        del buf12
        del buf23
        del buf36
        del primals_3
        buf46 = empty_strided_cuda((4, 8, 64, 64), (32768, 4096, 64, 1),
            torch.float32)
        triton_poi_fused_cat_16[grid(131072)](buf10, buf21, buf32, buf45,
            primals_1, buf46, 131072, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_1
    return (buf46, buf45, buf32, buf21, buf10, primals_2, buf0, buf2, buf3,
        buf4, buf5, buf6, buf8, buf11, buf13, buf14, buf15, buf16, buf17,
        buf19, buf22, buf24, buf25, buf26, buf27, buf28, buf30, buf34,
        buf37, buf38, buf39, buf40, buf41, buf43)


class SPPblockNew(nn.Module):

    def __init__(self, in_channels):
        super(SPPblockNew, self).__init__()
        self.pool1 = nn.MaxPool2d(kernel_size=[2, 2], stride=2)
        self.pool2 = nn.MaxPool2d(kernel_size=[3, 3], stride=3)
        self.pool3 = nn.MaxPool2d(kernel_size=[5, 5], stride=5)
        self.pool4 = nn.MaxPool2d(kernel_size=[6, 6], stride=6)
        self.conv = nn.Conv2d(in_channels=in_channels, out_channels=1,
            kernel_size=1, padding=0)

    def forward(self, input_0):
        primals_2 = self.conv.weight
        primals_3 = self.conv.bias
        primals_1 = input_0
        output = call([primals_1, primals_2, primals_3])
        return output[0]


Measured latency_ms: 0.445252