# 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/2k/c2kcraw2l6i5usoqj5lv2qye7u4cg26yoptt475f7j54itqpogy5.py
# Topologically Sorted Source Nodes: [y_true_shuffled, sort], Original ATen: [aten.index, aten.sort]
# Source node to ATen node mapping:
#   sort => sort
#   y_true_shuffled => index_1
# Graph fragment:
#   %index_1 : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg1_1, [None, %randperm]), kwargs = {})
#   %sort : [num_users=1] = call_function[target=torch.ops.aten.sort.default](args = (%index_1, -1, True), kwargs = {})
triton_per_fused_index_sort_0 = async_compile.triton('triton_per_fused_index_sort_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.persistent_reduction(
    size_hints=[64, 4],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*i64', 1: '*fp32', 2: '*i16', 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': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_index_sort_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, '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}
)
@triton.jit
def triton_per_fused_index_sort_0(in_ptr0, in_ptr1, out_ptr0, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    rnumel = 4
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x1 = (xindex // 4) % 4
    r3 = rindex
    x0 = xindex % 4
    x2 = (xindex // 16)
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK, RBLOCK], 4, tl.int32)
    tmp2 = tmp0 + tmp1
    tmp3 = tmp0 < 0
    tmp4 = tl.where(tmp3, tmp2, tmp0)
    tl.device_assert(((0 <= tmp4) & (tmp4 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp4 < 4")
    tmp6 = tl.load(in_ptr1 + (r3 + (4*x0) + (16*tmp4) + (64*x2)), xmask, other=0.0)
    tmp7 = r3
    tmp8 = tmp7.to(tl.int16)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp10 = tl.broadcast_to(tmp8, [XBLOCK, RBLOCK])
    tmp11, tmp12, = triton_helpers.sort_with_index(tmp9, tmp10, None, 1, stable=False, descending=True)
    tl.store(out_ptr0 + (r3 + (4*x4)), tmp12, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/km/ckmab3w6k6isdk4mh5vg7dy675iyetyejlqa5yss7klua3lx5sjc.py
# Topologically Sorted Source Nodes: [y_true_shuffled, sort, y_pred_shuffled, preds_sorted_by_true, max_1, preds_sorted_by_true_minus_max, exp, flip, cumsum], Original ATen: [aten.index, aten.sort, aten.gather, aten.max, aten.sub, aten.exp, aten.flip, aten.cumsum]
# Source node to ATen node mapping:
#   cumsum => cumsum
#   exp => exp
#   flip => rev
#   max_1 => max_1
#   preds_sorted_by_true => gather
#   preds_sorted_by_true_minus_max => sub
#   sort => sort
#   y_pred_shuffled => index
#   y_true_shuffled => index_1
# Graph fragment:
#   %index_1 : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg1_1, [None, %randperm]), kwargs = {})
#   %sort : [num_users=1] = call_function[target=torch.ops.aten.sort.default](args = (%index_1, -1, True), kwargs = {})
#   %index : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg0_1, [None, %randperm]), kwargs = {})
#   %gather : [num_users=2] = call_function[target=torch.ops.aten.gather.default](args = (%index, 1, %getitem_1), kwargs = {})
#   %max_1 : [num_users=1] = call_function[target=torch.ops.aten.max.dim](args = (%gather, 1, True), kwargs = {})
#   %sub : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%gather, %getitem_2), kwargs = {})
#   %exp : [num_users=1] = call_function[target=torch.ops.aten.exp.default](args = (%sub,), kwargs = {})
#   %rev : [num_users=1] = call_function[target=torch.ops.prims.rev.default](args = (%exp, [1]), kwargs = {})
#   %cumsum : [num_users=1] = call_function[target=torch.ops.aten.cumsum.default](args = (%rev, 1), kwargs = {})
triton_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_1 = async_compile.triton('triton_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_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.jit
def _triton_helper_fn_add0(arg0_0, arg1_0):
    tmp0 = arg0_0 + arg1_0
    return tmp0

@triton_heuristics.persistent_reduction(
    size_hints=[64, 4],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*i16', 1: '*i64', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: 'i32', 6: '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_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_1', '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}
)
@triton.jit
def triton_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_1(in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    rnumel = 4
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x0 = xindex % 16
    x1 = (xindex // 16)
    x3 = xindex
    r2 = rindex
    tmp0 = tl.load(in_ptr0 + (x0 + (64*x1)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (16 + x0 + (64*x1)), xmask, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr0 + (32 + x0 + (64*x1)), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr0 + (48 + x0 + (64*x1)), xmask, eviction_policy='evict_last')
    tmp52 = tl.load(in_ptr0 + (48 + x0 + ((-16)*r2) + (64*x1)), xmask, other=0.0)
    tmp1 = tmp0.to(tl.int64)
    tmp2 = tl.full([XBLOCK, 1], 4, tl.int32)
    tmp3 = tmp1 + tmp2
    tmp4 = tmp1 < 0
    tmp5 = tl.where(tmp4, tmp3, tmp1)
    tl.device_assert(((0 <= tmp5) & (tmp5 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp5 < 4")
    tmp7 = tl.load(in_ptr1 + (tmp5), xmask, eviction_policy='evict_last')
    tmp8 = tmp7 + tmp2
    tmp9 = tmp7 < 0
    tmp10 = tl.where(tmp9, tmp8, tmp7)
    tl.device_assert(((0 <= tmp10) & (tmp10 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp10 < 4")
    tmp12 = tl.load(in_ptr2 + (x0 + (16*tmp10) + (64*x1)), xmask)
    tmp14 = tmp13.to(tl.int64)
    tmp15 = tmp14 + tmp2
    tmp16 = tmp14 < 0
    tmp17 = tl.where(tmp16, tmp15, tmp14)
    tl.device_assert(((0 <= tmp17) & (tmp17 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp17 < 4")
    tmp19 = tl.load(in_ptr1 + (tmp17), xmask, eviction_policy='evict_last')
    tmp20 = tmp19 + tmp2
    tmp21 = tmp19 < 0
    tmp22 = tl.where(tmp21, tmp20, tmp19)
    tl.device_assert(((0 <= tmp22) & (tmp22 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp22 < 4")
    tmp24 = tl.load(in_ptr2 + (x0 + (16*tmp22) + (64*x1)), xmask)
    tmp25 = triton_helpers.maximum(tmp12, tmp24)
    tmp27 = tmp26.to(tl.int64)
    tmp28 = tmp27 + tmp2
    tmp29 = tmp27 < 0
    tmp30 = tl.where(tmp29, tmp28, tmp27)
    tl.device_assert(((0 <= tmp30) & (tmp30 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp30 < 4")
    tmp32 = tl.load(in_ptr1 + (tmp30), xmask, eviction_policy='evict_last')
    tmp33 = tmp32 + tmp2
    tmp34 = tmp32 < 0
    tmp35 = tl.where(tmp34, tmp33, tmp32)
    tl.device_assert(((0 <= tmp35) & (tmp35 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp35 < 4")
    tmp37 = tl.load(in_ptr2 + (x0 + (16*tmp35) + (64*x1)), xmask)
    tmp38 = triton_helpers.maximum(tmp25, tmp37)
    tmp40 = tmp39.to(tl.int64)
    tmp41 = tmp40 + tmp2
    tmp42 = tmp40 < 0
    tmp43 = tl.where(tmp42, tmp41, tmp40)
    tl.device_assert(((0 <= tmp43) & (tmp43 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp43 < 4")
    tmp45 = tl.load(in_ptr1 + (tmp43), xmask, eviction_policy='evict_last')
    tmp46 = tmp45 + tmp2
    tmp47 = tmp45 < 0
    tmp48 = tl.where(tmp47, tmp46, tmp45)
    tl.device_assert(((0 <= tmp48) & (tmp48 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp48 < 4")
    tmp50 = tl.load(in_ptr2 + (x0 + (16*tmp48) + (64*x1)), xmask)
    tmp51 = triton_helpers.maximum(tmp38, tmp50)
    tmp53 = tmp52.to(tl.int64)
    tmp54 = tl.full([XBLOCK, RBLOCK], 4, tl.int32)
    tmp55 = tmp53 + tmp54
    tmp56 = tmp53 < 0
    tmp57 = tl.where(tmp56, tmp55, tmp53)
    tl.device_assert(((0 <= tmp57) & (tmp57 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp57 < 4")
    tmp59 = tl.load(in_ptr1 + (tmp57), xmask, eviction_policy='evict_last')
    tmp60 = tmp59 + tmp54
    tmp61 = tmp59 < 0
    tmp62 = tl.where(tmp61, tmp60, tmp59)
    tl.device_assert(((0 <= tmp62) & (tmp62 < 4)) | ~(xmask), "index out of bounds: 0 <= tmp62 < 4")
    tmp64 = tl.load(in_ptr2 + (x0 + (16*tmp62) + (64*x1)), xmask)
    tmp65 = tmp64 - tmp51
    tmp66 = tl_math.exp(tmp65)
    tmp67 = tmp66.to(tl.float32)
    tmp68 = tl.broadcast_to(tmp67, [XBLOCK, RBLOCK])
    tmp69, = tl.associative_scan((tmp68,), 1, _triton_helper_fn_add0)
    tl.store(out_ptr0 + (x3), tmp51, xmask)
    tl.store(out_ptr1 + (x0 + (16*r2) + (64*x1)), tmp69, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/pt/cptdzn34dy5g2gawu6q2nc7xqndn4wjrzh4mxmffekrctqd4zngu.py
# Topologically Sorted Source Nodes: [y_true_shuffled, sort, y_pred_shuffled, preds_sorted_by_true, preds_sorted_by_true_minus_max, cumsums, add, log, observation_loss, sum_1, mean], Original ATen: [aten.index, aten.sort, aten.gather, aten.sub, aten.flip, aten.add, aten.log, aten.sum, aten.mean]
# Source node to ATen node mapping:
#   add => add
#   cumsums => rev_1
#   log => log
#   mean => mean
#   observation_loss => sub_1
#   preds_sorted_by_true => gather
#   preds_sorted_by_true_minus_max => sub
#   sort => sort
#   sum_1 => sum_1
#   y_pred_shuffled => index
#   y_true_shuffled => index_1
# Graph fragment:
#   %index_1 : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg1_1, [None, %randperm]), kwargs = {})
#   %sort : [num_users=1] = call_function[target=torch.ops.aten.sort.default](args = (%index_1, -1, True), kwargs = {})
#   %index : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%arg0_1, [None, %randperm]), kwargs = {})
#   %gather : [num_users=2] = call_function[target=torch.ops.aten.gather.default](args = (%index, 1, %getitem_1), kwargs = {})
#   %sub : [num_users=2] = call_function[target=torch.ops.aten.sub.Tensor](args = (%gather, %getitem_2), kwargs = {})
#   %rev_1 : [num_users=1] = call_function[target=torch.ops.prims.rev.default](args = (%cumsum, [1]), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%rev_1, 1e-05), kwargs = {})
#   %log : [num_users=1] = call_function[target=torch.ops.aten.log.default](args = (%add,), kwargs = {})
#   %sub_1 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%log, %sub), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%sub_1, [1]), kwargs = {})
#   %mean : [num_users=1] = call_function[target=torch.ops.aten.mean.default](args = (%sum_1,), kwargs = {})
triton_per_fused_add_flip_gather_index_log_mean_sort_sub_sum_2 = async_compile.triton('triton_per_fused_add_flip_gather_index_log_mean_sort_sub_sum_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.persistent_reduction(
    size_hints=[1, 64],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*i16', 4: '*i64', 5: '*fp32', 6: 'i32', 7: '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': {6: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 7), equal_to_1=(6,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_add_flip_gather_index_log_mean_sort_sub_sum_2', 'mutated_arg_names': ['in_out_ptr0', 'in_out_ptr1'], 'no_x_dim': False, 'num_load': 9, '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_flip_gather_index_log_mean_sort_sub_sum_2(in_out_ptr0, in_out_ptr1, in_ptr0, in_ptr1, in_ptr2, in_ptr3, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 64
    RBLOCK: tl.constexpr = 64
    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 % 16
    r1 = (rindex // 16)
    r2 = rindex
    tmp0 = tl.load(in_ptr0 + (48 + r0 + (64*r1)), None)
    tmp4 = tl.load(in_ptr1 + (r0 + (64*r1)), None)
    tmp17 = tl.load(in_out_ptr0 + (r2), None)
    tmp20 = tl.load(in_ptr0 + (32 + r0 + (64*r1)), None)
    tmp23 = tl.load(in_ptr1 + (16 + r0 + (64*r1)), None)
    tmp38 = tl.load(in_ptr0 + (16 + r0 + (64*r1)), None)
    tmp41 = tl.load(in_ptr1 + (32 + r0 + (64*r1)), None)
    tmp56 = tl.load(in_ptr0 + (r0 + (64*r1)), None)
    tmp59 = tl.load(in_ptr1 + (48 + r0 + (64*r1)), None)
    tmp1 = 1e-05
    tmp2 = tmp0 + tmp1
    tmp3 = tl_math.log(tmp2)
    tmp5 = tmp4.to(tl.int64)
    tmp6 = tl.full([XBLOCK, RBLOCK], 4, tl.int32)
    tmp7 = tmp5 + tmp6
    tmp8 = tmp5 < 0
    tmp9 = tl.where(tmp8, tmp7, tmp5)
    tl.device_assert((0 <= tmp9) & (tmp9 < 4), "index out of bounds: 0 <= tmp9 < 4")
    tmp11 = tl.load(in_ptr2 + (tmp9), None, eviction_policy='evict_last')
    tmp12 = tmp11 + tmp6
    tmp13 = tmp11 < 0
    tmp14 = tl.where(tmp13, tmp12, tmp11)
    tl.device_assert((0 <= tmp14) & (tmp14 < 4), "index out of bounds: 0 <= tmp14 < 4")
    tmp16 = tl.load(in_ptr3 + (r0 + (16*tmp14) + (64*r1)), None)
    tmp18 = tmp16 - tmp17
    tmp19 = tmp3 - tmp18
    tmp21 = tmp20 + tmp1
    tmp22 = tl_math.log(tmp21)
    tmp24 = tmp23.to(tl.int64)
    tmp25 = tmp24 + tmp6
    tmp26 = tmp24 < 0
    tmp27 = tl.where(tmp26, tmp25, tmp24)
    tl.device_assert((0 <= tmp27) & (tmp27 < 4), "index out of bounds: 0 <= tmp27 < 4")
    tmp29 = tl.load(in_ptr2 + (tmp27), None, eviction_policy='evict_last')
    tmp30 = tmp29 + tmp6
    tmp31 = tmp29 < 0
    tmp32 = tl.where(tmp31, tmp30, tmp29)
    tl.device_assert((0 <= tmp32) & (tmp32 < 4), "index out of bounds: 0 <= tmp32 < 4")
    tmp34 = tl.load(in_ptr3 + (r0 + (16*tmp32) + (64*r1)), None)
    tmp35 = tmp34 - tmp17
    tmp36 = tmp22 - tmp35
    tmp37 = tmp19 + tmp36
    tmp39 = tmp38 + tmp1
    tmp40 = tl_math.log(tmp39)
    tmp42 = tmp41.to(tl.int64)
    tmp43 = tmp42 + tmp6
    tmp44 = tmp42 < 0
    tmp45 = tl.where(tmp44, tmp43, tmp42)
    tl.device_assert((0 <= tmp45) & (tmp45 < 4), "index out of bounds: 0 <= tmp45 < 4")
    tmp47 = tl.load(in_ptr2 + (tmp45), None, eviction_policy='evict_last')
    tmp48 = tmp47 + tmp6
    tmp49 = tmp47 < 0
    tmp50 = tl.where(tmp49, tmp48, tmp47)
    tl.device_assert((0 <= tmp50) & (tmp50 < 4), "index out of bounds: 0 <= tmp50 < 4")
    tmp52 = tl.load(in_ptr3 + (r0 + (16*tmp50) + (64*r1)), None)
    tmp53 = tmp52 - tmp17
    tmp54 = tmp40 - tmp53
    tmp55 = tmp37 + tmp54
    tmp57 = tmp56 + tmp1
    tmp58 = tl_math.log(tmp57)
    tmp60 = tmp59.to(tl.int64)
    tmp61 = tmp60 + tmp6
    tmp62 = tmp60 < 0
    tmp63 = tl.where(tmp62, tmp61, tmp60)
    tl.device_assert((0 <= tmp63) & (tmp63 < 4), "index out of bounds: 0 <= tmp63 < 4")
    tmp65 = tl.load(in_ptr2 + (tmp63), None, eviction_policy='evict_last')
    tmp66 = tmp65 + tmp6
    tmp67 = tmp65 < 0
    tmp68 = tl.where(tmp67, tmp66, tmp65)
    tl.device_assert((0 <= tmp68) & (tmp68 < 4), "index out of bounds: 0 <= tmp68 < 4")
    tmp70 = tl.load(in_ptr3 + (r0 + (16*tmp68) + (64*r1)), None)
    tmp71 = tmp70 - tmp17
    tmp72 = tmp58 - tmp71
    tmp73 = tmp55 + tmp72
    tmp74 = tl.broadcast_to(tmp73, [XBLOCK, RBLOCK])
    tmp76 = tl.sum(tmp74, 1)[:, None]
    tmp77 = 64.0
    tmp78 = tmp76 / tmp77
    tl.debug_barrier()
    tl.store(in_out_ptr1 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp78, None)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    arg0_1, arg1_1 = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(arg1_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        # Topologically Sorted Source Nodes: [random_indices], Original ATen: [aten.randperm]
        buf0 = torch.ops.aten.randperm.default(4, device=device(type='cuda', index=0), pin_memory=False)
        buf1 = buf0
        del buf0
        buf3 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.int16)
        # Topologically Sorted Source Nodes: [y_true_shuffled, sort], Original ATen: [aten.index, aten.sort]
        stream0 = get_raw_stream(0)
        triton_per_fused_index_sort_0.run(buf1, arg1_1, buf3, 64, 4, grid=grid(64), stream=stream0)
        del arg1_1
        buf4 = empty_strided_cuda((4, 1, 4, 4), (16, 64, 4, 1), torch.float32)
        buf5 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [y_true_shuffled, sort, y_pred_shuffled, preds_sorted_by_true, max_1, preds_sorted_by_true_minus_max, exp, flip, cumsum], Original ATen: [aten.index, aten.sort, aten.gather, aten.max, aten.sub, aten.exp, aten.flip, aten.cumsum]
        triton_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_1.run(buf3, buf1, arg0_1, buf4, buf5, 64, 4, grid=grid(64), stream=stream0)
        buf6 = reinterpret_tensor(buf4, (4, 4, 4), (16, 4, 1), 0); del buf4  # reuse
        buf7 = empty_strided_cuda((), (), torch.float32)
        buf8 = buf7; del buf7  # reuse
        # Topologically Sorted Source Nodes: [y_true_shuffled, sort, y_pred_shuffled, preds_sorted_by_true, preds_sorted_by_true_minus_max, cumsums, add, log, observation_loss, sum_1, mean], Original ATen: [aten.index, aten.sort, aten.gather, aten.sub, aten.flip, aten.add, aten.log, aten.sum, aten.mean]
        triton_per_fused_add_flip_gather_index_log_mean_sort_sub_sum_2.run(buf6, buf8, buf5, buf3, buf1, arg0_1, 1, 64, grid=grid(1), stream=stream0)
        del arg0_1
        del buf1
        del buf3
        del buf5
        del buf6
    return (buf8, )


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)
    arg1_1 = rand_strided((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([arg0_1, arg1_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
import torch.nn as nn


class ListMLELoss(nn.Module):

    def __init__(self):
        super(ListMLELoss, self).__init__()
        return

    def forward(self, y_pred, y_true, eps=1e-05, padded_value_indicator=-1):
        """
        ListMLE loss introduced in "Listwise Approach to Learning to Rank - Theory and Algorithm".
        :param y_pred: predictions from the model, shape [batch_size, slate_length]
        :param y_true: ground truth labels, shape [batch_size, slate_length]
        :param eps: epsilon value, used for numerical stability
        :param padded_value_indicator: an indicator of the y_true index containing a padded item, e.g. -1
        :return: loss value, a torch.Tensor
        """
        random_indices = torch.randperm(y_pred.shape[-1])
        y_pred_shuffled = y_pred[:, random_indices]
        y_true_shuffled = y_true[:, random_indices]
        _y_true_sorted, indices = y_true_shuffled.sort(descending=True, dim=-1)
        preds_sorted_by_true = torch.gather(y_pred_shuffled, dim=1, index=
            indices)
        max_pred_values, _ = preds_sorted_by_true.max(dim=1, keepdim=True)
        preds_sorted_by_true_minus_max = preds_sorted_by_true - max_pred_values
        cumsums = torch.cumsum(preds_sorted_by_true_minus_max.exp().flip(
            dims=[1]), dim=1).flip(dims=[1])
        observation_loss = torch.log(cumsums + eps
            ) - preds_sorted_by_true_minus_max
        return torch.mean(torch.sum(observation_loss, dim=1))


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


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

import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import math as tl_math
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_per_fused_index_sort_0(in_ptr0, in_ptr1, out_ptr0, xnumel,
    rnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x1 = xindex // 4 % 4
    r3 = rindex
    x0 = xindex % 4
    x2 = xindex // 16
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK, RBLOCK], 4, tl.int32)
    tmp2 = tmp0 + tmp1
    tmp3 = tmp0 < 0
    tmp4 = tl.where(tmp3, tmp2, tmp0)
    tl.device_assert((0 <= tmp4) & (tmp4 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp4 < 4')
    tmp6 = tl.load(in_ptr1 + (r3 + 4 * x0 + 16 * tmp4 + 64 * x2), xmask,
        other=0.0)
    tmp7 = r3
    tmp8 = tmp7.to(tl.int16)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp10 = tl.broadcast_to(tmp8, [XBLOCK, RBLOCK])
    _tmp11, tmp12 = triton_helpers.sort_with_index(tmp9, tmp10, None, 1,
        stable=False, descending=True)
    tl.store(out_ptr0 + (r3 + 4 * x4), tmp12, xmask)


@triton.jit
def _triton_helper_fn_add0(arg0_0, arg1_0):
    tmp0 = arg0_0 + arg1_0
    return tmp0


@triton.jit
def triton_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_1(in_ptr0,
    in_ptr1, in_ptr2, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK: tl.constexpr
    ):
    xnumel = 64
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    x0 = xindex % 16
    x1 = xindex // 16
    x3 = xindex
    r2 = rindex
    tmp0 = tl.load(in_ptr0 + (x0 + 64 * x1), xmask, eviction_policy=
        'evict_last')
    tmp13 = tl.load(in_ptr0 + (16 + x0 + 64 * x1), xmask, eviction_policy=
        'evict_last')
    tmp26 = tl.load(in_ptr0 + (32 + x0 + 64 * x1), xmask, eviction_policy=
        'evict_last')
    tmp39 = tl.load(in_ptr0 + (48 + x0 + 64 * x1), xmask, eviction_policy=
        'evict_last')
    tmp52 = tl.load(in_ptr0 + (48 + x0 + -16 * r2 + 64 * x1), xmask, other=0.0)
    tmp1 = tmp0.to(tl.int64)
    tmp2 = tl.full([XBLOCK, 1], 4, tl.int32)
    tmp3 = tmp1 + tmp2
    tmp4 = tmp1 < 0
    tmp5 = tl.where(tmp4, tmp3, tmp1)
    tl.device_assert((0 <= tmp5) & (tmp5 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp5 < 4')
    tmp7 = tl.load(in_ptr1 + tmp5, xmask, eviction_policy='evict_last')
    tmp8 = tmp7 + tmp2
    tmp9 = tmp7 < 0
    tmp10 = tl.where(tmp9, tmp8, tmp7)
    tl.device_assert((0 <= tmp10) & (tmp10 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp10 < 4')
    tmp12 = tl.load(in_ptr2 + (x0 + 16 * tmp10 + 64 * x1), xmask)
    tmp14 = tmp13.to(tl.int64)
    tmp15 = tmp14 + tmp2
    tmp16 = tmp14 < 0
    tmp17 = tl.where(tmp16, tmp15, tmp14)
    tl.device_assert((0 <= tmp17) & (tmp17 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp17 < 4')
    tmp19 = tl.load(in_ptr1 + tmp17, xmask, eviction_policy='evict_last')
    tmp20 = tmp19 + tmp2
    tmp21 = tmp19 < 0
    tmp22 = tl.where(tmp21, tmp20, tmp19)
    tl.device_assert((0 <= tmp22) & (tmp22 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp22 < 4')
    tmp24 = tl.load(in_ptr2 + (x0 + 16 * tmp22 + 64 * x1), xmask)
    tmp25 = triton_helpers.maximum(tmp12, tmp24)
    tmp27 = tmp26.to(tl.int64)
    tmp28 = tmp27 + tmp2
    tmp29 = tmp27 < 0
    tmp30 = tl.where(tmp29, tmp28, tmp27)
    tl.device_assert((0 <= tmp30) & (tmp30 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp30 < 4')
    tmp32 = tl.load(in_ptr1 + tmp30, xmask, eviction_policy='evict_last')
    tmp33 = tmp32 + tmp2
    tmp34 = tmp32 < 0
    tmp35 = tl.where(tmp34, tmp33, tmp32)
    tl.device_assert((0 <= tmp35) & (tmp35 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp35 < 4')
    tmp37 = tl.load(in_ptr2 + (x0 + 16 * tmp35 + 64 * x1), xmask)
    tmp38 = triton_helpers.maximum(tmp25, tmp37)
    tmp40 = tmp39.to(tl.int64)
    tmp41 = tmp40 + tmp2
    tmp42 = tmp40 < 0
    tmp43 = tl.where(tmp42, tmp41, tmp40)
    tl.device_assert((0 <= tmp43) & (tmp43 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp43 < 4')
    tmp45 = tl.load(in_ptr1 + tmp43, xmask, eviction_policy='evict_last')
    tmp46 = tmp45 + tmp2
    tmp47 = tmp45 < 0
    tmp48 = tl.where(tmp47, tmp46, tmp45)
    tl.device_assert((0 <= tmp48) & (tmp48 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp48 < 4')
    tmp50 = tl.load(in_ptr2 + (x0 + 16 * tmp48 + 64 * x1), xmask)
    tmp51 = triton_helpers.maximum(tmp38, tmp50)
    tmp53 = tmp52.to(tl.int64)
    tmp54 = tl.full([XBLOCK, RBLOCK], 4, tl.int32)
    tmp55 = tmp53 + tmp54
    tmp56 = tmp53 < 0
    tmp57 = tl.where(tmp56, tmp55, tmp53)
    tl.device_assert((0 <= tmp57) & (tmp57 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp57 < 4')
    tmp59 = tl.load(in_ptr1 + tmp57, xmask, eviction_policy='evict_last')
    tmp60 = tmp59 + tmp54
    tmp61 = tmp59 < 0
    tmp62 = tl.where(tmp61, tmp60, tmp59)
    tl.device_assert((0 <= tmp62) & (tmp62 < 4) | ~xmask,
        'index out of bounds: 0 <= tmp62 < 4')
    tmp64 = tl.load(in_ptr2 + (x0 + 16 * tmp62 + 64 * x1), xmask)
    tmp65 = tmp64 - tmp51
    tmp66 = tl_math.exp(tmp65)
    tmp67 = tmp66.to(tl.float32)
    tmp68 = tl.broadcast_to(tmp67, [XBLOCK, RBLOCK])
    tmp69, = tl.associative_scan((tmp68,), 1, _triton_helper_fn_add0)
    tl.store(out_ptr0 + x3, tmp51, xmask)
    tl.store(out_ptr1 + (x0 + 16 * r2 + 64 * x1), tmp69, xmask)


@triton.jit
def triton_per_fused_add_flip_gather_index_log_mean_sort_sub_sum_2(in_out_ptr0,
    in_out_ptr1, in_ptr0, in_ptr1, in_ptr2, in_ptr3, xnumel, rnumel, XBLOCK:
    tl.constexpr):
    RBLOCK: tl.constexpr = 64
    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 % 16
    r1 = rindex // 16
    r2 = rindex
    tmp0 = tl.load(in_ptr0 + (48 + r0 + 64 * r1), None)
    tmp4 = tl.load(in_ptr1 + (r0 + 64 * r1), None)
    tmp17 = tl.load(in_out_ptr0 + r2, None)
    tmp20 = tl.load(in_ptr0 + (32 + r0 + 64 * r1), None)
    tmp23 = tl.load(in_ptr1 + (16 + r0 + 64 * r1), None)
    tmp38 = tl.load(in_ptr0 + (16 + r0 + 64 * r1), None)
    tmp41 = tl.load(in_ptr1 + (32 + r0 + 64 * r1), None)
    tmp56 = tl.load(in_ptr0 + (r0 + 64 * r1), None)
    tmp59 = tl.load(in_ptr1 + (48 + r0 + 64 * r1), None)
    tmp1 = 1e-05
    tmp2 = tmp0 + tmp1
    tmp3 = tl_math.log(tmp2)
    tmp5 = tmp4.to(tl.int64)
    tmp6 = tl.full([XBLOCK, RBLOCK], 4, tl.int32)
    tmp7 = tmp5 + tmp6
    tmp8 = tmp5 < 0
    tmp9 = tl.where(tmp8, tmp7, tmp5)
    tl.device_assert((0 <= tmp9) & (tmp9 < 4),
        'index out of bounds: 0 <= tmp9 < 4')
    tmp11 = tl.load(in_ptr2 + tmp9, None, eviction_policy='evict_last')
    tmp12 = tmp11 + tmp6
    tmp13 = tmp11 < 0
    tmp14 = tl.where(tmp13, tmp12, tmp11)
    tl.device_assert((0 <= tmp14) & (tmp14 < 4),
        'index out of bounds: 0 <= tmp14 < 4')
    tmp16 = tl.load(in_ptr3 + (r0 + 16 * tmp14 + 64 * r1), None)
    tmp18 = tmp16 - tmp17
    tmp19 = tmp3 - tmp18
    tmp21 = tmp20 + tmp1
    tmp22 = tl_math.log(tmp21)
    tmp24 = tmp23.to(tl.int64)
    tmp25 = tmp24 + tmp6
    tmp26 = tmp24 < 0
    tmp27 = tl.where(tmp26, tmp25, tmp24)
    tl.device_assert((0 <= tmp27) & (tmp27 < 4),
        'index out of bounds: 0 <= tmp27 < 4')
    tmp29 = tl.load(in_ptr2 + tmp27, None, eviction_policy='evict_last')
    tmp30 = tmp29 + tmp6
    tmp31 = tmp29 < 0
    tmp32 = tl.where(tmp31, tmp30, tmp29)
    tl.device_assert((0 <= tmp32) & (tmp32 < 4),
        'index out of bounds: 0 <= tmp32 < 4')
    tmp34 = tl.load(in_ptr3 + (r0 + 16 * tmp32 + 64 * r1), None)
    tmp35 = tmp34 - tmp17
    tmp36 = tmp22 - tmp35
    tmp37 = tmp19 + tmp36
    tmp39 = tmp38 + tmp1
    tmp40 = tl_math.log(tmp39)
    tmp42 = tmp41.to(tl.int64)
    tmp43 = tmp42 + tmp6
    tmp44 = tmp42 < 0
    tmp45 = tl.where(tmp44, tmp43, tmp42)
    tl.device_assert((0 <= tmp45) & (tmp45 < 4),
        'index out of bounds: 0 <= tmp45 < 4')
    tmp47 = tl.load(in_ptr2 + tmp45, None, eviction_policy='evict_last')
    tmp48 = tmp47 + tmp6
    tmp49 = tmp47 < 0
    tmp50 = tl.where(tmp49, tmp48, tmp47)
    tl.device_assert((0 <= tmp50) & (tmp50 < 4),
        'index out of bounds: 0 <= tmp50 < 4')
    tmp52 = tl.load(in_ptr3 + (r0 + 16 * tmp50 + 64 * r1), None)
    tmp53 = tmp52 - tmp17
    tmp54 = tmp40 - tmp53
    tmp55 = tmp37 + tmp54
    tmp57 = tmp56 + tmp1
    tmp58 = tl_math.log(tmp57)
    tmp60 = tmp59.to(tl.int64)
    tmp61 = tmp60 + tmp6
    tmp62 = tmp60 < 0
    tmp63 = tl.where(tmp62, tmp61, tmp60)
    tl.device_assert((0 <= tmp63) & (tmp63 < 4),
        'index out of bounds: 0 <= tmp63 < 4')
    tmp65 = tl.load(in_ptr2 + tmp63, None, eviction_policy='evict_last')
    tmp66 = tmp65 + tmp6
    tmp67 = tmp65 < 0
    tmp68 = tl.where(tmp67, tmp66, tmp65)
    tl.device_assert((0 <= tmp68) & (tmp68 < 4),
        'index out of bounds: 0 <= tmp68 < 4')
    tmp70 = tl.load(in_ptr3 + (r0 + 16 * tmp68 + 64 * r1), None)
    tmp71 = tmp70 - tmp17
    tmp72 = tmp58 - tmp71
    tmp73 = tmp55 + tmp72
    tmp74 = tl.broadcast_to(tmp73, [XBLOCK, RBLOCK])
    tmp76 = tl.sum(tmp74, 1)[:, None]
    tmp77 = 64.0
    tmp78 = tmp76 / tmp77
    tl.debug_barrier()
    tl.store(in_out_ptr1 + tl.full([XBLOCK, 1], 0, tl.int32), tmp78, None)


def call(args):
    arg0_1, arg1_1 = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(arg1_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = torch.ops.aten.randperm.default(4, device=device(type='cuda',
            index=0), pin_memory=False)
        buf1 = buf0
        del buf0
        buf3 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.int16)
        get_raw_stream(0)
        triton_per_fused_index_sort_0[grid(64)](buf1, arg1_1, buf3, 64, 4,
            XBLOCK=8, num_warps=2, num_stages=1)
        del arg1_1
        buf4 = empty_strided_cuda((4, 1, 4, 4), (16, 64, 4, 1), torch.float32)
        buf5 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        triton_per_fused_cumsum_exp_flip_gather_index_max_sort_sub_1[grid(64)](
            buf3, buf1, arg0_1, buf4, buf5, 64, 4, XBLOCK=8, num_warps=2,
            num_stages=1)
        buf6 = reinterpret_tensor(buf4, (4, 4, 4), (16, 4, 1), 0)
        del buf4
        buf7 = empty_strided_cuda((), (), torch.float32)
        buf8 = buf7
        del buf7
        triton_per_fused_add_flip_gather_index_log_mean_sort_sub_sum_2[grid(1)
            ](buf6, buf8, buf5, buf3, buf1, arg0_1, 1, 64, XBLOCK=1,
            num_warps=2, num_stages=1)
        del arg0_1
        del buf1
        del buf3
        del buf5
        del buf6
    return buf8,


class ListMLELossNew(nn.Module):

    def __init__(self):
        super(ListMLELossNew, self).__init__()
        return

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