# AOT ID: ['0_inference']
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_6/inductor_cache/ul/cul46sk6agsata5pdplvfqwaj42gbpi26yrooch7az5rcg4qns4y.py
# Topologically Sorted Source Nodes: [setitem_2], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_2 => copy_2, full_default_3
# Graph fragment:
#   %full_default_3 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_2 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_24, %full_default_3), kwargs = {})
#   %select_scatter_default_6 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_5, %copy_2, 0, 2), kwargs = {})
#   %select_scatter_default_7 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_4, %select_scatter_default_6, 0, 2), kwargs = {})
triton_poi_fused_fill_lift_fresh_0 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 0, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_0(out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex
    tmp0 = x2
    tmp1 = tl.full([1], 2, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 0, tl.int32)
    tmp6 = tmp5 == tmp5
    tmp7 = tl.full([1], 1, tl.int32)
    tmp8 = tmp1 == tmp7
    tmp9 = tmp3 == tmp7
    tmp10 = tmp7 == tmp5
    tmp11 = tmp3 == tmp5
    tmp12 = -1.0
    tmp13 = 1.0
    tmp14 = tl.where(tmp11, tmp12, tmp13)
    tmp15 = tl.where(tmp10, tmp14, tmp13)
    tmp16 = tl.where(tmp6, tmp15, tmp13)
    tmp17 = tl.where(tmp9, tmp12, tmp16)
    tmp18 = tmp1 == tmp5
    tmp19 = tl.where(tmp18, tmp14, tmp13)
    tmp20 = tl.where(tmp6, tmp19, tmp13)
    tmp21 = tl.where(tmp8, tmp17, tmp20)
    tmp22 = tl.where(tmp6, tmp21, tmp20)
    tmp23 = tl.where(tmp4, tmp12, tmp22)
    tmp24 = tmp0 == tmp7
    tmp25 = tmp0 == tmp5
    tmp26 = tl.where(tmp25, tmp14, tmp13)
    tmp27 = tl.where(tmp6, tmp26, tmp13)
    tmp28 = tl.where(tmp24, tmp17, tmp27)
    tmp29 = tl.where(tmp6, tmp28, tmp27)
    tmp30 = tl.where(tmp2, tmp23, tmp29)
    tl.store(out_ptr0 + (x3), tmp30, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/o5/co5yomkkcs2rgxeof426z4h4rrmbchimvmduqu343izlb45nqrih.py
# Topologically Sorted Source Nodes: [setitem_3], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_3 => copy_3, full_default_4
# Graph fragment:
#   %full_default_4 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_3 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_35, %full_default_4), kwargs = {})
#   %select_scatter_default_9 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_7, %copy_3, 0, 3), kwargs = {})
#   %select_scatter_default_10 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_6, %select_scatter_default_9, 0, 3), kwargs = {})
triton_poi_fused_fill_lift_fresh_1 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp7 = tl.load(in_ptr0 + (48 + x3), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + (x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 0, tl.int32)
    tmp6 = tmp5 == tmp5
    tmp8 = tl.full([1], 1, tl.int32)
    tmp9 = tmp1 == tmp8
    tmp10 = tmp3 == tmp8
    tmp11 = tmp8 == tmp5
    tmp12 = tmp3 == tmp5
    tmp13 = -1.0
    tmp14 = 1.0
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp11, tmp15, tmp14)
    tmp17 = tl.where(tmp6, tmp16, tmp14)
    tmp18 = tl.where(tmp10, tmp13, tmp17)
    tmp19 = tmp1 == tmp5
    tmp20 = tl.where(tmp19, tmp15, tmp14)
    tmp21 = tl.where(tmp6, tmp20, tmp14)
    tmp22 = tl.where(tmp9, tmp18, tmp21)
    tmp23 = tl.where(tmp6, tmp22, tmp21)
    tmp24 = tl.where(tmp6, tmp7, tmp23)
    tmp25 = tl.where(tmp4, tmp13, tmp24)
    tmp27 = tmp0 == tmp8
    tmp28 = tmp0 == tmp5
    tmp29 = tl.where(tmp28, tmp15, tmp14)
    tmp30 = tl.where(tmp6, tmp29, tmp14)
    tmp31 = tl.where(tmp27, tmp18, tmp30)
    tmp32 = tl.where(tmp6, tmp31, tmp30)
    tmp33 = tl.where(tmp6, tmp26, tmp32)
    tmp34 = tl.where(tmp2, tmp25, tmp33)
    tl.store(out_ptr0 + (x4), tmp34, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/un/cun6jfkm6oihpheyya22qcd7wgpe5wbpo63552kvgk4l3rprsvkw.py
# Topologically Sorted Source Nodes: [setitem_4], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_4 => copy_4, full_default_5
# Graph fragment:
#   %full_default_5 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_4 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_46, %full_default_5), kwargs = {})
#   %select_scatter_default_12 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_9, %copy_4, 0, 0), kwargs = {})
#   %select_scatter_default_13 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_8, %select_scatter_default_12, 0, 0), kwargs = {})
triton_poi_fused_fill_lift_fresh_2 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_2(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp7 = tl.load(in_ptr0 + (x3), xmask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr1 + (x3), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + (x4), xmask)
    tmp27 = tl.load(in_ptr1 + (x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 1, tl.int32)
    tmp6 = tmp5 == tmp1
    tmp9 = tmp1 == tmp5
    tmp10 = tmp3 == tmp5
    tmp11 = tmp1 == tmp1
    tmp12 = -1.0
    tmp13 = 1.0
    tmp14 = tl.where(tmp4, tmp12, tmp13)
    tmp15 = tl.where(tmp6, tmp14, tmp13)
    tmp16 = tl.where(tmp11, tmp15, tmp13)
    tmp17 = tl.where(tmp10, tmp12, tmp16)
    tmp18 = tl.where(tmp11, tmp14, tmp13)
    tmp19 = tl.where(tmp11, tmp18, tmp13)
    tmp20 = tl.where(tmp9, tmp17, tmp19)
    tmp21 = tl.where(tmp6, tmp18, tmp13)
    tmp22 = tl.where(tmp6, tmp20, tmp21)
    tmp23 = tl.where(tmp6, tmp8, tmp22)
    tmp24 = tl.where(tmp6, tmp7, tmp23)
    tmp25 = tl.where(tmp4, tmp12, tmp24)
    tmp28 = tmp0 == tmp5
    tmp29 = tl.where(tmp2, tmp14, tmp13)
    tmp30 = tl.where(tmp11, tmp29, tmp13)
    tmp31 = tl.where(tmp28, tmp17, tmp30)
    tmp32 = tl.where(tmp6, tmp29, tmp13)
    tmp33 = tl.where(tmp6, tmp31, tmp32)
    tmp34 = tl.where(tmp6, tmp27, tmp33)
    tmp35 = tl.where(tmp6, tmp26, tmp34)
    tmp36 = tl.where(tmp2, tmp25, tmp35)
    tl.store(out_ptr0 + (x4), tmp36, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/7y/c7ypywjg537wswju5w3bur534dxsyi6423wwgtvwd2c5f5sm6epb.py
# Topologically Sorted Source Nodes: [setitem_5], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_5 => copy_5, full_default_6
# Graph fragment:
#   %full_default_6 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_5 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_57, %full_default_6), kwargs = {})
#   %select_scatter_default_15 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_11, %copy_5, 0, 1), kwargs = {})
#   %select_scatter_default_16 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_10, %select_scatter_default_15, 0, 1), kwargs = {})
triton_poi_fused_fill_lift_fresh_3 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 6, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_3(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
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp6 = tl.load(in_ptr0 + (16 + x3), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (16 + x3), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + (16 + x3), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + (x4), xmask)
    tmp27 = tl.load(in_ptr1 + (x4), xmask)
    tmp28 = tl.load(in_ptr2 + (x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tmp1 == tmp1
    tmp7 = tl.full([1], 0, tl.int32)
    tmp8 = tmp1 == tmp7
    tmp11 = tmp7 == tmp7
    tmp12 = tmp3 == tmp7
    tmp13 = -1.0
    tmp14 = 1.0
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp8, tmp15, tmp14)
    tmp17 = tl.where(tmp11, tmp16, tmp14)
    tmp18 = tl.where(tmp4, tmp13, tmp17)
    tmp19 = tl.where(tmp5, tmp18, tmp17)
    tmp20 = tl.where(tmp8, tmp16, tmp14)
    tmp21 = tl.where(tmp8, tmp19, tmp20)
    tmp22 = tl.where(tmp8, tmp10, tmp21)
    tmp23 = tl.where(tmp8, tmp9, tmp22)
    tmp24 = tl.where(tmp5, tmp6, tmp23)
    tmp25 = tl.where(tmp4, tmp13, tmp24)
    tmp29 = tmp0 == tmp7
    tmp30 = tl.where(tmp29, tmp15, tmp14)
    tmp31 = tl.where(tmp11, tmp30, tmp14)
    tmp32 = tl.where(tmp2, tmp18, tmp31)
    tmp33 = tl.where(tmp8, tmp30, tmp14)
    tmp34 = tl.where(tmp8, tmp32, tmp33)
    tmp35 = tl.where(tmp8, tmp28, tmp34)
    tmp36 = tl.where(tmp8, tmp27, tmp35)
    tmp37 = tl.where(tmp5, tmp26, tmp36)
    tmp38 = tl.where(tmp2, tmp25, tmp37)
    tl.store(out_ptr0 + (x4), tmp38, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/vo/cvoqdjgdsbesevfttlp2kzfiy42njlm6joc6vme4keek4dnkvbp5.py
# Topologically Sorted Source Nodes: [mask, setitem, setitem_1], Original ATen: [aten.ones_like, aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   mask => full_default
#   setitem => copy, full_default_1
#   setitem_1 => copy_1, full_default_2
# Graph fragment:
#   %full_default : [num_users=4] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 4], 1), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %full_default_1 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), 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_2, %full_default_1), kwargs = {})
#   %select_scatter_default : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_1, %copy, 0, 0), kwargs = {})
#   %select_scatter_default_1 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int, %select_scatter_default, 0, 0), kwargs = {})
#   %select_scatter_default_2 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%full_default, %select_scatter_default_1, 0, 0), kwargs = {})
#   %full_default_2 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_1 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_13, %full_default_2), kwargs = {})
#   %select_scatter_default_3 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_3, %copy_1, 0, 1), kwargs = {})
#   %select_scatter_default_4 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_2, %select_scatter_default_3, 0, 1), kwargs = {})
#   %select_scatter_default_5 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_2, %select_scatter_default_4, 0, 0), kwargs = {})
#   %select_scatter_default_8 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_5, %select_scatter_default_7, 0, 0), kwargs = {})
#   %select_scatter_default_11 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_8, %select_scatter_default_10, 0, 0), kwargs = {})
#   %select_scatter_default_14 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_11, %select_scatter_default_13, 0, 1), kwargs = {})
#   %select_scatter_default_17 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_14, %select_scatter_default_16, 0, 1), kwargs = {})
triton_poi_fused_fill_lift_fresh_ones_like_4 = async_compile.triton('triton_poi_fused_fill_lift_fresh_ones_like_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_ones_like_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_ones_like_4(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = (xindex // 64)
    x4 = xindex % 64
    x2 = (xindex // 16) % 4
    x1 = (xindex // 4) % 4
    x5 = xindex
    tmp3 = tl.load(in_ptr0 + (x4), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr1 + (x4), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr2 + (x4), xmask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr3 + (x4), xmask, eviction_policy='evict_last')
    tmp0 = x3
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp5 = tl.full([1], 0, tl.int32)
    tmp6 = tmp0 == tmp5
    tmp9 = x2
    tmp10 = tmp9 == tmp1
    tmp11 = x1
    tmp12 = tmp11 == tmp1
    tmp13 = tmp5 == tmp5
    tmp14 = tmp1 == tmp5
    tmp15 = tmp11 == tmp5
    tmp16 = -1.0
    tmp17 = 1.0
    tmp18 = tl.where(tmp15, tmp16, tmp17)
    tmp19 = tl.where(tmp14, tmp18, tmp17)
    tmp20 = tl.where(tmp13, tmp19, tmp17)
    tmp21 = tl.where(tmp12, tmp16, tmp20)
    tmp22 = tmp9 == tmp5
    tmp23 = tl.where(tmp22, tmp18, tmp17)
    tmp24 = tl.where(tmp13, tmp23, tmp17)
    tmp25 = tl.where(tmp10, tmp21, tmp24)
    tmp26 = tl.where(tmp6, tmp23, tmp17)
    tmp27 = tl.where(tmp6, tmp25, tmp26)
    tmp28 = tl.where(tmp6, tmp8, tmp27)
    tmp29 = tl.where(tmp6, tmp7, tmp28)
    tmp30 = tl.where(tmp2, tmp4, tmp29)
    tmp31 = tl.where(tmp2, tmp3, tmp30)
    tl.store(out_ptr0 + (x5), tmp31, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/cl/ccl6wlbovhv6lo73iy7pmrbir4ddxwsby7f67ojxshoiu4rrbi22.py
# Topologically Sorted Source Nodes: [setitem_8], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_8 => copy_8, full_default_9
# Graph fragment:
#   %full_default_9 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_8 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_90, %full_default_9), kwargs = {})
#   %select_scatter_default_24 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_17, %copy_8, 0, 0), kwargs = {})
#   %select_scatter_default_25 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_16, %select_scatter_default_24, 0, 0), kwargs = {})
triton_poi_fused_fill_lift_fresh_5 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 6, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_5(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp14 = tl.load(in_ptr0 + (96 + x3), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (112 + x3), xmask, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr0 + (64 + x3), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + (128 + x3), xmask, eviction_policy='evict_last')
    tmp32 = tl.load(in_ptr0 + (64 + x4), xmask)
    tmp36 = tl.load(in_ptr0 + (128 + x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 2, tl.int32)
    tmp6 = tl.full([1], 1, tl.int32)
    tmp7 = tmp5 == tmp6
    tmp8 = tl.full([1], 3, tl.int32)
    tmp9 = tmp1 == tmp8
    tmp10 = tmp3 == tmp8
    tmp11 = tmp6 == tmp6
    tmp12 = tmp8 == tmp5
    tmp13 = tmp3 == tmp5
    tmp15 = -1.0
    tmp16 = tl.where(tmp13, tmp15, tmp14)
    tmp18 = tl.where(tmp12, tmp16, tmp17)
    tmp19 = tl.where(tmp11, tmp18, tmp17)
    tmp20 = tl.where(tmp10, tmp15, tmp19)
    tmp21 = tmp1 == tmp5
    tmp23 = tl.where(tmp21, tmp16, tmp22)
    tmp24 = tl.where(tmp11, tmp23, tmp22)
    tmp25 = tl.where(tmp9, tmp20, tmp24)
    tmp27 = tl.where(tmp7, tmp23, tmp26)
    tmp28 = tl.where(tmp7, tmp25, tmp27)
    tmp29 = tl.where(tmp4, tmp15, tmp28)
    tmp30 = tmp0 == tmp8
    tmp31 = tmp0 == tmp5
    tmp33 = tl.where(tmp31, tmp16, tmp32)
    tmp34 = tl.where(tmp11, tmp33, tmp32)
    tmp35 = tl.where(tmp30, tmp20, tmp34)
    tmp37 = tl.where(tmp7, tmp33, tmp36)
    tmp38 = tl.where(tmp7, tmp35, tmp37)
    tmp39 = tl.where(tmp2, tmp29, tmp38)
    tl.store(out_ptr0 + (x4), tmp39, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/g6/cg6cd2lwpictv7xe7vbpr7ji3nbp4c73svhk6jzlqlqwyshni6ra.py
# Topologically Sorted Source Nodes: [setitem_6, setitem_7], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_6 => copy_6, full_default_7
#   setitem_7 => copy_7, full_default_8
# Graph fragment:
#   %full_default_7 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_6 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_68, %full_default_7), kwargs = {})
#   %select_scatter_default_18 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_13, %copy_6, 0, 2), kwargs = {})
#   %select_scatter_default_19 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_12, %select_scatter_default_18, 0, 2), kwargs = {})
#   %select_scatter_default_20 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_17, %select_scatter_default_19, 0, 1), kwargs = {})
#   %full_default_8 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_7 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_79, %full_default_8), kwargs = {})
#   %select_scatter_default_21 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_15, %copy_7, 0, 3), kwargs = {})
#   %select_scatter_default_22 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_14, %select_scatter_default_21, 0, 3), kwargs = {})
#   %select_scatter_default_23 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_20, %select_scatter_default_22, 0, 1), kwargs = {})
#   %select_scatter_default_26 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_23, %select_scatter_default_25, 0, 2), kwargs = {})
triton_poi_fused_fill_lift_fresh_6 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_6', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_6(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = (xindex // 64)
    x4 = xindex % 64
    x2 = (xindex // 16) % 4
    x1 = (xindex // 4) % 4
    x6 = xindex % 16
    x7 = xindex
    tmp3 = tl.load(in_ptr0 + (x4), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + (96 + x6), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (112 + x6), xmask, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr1 + (64 + x4), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr1 + (x7), xmask)
    tmp0 = x3
    tmp1 = tl.full([1], 2, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = tl.full([1], 1, tl.int32)
    tmp5 = tmp0 == tmp4
    tmp6 = x2
    tmp7 = tl.full([1], 3, tl.int32)
    tmp8 = tmp6 == tmp7
    tmp9 = x1
    tmp10 = tmp9 == tmp7
    tmp11 = tmp4 == tmp4
    tmp12 = tmp7 == tmp1
    tmp13 = tmp9 == tmp1
    tmp15 = -1.0
    tmp16 = tl.where(tmp13, tmp15, tmp14)
    tmp18 = tl.where(tmp12, tmp16, tmp17)
    tmp19 = tl.where(tmp11, tmp18, tmp17)
    tmp20 = tl.where(tmp10, tmp15, tmp19)
    tmp21 = tmp6 == tmp1
    tmp23 = tl.where(tmp21, tmp16, tmp22)
    tmp24 = tl.where(tmp11, tmp23, tmp22)
    tmp25 = tl.where(tmp8, tmp20, tmp24)
    tmp27 = tl.where(tmp5, tmp23, tmp26)
    tmp28 = tl.where(tmp5, tmp25, tmp27)
    tmp29 = tl.where(tmp2, tmp3, tmp28)
    tl.store(out_ptr0 + (x7), tmp29, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/3c/c3coocxjam5lvcqaujgmyixhlezs7tkgkncieupaji7qgfpyhzfn.py
# Topologically Sorted Source Nodes: [setitem_11], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_11 => copy_11, full_default_12
# Graph fragment:
#   %full_default_12 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_11 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_123, %full_default_12), kwargs = {})
#   %select_scatter_default_33 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_23, %copy_11, 0, 3), kwargs = {})
#   %select_scatter_default_34 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_22, %select_scatter_default_33, 0, 3), kwargs = {})
triton_poi_fused_fill_lift_fresh_7 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_7', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_7(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp12 = tl.load(in_ptr0 + (144 + x3), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr0 + (160 + x3), xmask, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr0 + (176 + x3), xmask, eviction_policy='evict_last')
    tmp28 = tl.load(in_ptr0 + (128 + x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 2, tl.int32)
    tmp6 = tmp5 == tmp5
    tmp7 = tmp1 == tmp5
    tmp8 = tmp3 == tmp5
    tmp9 = tl.full([1], 1, tl.int32)
    tmp10 = tmp5 == tmp9
    tmp11 = tmp3 == tmp9
    tmp13 = -1.0
    tmp14 = tl.where(tmp11, tmp13, tmp12)
    tmp16 = tl.where(tmp10, tmp14, tmp15)
    tmp17 = tl.where(tmp6, tmp16, tmp15)
    tmp18 = tl.where(tmp8, tmp13, tmp17)
    tmp19 = tmp1 == tmp9
    tmp21 = tl.where(tmp19, tmp14, tmp20)
    tmp22 = tl.where(tmp6, tmp21, tmp20)
    tmp23 = tl.where(tmp7, tmp18, tmp22)
    tmp24 = tl.where(tmp6, tmp23, tmp22)
    tmp25 = tl.where(tmp4, tmp13, tmp24)
    tmp26 = tmp0 == tmp5
    tmp27 = tmp0 == tmp9
    tmp29 = tl.where(tmp27, tmp14, tmp28)
    tmp30 = tl.where(tmp6, tmp29, tmp28)
    tmp31 = tl.where(tmp26, tmp18, tmp30)
    tmp32 = tl.where(tmp6, tmp31, tmp30)
    tmp33 = tl.where(tmp2, tmp25, tmp32)
    tl.store(out_ptr0 + (x4), tmp33, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/5k/c5kg5y7siwe6bnuycvfamfzclact7gqepiigsayadbaftktu22b3.py
# Topologically Sorted Source Nodes: [setitem_9, setitem_10], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_10 => copy_10, full_default_11
#   setitem_9 => copy_9, full_default_10
# Graph fragment:
#   %full_default_10 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_9 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_101, %full_default_10), kwargs = {})
#   %select_scatter_default_27 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_19, %copy_9, 0, 1), kwargs = {})
#   %select_scatter_default_28 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_18, %select_scatter_default_27, 0, 1), kwargs = {})
#   %select_scatter_default_29 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_26, %select_scatter_default_28, 0, 2), kwargs = {})
#   %full_default_11 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_10 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_112, %full_default_11), kwargs = {})
#   %select_scatter_default_30 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_21, %copy_10, 0, 2), kwargs = {})
#   %select_scatter_default_31 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_20, %select_scatter_default_30, 0, 2), kwargs = {})
#   %select_scatter_default_32 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_29, %select_scatter_default_31, 0, 2), kwargs = {})
#   %select_scatter_default_35 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_32, %select_scatter_default_34, 0, 2), kwargs = {})
triton_poi_fused_fill_lift_fresh_8 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_8', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_8(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = (xindex // 64)
    x4 = xindex % 64
    x2 = (xindex // 16) % 4
    x1 = (xindex // 4) % 4
    x6 = xindex % 16
    x7 = xindex
    tmp3 = tl.load(in_ptr0 + (x4), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr1 + (144 + x6), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (160 + x6), xmask, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr1 + (128 + x4), xmask, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr1 + (x7), xmask)
    tmp0 = x3
    tmp1 = tl.full([1], 2, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = x2
    tmp5 = tmp4 == tmp1
    tmp6 = x1
    tmp7 = tmp6 == tmp1
    tmp8 = tmp1 == tmp1
    tmp9 = tl.full([1], 1, tl.int32)
    tmp10 = tmp1 == tmp9
    tmp11 = tmp6 == tmp9
    tmp13 = -1.0
    tmp14 = tl.where(tmp11, tmp13, tmp12)
    tmp16 = tl.where(tmp10, tmp14, tmp15)
    tmp17 = tl.where(tmp8, tmp16, tmp15)
    tmp18 = tl.where(tmp7, tmp13, tmp17)
    tmp19 = tmp4 == tmp9
    tmp21 = tl.where(tmp19, tmp14, tmp20)
    tmp22 = tl.where(tmp8, tmp21, tmp20)
    tmp23 = tl.where(tmp5, tmp18, tmp22)
    tmp25 = tl.where(tmp2, tmp21, tmp24)
    tmp26 = tl.where(tmp2, tmp23, tmp25)
    tmp27 = tl.where(tmp2, tmp3, tmp26)
    tl.store(out_ptr0 + (x7), tmp27, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/d7/cd7q7w4xgz7bt2px4m3m7lgjhgjekwyzonegxewzaloezea3aedd.py
# Topologically Sorted Source Nodes: [setitem_14], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_14 => copy_14, full_default_15
# Graph fragment:
#   %full_default_15 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_14 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_156, %full_default_15), kwargs = {})
#   %select_scatter_default_42 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_29, %copy_14, 0, 2), kwargs = {})
#   %select_scatter_default_43 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_28, %select_scatter_default_42, 0, 2), kwargs = {})
triton_poi_fused_fill_lift_fresh_9 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_9', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_9(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp13 = tl.load(in_ptr0 + (192 + x3), xmask, eviction_policy='evict_last')
    tmp16 = tl.load(in_ptr0 + (208 + x3), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr0 + (224 + x3), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (192 + x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 2, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 3, tl.int32)
    tmp6 = tmp5 == tmp5
    tmp7 = tl.full([1], 1, tl.int32)
    tmp8 = tmp1 == tmp7
    tmp9 = tmp3 == tmp7
    tmp10 = tl.full([1], 0, tl.int32)
    tmp11 = tmp7 == tmp10
    tmp12 = tmp3 == tmp10
    tmp14 = -1.0
    tmp15 = tl.where(tmp12, tmp14, tmp13)
    tmp17 = tl.where(tmp11, tmp15, tmp16)
    tmp18 = tl.where(tmp6, tmp17, tmp16)
    tmp19 = tl.where(tmp9, tmp14, tmp18)
    tmp20 = tmp1 == tmp10
    tmp22 = tl.where(tmp20, tmp15, tmp21)
    tmp23 = tl.where(tmp6, tmp22, tmp21)
    tmp24 = tl.where(tmp8, tmp19, tmp23)
    tmp25 = tl.where(tmp6, tmp24, tmp23)
    tmp26 = tl.where(tmp4, tmp14, tmp25)
    tmp27 = tmp0 == tmp7
    tmp28 = tmp0 == tmp10
    tmp30 = tl.where(tmp28, tmp15, tmp29)
    tmp31 = tl.where(tmp6, tmp30, tmp29)
    tmp32 = tl.where(tmp27, tmp19, tmp31)
    tmp33 = tl.where(tmp6, tmp32, tmp31)
    tmp34 = tl.where(tmp2, tmp26, tmp33)
    tl.store(out_ptr0 + (x4), tmp34, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/cs/ccsfwyb4wxftjo6rtcp6az7e3vto53qvyyrihtpjd2tyyrglkdn2.py
# Topologically Sorted Source Nodes: [setitem_12, setitem_13], Original ATen: [aten.lift_fresh, aten.fill]
# Source node to ATen node mapping:
#   setitem_12 => copy_12, full_default_13
#   setitem_13 => copy_13, full_default_14
# Graph fragment:
#   %full_default_13 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_12 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_134, %full_default_13), kwargs = {})
#   %select_scatter_default_36 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_25, %copy_12, 0, 0), kwargs = {})
#   %select_scatter_default_37 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_24, %select_scatter_default_36, 0, 0), kwargs = {})
#   %select_scatter_default_38 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_35, %select_scatter_default_37, 0, 3), kwargs = {})
#   %full_default_14 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_13 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_145, %full_default_14), kwargs = {})
#   %select_scatter_default_39 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_27, %copy_13, 0, 1), kwargs = {})
#   %select_scatter_default_40 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_26, %select_scatter_default_39, 0, 1), kwargs = {})
#   %select_scatter_default_41 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_38, %select_scatter_default_40, 0, 3), kwargs = {})
#   %select_scatter_default_44 : [num_users=4] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_41, %select_scatter_default_43, 0, 3), kwargs = {})
triton_poi_fused_fill_lift_fresh_10 = async_compile.triton('triton_poi_fused_fill_lift_fresh_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_10', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_10(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = (xindex // 64)
    x4 = xindex % 64
    x2 = (xindex // 16) % 4
    x1 = (xindex // 4) % 4
    x6 = xindex % 16
    x7 = xindex
    tmp3 = tl.load(in_ptr0 + (x4), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (192 + x6), xmask, eviction_policy='evict_last')
    tmp16 = tl.load(in_ptr1 + (208 + x6), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (192 + x4), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (x7), xmask)
    tmp0 = x3
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp4 = x2
    tmp5 = tl.full([1], 1, tl.int32)
    tmp6 = tmp4 == tmp5
    tmp7 = x1
    tmp8 = tmp7 == tmp5
    tmp9 = tmp1 == tmp1
    tmp10 = tl.full([1], 0, tl.int32)
    tmp11 = tmp5 == tmp10
    tmp12 = tmp7 == tmp10
    tmp14 = -1.0
    tmp15 = tl.where(tmp12, tmp14, tmp13)
    tmp17 = tl.where(tmp11, tmp15, tmp16)
    tmp18 = tl.where(tmp9, tmp17, tmp16)
    tmp19 = tl.where(tmp8, tmp14, tmp18)
    tmp20 = tmp4 == tmp10
    tmp22 = tl.where(tmp20, tmp15, tmp21)
    tmp23 = tl.where(tmp9, tmp22, tmp21)
    tmp24 = tl.where(tmp6, tmp19, tmp23)
    tmp26 = tl.where(tmp2, tmp22, tmp25)
    tmp27 = tl.where(tmp2, tmp24, tmp26)
    tmp28 = tl.where(tmp2, tmp3, tmp27)
    tl.store(out_ptr0 + (x7), tmp28, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/cg/ccgyn3k3m35wjvniirc3omuaar7huvsx544rjsssb3bubtibzkfu.py
# Topologically Sorted Source Nodes: [setitem_15, nw, max_1, sum_1], Original ATen: [aten.lift_fresh, aten.fill, aten.mul, aten.max, aten.sum]
# Source node to ATen node mapping:
#   max_1 => max_1
#   nw => mul
#   setitem_15 => copy_15, full_default_16
#   sum_1 => sum_1
# Graph fragment:
#   %full_default_16 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], -1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %copy_15 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%select_167, %full_default_16), kwargs = {})
#   %select_scatter_default_45 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_31, %copy_15, 0, 3), kwargs = {})
#   %select_scatter_default_46 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_int_30, %select_scatter_default_45, 0, 3), kwargs = {})
#   %select_scatter_default_47 : [num_users=1] = call_function[target=torch.ops.aten.select_scatter.default](args = (%select_scatter_default_44, %select_scatter_default_46, 0, 3), kwargs = {})
#   %mul : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%select_scatter_default_47, %arg0_1), kwargs = {})
#   %max_1 : [num_users=1] = call_function[target=torch.ops.aten.max.dim](args = (%mul, 1), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul, [1]), kwargs = {})
triton_poi_fused_fill_lift_fresh_max_mul_sum_11 = async_compile.triton('triton_poi_fused_fill_lift_fresh_max_mul_sum_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_fill_lift_fresh_max_mul_sum_11', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 12, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_fill_lift_fresh_max_mul_sum_11(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = (xindex // 16)
    x1 = (xindex // 4) % 4
    x3 = xindex % 16
    x4 = xindex
    tmp7 = tl.load(in_ptr0 + (240 + x3), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr0 + (192 + x3), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr0 + (x3 + (64*x2)), xmask)
    tmp14 = tl.load(in_ptr1 + (x3 + (64*x2)), xmask)
    tmp18 = tl.load(in_ptr0 + (208 + x3), xmask, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr0 + (16 + x3 + (64*x2)), xmask)
    tmp22 = tl.load(in_ptr1 + (16 + x3 + (64*x2)), xmask)
    tmp27 = tl.load(in_ptr0 + (224 + x3), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (32 + x3 + (64*x2)), xmask)
    tmp31 = tl.load(in_ptr1 + (32 + x3 + (64*x2)), xmask)
    tmp36 = tl.load(in_ptr0 + (48 + x3 + (64*x2)), xmask)
    tmp38 = tl.load(in_ptr1 + (48 + x3 + (64*x2)), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = tmp3 == tmp1
    tmp5 = x1
    tmp6 = tmp5 == tmp1
    tmp8 = -1.0
    tmp9 = tl.where(tmp6, tmp8, tmp7)
    tmp11 = tl.where(tmp4, tmp9, tmp10)
    tmp13 = tl.where(tmp2, tmp11, tmp12)
    tmp15 = tmp13 * tmp14
    tmp16 = tl.full([1], 1, tl.int32)
    tmp17 = tmp16 == tmp1
    tmp19 = tl.where(tmp17, tmp9, tmp18)
    tmp21 = tl.where(tmp2, tmp19, tmp20)
    tmp23 = tmp21 * tmp22
    tmp24 = triton_helpers.maximum(tmp15, tmp23)
    tmp25 = tl.full([1], 2, tl.int32)
    tmp26 = tmp25 == tmp1
    tmp28 = tl.where(tmp26, tmp9, tmp27)
    tmp30 = tl.where(tmp2, tmp28, tmp29)
    tmp32 = tmp30 * tmp31
    tmp33 = triton_helpers.maximum(tmp24, tmp32)
    tmp34 = tmp1 == tmp1
    tmp35 = tl.where(tmp34, tmp9, tmp7)
    tmp37 = tl.where(tmp2, tmp35, tmp36)
    tmp39 = tmp37 * tmp38
    tmp40 = triton_helpers.maximum(tmp33, tmp39)
    tmp41 = tmp15 + tmp23
    tmp42 = tmp41 + tmp32
    tmp43 = tmp42 + tmp39
    tl.store(out_ptr0 + (x4), tmp40, xmask)
    tl.store(out_ptr1 + (x4), tmp43, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/o6/co6tytd2ppuu4uaopq5duefn5z2l2da67l3t6goia5yvqiuj7gqi.py
# Topologically Sorted Source Nodes: [max_2, sum_2, mul_1, tmp_all, loss], Original ATen: [aten.max, aten.sum, aten.mul, aten.add, aten.mean]
# Source node to ATen node mapping:
#   loss => mean
#   max_2 => max_2
#   mul_1 => mul_1
#   sum_2 => sum_2
#   tmp_all => add
# Graph fragment:
#   %max_2 : [num_users=1] = call_function[target=torch.ops.aten.max.dim](args = (%getitem, 1), kwargs = {})
#   %sum_2 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%sum_1, [1]), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_2, 6e-07), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_2, %mul_1), kwargs = {})
#   %mean : [num_users=1] = call_function[target=torch.ops.aten.mean.default](args = (%add,), kwargs = {})
triton_per_fused_add_max_mean_mul_sum_12 = async_compile.triton('triton_per_fused_add_max_mean_mul_sum_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.persistent_reduction(
    size_hints=[1, 16],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {3: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 4), equal_to_1=(3,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_add_max_mean_mul_sum_12', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 8, 'num_reduction': 1, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused_add_max_mean_mul_sum_12(in_out_ptr0, in_ptr0, in_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex % 4
    r1 = (rindex // 4)
    tmp0 = tl.load(in_ptr0 + (r0 + (16*r1)), None)
    tmp1 = tl.load(in_ptr0 + (4 + r0 + (16*r1)), None)
    tmp3 = tl.load(in_ptr0 + (8 + r0 + (16*r1)), None)
    tmp5 = tl.load(in_ptr0 + (12 + r0 + (16*r1)), None)
    tmp7 = tl.load(in_ptr1 + (r0 + (16*r1)), None)
    tmp8 = tl.load(in_ptr1 + (4 + r0 + (16*r1)), None)
    tmp10 = tl.load(in_ptr1 + (8 + r0 + (16*r1)), None)
    tmp12 = tl.load(in_ptr1 + (12 + r0 + (16*r1)), None)
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp4 = triton_helpers.maximum(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp4, tmp5)
    tmp9 = tmp7 + tmp8
    tmp11 = tmp9 + tmp10
    tmp13 = tmp11 + tmp12
    tmp14 = 6e-07
    tmp15 = tmp13 * tmp14
    tmp16 = tmp6 + tmp15
    tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
    tmp19 = tl.sum(tmp17, 1)[:, None]
    tmp20 = 16.0
    tmp21 = tmp19 / tmp20
    tl.debug_barrier()
    tl.store(in_out_ptr0 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp21, None)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_2], Original ATen: [aten.lift_fresh, aten.fill]
        stream0 = get_raw_stream(0)
        triton_poi_fused_fill_lift_fresh_0.run(buf0, 64, grid=grid(64), stream=stream0)
        buf1 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_3], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_1.run(buf0, buf1, 64, grid=grid(64), stream=stream0)
        buf2 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_4], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_2.run(buf1, buf0, buf2, 64, grid=grid(64), stream=stream0)
        buf3 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_5], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_3.run(buf2, buf1, buf0, buf3, 64, grid=grid(64), stream=stream0)
        buf4 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [mask, setitem, setitem_1], Original ATen: [aten.ones_like, aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_ones_like_4.run(buf3, buf2, buf1, buf0, buf4, 256, grid=grid(256), stream=stream0)
        del buf0
        del buf1
        buf5 = buf3; del buf3  # reuse
        # Topologically Sorted Source Nodes: [setitem_8], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_5.run(buf4, buf5, 64, grid=grid(64), stream=stream0)
        buf6 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [setitem_6, setitem_7], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_6.run(buf5, buf4, buf6, 256, grid=grid(256), stream=stream0)
        buf7 = buf5; del buf5  # reuse
        # Topologically Sorted Source Nodes: [setitem_11], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_7.run(buf6, buf7, 64, grid=grid(64), stream=stream0)
        buf8 = buf4; del buf4  # reuse
        # Topologically Sorted Source Nodes: [setitem_9, setitem_10], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_8.run(buf7, buf6, buf8, 256, grid=grid(256), stream=stream0)
        buf9 = buf7; del buf7  # reuse
        # Topologically Sorted Source Nodes: [setitem_14], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_9.run(buf8, buf9, 64, grid=grid(64), stream=stream0)
        buf10 = buf6; del buf6  # reuse
        # Topologically Sorted Source Nodes: [setitem_12, setitem_13], Original ATen: [aten.lift_fresh, aten.fill]
        triton_poi_fused_fill_lift_fresh_10.run(buf9, buf8, buf10, 256, grid=grid(256), stream=stream0)
        del buf8
        buf11 = buf9; del buf9  # reuse
        buf12 = buf2; del buf2  # reuse
        # Topologically Sorted Source Nodes: [setitem_15, nw, max_1, sum_1], Original ATen: [aten.lift_fresh, aten.fill, aten.mul, aten.max, aten.sum]
        triton_poi_fused_fill_lift_fresh_max_mul_sum_11.run(buf10, arg0_1, buf11, buf12, 64, grid=grid(64), stream=stream0)
        del arg0_1
        del buf10
        buf13 = empty_strided_cuda((), (), torch.float32)
        buf14 = buf13; del buf13  # reuse
        # Topologically Sorted Source Nodes: [max_2, sum_2, mul_1, tmp_all, loss], Original ATen: [aten.max, aten.sum, aten.mul, aten.add, aten.mean]
        triton_per_fused_add_max_mean_mul_sum_12.run(buf14, buf11, buf12, 1, 16, grid=grid(1), stream=stream0)
        del buf11
        del buf12
    return (buf14, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    arg0_1 = rand_strided((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([arg0_1])
    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
from torch import nn
import torch.utils.data


class CosLoss(nn.Module):

    def __init__(self, factor=6e-07, havesum=True, havemax=True):
        super(CosLoss, self).__init__()
        self.factor = factor
        self.havesum = havesum
        self.havemax = havemax

    def forward(self, w):
        mask = torch.ones_like(w)
        for i in range(mask.shape[0]):
            for j in range(mask.shape[1]):
                mask[i, j, j] = -1
        nw = mask * w
        tmp, _ = torch.max(nw, dim=1)
        tmp, _ = torch.max(tmp, dim=1)
        if self.havesum and self.havemax:
            tmp_all = tmp + self.factor * torch.sum(torch.sum(nw, dim=1), dim=1
                )
        elif self.havesum:
            tmp_all = self.factor * torch.sum(torch.sum(nw, dim=1), dim=1)
        else:
            tmp_all = tmp
        loss = torch.mean(tmp_all)
        return loss


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


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

import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch import nn
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda


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


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


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


@triton.jit
def triton_poi_fused_fill_lift_fresh_3(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
    x2 = xindex // 16
    x1 = xindex // 4 % 4
    x3 = xindex % 16
    x4 = xindex
    tmp6 = tl.load(in_ptr0 + (16 + x3), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (16 + x3), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr2 + (16 + x3), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + x4, xmask)
    tmp27 = tl.load(in_ptr1 + x4, xmask)
    tmp28 = tl.load(in_ptr2 + x4, xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 1, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tmp1 == tmp1
    tmp7 = tl.full([1], 0, tl.int32)
    tmp8 = tmp1 == tmp7
    tmp11 = tmp7 == tmp7
    tmp12 = tmp3 == tmp7
    tmp13 = -1.0
    tmp14 = 1.0
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp8, tmp15, tmp14)
    tmp17 = tl.where(tmp11, tmp16, tmp14)
    tmp18 = tl.where(tmp4, tmp13, tmp17)
    tmp19 = tl.where(tmp5, tmp18, tmp17)
    tmp20 = tl.where(tmp8, tmp16, tmp14)
    tmp21 = tl.where(tmp8, tmp19, tmp20)
    tmp22 = tl.where(tmp8, tmp10, tmp21)
    tmp23 = tl.where(tmp8, tmp9, tmp22)
    tmp24 = tl.where(tmp5, tmp6, tmp23)
    tmp25 = tl.where(tmp4, tmp13, tmp24)
    tmp29 = tmp0 == tmp7
    tmp30 = tl.where(tmp29, tmp15, tmp14)
    tmp31 = tl.where(tmp11, tmp30, tmp14)
    tmp32 = tl.where(tmp2, tmp18, tmp31)
    tmp33 = tl.where(tmp8, tmp30, tmp14)
    tmp34 = tl.where(tmp8, tmp32, tmp33)
    tmp35 = tl.where(tmp8, tmp28, tmp34)
    tmp36 = tl.where(tmp8, tmp27, tmp35)
    tmp37 = tl.where(tmp5, tmp26, tmp36)
    tmp38 = tl.where(tmp2, tmp25, tmp37)
    tl.store(out_ptr0 + x4, tmp38, xmask)


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


@triton.jit
def triton_poi_fused_fill_lift_fresh_5(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex // 16
    x1 = xindex // 4 % 4
    x3 = xindex % 16
    x4 = xindex
    tmp14 = tl.load(in_ptr0 + (96 + x3), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr0 + (112 + x3), xmask, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr0 + (64 + x3), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + (128 + x3), xmask, eviction_policy='evict_last')
    tmp32 = tl.load(in_ptr0 + (64 + x4), xmask)
    tmp36 = tl.load(in_ptr0 + (128 + x4), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 0, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = x1
    tmp4 = tmp3 == tmp1
    tmp5 = tl.full([1], 2, tl.int32)
    tmp6 = tl.full([1], 1, tl.int32)
    tmp7 = tmp5 == tmp6
    tmp8 = tl.full([1], 3, tl.int32)
    tmp9 = tmp1 == tmp8
    tmp10 = tmp3 == tmp8
    tmp11 = tmp6 == tmp6
    tmp12 = tmp8 == tmp5
    tmp13 = tmp3 == tmp5
    tmp15 = -1.0
    tmp16 = tl.where(tmp13, tmp15, tmp14)
    tmp18 = tl.where(tmp12, tmp16, tmp17)
    tmp19 = tl.where(tmp11, tmp18, tmp17)
    tmp20 = tl.where(tmp10, tmp15, tmp19)
    tmp21 = tmp1 == tmp5
    tmp23 = tl.where(tmp21, tmp16, tmp22)
    tmp24 = tl.where(tmp11, tmp23, tmp22)
    tmp25 = tl.where(tmp9, tmp20, tmp24)
    tmp27 = tl.where(tmp7, tmp23, tmp26)
    tmp28 = tl.where(tmp7, tmp25, tmp27)
    tmp29 = tl.where(tmp4, tmp15, tmp28)
    tmp30 = tmp0 == tmp8
    tmp31 = tmp0 == tmp5
    tmp33 = tl.where(tmp31, tmp16, tmp32)
    tmp34 = tl.where(tmp11, tmp33, tmp32)
    tmp35 = tl.where(tmp30, tmp20, tmp34)
    tmp37 = tl.where(tmp7, tmp33, tmp36)
    tmp38 = tl.where(tmp7, tmp35, tmp37)
    tmp39 = tl.where(tmp2, tmp29, tmp38)
    tl.store(out_ptr0 + x4, tmp39, xmask)


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


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


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


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


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


@triton.jit
def triton_poi_fused_fill_lift_fresh_max_mul_sum_11(in_ptr0, in_ptr1,
    out_ptr0, out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex // 16
    x1 = xindex // 4 % 4
    x3 = xindex % 16
    x4 = xindex
    tmp7 = tl.load(in_ptr0 + (240 + x3), xmask, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr0 + (192 + x3), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr0 + (x3 + 64 * x2), xmask)
    tmp14 = tl.load(in_ptr1 + (x3 + 64 * x2), xmask)
    tmp18 = tl.load(in_ptr0 + (208 + x3), xmask, eviction_policy='evict_last')
    tmp20 = tl.load(in_ptr0 + (16 + x3 + 64 * x2), xmask)
    tmp22 = tl.load(in_ptr1 + (16 + x3 + 64 * x2), xmask)
    tmp27 = tl.load(in_ptr0 + (224 + x3), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr0 + (32 + x3 + 64 * x2), xmask)
    tmp31 = tl.load(in_ptr1 + (32 + x3 + 64 * x2), xmask)
    tmp36 = tl.load(in_ptr0 + (48 + x3 + 64 * x2), xmask)
    tmp38 = tl.load(in_ptr1 + (48 + x3 + 64 * x2), xmask)
    tmp0 = x2
    tmp1 = tl.full([1], 3, tl.int32)
    tmp2 = tmp0 == tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = tmp3 == tmp1
    tmp5 = x1
    tmp6 = tmp5 == tmp1
    tmp8 = -1.0
    tmp9 = tl.where(tmp6, tmp8, tmp7)
    tmp11 = tl.where(tmp4, tmp9, tmp10)
    tmp13 = tl.where(tmp2, tmp11, tmp12)
    tmp15 = tmp13 * tmp14
    tmp16 = tl.full([1], 1, tl.int32)
    tmp17 = tmp16 == tmp1
    tmp19 = tl.where(tmp17, tmp9, tmp18)
    tmp21 = tl.where(tmp2, tmp19, tmp20)
    tmp23 = tmp21 * tmp22
    tmp24 = triton_helpers.maximum(tmp15, tmp23)
    tmp25 = tl.full([1], 2, tl.int32)
    tmp26 = tmp25 == tmp1
    tmp28 = tl.where(tmp26, tmp9, tmp27)
    tmp30 = tl.where(tmp2, tmp28, tmp29)
    tmp32 = tmp30 * tmp31
    tmp33 = triton_helpers.maximum(tmp24, tmp32)
    tmp34 = tmp1 == tmp1
    tmp35 = tl.where(tmp34, tmp9, tmp7)
    tmp37 = tl.where(tmp2, tmp35, tmp36)
    tmp39 = tmp37 * tmp38
    tmp40 = triton_helpers.maximum(tmp33, tmp39)
    tmp41 = tmp15 + tmp23
    tmp42 = tmp41 + tmp32
    tmp43 = tmp42 + tmp39
    tl.store(out_ptr0 + x4, tmp40, xmask)
    tl.store(out_ptr1 + x4, tmp43, xmask)


@triton.jit
def triton_per_fused_add_max_mean_mul_sum_12(in_out_ptr0, in_ptr0, in_ptr1,
    xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex % 4
    r1 = rindex // 4
    tmp0 = tl.load(in_ptr0 + (r0 + 16 * r1), None)
    tmp1 = tl.load(in_ptr0 + (4 + r0 + 16 * r1), None)
    tmp3 = tl.load(in_ptr0 + (8 + r0 + 16 * r1), None)
    tmp5 = tl.load(in_ptr0 + (12 + r0 + 16 * r1), None)
    tmp7 = tl.load(in_ptr1 + (r0 + 16 * r1), None)
    tmp8 = tl.load(in_ptr1 + (4 + r0 + 16 * r1), None)
    tmp10 = tl.load(in_ptr1 + (8 + r0 + 16 * r1), None)
    tmp12 = tl.load(in_ptr1 + (12 + r0 + 16 * r1), None)
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp4 = triton_helpers.maximum(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp4, tmp5)
    tmp9 = tmp7 + tmp8
    tmp11 = tmp9 + tmp10
    tmp13 = tmp11 + tmp12
    tmp14 = 6e-07
    tmp15 = tmp13 * tmp14
    tmp16 = tmp6 + tmp15
    tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
    tmp19 = tl.sum(tmp17, 1)[:, None]
    tmp20 = 16.0
    tmp21 = tmp19 / tmp20
    tl.debug_barrier()
    tl.store(in_out_ptr0 + tl.full([XBLOCK, 1], 0, tl.int32), tmp21, None)


def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_fill_lift_fresh_0[grid(64)](buf0, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf1 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_fill_lift_fresh_1[grid(64)](buf0, buf1, 64, XBLOCK
            =64, num_warps=1, num_stages=1)
        buf2 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_fill_lift_fresh_2[grid(64)](buf1, buf0, buf2, 64,
            XBLOCK=64, num_warps=1, num_stages=1)
        buf3 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_fill_lift_fresh_3[grid(64)](buf2, buf1, buf0, buf3,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf4 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        triton_poi_fused_fill_lift_fresh_ones_like_4[grid(256)](buf3, buf2,
            buf1, buf0, buf4, 256, XBLOCK=256, num_warps=4, num_stages=1)
        del buf0
        del buf1
        buf5 = buf3
        del buf3
        triton_poi_fused_fill_lift_fresh_5[grid(64)](buf4, buf5, 64, XBLOCK
            =64, num_warps=1, num_stages=1)
        buf6 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        triton_poi_fused_fill_lift_fresh_6[grid(256)](buf5, buf4, buf6, 256,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf7 = buf5
        del buf5
        triton_poi_fused_fill_lift_fresh_7[grid(64)](buf6, buf7, 64, XBLOCK
            =64, num_warps=1, num_stages=1)
        buf8 = buf4
        del buf4
        triton_poi_fused_fill_lift_fresh_8[grid(256)](buf7, buf6, buf8, 256,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf9 = buf7
        del buf7
        triton_poi_fused_fill_lift_fresh_9[grid(64)](buf8, buf9, 64, XBLOCK
            =64, num_warps=1, num_stages=1)
        buf10 = buf6
        del buf6
        triton_poi_fused_fill_lift_fresh_10[grid(256)](buf9, buf8, buf10, 
            256, XBLOCK=256, num_warps=4, num_stages=1)
        del buf8
        buf11 = buf9
        del buf9
        buf12 = buf2
        del buf2
        triton_poi_fused_fill_lift_fresh_max_mul_sum_11[grid(64)](buf10,
            arg0_1, buf11, buf12, 64, XBLOCK=64, num_warps=1, num_stages=1)
        del arg0_1
        del buf10
        buf13 = empty_strided_cuda((), (), torch.float32)
        buf14 = buf13
        del buf13
        triton_per_fused_add_max_mean_mul_sum_12[grid(1)](buf14, buf11,
            buf12, 1, 16, XBLOCK=1, num_warps=2, num_stages=1)
        del buf11
        del buf12
    return buf14,


class CosLossNew(nn.Module):

    def __init__(self, factor=6e-07, havesum=True, havemax=True):
        super(CosLossNew, self).__init__()
        self.factor = factor
        self.havesum = havesum
        self.havemax = havemax

    def forward(self, input_0):
        arg0_1 = input_0
        output = call([arg0_1])
        return output[0]
