# 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_1/inductor_cache/zm/czm6acrrgjryz6xi3wza7npycjuiqsdsygpfdo3lbzaquecrmeuj.py
# Topologically Sorted Source Nodes: [combined], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   combined => cat
# Graph fragment:
#   %cat : [num_users=4] = call_function[target=torch.ops.aten.cat.default](args = ([%primals_1, %primals_2], 1), kwargs = {})
triton_poi_fused_cat_0 = async_compile.triton('triton_poi_fused_cat_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=[32], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_0(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 32
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8
    x1 = (xindex // 8)
    x2 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + ((4*x1) + x0), tmp4 & xmask, eviction_policy='evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 8, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.load(in_ptr1 + ((4*x1) + ((-4) + x0)), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp10 = tl.where(tmp4, tmp5, tmp9)
    tl.store(out_ptr0 + (x2), tmp10, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/sj/csj453dnemeic5vb74vrtqvlmefw2piyslrjpsp6rey74tg64s6n.py
# Topologically Sorted Source Nodes: [combined_d], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   combined_d => cat_1
# Graph fragment:
#   %cat_1 : [num_users=2] = call_function[target=torch.ops.aten.cat.default](args = ([%primals_1, %primals_2, %primals_4], 1), kwargs = {})
triton_poi_fused_cat_1 = async_compile.triton('triton_poi_fused_cat_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 3, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_1(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 48
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 12
    x1 = (xindex // 12)
    x2 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + ((4*x1) + x0), tmp4 & xmask, eviction_policy='evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 8, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tmp6 & tmp8
    tmp10 = tl.load(in_ptr1 + ((4*x1) + ((-4) + x0)), tmp9 & xmask, eviction_policy='evict_last', other=0.0)
    tmp11 = tmp0 >= tmp7
    tmp12 = tl.full([1], 12, tl.int64)
    tmp13 = tmp0 < tmp12
    tmp14 = tl.load(in_ptr2 + ((4*x1) + ((-8) + x0)), tmp11 & xmask, eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp9, tmp10, tmp14)
    tmp16 = tl.where(tmp4, tmp5, tmp15)
    tl.store(out_ptr0 + (x2), tmp16, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/pl/cplxcy4v3r3yzudhscspkmuhekmbu2kwkkzsygtsspg7gczcply3.py
# Topologically Sorted Source Nodes: [sigmoid, d_1], Original ATen: [aten.sigmoid, aten.mul]
# Source node to ATen node mapping:
#   d_1 => mul
#   sigmoid => sigmoid
# Graph fragment:
#   %sigmoid : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%addmm,), kwargs = {})
#   %mul : [num_users=17] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sigmoid, 0.5), kwargs = {})
triton_poi_fused_mul_sigmoid_2 = async_compile.triton('triton_poi_fused_mul_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=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_sigmoid_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_mul_sigmoid_2(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (x0), xmask)
    tmp1 = tl.sigmoid(tmp0)
    tmp2 = 0.5
    tmp3 = tmp1 * tmp2
    tl.store(out_ptr0 + (x0), tmp3, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/x3/cx3ff36v47jn6xvrvhx7eiqdhzooeqmu2h3ri2fie6qealrxvc7b.py
# Topologically Sorted Source Nodes: [cat_2], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_2 => cat_2
# Graph fragment:
#   %cat_2 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_3, %div_2, %div_1, %div],), kwargs = {})
triton_poi_fused_cat_3 = async_compile.triton('triton_poi_fused_cat_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_3(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (0))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/zw/czwjo4n3regclck5sw2ycaeewamejyah5ku762ydt7yzjzqlwter.py
# Topologically Sorted Source Nodes: [cat_3], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_3 => cat_3
# Graph fragment:
#   %cat_3 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_7, %div_6, %div_5, %div_4],), kwargs = {})
triton_poi_fused_cat_4 = async_compile.triton('triton_poi_fused_cat_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_4(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (1))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/gc/cgcyhpnu5i5iygf4oii3mhbcxbndqtsqekrh363bhkyzj55gac7d.py
# Topologically Sorted Source Nodes: [cat_4], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_4 => cat_4
# Graph fragment:
#   %cat_4 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_11, %div_10, %div_9, %div_8],), kwargs = {})
triton_poi_fused_cat_5 = async_compile.triton('triton_poi_fused_cat_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_5(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (2))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/da/cdapqxu2aqfresxzqcyu66loof63ywm273aq4yvqggwoblyle4iu.py
# Topologically Sorted Source Nodes: [cat_5], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_5 => cat_5
# Graph fragment:
#   %cat_5 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_15, %div_14, %div_13, %div_12],), kwargs = {})
triton_poi_fused_cat_6 = async_compile.triton('triton_poi_fused_cat_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_6', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_6(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (3))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/je/cjefzhvmdbzaq5qkk56lvlmhm7tmym4q6qosigotepnpng6xkbsc.py
# Topologically Sorted Source Nodes: [cat_6], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_6 => cat_6
# Graph fragment:
#   %cat_6 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_19, %div_18, %div_17, %div_16],), kwargs = {})
triton_poi_fused_cat_7 = async_compile.triton('triton_poi_fused_cat_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_7', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_7(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (4))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/dd/cddfcic2f2wcza72uhbohrlu2vdlnhafwjne565bmopvtg7xzprk.py
# Topologically Sorted Source Nodes: [setitem_4], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   setitem_4 => copy_4
# Graph fragment:
#   %copy_4 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_47, %cat_6), kwargs = {})
#   %select_scatter_default_8 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_4, %copy_4, 1, 0), kwargs = {})
triton_poi_fused_copy_8 = async_compile.triton('triton_poi_fused_copy_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=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_copy_8', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_copy_8(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = (xindex // 4)
    x2 = xindex
    tmp3 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr3 + (x1), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last')
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = tl.full([1], 1, tl.int32)
    tmp5 = tmp4 == tmp1
    tmp6 = tl.full([1], 3, tl.int32)
    tmp7 = tmp0 == tmp6
    tmp9 = tmp1 == tmp1
    tmp10 = tl.full([1], 2, tl.int32)
    tmp11 = tmp0 == tmp10
    tmp13 = tmp0 == tmp4
    tmp16 = 1.0
    tmp17 = tl.where(tmp2, tmp15, tmp16)
    tmp18 = tl.where(tmp9, tmp17, tmp16)
    tmp19 = tl.where(tmp13, tmp14, tmp18)
    tmp20 = tl.where(tmp9, tmp19, tmp18)
    tmp21 = tl.where(tmp11, tmp12, tmp20)
    tmp22 = tl.where(tmp9, tmp21, tmp20)
    tmp23 = tl.where(tmp7, tmp8, tmp22)
    tmp24 = tl.where(tmp5, tmp17, tmp16)
    tmp25 = tl.where(tmp5, tmp19, tmp24)
    tmp26 = tl.where(tmp5, tmp21, tmp25)
    tmp27 = tl.where(tmp5, tmp23, tmp26)
    tmp28 = tl.where(tmp2, tmp3, tmp27)
    tl.store(out_ptr0 + (x2), tmp28, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/7w/c7wuknjn76zz4hh3arcrqleadlzjigfqcr2734ihvdunvc762ws6.py
# Topologically Sorted Source Nodes: [w, setitem, setitem_1, setitem_2, setitem_3, setitem_4], Original ATen: [aten.ones, aten.copy]
# Source node to ATen node mapping:
#   setitem => copy
#   setitem_1 => copy_1
#   setitem_2 => copy_2
#   setitem_3 => copy_3
#   setitem_4 => copy_4
#   w => full_default
# Graph fragment:
#   %full_default : [num_users=3] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4], 1), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_3, %cat_2), kwargs = {})
#   %select_scatter_default : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int, %copy, 1, 0), kwargs = {})
#   %select_scatter_default_1 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%full_default, %select_scatter_default, 1, 0), kwargs = {})
#   %copy_1 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_14, %cat_3), kwargs = {})
#   %select_scatter_default_2 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_1, %copy_1, 1, 1), kwargs = {})
#   %select_scatter_default_3 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_1, %select_scatter_default_2, 1, 0), kwargs = {})
#   %copy_2 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_25, %cat_4), kwargs = {})
#   %select_scatter_default_4 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_2, %copy_2, 1, 2), kwargs = {})
#   %select_scatter_default_5 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_3, %select_scatter_default_4, 1, 0), kwargs = {})
#   %copy_3 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_36, %cat_5), kwargs = {})
#   %select_scatter_default_6 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_3, %copy_3, 1, 3), kwargs = {})
#   %select_scatter_default_7 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_5, %select_scatter_default_6, 1, 0), kwargs = {})
#   %copy_4 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_47, %cat_6), kwargs = {})
#   %select_scatter_default_8 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_4, %copy_4, 1, 0), kwargs = {})
#   %select_scatter_default_9 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_7, %select_scatter_default_8, 1, 1), kwargs = {})
triton_poi_fused_copy_ones_9 = async_compile.triton('triton_poi_fused_copy_ones_9', '''
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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_copy_ones_9', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_copy_ones_9(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 4) % 4
    x0 = xindex % 4
    x2 = (xindex // 16)
    x3 = xindex
    tmp3 = tl.load(in_ptr0 + (x0 + (4*x2)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (x2), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + (x2), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr3 + (x2), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr4 + (x2), xmask, eviction_policy='evict_last')
    tmp0 = x1
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = tl.full([1], 0, tl.int32)
    tmp5 = tmp0 == tmp4
    tmp6 = x0
    tmp7 = tl.full([1], 3, tl.int32)
    tmp8 = tmp6 == tmp7
    tmp10 = tmp4 == tmp4
    tmp11 = tl.full([1], 2, tl.int32)
    tmp12 = tmp6 == tmp11
    tmp14 = tmp6 == tmp1
    tmp16 = tmp6 == tmp4
    tmp18 = 1.0
    tmp19 = tl.where(tmp16, tmp17, tmp18)
    tmp20 = tl.where(tmp10, tmp19, tmp18)
    tmp21 = tl.where(tmp14, tmp15, tmp20)
    tmp22 = tl.where(tmp10, tmp21, tmp20)
    tmp23 = tl.where(tmp12, tmp13, tmp22)
    tmp24 = tl.where(tmp10, tmp23, tmp22)
    tmp25 = tl.where(tmp8, tmp9, tmp24)
    tmp26 = tl.where(tmp5, tmp19, tmp18)
    tmp27 = tl.where(tmp5, tmp21, tmp26)
    tmp28 = tl.where(tmp5, tmp23, tmp27)
    tmp29 = tl.where(tmp5, tmp25, tmp28)
    tmp30 = tl.where(tmp2, tmp3, tmp29)
    tl.store(out_ptr0 + (x3), tmp30, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/jz/cjzsbymqmrdnvkb2kcsdhwhdautgqjduinigo6j2h5mvuj4a2ihw.py
# Topologically Sorted Source Nodes: [cat_7], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_7 => cat_7
# Graph fragment:
#   %cat_7 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_23, %div_22, %div_21, %div_20],), kwargs = {})
triton_poi_fused_cat_10 = async_compile.triton('triton_poi_fused_cat_10', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_10', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_10(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (5))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/be/cbelfuukvpuvtcl4cdtgqviixzc46vgnr2fdatagts3q3izqyahd.py
# Topologically Sorted Source Nodes: [cat_8], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_8 => cat_8
# Graph fragment:
#   %cat_8 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_27, %div_26, %div_25, %div_24],), kwargs = {})
triton_poi_fused_cat_11 = async_compile.triton('triton_poi_fused_cat_11', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_11', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_11(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (6))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/pu/cpulmdggw6po2g7bdsp3rxqtenifly66efjndtbhjfq77vyi3cvp.py
# Topologically Sorted Source Nodes: [cat_9], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_9 => cat_9
# Graph fragment:
#   %cat_9 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_31, %div_30, %div_29, %div_28],), kwargs = {})
triton_poi_fused_cat_12 = async_compile.triton('triton_poi_fused_cat_12', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_12', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_12(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (7))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/53/c53spvltloio7aajlw2hnvsy3yonl3bxdpznosmbbmkihrolpxoy.py
# Topologically Sorted Source Nodes: [setitem_5, setitem_6, setitem_7], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   setitem_5 => copy_5
#   setitem_6 => copy_6
#   setitem_7 => copy_7
# Graph fragment:
#   %copy_5 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_58, %cat_7), kwargs = {})
#   %select_scatter_default_10 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_5, %copy_5, 1, 1), kwargs = {})
#   %select_scatter_default_11 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_9, %select_scatter_default_10, 1, 1), kwargs = {})
#   %copy_6 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_69, %cat_8), kwargs = {})
#   %select_scatter_default_12 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_6, %copy_6, 1, 2), kwargs = {})
#   %select_scatter_default_13 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_11, %select_scatter_default_12, 1, 1), kwargs = {})
#   %copy_7 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_80, %cat_9), kwargs = {})
#   %select_scatter_default_14 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_7, %copy_7, 1, 3), kwargs = {})
#   %select_scatter_default_15 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_13, %select_scatter_default_14, 1, 1), kwargs = {})
triton_poi_fused_copy_13 = async_compile.triton('triton_poi_fused_copy_13', '''
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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), '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_copy_13', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_copy_13(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 4) % 4
    x0 = xindex % 4
    x2 = (xindex // 16)
    x3 = xindex
    tmp6 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + (x2), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + (x2), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr3 + (4 + x0 + (16*x2)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr3 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x0
    tmp4 = tl.full([1], 3, tl.int32)
    tmp5 = tmp3 == tmp4
    tmp7 = tmp1 == tmp1
    tmp8 = tl.full([1], 2, tl.int32)
    tmp9 = tmp3 == tmp8
    tmp11 = tmp3 == tmp1
    tmp14 = tl.where(tmp11, tmp12, tmp13)
    tmp15 = tl.where(tmp7, tmp14, tmp13)
    tmp16 = tl.where(tmp9, tmp10, tmp15)
    tmp17 = tl.where(tmp7, tmp16, tmp15)
    tmp18 = tl.where(tmp5, tmp6, tmp17)
    tmp20 = tl.where(tmp2, tmp14, tmp19)
    tmp21 = tl.where(tmp2, tmp16, tmp20)
    tmp22 = tl.where(tmp2, tmp18, tmp21)
    tl.store(out_ptr0 + (x3), tmp22, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/r4/cr4prtz5u5vsa2qt6xr26ojxyztwrwxnujvm2tgw6msgynghg5gk.py
# Topologically Sorted Source Nodes: [cat_10], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_10 => cat_10
# Graph fragment:
#   %cat_10 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_35, %div_34, %div_33, %div_32],), kwargs = {})
triton_poi_fused_cat_14 = async_compile.triton('triton_poi_fused_cat_14', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_14', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_14(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (8))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/2o/c2oknceyhq6bpsjsj5utqfxbts5hx6wovucbg37gmxrw6qnpfaae.py
# Topologically Sorted Source Nodes: [cat_11], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_11 => cat_11
# Graph fragment:
#   %cat_11 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_39, %div_38, %div_37, %div_36],), kwargs = {})
triton_poi_fused_cat_15 = async_compile.triton('triton_poi_fused_cat_15', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_15', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_15(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (9))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/4o/c4orv6bemdyen5o37qyqzdrr5bj57qvvltz5ifj6wz4apv47w5vc.py
# Topologically Sorted Source Nodes: [cat_12], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_12 => cat_12
# Graph fragment:
#   %cat_12 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_43, %div_42, %div_41, %div_40],), kwargs = {})
triton_poi_fused_cat_16 = async_compile.triton('triton_poi_fused_cat_16', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_16', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_16(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (10))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/mw/cmwkoucjyz5eerldomke2z4eudzpt225yokz3kcwzb6m7swcxpmn.py
# Topologically Sorted Source Nodes: [setitem_8, setitem_9, setitem_10], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   setitem_10 => copy_10
#   setitem_8 => copy_8
#   setitem_9 => copy_9
# Graph fragment:
#   %copy_8 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_91, %cat_10), kwargs = {})
#   %select_scatter_default_16 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_8, %copy_8, 1, 0), kwargs = {})
#   %select_scatter_default_17 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_15, %select_scatter_default_16, 1, 2), kwargs = {})
#   %copy_9 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_102, %cat_11), kwargs = {})
#   %select_scatter_default_18 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_9, %copy_9, 1, 1), kwargs = {})
#   %select_scatter_default_19 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_17, %select_scatter_default_18, 1, 2), kwargs = {})
#   %copy_10 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_113, %cat_12), kwargs = {})
#   %select_scatter_default_20 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_10, %copy_10, 1, 2), kwargs = {})
#   %select_scatter_default_21 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_19, %select_scatter_default_20, 1, 2), kwargs = {})
triton_poi_fused_copy_17 = async_compile.triton('triton_poi_fused_copy_17', '''
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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), '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_copy_17', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_copy_17(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 4) % 4
    x0 = xindex % 4
    x2 = (xindex // 16)
    x3 = xindex
    tmp5 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (x2), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + (x2), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr3 + (8 + x0 + (16*x2)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr3 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 2, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x0
    tmp4 = tmp3 == tmp1
    tmp6 = tmp1 == tmp1
    tmp7 = tl.full([1], 1, tl.int32)
    tmp8 = tmp3 == tmp7
    tmp10 = tl.full([1], 0, tl.int32)
    tmp11 = tmp3 == tmp10
    tmp14 = tl.where(tmp11, tmp12, tmp13)
    tmp15 = tl.where(tmp6, tmp14, tmp13)
    tmp16 = tl.where(tmp8, tmp9, tmp15)
    tmp17 = tl.where(tmp6, tmp16, tmp15)
    tmp18 = tl.where(tmp4, tmp5, tmp17)
    tmp20 = tl.where(tmp2, tmp14, tmp19)
    tmp21 = tl.where(tmp2, tmp16, tmp20)
    tmp22 = tl.where(tmp2, tmp18, tmp21)
    tl.store(out_ptr0 + (x3), tmp22, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/op/copcszro27fxcknc2lgva3vgyq46oo5p6zzwpq5ftivuo2gfbcbo.py
# Topologically Sorted Source Nodes: [cat_13], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_13 => cat_13
# Graph fragment:
#   %cat_13 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_47, %div_46, %div_45, %div_44],), kwargs = {})
triton_poi_fused_cat_18 = async_compile.triton('triton_poi_fused_cat_18', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_18', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_18(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (11))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/ph/cph2pxfbmlo2gynf4xsnkbq7gsipy6q4ydcsbowhs6guoetpcqwi.py
# Topologically Sorted Source Nodes: [cat_14], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_14 => cat_14
# Graph fragment:
#   %cat_14 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_51, %div_50, %div_49, %div_48],), kwargs = {})
triton_poi_fused_cat_19 = async_compile.triton('triton_poi_fused_cat_19', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_19', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_19(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (12))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/iu/ciugm66dfephs7ra2b7itkiuedvvixo3fhfsmgvfjnwlaj4ezhfd.py
# Topologically Sorted Source Nodes: [setitem_11, setitem_12], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   setitem_11 => copy_11
#   setitem_12 => copy_12
# Graph fragment:
#   %copy_11 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_124, %cat_13), kwargs = {})
#   %select_scatter_default_22 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_11, %copy_11, 1, 3), kwargs = {})
#   %select_scatter_default_23 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_21, %select_scatter_default_22, 1, 2), kwargs = {})
#   %copy_12 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_135, %cat_14), kwargs = {})
#   %select_scatter_default_24 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_12, %copy_12, 1, 0), kwargs = {})
#   %select_scatter_default_25 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_23, %select_scatter_default_24, 1, 3), kwargs = {})
triton_poi_fused_copy_20 = async_compile.triton('triton_poi_fused_copy_20', '''
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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_copy_20', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_copy_20(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 4) % 4
    x0 = xindex % 4
    x2 = (xindex // 16)
    x3 = xindex
    tmp6 = tl.load(in_ptr0 + (x2), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + (x2), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr2 + (8 + x0 + (16*x2)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + (12 + x0 + (16*x2)), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr2 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x0
    tmp4 = tl.full([1], 0, tl.int32)
    tmp5 = tmp3 == tmp4
    tmp7 = tl.full([1], 2, tl.int32)
    tmp8 = tmp1 == tmp7
    tmp9 = tmp3 == tmp1
    tmp12 = tl.where(tmp9, tmp10, tmp11)
    tmp14 = tl.where(tmp8, tmp12, tmp13)
    tmp15 = tl.where(tmp5, tmp6, tmp14)
    tmp16 = tmp0 == tmp7
    tmp18 = tl.where(tmp16, tmp12, tmp17)
    tmp19 = tl.where(tmp2, tmp15, tmp18)
    tl.store(out_ptr0 + (x3), tmp19, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/gk/cgkfgyewxaywdupi2jym4dv562rl4w2ds6ourjtbtsrjx3xvo2cf.py
# Topologically Sorted Source Nodes: [cat_15], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_15 => cat_15
# Graph fragment:
#   %cat_15 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_55, %div_54, %div_53, %div_52],), kwargs = {})
triton_poi_fused_cat_21 = async_compile.triton('triton_poi_fused_cat_21', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_21', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_21(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (13))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/ro/crodyinmla5nmp3tisk4535242r4ffzirporcsaxd3wcvf45tw33.py
# Topologically Sorted Source Nodes: [cat_16], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_16 => cat_16
# Graph fragment:
#   %cat_16 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_59, %div_58, %div_57, %div_56],), kwargs = {})
triton_poi_fused_cat_22 = async_compile.triton('triton_poi_fused_cat_22', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_22', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_22(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (14))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/g4/cg4xvehzfsiw7cmpfzlbdsffs7odrfkjlh3bghg6xb42c35xaplx.py
# Topologically Sorted Source Nodes: [cat_17], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   cat_17 => cat_17
# Graph fragment:
#   %cat_17 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%div_63, %div_62, %div_61, %div_60],), kwargs = {})
triton_poi_fused_cat_23 = async_compile.triton('triton_poi_fused_cat_23', '''
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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_cat_23', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_23(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + (15))
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tmp41 = tl.full([1], 4, tl.int64)
    tmp42 = tmp0 < tmp41
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + (x0), tmp47, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/zz/czzys25sfcimsksfj5prn5er4qkt6wdpz2gs7cygb26f5ckeikvy.py
# Topologically Sorted Source Nodes: [setitem_13, setitem_14, setitem_15, mul_65, outputs, first, i_gate_1, o_gate_1, c_tilde_1, second, cell, tanh_1, hidden], Original ATen: [aten.copy, aten.mul, aten.sum, aten.neg, aten.sigmoid, aten.tanh, aten.add]
# Source node to ATen node mapping:
#   c_tilde_1 => tanh
#   cell => add
#   first => neg
#   hidden => mul_67
#   i_gate_1 => sigmoid_1
#   mul_65 => mul_65
#   o_gate_1 => sigmoid_2
#   outputs => sum_1
#   second => mul_66
#   setitem_13 => copy_13
#   setitem_14 => copy_14
#   setitem_15 => copy_15
#   tanh_1 => tanh_1
# Graph fragment:
#   %copy_13 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_146, %cat_15), kwargs = {})
#   %select_scatter_default_26 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_13, %copy_13, 1, 1), kwargs = {})
#   %select_scatter_default_27 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_25, %select_scatter_default_26, 1, 3), kwargs = {})
#   %copy_14 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_157, %cat_16), kwargs = {})
#   %select_scatter_default_28 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_14, %copy_14, 1, 2), kwargs = {})
#   %select_scatter_default_29 : [num_users=3] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_27, %select_scatter_default_28, 1, 3), kwargs = {})
#   %copy_15 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_168, %cat_17), kwargs = {})
#   %select_scatter_default_30 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_15, %copy_15, 1, 3), kwargs = {})
#   %select_scatter_default_31 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_29, %select_scatter_default_30, 1, 3), kwargs = {})
#   %mul_65 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %select_scatter_default_31), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_65, [0]), kwargs = {})
#   %neg : [num_users=1] = call_function[target=torch.ops.aten.neg.default](args = (%sum_1,), kwargs = {})
#   %sigmoid_1 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%addmm_1,), kwargs = {})
#   %sigmoid_2 : [num_users=1] = call_function[target=torch.ops.aten.sigmoid.default](args = (%addmm_2,), kwargs = {})
#   %tanh : [num_users=1] = call_function[target=torch.ops.aten.tanh.default](args = (%addmm_3,), kwargs = {})
#   %mul_66 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh, %sigmoid_1), kwargs = {})
#   %add : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%neg, %mul_66), kwargs = {})
#   %tanh_1 : [num_users=2] = call_function[target=torch.ops.aten.tanh.default](args = (%add,), kwargs = {})
#   %mul_67 : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%tanh_1, %sigmoid_2), kwargs = {})
triton_poi_fused_add_copy_mul_neg_sigmoid_sum_tanh_24 = async_compile.triton('triton_poi_fused_add_copy_mul_neg_sigmoid_sum_tanh_24', '''
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=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: '*fp32', 11: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_copy_mul_neg_sigmoid_sum_tanh_24', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 27, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_copy_mul_neg_sigmoid_sum_tanh_24(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, out_ptr0, out_ptr1, out_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = (xindex // 4)
    x0 = xindex % 4
    tmp0 = tl.load(in_ptr0 + (x2), xmask)
    tmp6 = tl.load(in_ptr1 + (0))
    tmp7 = tl.broadcast_to(tmp6, [XBLOCK])
    tmp11 = tl.load(in_ptr2 + (0))
    tmp12 = tl.broadcast_to(tmp11, [XBLOCK])
    tmp15 = tl.load(in_ptr3 + (0))
    tmp16 = tl.broadcast_to(tmp15, [XBLOCK])
    tmp17 = tl.load(in_ptr4 + (12 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr4 + (x2), xmask)
    tmp28 = tl.load(in_ptr0 + (16 + x2), xmask)
    tmp29 = tl.load(in_ptr1 + (1))
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr2 + (1))
    tmp32 = tl.broadcast_to(tmp31, [XBLOCK])
    tmp33 = tl.load(in_ptr3 + (1))
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp35 = tl.load(in_ptr4 + (28 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr4 + (16 + x2), xmask)
    tmp47 = tl.load(in_ptr0 + (32 + x2), xmask)
    tmp48 = tl.load(in_ptr1 + (2))
    tmp49 = tl.broadcast_to(tmp48, [XBLOCK])
    tmp50 = tl.load(in_ptr2 + (2))
    tmp51 = tl.broadcast_to(tmp50, [XBLOCK])
    tmp52 = tl.load(in_ptr3 + (2))
    tmp53 = tl.broadcast_to(tmp52, [XBLOCK])
    tmp54 = tl.load(in_ptr4 + (44 + x0), xmask, eviction_policy='evict_last')
    tmp60 = tl.load(in_ptr4 + (32 + x2), xmask)
    tmp66 = tl.load(in_ptr0 + (48 + x2), xmask)
    tmp67 = tl.load(in_ptr1 + (3))
    tmp68 = tl.broadcast_to(tmp67, [XBLOCK])
    tmp69 = tl.load(in_ptr2 + (3))
    tmp70 = tl.broadcast_to(tmp69, [XBLOCK])
    tmp71 = tl.load(in_ptr3 + (3))
    tmp72 = tl.broadcast_to(tmp71, [XBLOCK])
    tmp73 = tl.load(in_ptr4 + (60 + x0), xmask, eviction_policy='evict_last')
    tmp79 = tl.load(in_ptr4 + (48 + x2), xmask)
    tmp86 = tl.load(in_ptr5 + (x2), xmask)
    tmp88 = tl.load(in_ptr6 + (x2), xmask)
    tmp93 = tl.load(in_ptr7 + (x2), xmask)
    tmp1 = x1
    tmp2 = tl.full([1], 3, tl.int32)
    tmp3 = tmp1 == tmp2
    tmp4 = x0
    tmp5 = tmp4 == tmp2
    tmp8 = tmp2 == tmp2
    tmp9 = tl.full([1], 2, tl.int32)
    tmp10 = tmp4 == tmp9
    tmp13 = tl.full([1], 1, tl.int32)
    tmp14 = tmp4 == tmp13
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.where(tmp8, tmp18, tmp17)
    tmp20 = tl.where(tmp10, tmp12, tmp19)
    tmp21 = tl.where(tmp8, tmp20, tmp19)
    tmp22 = tl.where(tmp5, tmp7, tmp21)
    tmp24 = tl.where(tmp3, tmp18, tmp23)
    tmp25 = tl.where(tmp3, tmp20, tmp24)
    tmp26 = tl.where(tmp3, tmp22, tmp25)
    tmp27 = tmp0 * tmp26
    tmp36 = tl.where(tmp14, tmp34, tmp35)
    tmp37 = tl.where(tmp8, tmp36, tmp35)
    tmp38 = tl.where(tmp10, tmp32, tmp37)
    tmp39 = tl.where(tmp8, tmp38, tmp37)
    tmp40 = tl.where(tmp5, tmp30, tmp39)
    tmp42 = tl.where(tmp3, tmp36, tmp41)
    tmp43 = tl.where(tmp3, tmp38, tmp42)
    tmp44 = tl.where(tmp3, tmp40, tmp43)
    tmp45 = tmp28 * tmp44
    tmp46 = tmp27 + tmp45
    tmp55 = tl.where(tmp14, tmp53, tmp54)
    tmp56 = tl.where(tmp8, tmp55, tmp54)
    tmp57 = tl.where(tmp10, tmp51, tmp56)
    tmp58 = tl.where(tmp8, tmp57, tmp56)
    tmp59 = tl.where(tmp5, tmp49, tmp58)
    tmp61 = tl.where(tmp3, tmp55, tmp60)
    tmp62 = tl.where(tmp3, tmp57, tmp61)
    tmp63 = tl.where(tmp3, tmp59, tmp62)
    tmp64 = tmp47 * tmp63
    tmp65 = tmp46 + tmp64
    tmp74 = tl.where(tmp14, tmp72, tmp73)
    tmp75 = tl.where(tmp8, tmp74, tmp73)
    tmp76 = tl.where(tmp10, tmp70, tmp75)
    tmp77 = tl.where(tmp8, tmp76, tmp75)
    tmp78 = tl.where(tmp5, tmp68, tmp77)
    tmp80 = tl.where(tmp3, tmp74, tmp79)
    tmp81 = tl.where(tmp3, tmp76, tmp80)
    tmp82 = tl.where(tmp3, tmp78, tmp81)
    tmp83 = tmp66 * tmp82
    tmp84 = tmp65 + tmp83
    tmp85 = -tmp84
    tmp87 = libdevice.tanh(tmp86)
    tmp89 = tl.sigmoid(tmp88)
    tmp90 = tmp87 * tmp89
    tmp91 = tmp85 + tmp90
    tmp92 = libdevice.tanh(tmp91)
    tmp94 = tl.sigmoid(tmp93)
    tmp95 = tmp92 * tmp94
    tl.store(out_ptr0 + (x2), tmp84, xmask)
    tl.store(out_ptr1 + (x2), tmp92, xmask)
    tl.store(out_ptr2 + (x2), tmp95, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/v2/cv2zwj6nik7eujfd6xnetpcxijdmhugq6y7fuaiunfbp5qmkapib.py
# Topologically Sorted Source Nodes: [hc], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   hc => cat_18
# Graph fragment:
#   %cat_18 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%primals_3, %view_16],), kwargs = {})
triton_poi_fused_cat_25 = async_compile.triton('triton_poi_fused_cat_25', '''
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=[128], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), '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_cat_25', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', '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_cat_25(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 80
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 16)
    x0 = xindex % 16
    x2 = xindex
    tmp0 = x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + (16*x1)), tmp4 & xmask, other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 5, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.load(in_ptr1 + (x0), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp10 = -tmp9
    tmp11 = tl.load(in_ptr2 + (x0), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp12 = libdevice.tanh(tmp11)
    tmp13 = tl.load(in_ptr3 + (x0), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp14 = tl.sigmoid(tmp13)
    tmp15 = tmp12 * tmp14
    tmp16 = tmp10 + tmp15
    tmp17 = tl.full(tmp16.shape, 0.0, tmp16.dtype)
    tmp18 = tl.where(tmp6, tmp16, tmp17)
    tmp19 = tl.where(tmp4, tmp5, tmp18)
    tl.store(out_ptr0 + (x2), tmp19, 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 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4), (4, 1))
    assert_size_stride(primals_2, (4, 4), (4, 1))
    assert_size_stride(primals_3, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4, 12), (12, 1))
    assert_size_stride(primals_6, (4, ), (1, ))
    assert_size_stride(primals_7, (4, 8), (8, 1))
    assert_size_stride(primals_8, (4, ), (1, ))
    assert_size_stride(primals_9, (4, 8), (8, 1))
    assert_size_stride(primals_10, (4, ), (1, ))
    assert_size_stride(primals_11, (4, 8), (8, 1))
    assert_size_stride(primals_12, (4, ), (1, ))
    assert_size_stride(primals_13, (4, 4), (4, 1))
    assert_size_stride(primals_14, (4, ), (1, ))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 8), (8, 1), torch.float32)
        # Topologically Sorted Source Nodes: [combined], Original ATen: [aten.cat]
        stream0 = get_raw_stream(0)
        triton_poi_fused_cat_0.run(primals_1, primals_2, buf0, 32, grid=grid(32), stream=stream0)
        buf1 = empty_strided_cuda((4, 12), (12, 1), torch.float32)
        # Topologically Sorted Source Nodes: [combined_d], Original ATen: [aten.cat]
        triton_poi_fused_cat_1.run(primals_1, primals_2, primals_4, buf1, 48, grid=grid(48), stream=stream0)
        del primals_1
        del primals_2
        del primals_4
        buf2 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [d], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_6, buf1, reinterpret_tensor(primals_5, (12, 4), (1, 12), 0), alpha=1, beta=1, out=buf2)
        del primals_5
        del primals_6
        buf3 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [sigmoid, d_1], Original ATen: [aten.sigmoid, aten.mul]
        triton_poi_fused_mul_sigmoid_2.run(buf2, buf3, 16, grid=grid(16), stream=stream0)
        buf4 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [cat_2], Original ATen: [aten.cat]
        triton_poi_fused_cat_3.run(buf3, buf4, 4, grid=grid(4), stream=stream0)
        buf5 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [cat_3], Original ATen: [aten.cat]
        triton_poi_fused_cat_4.run(buf3, buf5, 4, grid=grid(4), stream=stream0)
        buf6 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [cat_4], Original ATen: [aten.cat]
        triton_poi_fused_cat_5.run(buf3, buf6, 4, grid=grid(4), stream=stream0)
        buf7 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [cat_5], Original ATen: [aten.cat]
        triton_poi_fused_cat_6.run(buf3, buf7, 4, grid=grid(4), stream=stream0)
        buf8 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [cat_6], Original ATen: [aten.cat]
        triton_poi_fused_cat_7.run(buf3, buf8, 4, grid=grid(4), stream=stream0)
        buf9 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_4], Original ATen: [aten.copy]
        triton_poi_fused_copy_8.run(buf8, buf7, buf6, buf5, buf4, buf9, 16, grid=grid(16), stream=stream0)
        del buf8
        buf10 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [w, setitem, setitem_1, setitem_2, setitem_3, setitem_4], Original ATen: [aten.ones, aten.copy]
        triton_poi_fused_copy_ones_9.run(buf9, buf7, buf6, buf5, buf4, buf10, 64, grid=grid(64), stream=stream0)
        del buf4
        buf11 = buf7; del buf7  # reuse
        # Topologically Sorted Source Nodes: [cat_7], Original ATen: [aten.cat]
        triton_poi_fused_cat_10.run(buf3, buf11, 4, grid=grid(4), stream=stream0)
        buf12 = buf6; del buf6  # reuse
        # Topologically Sorted Source Nodes: [cat_8], Original ATen: [aten.cat]
        triton_poi_fused_cat_11.run(buf3, buf12, 4, grid=grid(4), stream=stream0)
        buf13 = buf5; del buf5  # reuse
        # Topologically Sorted Source Nodes: [cat_9], Original ATen: [aten.cat]
        triton_poi_fused_cat_12.run(buf3, buf13, 4, grid=grid(4), stream=stream0)
        buf14 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_5, setitem_6, setitem_7], Original ATen: [aten.copy]
        triton_poi_fused_copy_13.run(buf13, buf12, buf11, buf10, buf14, 64, grid=grid(64), stream=stream0)
        buf15 = buf13; del buf13  # reuse
        # Topologically Sorted Source Nodes: [cat_10], Original ATen: [aten.cat]
        triton_poi_fused_cat_14.run(buf3, buf15, 4, grid=grid(4), stream=stream0)
        buf16 = buf12; del buf12  # reuse
        # Topologically Sorted Source Nodes: [cat_11], Original ATen: [aten.cat]
        triton_poi_fused_cat_15.run(buf3, buf16, 4, grid=grid(4), stream=stream0)
        buf17 = buf11; del buf11  # reuse
        # Topologically Sorted Source Nodes: [cat_12], Original ATen: [aten.cat]
        triton_poi_fused_cat_16.run(buf3, buf17, 4, grid=grid(4), stream=stream0)
        buf18 = buf10; del buf10  # reuse
        # Topologically Sorted Source Nodes: [setitem_8, setitem_9, setitem_10], Original ATen: [aten.copy]
        triton_poi_fused_copy_17.run(buf17, buf16, buf15, buf14, buf18, 64, grid=grid(64), stream=stream0)
        buf19 = buf17; del buf17  # reuse
        # Topologically Sorted Source Nodes: [cat_13], Original ATen: [aten.cat]
        triton_poi_fused_cat_18.run(buf3, buf19, 4, grid=grid(4), stream=stream0)
        buf20 = buf16; del buf16  # reuse
        # Topologically Sorted Source Nodes: [cat_14], Original ATen: [aten.cat]
        triton_poi_fused_cat_19.run(buf3, buf20, 4, grid=grid(4), stream=stream0)
        buf21 = buf14; del buf14  # reuse
        # Topologically Sorted Source Nodes: [setitem_11, setitem_12], Original ATen: [aten.copy]
        triton_poi_fused_copy_20.run(buf20, buf19, buf18, buf21, 64, grid=grid(64), stream=stream0)
        del buf18
        buf22 = buf20; del buf20  # reuse
        # Topologically Sorted Source Nodes: [cat_15], Original ATen: [aten.cat]
        triton_poi_fused_cat_21.run(buf3, buf22, 4, grid=grid(4), stream=stream0)
        buf23 = buf19; del buf19  # reuse
        # Topologically Sorted Source Nodes: [cat_16], Original ATen: [aten.cat]
        triton_poi_fused_cat_22.run(buf3, buf23, 4, grid=grid(4), stream=stream0)
        buf24 = buf15; del buf15  # reuse
        # Topologically Sorted Source Nodes: [cat_17], Original ATen: [aten.cat]
        triton_poi_fused_cat_23.run(buf3, buf24, 4, grid=grid(4), stream=stream0)
        buf26 = buf9; del buf9  # reuse
        # Topologically Sorted Source Nodes: [i_gate], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_8, buf0, reinterpret_tensor(primals_7, (8, 4), (1, 8), 0), alpha=1, beta=1, out=buf26)
        del primals_7
        del primals_8
        buf27 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [o_gate], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_10, buf0, reinterpret_tensor(primals_9, (8, 4), (1, 8), 0), alpha=1, beta=1, out=buf27)
        del primals_10
        del primals_9
        buf28 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [c_tilde], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_12, buf0, reinterpret_tensor(primals_11, (8, 4), (1, 8), 0), alpha=1, beta=1, out=buf28)
        del primals_11
        del primals_12
        buf25 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf30 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf31 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_13, setitem_14, setitem_15, mul_65, outputs, first, i_gate_1, o_gate_1, c_tilde_1, second, cell, tanh_1, hidden], Original ATen: [aten.copy, aten.mul, aten.sum, aten.neg, aten.sigmoid, aten.tanh, aten.add]
        triton_poi_fused_add_copy_mul_neg_sigmoid_sum_tanh_24.run(primals_3, buf24, buf23, buf22, buf21, buf28, buf26, buf27, buf25, buf30, buf31, 16, grid=grid(16), stream=stream0)
        del buf21
        del buf22
        del buf23
        del buf24
        buf29 = empty_strided_cuda((5, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [hc], Original ATen: [aten.cat]
        triton_poi_fused_cat_25.run(primals_3, buf25, buf28, buf26, buf29, 80, grid=grid(80), stream=stream0)
        buf32 = buf25; del buf25  # reuse
        # Topologically Sorted Source Nodes: [output], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_14, buf31, reinterpret_tensor(primals_13, (4, 4), (1, 4), 0), alpha=1, beta=1, out=buf32)
        del primals_14
    return (buf32, buf31, reinterpret_tensor(buf29, (4, 4, 4), (16, 4, 1), 16), buf3, primals_3, buf0, buf1, buf2, reinterpret_tensor(buf3, (1, ), (1, ), 0), reinterpret_tensor(buf3, (1, ), (1, ), 1), reinterpret_tensor(buf3, (1, ), (1, ), 2), reinterpret_tensor(buf3, (1, ), (1, ), 3), reinterpret_tensor(buf3, (1, ), (1, ), 4), reinterpret_tensor(buf3, (1, ), (1, ), 5), reinterpret_tensor(buf3, (1, ), (1, ), 6), reinterpret_tensor(buf3, (1, ), (1, ), 7), reinterpret_tensor(buf3, (1, ), (1, ), 8), reinterpret_tensor(buf3, (1, ), (1, ), 9), reinterpret_tensor(buf3, (1, ), (1, ), 10), reinterpret_tensor(buf3, (1, ), (1, ), 11), reinterpret_tensor(buf3, (1, ), (1, ), 12), reinterpret_tensor(buf3, (1, ), (1, ), 13), reinterpret_tensor(buf3, (1, ), (1, ), 14), reinterpret_tensor(buf3, (1, ), (1, ), 15), buf26, buf27, buf28, buf30, buf31, primals_13, )


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((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((4, 12), (12, 1), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((4, 8), (8, 1), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((4, 8), (8, 1), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((4, 8), (8, 1), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((4, ), (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])
    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
from torch.autograd import Variable


class MLSTM_cell(nn.Module):

    def __init__(self, input_size, hidden_size, K, output_size):
        super(MLSTM_cell, self).__init__()
        self.hidden_size = hidden_size
        self.K = K
        self.output_size = output_size
        self.cgate = nn.Linear(input_size + hidden_size, hidden_size)
        self.igate = nn.Linear(input_size + hidden_size, hidden_size)
        self.fgate = nn.Linear(input_size + 2 * hidden_size, hidden_size)
        self.ogate = nn.Linear(input_size + hidden_size, hidden_size)
        self.output = nn.Linear(hidden_size, output_size)
        self.sigmoid = nn.Sigmoid()
        self.tanh = nn.Tanh()

    def get_ws(self, d):
        w = [1.0] * (self.K + 1)
        for i in range(0, self.K):
            w[self.K - i - 1] = w[self.K - i] * (i - d) / (i + 1)
        return torch.cat(w[0:self.K])

    def filter_d(self, celltensor, d):
        w = torch.ones(self.K, d.size(0), d.size(1), dtype=d.dtype, device=
            d.device)
        hidden_size = w.shape[2]
        batch_size = w.shape[1]
        for batch in range(batch_size):
            for hidden in range(hidden_size):
                w[:, batch, hidden] = self.get_ws(d[batch, hidden].view([1]))
        outputs = celltensor.mul(w).sum(dim=0)
        return outputs

    def forward(self, sample, hidden, celltensor, d_0):
        batch_size = sample.size(0)
        if hidden is None:
            hidden = torch.zeros(batch_size, self.hidden_size, dtype=sample
                .dtype, device=sample.device)
        if celltensor is None:
            celltensor = torch.zeros(self.K, batch_size, self.hidden_size,
                dtype=sample.dtype, device=sample.device)
        if d_0 is None:
            d_0 = torch.zeros(batch_size, self.hidden_size, dtype=sample.
                dtype, device=sample.device)
        combined = torch.cat((sample, hidden), 1)
        combined_d = torch.cat((sample, hidden, d_0), 1)
        d = self.fgate(combined_d)
        d = self.sigmoid(d) * 0.5
        first = -self.filter_d(celltensor, d)
        i_gate = self.igate(combined)
        o_gate = self.ogate(combined)
        i_gate = self.sigmoid(i_gate)
        o_gate = self.sigmoid(o_gate)
        c_tilde = self.cgate(combined)
        c_tilde = self.tanh(c_tilde)
        second = torch.mul(c_tilde, i_gate)
        cell = torch.add(first, second)
        hc = torch.cat([celltensor, cell.view([-1, cell.size(0), cell.size(
            1)])], 0)
        hc1 = hc[1:, :]
        hidden = torch.mul(self.tanh(cell), o_gate)
        output = self.output(hidden)
        return output, hidden, hc1, d

    def init_hidden(self):
        return Variable(torch.zeros(1, self.hidden_size))

    def init_cell(self):
        return Variable(torch.zeros(1, self.hidden_size))


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


def get_init_inputs():
    return [[], {'input_size': 4, 'hidden_size': 4, 'K': 4, 'output_size': 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.triton_helpers import libdevice
import torch.nn as nn
from torch.autograd import Variable
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_cat_0(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 32
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8
    x1 = xindex // 8
    x2 = xindex
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (4 * x1 + x0), tmp4 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tl.full([1], 8, tl.int64)
    tmp9 = tl.load(in_ptr1 + (4 * x1 + (-4 + x0)), tmp6 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp10 = tl.where(tmp4, tmp5, tmp9)
    tl.store(out_ptr0 + x2, tmp10, xmask)


@triton.jit
def triton_poi_fused_cat_1(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 48
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 12
    x1 = xindex // 12
    x2 = xindex
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (4 * x1 + x0), tmp4 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp6 = tmp0 >= tmp3
    tmp7 = tl.full([1], 8, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tmp6 & tmp8
    tmp10 = tl.load(in_ptr1 + (4 * x1 + (-4 + x0)), tmp9 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp11 = tmp0 >= tmp7
    tl.full([1], 12, tl.int64)
    tmp14 = tl.load(in_ptr2 + (4 * x1 + (-8 + x0)), tmp11 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp9, tmp10, tmp14)
    tmp16 = tl.where(tmp4, tmp5, tmp15)
    tl.store(out_ptr0 + x2, tmp16, xmask)


@triton.jit
def triton_poi_fused_mul_sigmoid_2(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = tl.sigmoid(tmp0)
    tmp2 = 0.5
    tmp3 = tmp1 * tmp2
    tl.store(out_ptr0 + x0, tmp3, xmask)


@triton.jit
def triton_poi_fused_cat_3(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 0)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_4(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 1)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_5(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 2)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_6(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_7(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 4)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_copy_8(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4
    x2 = xindex
    tmp3 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = tl.full([1], 1, tl.int32)
    tmp5 = tmp4 == tmp1
    tmp6 = tl.full([1], 3, tl.int32)
    tmp7 = tmp0 == tmp6
    tmp9 = tmp1 == tmp1
    tmp10 = tl.full([1], 2, tl.int32)
    tmp11 = tmp0 == tmp10
    tmp13 = tmp0 == tmp4
    tmp16 = 1.0
    tmp17 = tl.where(tmp2, tmp15, tmp16)
    tmp18 = tl.where(tmp9, tmp17, tmp16)
    tmp19 = tl.where(tmp13, tmp14, tmp18)
    tmp20 = tl.where(tmp9, tmp19, tmp18)
    tmp21 = tl.where(tmp11, tmp12, tmp20)
    tmp22 = tl.where(tmp9, tmp21, tmp20)
    tmp23 = tl.where(tmp7, tmp8, tmp22)
    tmp24 = tl.where(tmp5, tmp17, tmp16)
    tmp25 = tl.where(tmp5, tmp19, tmp24)
    tmp26 = tl.where(tmp5, tmp21, tmp25)
    tmp27 = tl.where(tmp5, tmp23, tmp26)
    tmp28 = tl.where(tmp2, tmp3, tmp27)
    tl.store(out_ptr0 + x2, tmp28, xmask)


@triton.jit
def triton_poi_fused_copy_ones_9(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 4
    x0 = xindex % 4
    x2 = xindex // 16
    x3 = xindex
    tmp3 = tl.load(in_ptr0 + (x0 + 4 * x2), xmask, eviction_policy='evict_last'
        )
    tmp9 = tl.load(in_ptr1 + x2, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + x2, xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr3 + x2, xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr4 + x2, xmask, eviction_policy='evict_last')
    tmp0 = x1
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = tl.full([1], 0, tl.int32)
    tmp5 = tmp0 == tmp4
    tmp6 = x0
    tmp7 = tl.full([1], 3, tl.int32)
    tmp8 = tmp6 == tmp7
    tmp10 = tmp4 == tmp4
    tmp11 = tl.full([1], 2, tl.int32)
    tmp12 = tmp6 == tmp11
    tmp14 = tmp6 == tmp1
    tmp16 = tmp6 == tmp4
    tmp18 = 1.0
    tmp19 = tl.where(tmp16, tmp17, tmp18)
    tmp20 = tl.where(tmp10, tmp19, tmp18)
    tmp21 = tl.where(tmp14, tmp15, tmp20)
    tmp22 = tl.where(tmp10, tmp21, tmp20)
    tmp23 = tl.where(tmp12, tmp13, tmp22)
    tmp24 = tl.where(tmp10, tmp23, tmp22)
    tmp25 = tl.where(tmp8, tmp9, tmp24)
    tmp26 = tl.where(tmp5, tmp19, tmp18)
    tmp27 = tl.where(tmp5, tmp21, tmp26)
    tmp28 = tl.where(tmp5, tmp23, tmp27)
    tmp29 = tl.where(tmp5, tmp25, tmp28)
    tmp30 = tl.where(tmp2, tmp3, tmp29)
    tl.store(out_ptr0 + x3, tmp30, xmask)


@triton.jit
def triton_poi_fused_cat_10(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 5)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_11(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 6)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_12(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 7)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_copy_13(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 4
    x0 = xindex % 4
    x2 = xindex // 16
    x3 = xindex
    tmp6 = tl.load(in_ptr0 + x2, xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + x2, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + x2, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr3 + (4 + x0 + 16 * x2), xmask, eviction_policy=
        'evict_last')
    tmp19 = tl.load(in_ptr3 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x0
    tmp4 = tl.full([1], 3, tl.int32)
    tmp5 = tmp3 == tmp4
    tmp7 = tmp1 == tmp1
    tmp8 = tl.full([1], 2, tl.int32)
    tmp9 = tmp3 == tmp8
    tmp11 = tmp3 == tmp1
    tmp14 = tl.where(tmp11, tmp12, tmp13)
    tmp15 = tl.where(tmp7, tmp14, tmp13)
    tmp16 = tl.where(tmp9, tmp10, tmp15)
    tmp17 = tl.where(tmp7, tmp16, tmp15)
    tmp18 = tl.where(tmp5, tmp6, tmp17)
    tmp20 = tl.where(tmp2, tmp14, tmp19)
    tmp21 = tl.where(tmp2, tmp16, tmp20)
    tmp22 = tl.where(tmp2, tmp18, tmp21)
    tl.store(out_ptr0 + x3, tmp22, xmask)


@triton.jit
def triton_poi_fused_cat_14(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 8)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_15(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 9)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_16(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 10)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_copy_17(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 4
    x0 = xindex % 4
    x2 = xindex // 16
    x3 = xindex
    tmp5 = tl.load(in_ptr0 + x2, xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x2, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr2 + x2, xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr3 + (8 + x0 + 16 * x2), xmask, eviction_policy=
        'evict_last')
    tmp19 = tl.load(in_ptr3 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 2, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x0
    tmp4 = tmp3 == tmp1
    tmp6 = tmp1 == tmp1
    tmp7 = tl.full([1], 1, tl.int32)
    tmp8 = tmp3 == tmp7
    tmp10 = tl.full([1], 0, tl.int32)
    tmp11 = tmp3 == tmp10
    tmp14 = tl.where(tmp11, tmp12, tmp13)
    tmp15 = tl.where(tmp6, tmp14, tmp13)
    tmp16 = tl.where(tmp8, tmp9, tmp15)
    tmp17 = tl.where(tmp6, tmp16, tmp15)
    tmp18 = tl.where(tmp4, tmp5, tmp17)
    tmp20 = tl.where(tmp2, tmp14, tmp19)
    tmp21 = tl.where(tmp2, tmp16, tmp20)
    tmp22 = tl.where(tmp2, tmp18, tmp21)
    tl.store(out_ptr0 + x3, tmp22, xmask)


@triton.jit
def triton_poi_fused_cat_18(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 11)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_19(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 12)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_copy_20(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 4
    x0 = xindex % 4
    x2 = xindex // 16
    x3 = xindex
    tmp6 = tl.load(in_ptr0 + x2, xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr1 + x2, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr2 + (8 + x0 + 16 * x2), xmask, eviction_policy=
        'evict_last')
    tmp13 = tl.load(in_ptr2 + (12 + x0 + 16 * x2), xmask, eviction_policy=
        'evict_last')
    tmp17 = tl.load(in_ptr2 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x0
    tmp4 = tl.full([1], 0, tl.int32)
    tmp5 = tmp3 == tmp4
    tmp7 = tl.full([1], 2, tl.int32)
    tmp8 = tmp1 == tmp7
    tmp9 = tmp3 == tmp1
    tmp12 = tl.where(tmp9, tmp10, tmp11)
    tmp14 = tl.where(tmp8, tmp12, tmp13)
    tmp15 = tl.where(tmp5, tmp6, tmp14)
    tmp16 = tmp0 == tmp7
    tmp18 = tl.where(tmp16, tmp12, tmp17)
    tmp19 = tl.where(tmp2, tmp15, tmp18)
    tl.store(out_ptr0 + x3, tmp19, xmask)


@triton.jit
def triton_poi_fused_cat_21(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 13)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_22(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 14)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_cat_23(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp5 = tl.load(in_ptr0 + 15)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK])
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp7 = 0.0
    tmp8 = tmp7 - tmp6
    tmp9 = 1.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp9
    tmp12 = tmp9 - tmp6
    tmp13 = tmp11 * tmp12
    tmp14 = 0.5
    tmp15 = tmp13 * tmp14
    tmp16 = 2.0
    tmp17 = tmp16 - tmp6
    tmp18 = tmp15 * tmp17
    tmp19 = 0.3333333333333333
    tmp20 = tmp18 * tmp19
    tmp21 = 3.0
    tmp22 = tmp21 - tmp6
    tmp23 = tmp20 * tmp22
    tmp24 = 0.25
    tmp25 = tmp23 * tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp4, tmp25, tmp26)
    tmp28 = tmp0 >= tmp3
    tmp29 = tl.full([1], 2, tl.int64)
    tmp30 = tmp0 < tmp29
    tmp31 = tmp28 & tmp30
    tmp32 = tl.full(tmp20.shape, 0.0, tmp20.dtype)
    tmp33 = tl.where(tmp31, tmp20, tmp32)
    tmp34 = tmp0 >= tmp29
    tmp35 = tl.full([1], 3, tl.int64)
    tmp36 = tmp0 < tmp35
    tmp37 = tmp34 & tmp36
    tmp38 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp39 = tl.where(tmp37, tmp15, tmp38)
    tmp40 = tmp0 >= tmp35
    tl.full([1], 4, tl.int64)
    tmp43 = tl.full(tmp11.shape, 0.0, tmp11.dtype)
    tmp44 = tl.where(tmp40, tmp11, tmp43)
    tmp45 = tl.where(tmp37, tmp39, tmp44)
    tmp46 = tl.where(tmp31, tmp33, tmp45)
    tmp47 = tl.where(tmp4, tmp27, tmp46)
    tl.store(out_ptr0 + x0, tmp47, xmask)


@triton.jit
def triton_poi_fused_add_copy_mul_neg_sigmoid_sum_tanh_24(in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, out_ptr0,
    out_ptr1, out_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    x0 = xindex % 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp6 = tl.load(in_ptr1 + 0)
    tmp7 = tl.broadcast_to(tmp6, [XBLOCK])
    tmp11 = tl.load(in_ptr2 + 0)
    tmp12 = tl.broadcast_to(tmp11, [XBLOCK])
    tmp15 = tl.load(in_ptr3 + 0)
    tmp16 = tl.broadcast_to(tmp15, [XBLOCK])
    tmp17 = tl.load(in_ptr4 + (12 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr4 + x2, xmask)
    tmp28 = tl.load(in_ptr0 + (16 + x2), xmask)
    tmp29 = tl.load(in_ptr1 + 1)
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr2 + 1)
    tmp32 = tl.broadcast_to(tmp31, [XBLOCK])
    tmp33 = tl.load(in_ptr3 + 1)
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp35 = tl.load(in_ptr4 + (28 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr4 + (16 + x2), xmask)
    tmp47 = tl.load(in_ptr0 + (32 + x2), xmask)
    tmp48 = tl.load(in_ptr1 + 2)
    tmp49 = tl.broadcast_to(tmp48, [XBLOCK])
    tmp50 = tl.load(in_ptr2 + 2)
    tmp51 = tl.broadcast_to(tmp50, [XBLOCK])
    tmp52 = tl.load(in_ptr3 + 2)
    tmp53 = tl.broadcast_to(tmp52, [XBLOCK])
    tmp54 = tl.load(in_ptr4 + (44 + x0), xmask, eviction_policy='evict_last')
    tmp60 = tl.load(in_ptr4 + (32 + x2), xmask)
    tmp66 = tl.load(in_ptr0 + (48 + x2), xmask)
    tmp67 = tl.load(in_ptr1 + 3)
    tmp68 = tl.broadcast_to(tmp67, [XBLOCK])
    tmp69 = tl.load(in_ptr2 + 3)
    tmp70 = tl.broadcast_to(tmp69, [XBLOCK])
    tmp71 = tl.load(in_ptr3 + 3)
    tmp72 = tl.broadcast_to(tmp71, [XBLOCK])
    tmp73 = tl.load(in_ptr4 + (60 + x0), xmask, eviction_policy='evict_last')
    tmp79 = tl.load(in_ptr4 + (48 + x2), xmask)
    tmp86 = tl.load(in_ptr5 + x2, xmask)
    tmp88 = tl.load(in_ptr6 + x2, xmask)
    tmp93 = tl.load(in_ptr7 + x2, xmask)
    tmp1 = x1
    tmp2 = tl.full([1], 3, tl.int32)
    tmp3 = tmp1 == tmp2
    tmp4 = x0
    tmp5 = tmp4 == tmp2
    tmp8 = tmp2 == tmp2
    tmp9 = tl.full([1], 2, tl.int32)
    tmp10 = tmp4 == tmp9
    tmp13 = tl.full([1], 1, tl.int32)
    tmp14 = tmp4 == tmp13
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.where(tmp8, tmp18, tmp17)
    tmp20 = tl.where(tmp10, tmp12, tmp19)
    tmp21 = tl.where(tmp8, tmp20, tmp19)
    tmp22 = tl.where(tmp5, tmp7, tmp21)
    tmp24 = tl.where(tmp3, tmp18, tmp23)
    tmp25 = tl.where(tmp3, tmp20, tmp24)
    tmp26 = tl.where(tmp3, tmp22, tmp25)
    tmp27 = tmp0 * tmp26
    tmp36 = tl.where(tmp14, tmp34, tmp35)
    tmp37 = tl.where(tmp8, tmp36, tmp35)
    tmp38 = tl.where(tmp10, tmp32, tmp37)
    tmp39 = tl.where(tmp8, tmp38, tmp37)
    tmp40 = tl.where(tmp5, tmp30, tmp39)
    tmp42 = tl.where(tmp3, tmp36, tmp41)
    tmp43 = tl.where(tmp3, tmp38, tmp42)
    tmp44 = tl.where(tmp3, tmp40, tmp43)
    tmp45 = tmp28 * tmp44
    tmp46 = tmp27 + tmp45
    tmp55 = tl.where(tmp14, tmp53, tmp54)
    tmp56 = tl.where(tmp8, tmp55, tmp54)
    tmp57 = tl.where(tmp10, tmp51, tmp56)
    tmp58 = tl.where(tmp8, tmp57, tmp56)
    tmp59 = tl.where(tmp5, tmp49, tmp58)
    tmp61 = tl.where(tmp3, tmp55, tmp60)
    tmp62 = tl.where(tmp3, tmp57, tmp61)
    tmp63 = tl.where(tmp3, tmp59, tmp62)
    tmp64 = tmp47 * tmp63
    tmp65 = tmp46 + tmp64
    tmp74 = tl.where(tmp14, tmp72, tmp73)
    tmp75 = tl.where(tmp8, tmp74, tmp73)
    tmp76 = tl.where(tmp10, tmp70, tmp75)
    tmp77 = tl.where(tmp8, tmp76, tmp75)
    tmp78 = tl.where(tmp5, tmp68, tmp77)
    tmp80 = tl.where(tmp3, tmp74, tmp79)
    tmp81 = tl.where(tmp3, tmp76, tmp80)
    tmp82 = tl.where(tmp3, tmp78, tmp81)
    tmp83 = tmp66 * tmp82
    tmp84 = tmp65 + tmp83
    tmp85 = -tmp84
    tmp87 = libdevice.tanh(tmp86)
    tmp89 = tl.sigmoid(tmp88)
    tmp90 = tmp87 * tmp89
    tmp91 = tmp85 + tmp90
    tmp92 = libdevice.tanh(tmp91)
    tmp94 = tl.sigmoid(tmp93)
    tmp95 = tmp92 * tmp94
    tl.store(out_ptr0 + x2, tmp84, xmask)
    tl.store(out_ptr1 + x2, tmp92, xmask)
    tl.store(out_ptr2 + x2, tmp95, xmask)


@triton.jit
def triton_poi_fused_cat_25(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 80
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 16
    x0 = xindex % 16
    x2 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 4, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 16 * x1), tmp4 & xmask, other=0.0)
    tmp6 = tmp0 >= tmp3
    tl.full([1], 5, tl.int64)
    tmp9 = tl.load(in_ptr1 + x0, tmp6 & xmask, eviction_policy='evict_last',
        other=0.0)
    tmp10 = -tmp9
    tmp11 = tl.load(in_ptr2 + x0, tmp6 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp12 = libdevice.tanh(tmp11)
    tmp13 = tl.load(in_ptr3 + x0, tmp6 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp14 = tl.sigmoid(tmp13)
    tmp15 = tmp12 * tmp14
    tmp16 = tmp10 + tmp15
    tmp17 = tl.full(tmp16.shape, 0.0, tmp16.dtype)
    tmp18 = tl.where(tmp6, tmp16, tmp17)
    tmp19 = tl.where(tmp4, tmp5, tmp18)
    tl.store(out_ptr0 + x2, tmp19, 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) = args
    args.clear()
    assert_size_stride(primals_1, (4, 4), (4, 1))
    assert_size_stride(primals_2, (4, 4), (4, 1))
    assert_size_stride(primals_3, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4, 12), (12, 1))
    assert_size_stride(primals_6, (4,), (1,))
    assert_size_stride(primals_7, (4, 8), (8, 1))
    assert_size_stride(primals_8, (4,), (1,))
    assert_size_stride(primals_9, (4, 8), (8, 1))
    assert_size_stride(primals_10, (4,), (1,))
    assert_size_stride(primals_11, (4, 8), (8, 1))
    assert_size_stride(primals_12, (4,), (1,))
    assert_size_stride(primals_13, (4, 4), (4, 1))
    assert_size_stride(primals_14, (4,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 8), (8, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_cat_0[grid(32)](primals_1, primals_2, buf0, 32,
            XBLOCK=32, num_warps=1, num_stages=1)
        buf1 = empty_strided_cuda((4, 12), (12, 1), torch.float32)
        triton_poi_fused_cat_1[grid(48)](primals_1, primals_2, primals_4,
            buf1, 48, XBLOCK=64, num_warps=1, num_stages=1)
        del primals_1
        del primals_2
        del primals_4
        buf2 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.addmm(primals_6, buf1, reinterpret_tensor(primals_5,
            (12, 4), (1, 12), 0), alpha=1, beta=1, out=buf2)
        del primals_5
        del primals_6
        buf3 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_mul_sigmoid_2[grid(16)](buf2, buf3, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        buf4 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_cat_3[grid(4)](buf3, buf4, 4, XBLOCK=4, num_warps=
            1, num_stages=1)
        buf5 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_cat_4[grid(4)](buf3, buf5, 4, XBLOCK=4, num_warps=
            1, num_stages=1)
        buf6 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_cat_5[grid(4)](buf3, buf6, 4, XBLOCK=4, num_warps=
            1, num_stages=1)
        buf7 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_cat_6[grid(4)](buf3, buf7, 4, XBLOCK=4, num_warps=
            1, num_stages=1)
        buf8 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_cat_7[grid(4)](buf3, buf8, 4, XBLOCK=4, num_warps=
            1, num_stages=1)
        buf9 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_copy_8[grid(16)](buf8, buf7, buf6, buf5, buf4,
            buf9, 16, XBLOCK=16, num_warps=1, num_stages=1)
        del buf8
        buf10 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_copy_ones_9[grid(64)](buf9, buf7, buf6, buf5, buf4,
            buf10, 64, XBLOCK=64, num_warps=1, num_stages=1)
        del buf4
        buf11 = buf7
        del buf7
        triton_poi_fused_cat_10[grid(4)](buf3, buf11, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf12 = buf6
        del buf6
        triton_poi_fused_cat_11[grid(4)](buf3, buf12, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf13 = buf5
        del buf5
        triton_poi_fused_cat_12[grid(4)](buf3, buf13, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf14 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_copy_13[grid(64)](buf13, buf12, buf11, buf10,
            buf14, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf15 = buf13
        del buf13
        triton_poi_fused_cat_14[grid(4)](buf3, buf15, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf16 = buf12
        del buf12
        triton_poi_fused_cat_15[grid(4)](buf3, buf16, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf17 = buf11
        del buf11
        triton_poi_fused_cat_16[grid(4)](buf3, buf17, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf18 = buf10
        del buf10
        triton_poi_fused_copy_17[grid(64)](buf17, buf16, buf15, buf14,
            buf18, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf19 = buf17
        del buf17
        triton_poi_fused_cat_18[grid(4)](buf3, buf19, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf20 = buf16
        del buf16
        triton_poi_fused_cat_19[grid(4)](buf3, buf20, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf21 = buf14
        del buf14
        triton_poi_fused_copy_20[grid(64)](buf20, buf19, buf18, buf21, 64,
            XBLOCK=64, num_warps=1, num_stages=1)
        del buf18
        buf22 = buf20
        del buf20
        triton_poi_fused_cat_21[grid(4)](buf3, buf22, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf23 = buf19
        del buf19
        triton_poi_fused_cat_22[grid(4)](buf3, buf23, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf24 = buf15
        del buf15
        triton_poi_fused_cat_23[grid(4)](buf3, buf24, 4, XBLOCK=4,
            num_warps=1, num_stages=1)
        buf26 = buf9
        del buf9
        extern_kernels.addmm(primals_8, buf0, reinterpret_tensor(primals_7,
            (8, 4), (1, 8), 0), alpha=1, beta=1, out=buf26)
        del primals_7
        del primals_8
        buf27 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.addmm(primals_10, buf0, reinterpret_tensor(primals_9,
            (8, 4), (1, 8), 0), alpha=1, beta=1, out=buf27)
        del primals_10
        del primals_9
        buf28 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.addmm(primals_12, buf0, reinterpret_tensor(
            primals_11, (8, 4), (1, 8), 0), alpha=1, beta=1, out=buf28)
        del primals_11
        del primals_12
        buf25 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf30 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        buf31 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_add_copy_mul_neg_sigmoid_sum_tanh_24[grid(16)](
            primals_3, buf24, buf23, buf22, buf21, buf28, buf26, buf27,
            buf25, buf30, buf31, 16, XBLOCK=16, num_warps=1, num_stages=1)
        del buf21
        del buf22
        del buf23
        del buf24
        buf29 = empty_strided_cuda((5, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_cat_25[grid(80)](primals_3, buf25, buf28, buf26,
            buf29, 80, XBLOCK=128, num_warps=4, num_stages=1)
        buf32 = buf25
        del buf25
        extern_kernels.addmm(primals_14, buf31, reinterpret_tensor(
            primals_13, (4, 4), (1, 4), 0), alpha=1, beta=1, out=buf32)
        del primals_14
    return buf32, buf31, reinterpret_tensor(buf29, (4, 4, 4), (16, 4, 1), 16
        ), buf3, primals_3, buf0, buf1, buf2, reinterpret_tensor(buf3, (1,),
        (1,), 0), reinterpret_tensor(buf3, (1,), (1,), 1), reinterpret_tensor(
        buf3, (1,), (1,), 2), reinterpret_tensor(buf3, (1,), (1,), 3
        ), reinterpret_tensor(buf3, (1,), (1,), 4), reinterpret_tensor(buf3,
        (1,), (1,), 5), reinterpret_tensor(buf3, (1,), (1,), 6
        ), reinterpret_tensor(buf3, (1,), (1,), 7), reinterpret_tensor(buf3,
        (1,), (1,), 8), reinterpret_tensor(buf3, (1,), (1,), 9
        ), reinterpret_tensor(buf3, (1,), (1,), 10), reinterpret_tensor(buf3,
        (1,), (1,), 11), reinterpret_tensor(buf3, (1,), (1,), 12
        ), reinterpret_tensor(buf3, (1,), (1,), 13), reinterpret_tensor(buf3,
        (1,), (1,), 14), reinterpret_tensor(buf3, (1,), (1,), 15
        ), buf26, buf27, buf28, buf30, buf31, primals_13


class MLSTM_cellNew(nn.Module):

    def __init__(self, input_size, hidden_size, K, output_size):
        super(MLSTM_cellNew, self).__init__()
        self.hidden_size = hidden_size
        self.K = K
        self.output_size = output_size
        self.cgate = nn.Linear(input_size + hidden_size, hidden_size)
        self.igate = nn.Linear(input_size + hidden_size, hidden_size)
        self.fgate = nn.Linear(input_size + 2 * hidden_size, hidden_size)
        self.ogate = nn.Linear(input_size + hidden_size, hidden_size)
        self.output = nn.Linear(hidden_size, output_size)
        self.sigmoid = nn.Sigmoid()
        self.tanh = nn.Tanh()

    def get_ws(self, d):
        w = [1.0] * (self.K + 1)
        for i in range(0, self.K):
            w[self.K - i - 1] = w[self.K - i] * (i - d) / (i + 1)
        return torch.cat(w[0:self.K])

    def filter_d(self, celltensor, d):
        w = torch.ones(self.K, d.size(0), d.size(1), dtype=d.dtype, device=
            d.device)
        hidden_size = w.shape[2]
        batch_size = w.shape[1]
        for batch in range(batch_size):
            for hidden in range(hidden_size):
                w[:, batch, hidden] = self.get_ws(d[batch, hidden].view([1]))
        outputs = celltensor.mul(w).sum(dim=0)
        return outputs

    def init_hidden(self):
        return Variable(torch.zeros(1, self.hidden_size))

    def init_cell(self):
        return Variable(torch.zeros(1, self.hidden_size))

    def forward(self, input_0, input_1, input_2, input_3):
        primals_7 = self.cgate.weight
        primals_6 = self.cgate.bias
        primals_9 = self.igate.weight
        primals_8 = self.igate.bias
        primals_5 = self.fgate.weight
        primals_10 = self.fgate.bias
        primals_11 = self.ogate.weight
        primals_12 = self.ogate.bias
        primals_1 = self.output.weight
        primals_14 = self.output.bias
        primals_2 = input_0
        primals_4 = input_1
        primals_3 = input_2
        primals_13 = input_3
        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])
        return output[0], output[1], output[2], output[3]
