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_poi_fused_convolution_relu_0(in_ptr0, in_ptr1, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 1476096
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = xindex // 3844 % 96
    x0 = xindex % 3844
    x4 = xindex // 3844
    tmp0 = tl.load(in_ptr0 + x3, xmask)
    tmp1 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(out_ptr0 + (x0 + 3872 * x4), tmp4, xmask)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_pow_1(in_ptr0, out_ptr0,
    out_ptr1, out_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 345600
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 30
    x1 = xindex // 30 % 30
    x2 = xindex // 900
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (62 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (63 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (64 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (124 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (125 + 2 * x0 + 124 * x1 + 3872 * x2), xmask,
        eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (126 + 2 * x0 + 124 * x1 + 3872 * 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)
    tmp17 = tmp1 > tmp0
    tmp18 = tl.full([1], 1, tl.int8)
    tmp19 = tl.full([1], 0, tl.int8)
    tmp20 = tl.where(tmp17, tmp18, tmp19)
    tmp21 = tmp3 > tmp2
    tmp22 = tl.full([1], 2, tl.int8)
    tmp23 = tl.where(tmp21, tmp22, tmp20)
    tmp24 = tmp5 > tmp4
    tmp25 = tl.full([1], 3, tl.int8)
    tmp26 = tl.where(tmp24, tmp25, tmp23)
    tmp27 = tmp7 > tmp6
    tmp28 = tl.full([1], 4, tl.int8)
    tmp29 = tl.where(tmp27, tmp28, tmp26)
    tmp30 = tmp9 > tmp8
    tmp31 = tl.full([1], 5, tl.int8)
    tmp32 = tl.where(tmp30, tmp31, tmp29)
    tmp33 = tmp11 > tmp10
    tmp34 = tl.full([1], 6, tl.int8)
    tmp35 = tl.where(tmp33, tmp34, tmp32)
    tmp36 = tmp13 > tmp12
    tmp37 = tl.full([1], 7, tl.int8)
    tmp38 = tl.where(tmp36, tmp37, tmp35)
    tmp39 = tmp15 > tmp14
    tmp40 = tl.full([1], 8, tl.int8)
    tmp41 = tl.where(tmp39, tmp40, tmp38)
    tmp42 = tmp16 * tmp16
    tl.store(out_ptr0 + x3, tmp16, xmask)
    tl.store(out_ptr1 + x3, tmp41, xmask)
    tl.store(out_ptr2 + x3, tmp42, xmask)


@triton.jit
def triton_poi_fused_add_avg_pool2d_div_mul_pow_2(in_ptr0, in_ptr1,
    out_ptr0, out_ptr1, out_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 345600
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 30 % 30
    x0 = xindex % 30
    x3 = xindex
    tmp118 = tl.load(in_ptr1 + x3, xmask)
    tmp0 = -2 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 30, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tmp2 & tmp4
    tmp6 = -2 + x0
    tmp7 = tmp6 >= tmp1
    tmp8 = tmp6 < tmp3
    tmp9 = tmp7 & tmp8
    tmp10 = tmp5 & tmp9
    tmp11 = tl.load(in_ptr0 + (-62 + x3), tmp10 & xmask, other=0.0)
    tmp12 = -1 + x0
    tmp13 = tmp12 >= tmp1
    tmp14 = tmp12 < tmp3
    tmp15 = tmp13 & tmp14
    tmp16 = tmp5 & tmp15
    tmp17 = tl.load(in_ptr0 + (-61 + x3), tmp16 & xmask, other=0.0)
    tmp18 = tmp17 + tmp11
    tmp19 = x0
    tmp20 = tmp19 >= tmp1
    tmp21 = tmp19 < tmp3
    tmp22 = tmp20 & tmp21
    tmp23 = tmp5 & tmp22
    tmp24 = tl.load(in_ptr0 + (-60 + x3), tmp23 & xmask, other=0.0)
    tmp25 = tmp24 + tmp18
    tmp26 = 1 + x0
    tmp27 = tmp26 >= tmp1
    tmp28 = tmp26 < tmp3
    tmp29 = tmp27 & tmp28
    tmp30 = tmp5 & tmp29
    tmp31 = tl.load(in_ptr0 + (-59 + x3), tmp30 & xmask, other=0.0)
    tmp32 = tmp31 + tmp25
    tmp33 = 2 + x0
    tmp34 = tmp33 >= tmp1
    tmp35 = tmp33 < tmp3
    tmp36 = tmp34 & tmp35
    tmp37 = tmp5 & tmp36
    tmp38 = tl.load(in_ptr0 + (-58 + x3), tmp37 & xmask, other=0.0)
    tmp39 = tmp38 + tmp32
    tmp40 = -1 + x1
    tmp41 = tmp40 >= tmp1
    tmp42 = tmp40 < tmp3
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp9
    tmp45 = tl.load(in_ptr0 + (-32 + x3), tmp44 & xmask, other=0.0)
    tmp46 = tmp45 + tmp39
    tmp47 = tmp43 & tmp15
    tmp48 = tl.load(in_ptr0 + (-31 + x3), tmp47 & xmask, other=0.0)
    tmp49 = tmp48 + tmp46
    tmp50 = tmp43 & tmp22
    tmp51 = tl.load(in_ptr0 + (-30 + x3), tmp50 & xmask, other=0.0)
    tmp52 = tmp51 + tmp49
    tmp53 = tmp43 & tmp29
    tmp54 = tl.load(in_ptr0 + (-29 + x3), tmp53 & xmask, other=0.0)
    tmp55 = tmp54 + tmp52
    tmp56 = tmp43 & tmp36
    tmp57 = tl.load(in_ptr0 + (-28 + x3), tmp56 & xmask, other=0.0)
    tmp58 = tmp57 + tmp55
    tmp59 = x1
    tmp60 = tmp59 >= tmp1
    tmp61 = tmp59 < tmp3
    tmp62 = tmp60 & tmp61
    tmp63 = tmp62 & tmp9
    tmp64 = tl.load(in_ptr0 + (-2 + x3), tmp63 & xmask, other=0.0)
    tmp65 = tmp64 + tmp58
    tmp66 = tmp62 & tmp15
    tmp67 = tl.load(in_ptr0 + (-1 + x3), tmp66 & xmask, other=0.0)
    tmp68 = tmp67 + tmp65
    tmp69 = tmp62 & tmp22
    tmp70 = tl.load(in_ptr0 + x3, tmp69 & xmask, other=0.0)
    tmp71 = tmp70 + tmp68
    tmp72 = tmp62 & tmp29
    tmp73 = tl.load(in_ptr0 + (1 + x3), tmp72 & xmask, other=0.0)
    tmp74 = tmp73 + tmp71
    tmp75 = tmp62 & tmp36
    tmp76 = tl.load(in_ptr0 + (2 + x3), tmp75 & xmask, other=0.0)
    tmp77 = tmp76 + tmp74
    tmp78 = 1 + x1
    tmp79 = tmp78 >= tmp1
    tmp80 = tmp78 < tmp3
    tmp81 = tmp79 & tmp80
    tmp82 = tmp81 & tmp9
    tmp83 = tl.load(in_ptr0 + (28 + x3), tmp82 & xmask, other=0.0)
    tmp84 = tmp83 + tmp77
    tmp85 = tmp81 & tmp15
    tmp86 = tl.load(in_ptr0 + (29 + x3), tmp85 & xmask, other=0.0)
    tmp87 = tmp86 + tmp84
    tmp88 = tmp81 & tmp22
    tmp89 = tl.load(in_ptr0 + (30 + x3), tmp88 & xmask, other=0.0)
    tmp90 = tmp89 + tmp87
    tmp91 = tmp81 & tmp29
    tmp92 = tl.load(in_ptr0 + (31 + x3), tmp91 & xmask, other=0.0)
    tmp93 = tmp92 + tmp90
    tmp94 = tmp81 & tmp36
    tmp95 = tl.load(in_ptr0 + (32 + x3), tmp94 & xmask, other=0.0)
    tmp96 = tmp95 + tmp93
    tmp97 = 2 + x1
    tmp98 = tmp97 >= tmp1
    tmp99 = tmp97 < tmp3
    tmp100 = tmp98 & tmp99
    tmp101 = tmp100 & tmp9
    tmp102 = tl.load(in_ptr0 + (58 + x3), tmp101 & xmask, other=0.0)
    tmp103 = tmp102 + tmp96
    tmp104 = tmp100 & tmp15
    tmp105 = tl.load(in_ptr0 + (59 + x3), tmp104 & xmask, other=0.0)
    tmp106 = tmp105 + tmp103
    tmp107 = tmp100 & tmp22
    tmp108 = tl.load(in_ptr0 + (60 + x3), tmp107 & xmask, other=0.0)
    tmp109 = tmp108 + tmp106
    tmp110 = tmp100 & tmp29
    tmp111 = tl.load(in_ptr0 + (61 + x3), tmp110 & xmask, other=0.0)
    tmp112 = tmp111 + tmp109
    tmp113 = tmp100 & tmp36
    tmp114 = tl.load(in_ptr0 + (62 + x3), tmp113 & xmask, other=0.0)
    tmp115 = tmp114 + tmp112
    tmp116 = 4 + -2 * x0 + -2 * x1 + 2 * (32 * (32 <= 3 + x0) + (3 + x0) *
        (3 + x0 < 32)) + 2 * (32 * (32 <= 3 + x1) + (3 + x1) * (3 + x1 < 32)
        ) + x0 * x1 + (32 * (32 <= 3 + x0) + (3 + x0) * (3 + x0 < 32)) * (
        32 * (32 <= 3 + x1) + (3 + x1) * (3 + x1 < 32)) + -1 * x0 * (32 * (
        32 <= 3 + x1) + (3 + x1) * (3 + x1 < 32)) + -1 * x1 * (32 * (32 <= 
        3 + x0) + (3 + x0) * (3 + x0 < 32))
    tmp117 = tmp115 / tmp116
    tmp119 = 0.0001
    tmp120 = tmp117 * tmp119
    tmp121 = 1.0
    tmp122 = tmp120 + tmp121
    tmp123 = 0.75
    tmp124 = libdevice.pow(tmp122, tmp123)
    tmp125 = tmp118 / tmp124
    tmp126 = 2.0
    tmp127 = tmp118 * tmp126
    tl.store(out_ptr0 + x3, tmp117, xmask)
    tl.store(out_ptr1 + x3, tmp125, xmask)
    tl.store(out_ptr2 + x3, tmp127, xmask)


@triton.jit
def triton_poi_fused_convolution_relu_3(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)
    x3 = xindex
    x1 = xindex // 900 % 256
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, 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 + x3, tmp4, None)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_pow_4(in_ptr0, out_ptr0,
    out_ptr1, out_ptr2, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x0 = xindex % 14
    x1 = xindex // 14 % 14
    x2 = xindex // 196
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (30 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (31 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (32 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (60 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (61 + 2 * x0 + 60 * x1 + 900 * x2), None,
        eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (62 + 2 * x0 + 60 * x1 + 900 * x2), None,
        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)
    tmp17 = tmp1 > tmp0
    tmp18 = tl.full([1], 1, tl.int8)
    tmp19 = tl.full([1], 0, tl.int8)
    tmp20 = tl.where(tmp17, tmp18, tmp19)
    tmp21 = tmp3 > tmp2
    tmp22 = tl.full([1], 2, tl.int8)
    tmp23 = tl.where(tmp21, tmp22, tmp20)
    tmp24 = tmp5 > tmp4
    tmp25 = tl.full([1], 3, tl.int8)
    tmp26 = tl.where(tmp24, tmp25, tmp23)
    tmp27 = tmp7 > tmp6
    tmp28 = tl.full([1], 4, tl.int8)
    tmp29 = tl.where(tmp27, tmp28, tmp26)
    tmp30 = tmp9 > tmp8
    tmp31 = tl.full([1], 5, tl.int8)
    tmp32 = tl.where(tmp30, tmp31, tmp29)
    tmp33 = tmp11 > tmp10
    tmp34 = tl.full([1], 6, tl.int8)
    tmp35 = tl.where(tmp33, tmp34, tmp32)
    tmp36 = tmp13 > tmp12
    tmp37 = tl.full([1], 7, tl.int8)
    tmp38 = tl.where(tmp36, tmp37, tmp35)
    tmp39 = tmp15 > tmp14
    tmp40 = tl.full([1], 8, tl.int8)
    tmp41 = tl.where(tmp39, tmp40, tmp38)
    tmp42 = tmp16 * tmp16
    tl.store(out_ptr0 + x3, tmp16, None)
    tl.store(out_ptr1 + x3, tmp41, None)
    tl.store(out_ptr2 + x3, tmp42, None)


@triton.jit
def triton_poi_fused_add_avg_pool2d_div_mul_pow_5(in_ptr0, in_ptr1,
    out_ptr0, out_ptr1, out_ptr2, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 14 % 14
    x0 = xindex % 14
    x3 = xindex
    tmp118 = tl.load(in_ptr1 + x3, None)
    tmp0 = -2 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 14, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tmp2 & tmp4
    tmp6 = -2 + x0
    tmp7 = tmp6 >= tmp1
    tmp8 = tmp6 < tmp3
    tmp9 = tmp7 & tmp8
    tmp10 = tmp5 & tmp9
    tmp11 = tl.load(in_ptr0 + (-30 + x3), tmp10, other=0.0)
    tmp12 = -1 + x0
    tmp13 = tmp12 >= tmp1
    tmp14 = tmp12 < tmp3
    tmp15 = tmp13 & tmp14
    tmp16 = tmp5 & tmp15
    tmp17 = tl.load(in_ptr0 + (-29 + x3), tmp16, other=0.0)
    tmp18 = tmp17 + tmp11
    tmp19 = x0
    tmp20 = tmp19 >= tmp1
    tmp21 = tmp19 < tmp3
    tmp22 = tmp20 & tmp21
    tmp23 = tmp5 & tmp22
    tmp24 = tl.load(in_ptr0 + (-28 + x3), tmp23, other=0.0)
    tmp25 = tmp24 + tmp18
    tmp26 = 1 + x0
    tmp27 = tmp26 >= tmp1
    tmp28 = tmp26 < tmp3
    tmp29 = tmp27 & tmp28
    tmp30 = tmp5 & tmp29
    tmp31 = tl.load(in_ptr0 + (-27 + x3), tmp30, other=0.0)
    tmp32 = tmp31 + tmp25
    tmp33 = 2 + x0
    tmp34 = tmp33 >= tmp1
    tmp35 = tmp33 < tmp3
    tmp36 = tmp34 & tmp35
    tmp37 = tmp5 & tmp36
    tmp38 = tl.load(in_ptr0 + (-26 + x3), tmp37, other=0.0)
    tmp39 = tmp38 + tmp32
    tmp40 = -1 + x1
    tmp41 = tmp40 >= tmp1
    tmp42 = tmp40 < tmp3
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp9
    tmp45 = tl.load(in_ptr0 + (-16 + x3), tmp44, other=0.0)
    tmp46 = tmp45 + tmp39
    tmp47 = tmp43 & tmp15
    tmp48 = tl.load(in_ptr0 + (-15 + x3), tmp47, other=0.0)
    tmp49 = tmp48 + tmp46
    tmp50 = tmp43 & tmp22
    tmp51 = tl.load(in_ptr0 + (-14 + x3), tmp50, other=0.0)
    tmp52 = tmp51 + tmp49
    tmp53 = tmp43 & tmp29
    tmp54 = tl.load(in_ptr0 + (-13 + x3), tmp53, other=0.0)
    tmp55 = tmp54 + tmp52
    tmp56 = tmp43 & tmp36
    tmp57 = tl.load(in_ptr0 + (-12 + x3), tmp56, other=0.0)
    tmp58 = tmp57 + tmp55
    tmp59 = x1
    tmp60 = tmp59 >= tmp1
    tmp61 = tmp59 < tmp3
    tmp62 = tmp60 & tmp61
    tmp63 = tmp62 & tmp9
    tmp64 = tl.load(in_ptr0 + (-2 + x3), tmp63, other=0.0)
    tmp65 = tmp64 + tmp58
    tmp66 = tmp62 & tmp15
    tmp67 = tl.load(in_ptr0 + (-1 + x3), tmp66, other=0.0)
    tmp68 = tmp67 + tmp65
    tmp69 = tmp62 & tmp22
    tmp70 = tl.load(in_ptr0 + x3, tmp69, other=0.0)
    tmp71 = tmp70 + tmp68
    tmp72 = tmp62 & tmp29
    tmp73 = tl.load(in_ptr0 + (1 + x3), tmp72, other=0.0)
    tmp74 = tmp73 + tmp71
    tmp75 = tmp62 & tmp36
    tmp76 = tl.load(in_ptr0 + (2 + x3), tmp75, other=0.0)
    tmp77 = tmp76 + tmp74
    tmp78 = 1 + x1
    tmp79 = tmp78 >= tmp1
    tmp80 = tmp78 < tmp3
    tmp81 = tmp79 & tmp80
    tmp82 = tmp81 & tmp9
    tmp83 = tl.load(in_ptr0 + (12 + x3), tmp82, other=0.0)
    tmp84 = tmp83 + tmp77
    tmp85 = tmp81 & tmp15
    tmp86 = tl.load(in_ptr0 + (13 + x3), tmp85, other=0.0)
    tmp87 = tmp86 + tmp84
    tmp88 = tmp81 & tmp22
    tmp89 = tl.load(in_ptr0 + (14 + x3), tmp88, other=0.0)
    tmp90 = tmp89 + tmp87
    tmp91 = tmp81 & tmp29
    tmp92 = tl.load(in_ptr0 + (15 + x3), tmp91, other=0.0)
    tmp93 = tmp92 + tmp90
    tmp94 = tmp81 & tmp36
    tmp95 = tl.load(in_ptr0 + (16 + x3), tmp94, other=0.0)
    tmp96 = tmp95 + tmp93
    tmp97 = 2 + x1
    tmp98 = tmp97 >= tmp1
    tmp99 = tmp97 < tmp3
    tmp100 = tmp98 & tmp99
    tmp101 = tmp100 & tmp9
    tmp102 = tl.load(in_ptr0 + (26 + x3), tmp101, other=0.0)
    tmp103 = tmp102 + tmp96
    tmp104 = tmp100 & tmp15
    tmp105 = tl.load(in_ptr0 + (27 + x3), tmp104, other=0.0)
    tmp106 = tmp105 + tmp103
    tmp107 = tmp100 & tmp22
    tmp108 = tl.load(in_ptr0 + (28 + x3), tmp107, other=0.0)
    tmp109 = tmp108 + tmp106
    tmp110 = tmp100 & tmp29
    tmp111 = tl.load(in_ptr0 + (29 + x3), tmp110, other=0.0)
    tmp112 = tmp111 + tmp109
    tmp113 = tmp100 & tmp36
    tmp114 = tl.load(in_ptr0 + (30 + x3), tmp113, other=0.0)
    tmp115 = tmp114 + tmp112
    tmp116 = 4 + -2 * x0 + -2 * x1 + 2 * (16 * (16 <= 3 + x0) + (3 + x0) *
        (3 + x0 < 16)) + 2 * (16 * (16 <= 3 + x1) + (3 + x1) * (3 + x1 < 16)
        ) + x0 * x1 + (16 * (16 <= 3 + x0) + (3 + x0) * (3 + x0 < 16)) * (
        16 * (16 <= 3 + x1) + (3 + x1) * (3 + x1 < 16)) + -1 * x0 * (16 * (
        16 <= 3 + x1) + (3 + x1) * (3 + x1 < 16)) + -1 * x1 * (16 * (16 <= 
        3 + x0) + (3 + x0) * (3 + x0 < 16))
    tmp117 = tmp115 / tmp116
    tmp119 = 0.0001
    tmp120 = tmp117 * tmp119
    tmp121 = 1.0
    tmp122 = tmp120 + tmp121
    tmp123 = 0.75
    tmp124 = libdevice.pow(tmp122, tmp123)
    tmp125 = tmp118 / tmp124
    tmp126 = 2.0
    tmp127 = tmp118 * tmp126
    tl.store(out_ptr0 + x3, tmp117, None)
    tl.store(out_ptr1 + x3, tmp125, None)
    tl.store(out_ptr2 + x3, tmp127, None)


@triton.jit
def triton_poi_fused_convolution_relu_6(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)
    x3 = xindex
    x1 = xindex // 196 % 384
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, 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 + x3, tmp4, 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)
    x3 = xindex
    x1 = xindex // 196 % 256
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, 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 + x3, 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 % 6
    x1 = xindex // 6 % 6
    x2 = xindex // 36
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (14 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (15 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (16 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (28 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (29 + 2 * x0 + 28 * x1 + 196 * x2), None,
        eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (30 + 2 * x0 + 28 * x1 + 196 * x2), None,
        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)
    tmp17 = tmp1 > tmp0
    tmp18 = tl.full([1], 1, tl.int8)
    tmp19 = tl.full([1], 0, tl.int8)
    tmp20 = tl.where(tmp17, tmp18, tmp19)
    tmp21 = tmp3 > tmp2
    tmp22 = tl.full([1], 2, tl.int8)
    tmp23 = tl.where(tmp21, tmp22, tmp20)
    tmp24 = tmp5 > tmp4
    tmp25 = tl.full([1], 3, tl.int8)
    tmp26 = tl.where(tmp24, tmp25, tmp23)
    tmp27 = tmp7 > tmp6
    tmp28 = tl.full([1], 4, tl.int8)
    tmp29 = tl.where(tmp27, tmp28, tmp26)
    tmp30 = tmp9 > tmp8
    tmp31 = tl.full([1], 5, tl.int8)
    tmp32 = tl.where(tmp30, tmp31, tmp29)
    tmp33 = tmp11 > tmp10
    tmp34 = tl.full([1], 6, tl.int8)
    tmp35 = tl.where(tmp33, tmp34, tmp32)
    tmp36 = tmp13 > tmp12
    tmp37 = tl.full([1], 7, tl.int8)
    tmp38 = tl.where(tmp36, tmp37, tmp35)
    tmp39 = tmp15 > tmp14
    tmp40 = tl.full([1], 8, tl.int8)
    tmp41 = tl.where(tmp39, tmp40, tmp38)
    tl.store(out_ptr0 + x3, tmp16, None)
    tl.store(out_ptr1 + x3, tmp41, 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) = args
    args.clear()
    assert_size_stride(primals_1, (96, 3, 11, 11), (363, 121, 11, 1))
    assert_size_stride(primals_2, (96,), (1,))
    assert_size_stride(primals_3, (4, 3, 256, 256), (196608, 65536, 256, 1))
    assert_size_stride(primals_4, (256, 48, 5, 5), (1200, 25, 5, 1))
    assert_size_stride(primals_5, (256,), (1,))
    assert_size_stride(primals_6, (384, 256, 3, 3), (2304, 9, 3, 1))
    assert_size_stride(primals_7, (384,), (1,))
    assert_size_stride(primals_8, (384, 192, 3, 3), (1728, 9, 3, 1))
    assert_size_stride(primals_9, (384,), (1,))
    assert_size_stride(primals_10, (256, 192, 3, 3), (1728, 9, 3, 1))
    assert_size_stride(primals_11, (256,), (1,))
    assert_size_stride(primals_12, (4096, 9216), (9216, 1))
    assert_size_stride(primals_13, (4096,), (1,))
    assert_size_stride(primals_14, (4096, 4096), (4096, 1))
    assert_size_stride(primals_15, (4096,), (1,))
    assert_size_stride(primals_16, (1000, 4096), (4096, 1))
    assert_size_stride(primals_17, (1000,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_3, primals_1, stride=(4, 
            4), padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 96, 62, 62), (369024, 3844, 62, 1))
        buf1 = empty_strided_cuda((4, 96, 62, 62), (371712, 3872, 62, 1),
            torch.float32)
        get_raw_stream(0)
        triton_poi_fused_convolution_relu_0[grid(1476096)](buf0, primals_2,
            buf1, 1476096, XBLOCK=1024, num_warps=4, num_stages=1)
        del buf0
        del primals_2
        buf2 = empty_strided_cuda((4, 96, 30, 30), (86400, 900, 30, 1),
            torch.float32)
        buf3 = empty_strided_cuda((4, 96, 30, 30), (86400, 900, 30, 1),
            torch.int8)
        buf4 = empty_strided_cuda((4, 96, 30, 30), (86400, 900, 30, 1),
            torch.float32)
        triton_poi_fused_max_pool2d_with_indices_pow_1[grid(345600)](buf1,
            buf2, buf3, buf4, 345600, XBLOCK=512, num_warps=8, num_stages=1)
        buf5 = empty_strided_cuda((4, 96, 30, 30), (86400, 900, 30, 1),
            torch.float32)
        buf6 = empty_strided_cuda((4, 96, 30, 30), (86400, 900, 30, 1),
            torch.float32)
        buf26 = empty_strided_cuda((4, 96, 30, 30), (86400, 900, 30, 1),
            torch.float32)
        triton_poi_fused_add_avg_pool2d_div_mul_pow_2[grid(345600)](buf4,
            buf2, buf5, buf6, buf26, 345600, XBLOCK=512, num_warps=8,
            num_stages=1)
        del buf2
        buf7 = extern_kernels.convolution(buf6, primals_4, stride=(1, 1),
            padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=2, bias=None)
        assert_size_stride(buf7, (4, 256, 30, 30), (230400, 900, 30, 1))
        buf8 = buf7
        del buf7
        triton_poi_fused_convolution_relu_3[grid(921600)](buf8, primals_5, 
            921600, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_5
        buf9 = empty_strided_cuda((4, 256, 14, 14), (50176, 196, 14, 1),
            torch.float32)
        buf10 = empty_strided_cuda((4, 256, 14, 14), (50176, 196, 14, 1),
            torch.int8)
        buf11 = empty_strided_cuda((4, 256, 14, 14), (50176, 196, 14, 1),
            torch.float32)
        triton_poi_fused_max_pool2d_with_indices_pow_4[grid(200704)](buf8,
            buf9, buf10, buf11, 200704, XBLOCK=512, num_warps=8, num_stages=1)
        buf12 = empty_strided_cuda((4, 256, 14, 14), (50176, 196, 14, 1),
            torch.float32)
        buf13 = empty_strided_cuda((4, 256, 14, 14), (50176, 196, 14, 1),
            torch.float32)
        buf25 = empty_strided_cuda((4, 256, 14, 14), (50176, 196, 14, 1),
            torch.float32)
        triton_poi_fused_add_avg_pool2d_div_mul_pow_5[grid(200704)](buf11,
            buf9, buf12, buf13, buf25, 200704, XBLOCK=512, num_warps=8,
            num_stages=1)
        del buf9
        buf14 = extern_kernels.convolution(buf13, primals_6, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 384, 14, 14), (75264, 196, 14, 1))
        buf15 = buf14
        del buf14
        triton_poi_fused_convolution_relu_6[grid(301056)](buf15, primals_7,
            301056, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_7
        buf16 = extern_kernels.convolution(buf15, primals_8, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=2, bias=None)
        assert_size_stride(buf16, (4, 384, 14, 14), (75264, 196, 14, 1))
        buf17 = buf16
        del buf16
        triton_poi_fused_convolution_relu_6[grid(301056)](buf17, primals_9,
            301056, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_9
        buf18 = extern_kernels.convolution(buf17, primals_10, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=2, bias=None)
        assert_size_stride(buf18, (4, 256, 14, 14), (50176, 196, 14, 1))
        buf19 = buf18
        del buf18
        triton_poi_fused_convolution_relu_7[grid(200704)](buf19, primals_11,
            200704, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_11
        buf20 = empty_strided_cuda((4, 256, 6, 6), (9216, 36, 6, 1), torch.
            float32)
        buf21 = empty_strided_cuda((4, 256, 6, 6), (9216, 36, 6, 1), torch.int8
            )
        triton_poi_fused_max_pool2d_with_indices_8[grid(36864)](buf19,
            buf20, buf21, 36864, XBLOCK=256, num_warps=4, num_stages=1)
        buf22 = empty_strided_cuda((4, 4096), (4096, 1), torch.float32)
        extern_kernels.addmm(primals_13, reinterpret_tensor(buf20, (4, 9216
            ), (9216, 1), 0), reinterpret_tensor(primals_12, (9216, 4096),
            (1, 9216), 0), alpha=1, beta=1, out=buf22)
        del primals_13
        buf23 = empty_strided_cuda((4, 4096), (4096, 1), torch.float32)
        extern_kernels.addmm(primals_15, buf22, reinterpret_tensor(
            primals_14, (4096, 4096), (1, 4096), 0), alpha=1, beta=1, out=buf23
            )
        del primals_15
        buf24 = empty_strided_cuda((4, 1000), (1000, 1), torch.float32)
        extern_kernels.addmm(primals_17, buf23, reinterpret_tensor(
            primals_16, (4096, 1000), (1, 4096), 0), alpha=1, beta=1, out=buf24
            )
        del primals_17
    return (buf24, primals_1, primals_3, primals_4, primals_6, primals_8,
        primals_10, buf1, buf3, buf4, buf5, buf6, buf8, buf10, buf11, buf12,
        buf13, buf15, buf17, buf19, buf21, reinterpret_tensor(buf20, (4, 
        9216), (9216, 1), 0), buf22, buf23, primals_16, primals_14,
        primals_12, buf25, buf26)


class LRN(nn.Module):
    """
    Local Response Normalization
    """

    def __init__(self, kernel_size, alpha, beta):
        super(LRN, self).__init__()
        self.avg_pool = nn.AvgPool2d(kernel_size=kernel_size, stride=1,
            padding=int(kernel_size / 2))
        self.alpha = alpha
        self.beta = beta

    def forward(self, x):
        div = x.pow(2)
        div = self.avg_pool(div)
        div = div.mul(self.alpha).add(1.0).pow(self.beta)
        x = x.div(div)
        return x


class AlexNetNew(nn.Module):

    def __init__(self, classes=1000):
        """
        GPU : 2
        """
        super(AlexNetNew, self).__init__()
        self.conv1 = nn.Conv2d(in_channels=3, out_channels=96, kernel_size=
            11, stride=4, padding=0, bias=True)
        self.relu1 = nn.ReLU()
        self.max_pool1 = nn.MaxPool2d(kernel_size=3, stride=2)
        self.LRN1 = LRN(kernel_size=5, alpha=0.0001, beta=0.75)
        self.conv2 = nn.Conv2d(in_channels=96, out_channels=256,
            kernel_size=5, stride=1, padding=2, bias=True, groups=2)
        self.relu2 = nn.ReLU()
        self.max_pool2 = nn.MaxPool2d(kernel_size=3, stride=2)
        self.LRN2 = LRN(kernel_size=5, alpha=0.0001, beta=0.75)
        self.conv3 = nn.Conv2d(in_channels=256, out_channels=384,
            kernel_size=3, stride=1, padding=1, bias=True)
        self.relu3 = nn.ReLU()
        self.conv4 = nn.Conv2d(384, 384, kernel_size=3, stride=1, padding=1,
            bias=True, groups=2)
        self.relu4 = nn.ReLU()
        self.conv5 = nn.Conv2d(384, 256, kernel_size=3, stride=1, padding=1,
            groups=2)
        self.relu5 = nn.ReLU()
        self.max_pool3 = nn.MaxPool2d(kernel_size=3, stride=2)
        self.dense1 = nn.Linear(6 * 6 * 256, 4096)
        self.dense2 = nn.Linear(4096, 4096)
        self.dense3 = nn.Linear(4096, classes)

    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.conv3.weight
        primals_7 = self.conv3.bias
        primals_8 = self.conv4.weight
        primals_9 = self.conv4.bias
        primals_10 = self.conv5.weight
        primals_11 = self.conv5.bias
        primals_12 = self.dense1.weight
        primals_13 = self.dense1.bias
        primals_14 = self.dense2.weight
        primals_15 = self.dense2.bias
        primals_16 = self.dense3.weight
        primals_17 = self.dense3.bias
        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])
        return output[0]


Measured latency_ms: 0.033304