# 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/ve/cven4fg5p554vidmwu2g3ea6jgqwadbawpokvsw357czr2wouxgw.py
# Topologically Sorted Source Nodes: [x, x_1], Original ATen: [aten.convolution, aten.sigmoid]
# Source node to ATen node mapping:
#   x => convolution
#   x_1 => sigmoid
# Graph fragment:
#   %convolution : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%primals_3, %primals_1, %primals_2, [1, 1], [2, 2], [1, 1], False, [0, 0], 1), kwargs = {})
#   %sigmoid : [num_users=2] = call_function[target=torch.ops.aten.sigmoid.default](args = (%convolution,), kwargs = {})
triton_poi_fused_convolution_sigmoid_0 = async_compile.triton('triton_poi_fused_convolution_sigmoid_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=[131072], 
    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_sigmoid_0', '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_sigmoid_0(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 98304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x1 = (xindex // 4096) % 6
    tmp0 = tl.load(in_out_ptr0 + (x3), None)
    tmp1 = tl.load(in_ptr0 + (x1), None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.sigmoid(tmp2)
    tl.store(in_out_ptr0 + (x3), tmp3, None)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/qz/cqz2afmrnuzfkvjeuboetwjy53aw27ea6kbdvaojvehvsnmlpibc.py
# Topologically Sorted Source Nodes: [x_2], Original ATen: [aten.avg_pool2d]
# Source node to ATen node mapping:
#   x_2 => avg_pool2d
# Graph fragment:
#   %avg_pool2d : [num_users=2] = call_function[target=torch.ops.aten.avg_pool2d.default](args = (%sigmoid, [5, 5], [2, 2]), kwargs = {})
triton_poi_fused_avg_pool2d_1 = async_compile.triton('triton_poi_fused_avg_pool2d_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=[32768], 
    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_avg_pool2d_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 25, '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_avg_pool2d_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 21600
    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) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (4 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (64 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (65 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (66 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (67 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (68 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr0 + (128 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr0 + (129 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr0 + (130 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr0 + (131 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr0 + (132 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (192 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr0 + (193 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr0 + (194 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr0 + (195 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr0 + (196 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr0 + (256 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr0 + (257 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr0 + (258 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr0 + (259 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (260 + (2*x0) + (128*x1) + (4096*x2)), xmask, eviction_policy='evict_last')
    tmp2 = tmp1 + tmp0
    tmp4 = tmp3 + tmp2
    tmp6 = tmp5 + tmp4
    tmp8 = tmp7 + tmp6
    tmp10 = tmp9 + tmp8
    tmp12 = tmp11 + tmp10
    tmp14 = tmp13 + tmp12
    tmp16 = tmp15 + tmp14
    tmp18 = tmp17 + tmp16
    tmp20 = tmp19 + tmp18
    tmp22 = tmp21 + tmp20
    tmp24 = tmp23 + tmp22
    tmp26 = tmp25 + tmp24
    tmp28 = tmp27 + tmp26
    tmp30 = tmp29 + tmp28
    tmp32 = tmp31 + tmp30
    tmp34 = tmp33 + tmp32
    tmp36 = tmp35 + tmp34
    tmp38 = tmp37 + tmp36
    tmp40 = tmp39 + tmp38
    tmp42 = tmp41 + tmp40
    tmp44 = tmp43 + tmp42
    tmp46 = tmp45 + tmp44
    tmp48 = tmp47 + tmp46
    tmp49 = 0.04
    tmp50 = tmp48 * tmp49
    tl.store(out_ptr0 + (x3), tmp50, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/n7/cn7okv6oflbmhd4mtrlboa5nl5m3rrlwo4btzman7mpv3jrayhye.py
# Topologically Sorted Source Nodes: [x_3, x_4], Original ATen: [aten.convolution, aten.sigmoid]
# Source node to ATen node mapping:
#   x_3 => convolution_1
#   x_4 => sigmoid_1
# Graph fragment:
#   %convolution_1 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%avg_pool2d, %primals_4, %primals_5, [2, 2], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
#   %sigmoid_1 : [num_users=2] = call_function[target=torch.ops.aten.sigmoid.default](args = (%convolution_1,), kwargs = {})
triton_poi_fused_convolution_sigmoid_2 = async_compile.triton('triton_poi_fused_convolution_sigmoid_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=[16384], 
    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_sigmoid_2', '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_sigmoid_2(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 10816
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 169) % 16
    x2 = (xindex // 2704)
    x4 = xindex % 2704
    tmp0 = tl.load(in_ptr0 + (x3), xmask)
    tmp1 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.sigmoid(tmp2)
    tl.store(out_ptr0 + (x4 + (2720*x2)), tmp3, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/ow/cow3adnhdtf4hslx7he6cgthapbc3enub5ejfad2vez6kmjhk7y4.py
# Topologically Sorted Source Nodes: [x_5], Original ATen: [aten.avg_pool2d]
# Source node to ATen node mapping:
#   x_5 => avg_pool2d_1
# Graph fragment:
#   %avg_pool2d_1 : [num_users=1] = call_function[target=torch.ops.aten.avg_pool2d.default](args = (%sigmoid_1, [5, 5], [2, 2]), kwargs = {})
triton_poi_fused_avg_pool2d_3 = async_compile.triton('triton_poi_fused_avg_pool2d_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=[2048], 
    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_avg_pool2d_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 25, '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_avg_pool2d_3(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1600
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 5
    x1 = (xindex // 5) % 5
    x2 = (xindex // 25) % 16
    x3 = (xindex // 400)
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + ((2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (4 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (13 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (14 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (15 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (16 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (17 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr0 + (26 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr0 + (27 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr0 + (28 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr0 + (29 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr0 + (30 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (39 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr0 + (40 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr0 + (41 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr0 + (42 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr0 + (43 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr0 + (52 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr0 + (53 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr0 + (54 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr0 + (55 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (56 + (2*x0) + (26*x1) + (169*x2) + (2720*x3)), xmask, eviction_policy='evict_last')
    tmp2 = tmp1 + tmp0
    tmp4 = tmp3 + tmp2
    tmp6 = tmp5 + tmp4
    tmp8 = tmp7 + tmp6
    tmp10 = tmp9 + tmp8
    tmp12 = tmp11 + tmp10
    tmp14 = tmp13 + tmp12
    tmp16 = tmp15 + tmp14
    tmp18 = tmp17 + tmp16
    tmp20 = tmp19 + tmp18
    tmp22 = tmp21 + tmp20
    tmp24 = tmp23 + tmp22
    tmp26 = tmp25 + tmp24
    tmp28 = tmp27 + tmp26
    tmp30 = tmp29 + tmp28
    tmp32 = tmp31 + tmp30
    tmp34 = tmp33 + tmp32
    tmp36 = tmp35 + tmp34
    tmp38 = tmp37 + tmp36
    tmp40 = tmp39 + tmp38
    tmp42 = tmp41 + tmp40
    tmp44 = tmp43 + tmp42
    tmp46 = tmp45 + tmp44
    tmp48 = tmp47 + tmp46
    tmp49 = 0.04
    tmp50 = tmp48 * tmp49
    tl.store(out_ptr0 + (x4), tmp50, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/ro/cromrs4zaduq7m7se2v4z3w5znirybvx4xdcc34q24m5zvs25ttz.py
# Topologically Sorted Source Nodes: [x_8], Original ATen: [aten.sigmoid]
# Source node to ATen node mapping:
#   x_8 => sigmoid_2
# Graph fragment:
#   %add_tensor_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mm_default_1, %primals_7), kwargs = {})
#   %sigmoid_2 : [num_users=2] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_tensor_1,), kwargs = {})
triton_poi_fused_sigmoid_4 = async_compile.triton('triton_poi_fused_sigmoid_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=[512], 
    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_sigmoid_4', '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_sigmoid_4(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 480
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 120
    tmp0 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.sigmoid(tmp2)
    tl.store(in_out_ptr0 + (x2), tmp3, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/hr/chr2suwacm2elmaum6cxyefw762ibu5yr35eg7zkmfx33cr7hkuk.py
# Topologically Sorted Source Nodes: [x_10], Original ATen: [aten.sigmoid]
# Source node to ATen node mapping:
#   x_10 => sigmoid_3
# Graph fragment:
#   %add_tensor : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mm_default, %primals_9), kwargs = {})
#   %sigmoid_3 : [num_users=2] = call_function[target=torch.ops.aten.sigmoid.default](args = (%add_tensor,), kwargs = {})
triton_poi_fused_sigmoid_5 = async_compile.triton('triton_poi_fused_sigmoid_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=[512], 
    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_sigmoid_5', '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_sigmoid_5(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 336
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 84
    tmp0 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.sigmoid(tmp2)
    tl.store(in_out_ptr0 + (x2), tmp3, xmask)
''', 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 = args
    args.clear()
    assert_size_stride(primals_1, (6, 3, 5, 5), (75, 25, 5, 1))
    assert_size_stride(primals_2, (6, ), (1, ))
    assert_size_stride(primals_3, (4, 3, 64, 64), (12288, 4096, 64, 1))
    assert_size_stride(primals_4, (16, 6, 5, 5), (150, 25, 5, 1))
    assert_size_stride(primals_5, (16, ), (1, ))
    assert_size_stride(primals_6, (120, 400), (400, 1))
    assert_size_stride(primals_7, (120, ), (1, ))
    assert_size_stride(primals_8, (84, 120), (120, 1))
    assert_size_stride(primals_9, (84, ), (1, ))
    assert_size_stride(primals_10, (7, 84), (84, 1))
    assert_size_stride(primals_11, (7, ), (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=(1, 1), padding=(2, 2), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 6, 64, 64), (24576, 4096, 64, 1))
        buf1 = buf0; del buf0  # reuse
        # Topologically Sorted Source Nodes: [x, x_1], Original ATen: [aten.convolution, aten.sigmoid]
        stream0 = get_raw_stream(0)
        triton_poi_fused_convolution_sigmoid_0.run(buf1, primals_2, 98304, grid=grid(98304), stream=stream0)
        del primals_2
        buf2 = empty_strided_cuda((4, 6, 30, 30), (5400, 900, 30, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x_2], Original ATen: [aten.avg_pool2d]
        triton_poi_fused_avg_pool2d_1.run(buf1, buf2, 21600, grid=grid(21600), stream=stream0)
        # Topologically Sorted Source Nodes: [x_3], Original ATen: [aten.convolution]
        buf3 = extern_kernels.convolution(buf2, primals_4, stride=(2, 2), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 16, 13, 13), (2704, 169, 13, 1))
        buf4 = empty_strided_cuda((4, 16, 13, 13), (2720, 169, 13, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x_3, x_4], Original ATen: [aten.convolution, aten.sigmoid]
        triton_poi_fused_convolution_sigmoid_2.run(buf3, primals_5, buf4, 10816, grid=grid(10816), stream=stream0)
        del buf3
        del primals_5
        buf5 = empty_strided_cuda((4, 16, 5, 5), (400, 25, 5, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x_5], Original ATen: [aten.avg_pool2d]
        triton_poi_fused_avg_pool2d_3.run(buf4, buf5, 1600, grid=grid(1600), stream=stream0)
        buf6 = empty_strided_cuda((4, 120), (120, 1), torch.float32)
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(reinterpret_tensor(buf5, (4, 400), (400, 1), 0), reinterpret_tensor(primals_6, (400, 120), (1, 400), 0), out=buf6)
        buf7 = buf6; del buf6  # reuse
        # Topologically Sorted Source Nodes: [x_8], Original ATen: [aten.sigmoid]
        triton_poi_fused_sigmoid_4.run(buf7, primals_7, 480, grid=grid(480), stream=stream0)
        del primals_7
        buf8 = empty_strided_cuda((4, 84), (84, 1), torch.float32)
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(buf7, reinterpret_tensor(primals_8, (120, 84), (1, 120), 0), out=buf8)
        buf9 = buf8; del buf8  # reuse
        # Topologically Sorted Source Nodes: [x_10], Original ATen: [aten.sigmoid]
        triton_poi_fused_sigmoid_5.run(buf9, primals_9, 336, grid=grid(336), stream=stream0)
        del primals_9
        buf10 = empty_strided_cuda((4, 7), (7, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x_11], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_11, buf9, reinterpret_tensor(primals_10, (84, 7), (1, 84), 0), alpha=1, beta=1, out=buf10)
        del primals_11
    return (buf10, buf10, primals_1, primals_3, primals_4, buf1, buf2, buf4, reinterpret_tensor(buf5, (4, 400), (400, 1), 0), buf7, buf9, primals_10, primals_8, primals_6, )


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((6, 3, 5, 5), (75, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((6, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 3, 64, 64), (12288, 4096, 64, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((16, 6, 5, 5), (150, 25, 5, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((16, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((120, 400), (400, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((120, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((84, 120), (120, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((84, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((7, 84), (84, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((7, ), (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])
    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 LeNet(nn.Module):

    def __init__(self):
        super().__init__()
        self.conv_1 = nn.Conv2d(3, 6, kernel_size=5, padding=2)
        self.sigmoid = nn.Sigmoid()
        self.avgpool = nn.AvgPool2d(kernel_size=5, stride=2)
        self.conv_2 = nn.Conv2d(6, 16, kernel_size=5, stride=2)
        self.fc_1 = nn.Linear(16 * 5 * 5, 120)
        self.fc_2 = nn.Linear(120, 84)
        self.fc_3 = nn.Linear(84, 7)

    def get_resnet_layer(self, block, n_blocks, channels, stride=1):
        layers = []
        if self.in_channels != block.expansion * channels:
            downsample = True
        else:
            downsample = False
        layers.append(block(self.in_channels, channels, stride, downsample))
        for i in range(1, n_blocks):
            layers.append(block(block.expansion * channels, channels))
        self.in_channels = block.expansion * channels
        return nn.Sequential(*layers)

    def forward(self, x):
        x = self.conv_1(x)
        x = self.sigmoid(x)
        x = self.avgpool(x)
        x = self.conv_2(x)
        x = self.sigmoid(x)
        x = self.avgpool(x)
        x = nn.Flatten()(x)
        x = self.fc_1(x)
        x = self.sigmoid(x)
        x = self.fc_2(x)
        x = self.sigmoid(x)
        x = self.fc_3(x)
        h = x.view(x.shape[0], -1)
        return x, h


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


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
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_sigmoid_0(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 // 4096 % 6
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.sigmoid(tmp2)
    tl.store(in_out_ptr0 + x3, tmp3, None)


@triton.jit
def triton_poi_fused_avg_pool2d_1(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 21600
    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 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (4 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (64 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (65 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (66 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (67 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (68 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr0 + (128 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr0 + (129 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr0 + (130 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr0 + (131 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr0 + (132 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (192 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr0 + (193 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr0 + (194 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr0 + (195 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr0 + (196 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr0 + (256 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr0 + (257 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr0 + (258 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr0 + (259 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (260 + 2 * x0 + 128 * x1 + 4096 * x2), xmask,
        eviction_policy='evict_last')
    tmp2 = tmp1 + tmp0
    tmp4 = tmp3 + tmp2
    tmp6 = tmp5 + tmp4
    tmp8 = tmp7 + tmp6
    tmp10 = tmp9 + tmp8
    tmp12 = tmp11 + tmp10
    tmp14 = tmp13 + tmp12
    tmp16 = tmp15 + tmp14
    tmp18 = tmp17 + tmp16
    tmp20 = tmp19 + tmp18
    tmp22 = tmp21 + tmp20
    tmp24 = tmp23 + tmp22
    tmp26 = tmp25 + tmp24
    tmp28 = tmp27 + tmp26
    tmp30 = tmp29 + tmp28
    tmp32 = tmp31 + tmp30
    tmp34 = tmp33 + tmp32
    tmp36 = tmp35 + tmp34
    tmp38 = tmp37 + tmp36
    tmp40 = tmp39 + tmp38
    tmp42 = tmp41 + tmp40
    tmp44 = tmp43 + tmp42
    tmp46 = tmp45 + tmp44
    tmp48 = tmp47 + tmp46
    tmp49 = 0.04
    tmp50 = tmp48 * tmp49
    tl.store(out_ptr0 + x3, tmp50, xmask)


@triton.jit
def triton_poi_fused_convolution_sigmoid_2(in_ptr0, in_ptr1, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 10816
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = xindex // 169 % 16
    x2 = xindex // 2704
    x4 = xindex % 2704
    tmp0 = tl.load(in_ptr0 + x3, xmask)
    tmp1 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.sigmoid(tmp2)
    tl.store(out_ptr0 + (x4 + 2720 * x2), tmp3, xmask)


@triton.jit
def triton_poi_fused_avg_pool2d_3(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 1600
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 5
    x1 = xindex // 5 % 5
    x2 = xindex // 25 % 16
    x3 = xindex // 400
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3),
        xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3),
        xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3),
        xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3),
        xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (4 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3),
        xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (13 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3),
        xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr0 + (14 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (15 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (16 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (17 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr0 + (26 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr0 + (27 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr0 + (28 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr0 + (29 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr0 + (30 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (39 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr0 + (40 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr0 + (41 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr0 + (42 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr0 + (43 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr0 + (52 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr0 + (53 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr0 + (54 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr0 + (55 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (56 + 2 * x0 + 26 * x1 + 169 * x2 + 2720 * x3
        ), xmask, eviction_policy='evict_last')
    tmp2 = tmp1 + tmp0
    tmp4 = tmp3 + tmp2
    tmp6 = tmp5 + tmp4
    tmp8 = tmp7 + tmp6
    tmp10 = tmp9 + tmp8
    tmp12 = tmp11 + tmp10
    tmp14 = tmp13 + tmp12
    tmp16 = tmp15 + tmp14
    tmp18 = tmp17 + tmp16
    tmp20 = tmp19 + tmp18
    tmp22 = tmp21 + tmp20
    tmp24 = tmp23 + tmp22
    tmp26 = tmp25 + tmp24
    tmp28 = tmp27 + tmp26
    tmp30 = tmp29 + tmp28
    tmp32 = tmp31 + tmp30
    tmp34 = tmp33 + tmp32
    tmp36 = tmp35 + tmp34
    tmp38 = tmp37 + tmp36
    tmp40 = tmp39 + tmp38
    tmp42 = tmp41 + tmp40
    tmp44 = tmp43 + tmp42
    tmp46 = tmp45 + tmp44
    tmp48 = tmp47 + tmp46
    tmp49 = 0.04
    tmp50 = tmp48 * tmp49
    tl.store(out_ptr0 + x4, tmp50, xmask)


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


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


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) = args
    args.clear()
    assert_size_stride(primals_1, (6, 3, 5, 5), (75, 25, 5, 1))
    assert_size_stride(primals_2, (6,), (1,))
    assert_size_stride(primals_3, (4, 3, 64, 64), (12288, 4096, 64, 1))
    assert_size_stride(primals_4, (16, 6, 5, 5), (150, 25, 5, 1))
    assert_size_stride(primals_5, (16,), (1,))
    assert_size_stride(primals_6, (120, 400), (400, 1))
    assert_size_stride(primals_7, (120,), (1,))
    assert_size_stride(primals_8, (84, 120), (120, 1))
    assert_size_stride(primals_9, (84,), (1,))
    assert_size_stride(primals_10, (7, 84), (84, 1))
    assert_size_stride(primals_11, (7,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_3, primals_1, stride=(1, 
            1), padding=(2, 2), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 6, 64, 64), (24576, 4096, 64, 1))
        buf1 = buf0
        del buf0
        get_raw_stream(0)
        triton_poi_fused_convolution_sigmoid_0[grid(98304)](buf1, primals_2,
            98304, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_2
        buf2 = empty_strided_cuda((4, 6, 30, 30), (5400, 900, 30, 1), torch
            .float32)
        triton_poi_fused_avg_pool2d_1[grid(21600)](buf1, buf2, 21600,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf3 = extern_kernels.convolution(buf2, primals_4, stride=(2, 2),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 16, 13, 13), (2704, 169, 13, 1))
        buf4 = empty_strided_cuda((4, 16, 13, 13), (2720, 169, 13, 1),
            torch.float32)
        triton_poi_fused_convolution_sigmoid_2[grid(10816)](buf3, primals_5,
            buf4, 10816, XBLOCK=256, num_warps=4, num_stages=1)
        del buf3
        del primals_5
        buf5 = empty_strided_cuda((4, 16, 5, 5), (400, 25, 5, 1), torch.float32
            )
        triton_poi_fused_avg_pool2d_3[grid(1600)](buf4, buf5, 1600, XBLOCK=
            128, num_warps=4, num_stages=1)
        buf6 = empty_strided_cuda((4, 120), (120, 1), torch.float32)
        extern_kernels.mm(reinterpret_tensor(buf5, (4, 400), (400, 1), 0),
            reinterpret_tensor(primals_6, (400, 120), (1, 400), 0), out=buf6)
        buf7 = buf6
        del buf6
        triton_poi_fused_sigmoid_4[grid(480)](buf7, primals_7, 480, XBLOCK=
            256, num_warps=4, num_stages=1)
        del primals_7
        buf8 = empty_strided_cuda((4, 84), (84, 1), torch.float32)
        extern_kernels.mm(buf7, reinterpret_tensor(primals_8, (120, 84), (1,
            120), 0), out=buf8)
        buf9 = buf8
        del buf8
        triton_poi_fused_sigmoid_5[grid(336)](buf9, primals_9, 336, XBLOCK=
            128, num_warps=4, num_stages=1)
        del primals_9
        buf10 = empty_strided_cuda((4, 7), (7, 1), torch.float32)
        extern_kernels.addmm(primals_11, buf9, reinterpret_tensor(
            primals_10, (84, 7), (1, 84), 0), alpha=1, beta=1, out=buf10)
        del primals_11
    return (buf10, buf10, primals_1, primals_3, primals_4, buf1, buf2, buf4,
        reinterpret_tensor(buf5, (4, 400), (400, 1), 0), buf7, buf9,
        primals_10, primals_8, primals_6)


class LeNetNew(nn.Module):

    def __init__(self):
        super().__init__()
        self.conv_1 = nn.Conv2d(3, 6, kernel_size=5, padding=2)
        self.sigmoid = nn.Sigmoid()
        self.avgpool = nn.AvgPool2d(kernel_size=5, stride=2)
        self.conv_2 = nn.Conv2d(6, 16, kernel_size=5, stride=2)
        self.fc_1 = nn.Linear(16 * 5 * 5, 120)
        self.fc_2 = nn.Linear(120, 84)
        self.fc_3 = nn.Linear(84, 7)

    def get_resnet_layer(self, block, n_blocks, channels, stride=1):
        layers = []
        if self.in_channels != block.expansion * channels:
            downsample = True
        else:
            downsample = False
        layers.append(block(self.in_channels, channels, stride, downsample))
        for i in range(1, n_blocks):
            layers.append(block(block.expansion * channels, channels))
        self.in_channels = block.expansion * channels
        return nn.Sequential(*layers)

    def forward(self, input_0):
        primals_1 = self.conv_1.weight
        primals_2 = self.conv_1.bias
        primals_4 = self.conv_2.weight
        primals_5 = self.conv_2.bias
        primals_6 = self.fc_1.weight
        primals_7 = self.fc_1.bias
        primals_8 = self.fc_2.weight
        primals_9 = self.fc_2.bias
        primals_10 = self.fc_3.weight
        primals_11 = self.fc_3.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])
        return output[0], output[1]
