# AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _align as align
from torch import device, empty_strided
from torch._inductor.async_compile import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels
from torch._inductor.codegen.multi_kernel import MultiKernelCall
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid, split_scan_grid, grid_combo_kernels, start_graph, end_graph
from torch._C import _cuda_getCurrentRawStream as get_raw_stream

aten = torch.ops.aten
inductor_ops = torch.ops.inductor
_quantized = torch.ops._quantized
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor
alloc_from_pool = torch.ops.inductor._alloc_from_pool
async_compile = AsyncCompile()


# kernel path: runs/run_shard_4/inductor_cache/3j/c3jcyamwgi62wqn3zu3j6pebpmcimdfgshkghv6sxxavfuohbroi.py
# Topologically Sorted Source Nodes: [x, x_1], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   x => convolution
#   x_1 => relu
# Graph fragment:
#   %convolution : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%primals_3, %primals_1, %primals_2, [4, 4], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
#   %relu : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution,), kwargs = {})
triton_poi_fused_convolution_relu_0 = async_compile.triton('triton_poi_fused_convolution_relu_0', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[2097152], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_relu_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/za/cza3ey7hkyy5xmmvxqevc4t7mmbqlzbllriupvfag6s2k5pa56nv.py
# Topologically Sorted Source Nodes: [x_2, div], Original ATen: [aten.max_pool2d_with_indices, aten.pow]
# Source node to ATen node mapping:
#   div => pow_1
#   x_2 => _low_memory_max_pool2d_with_offsets, getitem_1
# Graph fragment:
#   %_low_memory_max_pool2d_with_offsets : [num_users=2] = call_function[target=torch.ops.prims._low_memory_max_pool2d_with_offsets.default](args = (%relu, [3, 3], [2, 2], [0, 0], [1, 1], False), kwargs = {})
#   %getitem_1 : [num_users=1] = call_function[target=operator.getitem](args = (%_low_memory_max_pool2d_with_offsets, 1), kwargs = {})
#   %pow_1 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%getitem, 2), kwargs = {})
triton_poi_fused_max_pool2d_with_indices_pow_1 = async_compile.triton('triton_poi_fused_max_pool2d_with_indices_pow_1', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[524288], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i8', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_pool2d_with_indices_pow_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 9, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/2b/c2bzrikzlv5fjqzv7srcovmz5lxmof4cinxfk7txkso46wlnfibs.py
# Topologically Sorted Source Nodes: [div_1, mul, add, div_2, x_3], Original ATen: [aten.avg_pool2d, aten.mul, aten.add, aten.pow, aten.div]
# Source node to ATen node mapping:
#   add => add
#   div_1 => avg_pool2d
#   div_2 => pow_2
#   mul => mul
#   x_3 => div
# Graph fragment:
#   %avg_pool2d : [num_users=2] = call_function[target=torch.ops.aten.avg_pool2d.default](args = (%pow_1, [5, 5], [1, 1], [2, 2]), kwargs = {})
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%avg_pool2d, 0.0001), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul, 1.0), kwargs = {})
#   %pow_2 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%add, 0.75), kwargs = {})
#   %div : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%getitem, %pow_2), kwargs = {})
#   %pow_8 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%getitem, 1.0), kwargs = {})
#   %mul_12 : [num_users=1] = call_function[target=torch.ops.aten.mul.Scalar](args = (%pow_8, 2.0), kwargs = {})
triton_poi_fused_add_avg_pool2d_div_mul_pow_2 = async_compile.triton('triton_poi_fused_add_avg_pool2d_div_mul_pow_2', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[524288], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_avg_pool2d_div_mul_pow_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 26, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/l7/cl7cxheq7ddvcecqhdge3naydmjeqypgyqphaqcitlorl5ly5qdz.py
# Topologically Sorted Source Nodes: [x_4, x_5], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   x_4 => convolution_1
#   x_5 => relu_1
# Graph fragment:
#   %convolution_1 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%div, %primals_4, %primals_5, [1, 1], [2, 2], [1, 1], False, [0, 0], 2), kwargs = {})
#   %relu_1 : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution_1,), kwargs = {})
triton_poi_fused_convolution_relu_3 = async_compile.triton('triton_poi_fused_convolution_relu_3', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[1048576], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_relu_3', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_convolution_relu_3(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 921600
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = 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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/qs/cqs2ylb7hs6zjqwwzkmhix2qsvfnqvjwwcxs53224b37jxhkmtsd.py
# Topologically Sorted Source Nodes: [x_6, div_4], Original ATen: [aten.max_pool2d_with_indices, aten.pow]
# Source node to ATen node mapping:
#   div_4 => pow_3
#   x_6 => _low_memory_max_pool2d_with_offsets_1, getitem_3
# Graph fragment:
#   %_low_memory_max_pool2d_with_offsets_1 : [num_users=2] = call_function[target=torch.ops.prims._low_memory_max_pool2d_with_offsets.default](args = (%relu_1, [3, 3], [2, 2], [0, 0], [1, 1], False), kwargs = {})
#   %getitem_3 : [num_users=1] = call_function[target=operator.getitem](args = (%_low_memory_max_pool2d_with_offsets_1, 1), kwargs = {})
#   %pow_3 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%getitem_2, 2), kwargs = {})
triton_poi_fused_max_pool2d_with_indices_pow_4 = async_compile.triton('triton_poi_fused_max_pool2d_with_indices_pow_4', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[262144], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i8', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_pool2d_with_indices_pow_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 9, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_max_pool2d_with_indices_pow_4(in_ptr0, out_ptr0, out_ptr1, out_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 200704
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = 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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/ji/cjii5mxgbzszh7ysrdisbvam2vq53cdysofvlnl3sl3f2laljcf4.py
# Topologically Sorted Source Nodes: [div_5, mul_1, add_1, div_6, x_7], Original ATen: [aten.avg_pool2d, aten.mul, aten.add, aten.pow, aten.div]
# Source node to ATen node mapping:
#   add_1 => add_1
#   div_5 => avg_pool2d_1
#   div_6 => pow_4
#   mul_1 => mul_1
#   x_7 => div_1
# Graph fragment:
#   %avg_pool2d_1 : [num_users=2] = call_function[target=torch.ops.aten.avg_pool2d.default](args = (%pow_3, [5, 5], [1, 1], [2, 2]), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%avg_pool2d_1, 0.0001), kwargs = {})
#   %add_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_1, 1.0), kwargs = {})
#   %pow_4 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%add_1, 0.75), kwargs = {})
#   %div_1 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%getitem_2, %pow_4), kwargs = {})
#   %pow_6 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%getitem_2, 1.0), kwargs = {})
#   %mul_6 : [num_users=1] = call_function[target=torch.ops.aten.mul.Scalar](args = (%pow_6, 2.0), kwargs = {})
triton_poi_fused_add_avg_pool2d_div_mul_pow_5 = async_compile.triton('triton_poi_fused_add_avg_pool2d_div_mul_pow_5', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[262144], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_avg_pool2d_div_mul_pow_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 26, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@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):
    xnumel = 200704
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = 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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/5z/c5zfzjn2aqx6dpwajwe2vfhsllvzwsgqquc6wkhy35cdnwh2tbyo.py
# Topologically Sorted Source Nodes: [x_8, x_9], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   x_8 => convolution_2
#   x_9 => relu_2
# Graph fragment:
#   %convolution_2 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%div_1, %primals_6, %primals_7, [1, 1], [1, 1], [1, 1], False, [0, 0], 1), kwargs = {})
#   %relu_2 : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution_2,), kwargs = {})
triton_poi_fused_convolution_relu_6 = async_compile.triton('triton_poi_fused_convolution_relu_6', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[524288], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_relu_6', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_convolution_relu_6(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 301056
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = 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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/yn/cyng2xph3fpspqivby6n3hhn7nafozgsxmef26nxb4ghbtkve3xf.py
# Topologically Sorted Source Nodes: [x_12, x_13], Original ATen: [aten.convolution, aten.relu]
# Source node to ATen node mapping:
#   x_12 => convolution_4
#   x_13 => relu_4
# Graph fragment:
#   %convolution_4 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%relu_3, %primals_10, %primals_11, [1, 1], [1, 1], [1, 1], False, [0, 0], 2), kwargs = {})
#   %relu_4 : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%convolution_4,), kwargs = {})
triton_poi_fused_convolution_relu_7 = async_compile.triton('triton_poi_fused_convolution_relu_7', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[262144], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_relu_7', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_convolution_relu_7(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 200704
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = 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)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/dn/cdnlo5aymjge4ss5gspczlpvovvevlp4ezz34qa5gzoavy2awgks.py
# Topologically Sorted Source Nodes: [x_14], Original ATen: [aten.max_pool2d_with_indices]
# Source node to ATen node mapping:
#   x_14 => _low_memory_max_pool2d_with_offsets_2, getitem_5
# Graph fragment:
#   %_low_memory_max_pool2d_with_offsets_2 : [num_users=2] = call_function[target=torch.ops.prims._low_memory_max_pool2d_with_offsets.default](args = (%relu_4, [3, 3], [2, 2], [0, 0], [1, 1], False), kwargs = {})
#   %getitem_5 : [num_users=1] = call_function[target=operator.getitem](args = (%_low_memory_max_pool2d_with_offsets_2, 1), kwargs = {})
triton_poi_fused_max_pool2d_with_indices_8 = async_compile.triton('triton_poi_fused_max_pool2d_with_indices_8', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[65536], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i8', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_max_pool2d_with_indices_8', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 9, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_max_pool2d_with_indices_8(in_ptr0, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 36864
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = 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)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

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)
        # Topologically Sorted Source Nodes: [x], Original ATen: [aten.convolution]
        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)
        # Topologically Sorted Source Nodes: [x, x_1], Original ATen: [aten.convolution, aten.relu]
        stream0 = get_raw_stream(0)
        triton_poi_fused_convolution_relu_0.run(buf0, primals_2, buf1, 1476096, grid=grid(1476096), stream=stream0)
        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)
        # Topologically Sorted Source Nodes: [x_2, div], Original ATen: [aten.max_pool2d_with_indices, aten.pow]
        triton_poi_fused_max_pool2d_with_indices_pow_1.run(buf1, buf2, buf3, buf4, 345600, grid=grid(345600), stream=stream0)
        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)
        # Topologically Sorted Source Nodes: [div_1, mul, add, div_2, x_3], Original ATen: [aten.avg_pool2d, aten.mul, aten.add, aten.pow, aten.div]
        triton_poi_fused_add_avg_pool2d_div_mul_pow_2.run(buf4, buf2, buf5, buf6, buf26, 345600, grid=grid(345600), stream=stream0)
        del buf2
        # Topologically Sorted Source Nodes: [x_4], Original ATen: [aten.convolution]
        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  # reuse
        # Topologically Sorted Source Nodes: [x_4, x_5], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_3.run(buf8, primals_5, 921600, grid=grid(921600), stream=stream0)
        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)
        # Topologically Sorted Source Nodes: [x_6, div_4], Original ATen: [aten.max_pool2d_with_indices, aten.pow]
        triton_poi_fused_max_pool2d_with_indices_pow_4.run(buf8, buf9, buf10, buf11, 200704, grid=grid(200704), stream=stream0)
        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)
        # Topologically Sorted Source Nodes: [div_5, mul_1, add_1, div_6, x_7], Original ATen: [aten.avg_pool2d, aten.mul, aten.add, aten.pow, aten.div]
        triton_poi_fused_add_avg_pool2d_div_mul_pow_5.run(buf11, buf9, buf12, buf13, buf25, 200704, grid=grid(200704), stream=stream0)
        del buf9
        # Topologically Sorted Source Nodes: [x_8], Original ATen: [aten.convolution]
        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  # reuse
        # Topologically Sorted Source Nodes: [x_8, x_9], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_6.run(buf15, primals_7, 301056, grid=grid(301056), stream=stream0)
        del primals_7
        # Topologically Sorted Source Nodes: [x_10], Original ATen: [aten.convolution]
        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  # reuse
        # Topologically Sorted Source Nodes: [x_10, x_11], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_6.run(buf17, primals_9, 301056, grid=grid(301056), stream=stream0)
        del primals_9
        # Topologically Sorted Source Nodes: [x_12], Original ATen: [aten.convolution]
        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  # reuse
        # Topologically Sorted Source Nodes: [x_12, x_13], Original ATen: [aten.convolution, aten.relu]
        triton_poi_fused_convolution_relu_7.run(buf19, primals_11, 200704, grid=grid(200704), stream=stream0)
        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)
        # Topologically Sorted Source Nodes: [x_14], Original ATen: [aten.max_pool2d_with_indices]
        triton_poi_fused_max_pool2d_with_indices_8.run(buf19, buf20, buf21, 36864, grid=grid(36864), stream=stream0)
        buf22 = empty_strided_cuda((4, 4096), (4096, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x_16], Original ATen: [aten.addmm]
        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)
        # Topologically Sorted Source Nodes: [x_17], Original ATen: [aten.addmm]
        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)
        # Topologically Sorted Source Nodes: [x_18], Original ATen: [aten.addmm]
        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, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((96, 3, 11, 11), (363, 121, 11, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((96, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 3, 256, 256), (196608, 65536, 256, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((256, 48, 5, 5), (1200, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((384, 256, 3, 3), (2304, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((384, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((384, 192, 3, 3), (1728, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((384, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((256, 192, 3, 3), (1728, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((4096, 9216), (9216, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((4096, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((4096, 4096), (4096, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((4096, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_16 = rand_strided((1000, 4096), (4096, 1), device='cuda:0', dtype=torch.float32)
    primals_17 = rand_strided((1000, ), (1, ), device='cuda:0', dtype=torch.float32)
    fn = lambda: 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 print_performance(fn, times=times, repeat=repeat)


if __name__ == "__main__":
    from torch._inductor.wrapper_benchmark import compiled_module_main
    compiled_module_main('None', benchmark_compiled_module)

import torch
import torch.nn as nn


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 AlexNet(nn.Module):

    def __init__(self, classes=1000):
        """
        GPU : 2
        """
        super(AlexNet, 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, x):
        x = self.conv1(x)
        x = self.relu1(x)
        x = self.max_pool1(x)
        x = self.LRN1(x)
        x = self.conv2(x)
        x = self.relu2(x)
        x = self.max_pool2(x)
        x = self.LRN2(x)
        x = self.conv3(x)
        x = self.relu3(x)
        x = self.conv4(x)
        x = self.relu4(x)
        x = self.conv5(x)
        x = self.relu5(x)
        x = self.max_pool3(x)
        x = x.view(-1, 6 * 6 * 256)
        x = self.dense1(x)
        x = self.dense2(x)
        x = self.dense3(x)
        return x


def get_inputs():
    return [torch.rand([4, 3, 256, 256])]


def get_init_inputs():
    return [[], {}]

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]
