# 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_8/inductor_cache/f7/cf7t2azw77zhvntgkizfbcihtgnwbjokkhl45vf445phgvt3k2ir.py
# Topologically Sorted Source Nodes: [net_parts], Original ATen: [aten.relu, aten.threshold_backward]
# Source node to ATen node mapping:
#   net_parts => relu
# Graph fragment:
#   %relu : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%squeeze,), kwargs = {})
#   %le_4 : [num_users=1] = call_function[target=torch.ops.aten.le.Scalar](args = (%relu, 0), kwargs = {})
triton_poi_fused_relu_threshold_backward_0 = async_compile.triton('triton_poi_fused_relu_threshold_backward_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=[2048], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i1', 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_relu_threshold_backward_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_relu_threshold_backward_0(in_out_ptr0, in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2048
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_out_ptr0 + (x2), 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)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(in_out_ptr0 + (x2), tmp4, None)
    tl.store(out_ptr0 + (x2), tmp6, None)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/gu/cgu7whlyarwbca5fqwinl7cdxaano7o362etkuy3afcmlz5jsivu.py
# Topologically Sorted Source Nodes: [net_parts_1], Original ATen: [aten.relu, aten.threshold_backward]
# Source node to ATen node mapping:
#   net_parts_1 => relu_1
# Graph fragment:
#   %relu_1 : [num_users=2] = call_function[target=torch.ops.aten.relu.default](args = (%squeeze_1,), kwargs = {})
#   %le_3 : [num_users=1] = call_function[target=torch.ops.aten.le.Scalar](args = (%relu_1, 0), kwargs = {})
triton_poi_fused_relu_threshold_backward_1 = async_compile.triton('triton_poi_fused_relu_threshold_backward_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=[1024], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i1', 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_relu_threshold_backward_1', '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_relu_threshold_backward_1(in_out_ptr0, in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(in_out_ptr0 + (x2), tmp4, xmask)
    tl.store(out_ptr0 + (x2), tmp6, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/dr/cdr4b7log4koaz7kdde362prkzpgyhfispsczyf5wvnslvzlcbyo.py
# Topologically Sorted Source Nodes: [out_parts], Original ATen: [aten.convolution]
# Source node to ATen node mapping:
#   out_parts => convolution_2
# Graph fragment:
#   %convolution_2 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%unsqueeze_2, %primals_6, %primals_7, [1], [0], [1], False, [0], 1), kwargs = {})
triton_poi_fused_convolution_2 = async_compile.triton('triton_poi_fused_convolution_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=[8], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_2', '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_2(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x2), tmp2, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/f4/cf4m4ydpuf6fxehm6gbjft5kxyh62yoovzebdva2k2mdtkxs5ch4.py
# Topologically Sorted Source Nodes: [parts_softmax], Original ATen: [aten._softmax]
# Source node to ATen node mapping:
#   parts_softmax => amax, exp, sub
# Graph fragment:
#   %amax : [num_users=1] = call_function[target=torch.ops.aten.amax.default](args = (%squeeze_2, [1], True), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%squeeze_2, %amax), kwargs = {})
#   %exp : [num_users=2] = call_function[target=torch.ops.aten.exp.default](args = (%sub,), kwargs = {})
triton_poi_fused__softmax_3 = async_compile.triton('triton_poi_fused__softmax_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=[8], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__softmax_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, '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__softmax_3(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (4*x1), xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp3 = triton_helpers.maximum(tmp1, tmp2)
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp0 - tmp7
    tmp9 = tl_math.exp(tmp8)
    tl.store(out_ptr0 + (x2), tmp9, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_8/inductor_cache/fx/cfxqbqvwvdyebqblak5r3mluvfs5w4mqhhfsx2xhqonzdmwyqa45.py
# Topologically Sorted Source Nodes: [mean], Original ATen: [aten.mean]
# Source node to ATen node mapping:
#   mean => mean
# Graph fragment:
#   %mean : [num_users=1] = call_function[target=torch.ops.aten.mean.dim](args = (%squeeze_7, [1]), kwargs = {})
triton_poi_fused_mean_4 = async_compile.triton('triton_poi_fused_mean_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=[2], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mean_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 8, '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_mean_4(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (4*x0), xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr1 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr1 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr1 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp18 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp5 = tmp3 + tmp4
    tmp7 = tmp5 + tmp6
    tmp8 = tmp1 / tmp7
    tmp9 = tmp0 * tmp8
    tmp11 = tmp2 / tmp7
    tmp12 = tmp10 * tmp11
    tmp13 = tmp9 + tmp12
    tmp15 = tmp4 / tmp7
    tmp16 = tmp14 * tmp15
    tmp17 = tmp13 + tmp16
    tmp19 = tmp6 / tmp7
    tmp20 = tmp18 * tmp19
    tmp21 = tmp17 + tmp20
    tmp22 = 4.0
    tmp23 = tmp21 / tmp22
    tl.store(out_ptr0 + (x0), tmp23, 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, primals_12, primals_13, primals_14, primals_15 = args
    args.clear()
    assert_size_stride(primals_1, (512, 4, 1), (4, 1, 1))
    assert_size_stride(primals_2, (512, ), (1, ))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (256, 512, 1), (512, 1, 1))
    assert_size_stride(primals_5, (256, ), (1, ))
    assert_size_stride(primals_6, (2, 256, 1), (256, 1, 1))
    assert_size_stride(primals_7, (2, ), (1, ))
    assert_size_stride(primals_8, (512, 4, 1), (4, 1, 1))
    assert_size_stride(primals_9, (512, ), (1, ))
    assert_size_stride(primals_10, (256, 256, 1), (256, 1, 1))
    assert_size_stride(primals_11, (256, ), (1, ))
    assert_size_stride(primals_12, (256, 128, 1), (128, 1, 1))
    assert_size_stride(primals_13, (256, ), (1, ))
    assert_size_stride(primals_14, (2, 128, 1), (128, 1, 1))
    assert_size_stride(primals_15, (2, ), (1, ))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        # Topologically Sorted Source Nodes: [conv1d], Original ATen: [aten.convolution]
        buf0 = extern_kernels.convolution(reinterpret_tensor(primals_3, (1, 4, 4), (16, 4, 1), 0), primals_1, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf0, (1, 512, 4), (2048, 4, 1))
        buf1 = reinterpret_tensor(buf0, (512, 4), (4, 1), 0); del buf0  # reuse
        buf20 = empty_strided_cuda((512, 4), (4, 1), torch.bool)
        # Topologically Sorted Source Nodes: [net_parts], Original ATen: [aten.relu, aten.threshold_backward]
        stream0 = get_raw_stream(0)
        triton_poi_fused_relu_threshold_backward_0.run(buf1, primals_2, buf20, 2048, grid=grid(2048), stream=stream0)
        del primals_2
        # Topologically Sorted Source Nodes: [conv1d_1], Original ATen: [aten.convolution]
        buf2 = extern_kernels.convolution(reinterpret_tensor(buf1, (1, 512, 4), (0, 4, 1), 0), primals_4, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf2, (1, 256, 4), (1024, 4, 1))
        buf3 = reinterpret_tensor(buf2, (256, 4), (4, 1), 0); del buf2  # reuse
        buf19 = empty_strided_cuda((256, 4), (4, 1), torch.bool)
        # Topologically Sorted Source Nodes: [net_parts_1], Original ATen: [aten.relu, aten.threshold_backward]
        triton_poi_fused_relu_threshold_backward_1.run(buf3, primals_5, buf19, 1024, grid=grid(1024), stream=stream0)
        del primals_5
        # Topologically Sorted Source Nodes: [out_parts], Original ATen: [aten.convolution]
        buf4 = extern_kernels.convolution(reinterpret_tensor(buf3, (1, 256, 4), (0, 4, 1), 0), primals_6, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf4, (1, 2, 4), (8, 4, 1))
        buf5 = buf4; del buf4  # reuse
        # Topologically Sorted Source Nodes: [out_parts], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_2.run(buf5, primals_7, 8, grid=grid(8), stream=stream0)
        del primals_7
        buf6 = empty_strided_cuda((2, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [parts_softmax], Original ATen: [aten._softmax]
        triton_poi_fused__softmax_3.run(buf5, buf6, 8, grid=grid(8), stream=stream0)
        # Topologically Sorted Source Nodes: [conv1d_3], Original ATen: [aten.convolution]
        buf7 = extern_kernels.convolution(reinterpret_tensor(primals_3, (1, 4, 4), (16, 4, 1), 0), primals_8, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf7, (1, 512, 4), (2048, 4, 1))
        buf8 = reinterpret_tensor(buf7, (512, 4), (4, 1), 0); del buf7  # reuse
        buf18 = empty_strided_cuda((512, 4), (4, 1), torch.bool)
        # Topologically Sorted Source Nodes: [net_full], Original ATen: [aten.relu, aten.threshold_backward]
        triton_poi_fused_relu_threshold_backward_0.run(buf8, primals_9, buf18, 2048, grid=grid(2048), stream=stream0)
        del primals_9
        # Topologically Sorted Source Nodes: [conv1d_4], Original ATen: [aten.convolution]
        buf9 = extern_kernels.convolution(reinterpret_tensor(buf8, (1, 512, 4), (0, 4, 1), 0), primals_10, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=2, bias=None)
        assert_size_stride(buf9, (1, 256, 4), (1024, 4, 1))
        buf10 = reinterpret_tensor(buf9, (256, 4), (4, 1), 0); del buf9  # reuse
        buf17 = empty_strided_cuda((256, 4), (4, 1), torch.bool)
        # Topologically Sorted Source Nodes: [net_full_1], Original ATen: [aten.relu, aten.threshold_backward]
        triton_poi_fused_relu_threshold_backward_1.run(buf10, primals_11, buf17, 1024, grid=grid(1024), stream=stream0)
        del primals_11
        # Topologically Sorted Source Nodes: [conv1d_5], Original ATen: [aten.convolution]
        buf11 = extern_kernels.convolution(reinterpret_tensor(buf10, (1, 256, 4), (0, 4, 1), 0), primals_12, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=2, bias=None)
        assert_size_stride(buf11, (1, 256, 4), (1024, 4, 1))
        buf12 = reinterpret_tensor(buf11, (256, 4), (4, 1), 0); del buf11  # reuse
        buf16 = empty_strided_cuda((256, 4), (4, 1), torch.bool)
        # Topologically Sorted Source Nodes: [net_full_2], Original ATen: [aten.relu, aten.threshold_backward]
        triton_poi_fused_relu_threshold_backward_1.run(buf12, primals_13, buf16, 1024, grid=grid(1024), stream=stream0)
        del primals_13
        # Topologically Sorted Source Nodes: [net_full_3], Original ATen: [aten.convolution]
        buf13 = extern_kernels.convolution(reinterpret_tensor(buf12, (1, 256, 4), (0, 4, 1), 0), primals_14, stride=(1,), padding=(0,), dilation=(1,), transposed=False, output_padding=(0,), groups=2, bias=None)
        assert_size_stride(buf13, (1, 2, 4), (8, 4, 1))
        buf14 = buf13; del buf13  # reuse
        # Topologically Sorted Source Nodes: [net_full_3], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_2.run(buf14, primals_15, 8, grid=grid(8), stream=stream0)
        del primals_15
        buf15 = empty_strided_cuda((2, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [mean], Original ATen: [aten.mean]
        triton_poi_fused_mean_4.run(buf14, buf6, buf15, 2, grid=grid(2), stream=stream0)
        del buf6
    return (reinterpret_tensor(buf15, (2, 1, 1), (1, 1, 1), 0), reinterpret_tensor(buf5, (2, 4), (4, 1), 0), primals_1, primals_4, primals_6, primals_8, primals_10, primals_12, primals_14, reinterpret_tensor(primals_3, (1, 4, 4), (16, 4, 1), 0), reinterpret_tensor(buf1, (1, 512, 4), (2048, 4, 1), 0), reinterpret_tensor(buf3, (1, 256, 4), (1024, 4, 1), 0), reinterpret_tensor(buf5, (2, 4), (4, 1), 0), reinterpret_tensor(buf8, (1, 512, 4), (2048, 4, 1), 0), reinterpret_tensor(buf10, (1, 256, 4), (1024, 4, 1), 0), reinterpret_tensor(buf12, (1, 256, 4), (1024, 4, 1), 0), buf14, buf16, buf17, buf18, buf19, buf20, )


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((512, 4, 1), (4, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((512, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((256, 512, 1), (512, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((2, 256, 1), (256, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((2, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((512, 4, 1), (4, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((512, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((256, 256, 1), (256, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((256, 128, 1), (128, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((256, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((2, 128, 1), (128, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((2, ), (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])
    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
import torch.nn.functional as F


class MLP_PART(nn.Module):

    def __init__(self, filter_channels, merge_layer=0, res_layers=[], norm=
        'group', num_parts=2, last_op=None):
        super(MLP_PART, self).__init__()
        self.num_parts = num_parts
        self.fc_parts_0 = nn.Conv1d(filter_channels[0], 512, 1)
        self.fc_parts_1 = nn.Conv1d(512, 256, 1)
        self.fc_parts_out = nn.Conv1d(256, num_parts, 1)
        self.fc_parts_softmax = nn.Softmax(1)
        self.part_0 = nn.Conv1d(filter_channels[0], 256 * num_parts, 1)
        self.part_1 = nn.Conv1d(256 * num_parts, 128 * num_parts, 1, groups
            =num_parts)
        self.part_2 = nn.Conv1d(128 * num_parts, 128 * num_parts, 1, groups
            =num_parts)
        self.part_out = nn.Conv1d(128 * num_parts, num_parts, 1, groups=
            num_parts)
        self.actvn = nn.ReLU()
        self.last = last_op

    def forward(self, feature):
        """
        feature may include multiple view inputs
        args:
            feature: [B, C_in, N]
        return:
            [B, C_out, N] occupancy prediction
            [B, num_parts, N] parts prediction
        """
        net_parts = self.actvn(self.fc_parts_0(feature))
        net_parts = F.relu(self.fc_parts_1(net_parts))
        out_parts = self.fc_parts_out(net_parts)
        parts_softmax = self.fc_parts_softmax(out_parts)
        net_full = self.actvn(self.part_0(feature))
        net_full = self.actvn(self.part_1(net_full))
        net_full = self.actvn(self.part_2(net_full))
        net_full = self.part_out(net_full)
        net_full *= parts_softmax
        out_full = net_full.mean(1).view(net_full.shape[0], 1, -1)
        if self.last:
            out_full = self.last(out_full)
        return out_full, out_parts


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


def get_init_inputs():
    return [[], {'filter_channels': [4, 4]}]

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 math as tl_math
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_relu_threshold_backward_0(in_out_ptr0, in_ptr0,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_out_ptr0 + x2, 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)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(in_out_ptr0 + x2, tmp4, None)
    tl.store(out_ptr0 + x2, tmp6, None)


@triton.jit
def triton_poi_fused_relu_threshold_backward_1(in_out_ptr0, in_ptr0,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_out_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tmp5 = 0.0
    tmp6 = tmp4 <= tmp5
    tl.store(in_out_ptr0 + x2, tmp4, xmask)
    tl.store(out_ptr0 + x2, tmp6, xmask)


@triton.jit
def triton_poi_fused_convolution_2(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xnumel = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_out_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x2, tmp2, xmask)


@triton.jit
def triton_poi_fused__softmax_3(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr
    ):
    xnumel = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + 4 * x1, xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp3 = triton_helpers.maximum(tmp1, tmp2)
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp0 - tmp7
    tmp9 = tl_math.exp(tmp8)
    tl.store(out_ptr0 + x2, tmp9, xmask)


@triton.jit
def triton_poi_fused_mean_4(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 2
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr1 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr1 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr1 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp14 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp18 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp3 = tmp1 + tmp2
    tmp5 = tmp3 + tmp4
    tmp7 = tmp5 + tmp6
    tmp8 = tmp1 / tmp7
    tmp9 = tmp0 * tmp8
    tmp11 = tmp2 / tmp7
    tmp12 = tmp10 * tmp11
    tmp13 = tmp9 + tmp12
    tmp15 = tmp4 / tmp7
    tmp16 = tmp14 * tmp15
    tmp17 = tmp13 + tmp16
    tmp19 = tmp6 / tmp7
    tmp20 = tmp18 * tmp19
    tmp21 = tmp17 + tmp20
    tmp22 = 4.0
    tmp23 = tmp21 / tmp22
    tl.store(out_ptr0 + x0, tmp23, 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, primals_12,
        primals_13, primals_14, primals_15) = args
    args.clear()
    assert_size_stride(primals_1, (512, 4, 1), (4, 1, 1))
    assert_size_stride(primals_2, (512,), (1,))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (256, 512, 1), (512, 1, 1))
    assert_size_stride(primals_5, (256,), (1,))
    assert_size_stride(primals_6, (2, 256, 1), (256, 1, 1))
    assert_size_stride(primals_7, (2,), (1,))
    assert_size_stride(primals_8, (512, 4, 1), (4, 1, 1))
    assert_size_stride(primals_9, (512,), (1,))
    assert_size_stride(primals_10, (256, 256, 1), (256, 1, 1))
    assert_size_stride(primals_11, (256,), (1,))
    assert_size_stride(primals_12, (256, 128, 1), (128, 1, 1))
    assert_size_stride(primals_13, (256,), (1,))
    assert_size_stride(primals_14, (2, 128, 1), (128, 1, 1))
    assert_size_stride(primals_15, (2,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(reinterpret_tensor(primals_3, (1,
            4, 4), (16, 4, 1), 0), primals_1, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=1,
            bias=None)
        assert_size_stride(buf0, (1, 512, 4), (2048, 4, 1))
        buf1 = reinterpret_tensor(buf0, (512, 4), (4, 1), 0)
        del buf0
        buf20 = empty_strided_cuda((512, 4), (4, 1), torch.bool)
        get_raw_stream(0)
        triton_poi_fused_relu_threshold_backward_0[grid(2048)](buf1,
            primals_2, buf20, 2048, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_2
        buf2 = extern_kernels.convolution(reinterpret_tensor(buf1, (1, 512,
            4), (0, 4, 1), 0), primals_4, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=1,
            bias=None)
        assert_size_stride(buf2, (1, 256, 4), (1024, 4, 1))
        buf3 = reinterpret_tensor(buf2, (256, 4), (4, 1), 0)
        del buf2
        buf19 = empty_strided_cuda((256, 4), (4, 1), torch.bool)
        triton_poi_fused_relu_threshold_backward_1[grid(1024)](buf3,
            primals_5, buf19, 1024, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_5
        buf4 = extern_kernels.convolution(reinterpret_tensor(buf3, (1, 256,
            4), (0, 4, 1), 0), primals_6, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=1,
            bias=None)
        assert_size_stride(buf4, (1, 2, 4), (8, 4, 1))
        buf5 = buf4
        del buf4
        triton_poi_fused_convolution_2[grid(8)](buf5, primals_7, 8, XBLOCK=
            8, num_warps=1, num_stages=1)
        del primals_7
        buf6 = empty_strided_cuda((2, 4), (4, 1), torch.float32)
        triton_poi_fused__softmax_3[grid(8)](buf5, buf6, 8, XBLOCK=8,
            num_warps=1, num_stages=1)
        buf7 = extern_kernels.convolution(reinterpret_tensor(primals_3, (1,
            4, 4), (16, 4, 1), 0), primals_8, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=1,
            bias=None)
        assert_size_stride(buf7, (1, 512, 4), (2048, 4, 1))
        buf8 = reinterpret_tensor(buf7, (512, 4), (4, 1), 0)
        del buf7
        buf18 = empty_strided_cuda((512, 4), (4, 1), torch.bool)
        triton_poi_fused_relu_threshold_backward_0[grid(2048)](buf8,
            primals_9, buf18, 2048, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_9
        buf9 = extern_kernels.convolution(reinterpret_tensor(buf8, (1, 512,
            4), (0, 4, 1), 0), primals_10, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=2,
            bias=None)
        assert_size_stride(buf9, (1, 256, 4), (1024, 4, 1))
        buf10 = reinterpret_tensor(buf9, (256, 4), (4, 1), 0)
        del buf9
        buf17 = empty_strided_cuda((256, 4), (4, 1), torch.bool)
        triton_poi_fused_relu_threshold_backward_1[grid(1024)](buf10,
            primals_11, buf17, 1024, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_11
        buf11 = extern_kernels.convolution(reinterpret_tensor(buf10, (1, 
            256, 4), (0, 4, 1), 0), primals_12, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=2,
            bias=None)
        assert_size_stride(buf11, (1, 256, 4), (1024, 4, 1))
        buf12 = reinterpret_tensor(buf11, (256, 4), (4, 1), 0)
        del buf11
        buf16 = empty_strided_cuda((256, 4), (4, 1), torch.bool)
        triton_poi_fused_relu_threshold_backward_1[grid(1024)](buf12,
            primals_13, buf16, 1024, XBLOCK=128, num_warps=4, num_stages=1)
        del primals_13
        buf13 = extern_kernels.convolution(reinterpret_tensor(buf12, (1, 
            256, 4), (0, 4, 1), 0), primals_14, stride=(1,), padding=(0,),
            dilation=(1,), transposed=False, output_padding=(0,), groups=2,
            bias=None)
        assert_size_stride(buf13, (1, 2, 4), (8, 4, 1))
        buf14 = buf13
        del buf13
        triton_poi_fused_convolution_2[grid(8)](buf14, primals_15, 8,
            XBLOCK=8, num_warps=1, num_stages=1)
        del primals_15
        buf15 = empty_strided_cuda((2,), (1,), torch.float32)
        triton_poi_fused_mean_4[grid(2)](buf14, buf6, buf15, 2, XBLOCK=2,
            num_warps=1, num_stages=1)
        del buf6
    return (reinterpret_tensor(buf15, (2, 1, 1), (1, 1, 1), 0),
        reinterpret_tensor(buf5, (2, 4), (4, 1), 0), primals_1, primals_4,
        primals_6, primals_8, primals_10, primals_12, primals_14,
        reinterpret_tensor(primals_3, (1, 4, 4), (16, 4, 1), 0),
        reinterpret_tensor(buf1, (1, 512, 4), (2048, 4, 1), 0),
        reinterpret_tensor(buf3, (1, 256, 4), (1024, 4, 1), 0),
        reinterpret_tensor(buf5, (2, 4), (4, 1), 0), reinterpret_tensor(
        buf8, (1, 512, 4), (2048, 4, 1), 0), reinterpret_tensor(buf10, (1, 
        256, 4), (1024, 4, 1), 0), reinterpret_tensor(buf12, (1, 256, 4), (
        1024, 4, 1), 0), buf14, buf16, buf17, buf18, buf19, buf20)


class MLP_PARTNew(nn.Module):

    def __init__(self, filter_channels, merge_layer=0, res_layers=[], norm=
        'group', num_parts=2, last_op=None):
        super(MLP_PARTNew, self).__init__()
        self.num_parts = num_parts
        self.fc_parts_0 = nn.Conv1d(filter_channels[0], 512, 1)
        self.fc_parts_1 = nn.Conv1d(512, 256, 1)
        self.fc_parts_out = nn.Conv1d(256, num_parts, 1)
        self.fc_parts_softmax = nn.Softmax(1)
        self.part_0 = nn.Conv1d(filter_channels[0], 256 * num_parts, 1)
        self.part_1 = nn.Conv1d(256 * num_parts, 128 * num_parts, 1, groups
            =num_parts)
        self.part_2 = nn.Conv1d(128 * num_parts, 128 * num_parts, 1, groups
            =num_parts)
        self.part_out = nn.Conv1d(128 * num_parts, num_parts, 1, groups=
            num_parts)
        self.actvn = nn.ReLU()
        self.last = last_op

    def forward(self, input_0):
        primals_1 = self.fc_parts_0.weight
        primals_2 = self.fc_parts_0.bias
        primals_4 = self.fc_parts_1.weight
        primals_5 = self.fc_parts_1.bias
        primals_6 = self.fc_parts_out.weight
        primals_7 = self.fc_parts_out.bias
        primals_8 = self.part_0.weight
        primals_9 = self.part_0.bias
        primals_10 = self.part_1.weight
        primals_11 = self.part_1.bias
        primals_12 = self.part_2.weight
        primals_13 = self.part_2.bias
        primals_14 = self.part_out.weight
        primals_15 = self.part_out.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])
        return output[0], output[1]
