# 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_1/inductor_cache/o3/co3fvzuaybjp4ocvx5bnaukyhlezccwzraqdsx6elnoggrfynhhv.py
# Topologically Sorted Source Nodes: [map_h], Original ATen: [aten.new_zeros]
# Source node to ATen node mapping:
#   map_h => full_default
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 4], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
triton_poi_fused_new_zeros_0 = async_compile.triton('triton_poi_fused_new_zeros_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_new_zeros_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 0, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_new_zeros_0(out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = 0.0
    tl.store(out_ptr0 + (x0), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/lg/clgxgb5ifxkfz47ikkzqlj6pgovt74rn2ejb3t7kvtlwnebdzz74.py
# Topologically Sorted Source Nodes: [map_h, setitem], Original ATen: [aten.new_zeros, aten.index_put]
# Source node to ATen node mapping:
#   map_h => full_default
#   setitem => index_put
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 4], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %index_put : [num_users=1] = call_function[target=torch.ops.aten.index_put_.default](args = (%full_default, [None, None, %lift_fresh_copy, %lift_fresh_copy_1], %arg0_1), kwargs = {})
triton_poi_fused_index_put_new_zeros_1 = async_compile.triton('triton_poi_fused_index_put_new_zeros_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=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_index_put_new_zeros_1', 'mutated_arg_names': ['out_ptr0'], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_index_put_new_zeros_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
    x0 = xindex % 4
    x2 = xindex
    x1 = (xindex // 4)
    tmp11 = tl.load(in_ptr0 + (x2), xmask)
    tmp0 = x0
    tmp1 = tl.full([1], 2, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.full([1], 0, tl.int64)
    tmp6 = tl.where(tmp4, tmp5, tmp3)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.where(tmp8, tmp1, tmp7)
    tmp10 = tl.where(tmp2, tmp6, tmp9)
    tl.store(out_ptr0 + ((5*tmp10) + (16*x1)), tmp11, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/3m/c3m5zntshenarfio7ilpf5k726vzzoayxjev4sjdillw6khpkhfk.py
# Topologically Sorted Source Nodes: [x, setitem_2], Original ATen: [aten.max_pool2d_with_indices, aten.index_put]
# Source node to ATen node mapping:
#   setitem_2 => index_put_2
#   x => _low_memory_max_pool2d_with_offsets
# Graph fragment:
#   %_low_memory_max_pool2d_with_offsets : [num_users=1] = call_function[target=torch.ops.prims._low_memory_max_pool2d_with_offsets.default](args = (%unsqueeze, [1, 2], [1, 1], [0, 0], [1, 1], False), kwargs = {})
#   %index_put_2 : [num_users=1] = call_function[target=torch.ops.aten.index_put_.default](args = (%index_put, [None, None, %lift_fresh_copy_6, %lift_fresh_copy_7], %squeeze), kwargs = {})
triton_poi_fused_index_put_max_pool2d_with_indices_2 = async_compile.triton('triton_poi_fused_index_put_max_pool2d_with_indices_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=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_index_put_max_pool2d_with_indices_2', 'mutated_arg_names': ['out_ptr1'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_index_put_max_pool2d_with_indices_2(in_ptr0, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 48
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 3
    x1 = (xindex // 3)
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (4*x1)), xmask)
    tmp1 = tl.load(in_ptr0 + (1 + x0 + (4*x1)), xmask)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp3 = x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tl.full([1], 2, tl.int64)
    tmp7 = tmp3 < tmp6
    tmp8 = tl.where(tmp7, tmp4, tmp6)
    tmp9 = tl.full([1], 0, tl.int64)
    tmp10 = tl.where(tmp5, tmp9, tmp8)
    tmp11 = tl.full([1], 3, tl.int64)
    tmp12 = tl.where(tmp7, tmp6, tmp11)
    tmp13 = tl.where(tmp5, tmp4, tmp12)
    tl.store(out_ptr0 + (x2), tmp2, xmask)
    tl.store(out_ptr1 + (tmp13 + (4*tmp10) + (16*x1)), tmp2, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/rx/crxe2gmw4ppbxxq3kvcirqaw5tb4kagz5epjsaw3i5xywjm6fnxp.py
# Topologically Sorted Source Nodes: [x_1, setitem_4], Original ATen: [aten.max_pool2d_with_indices, aten.index_put]
# Source node to ATen node mapping:
#   setitem_4 => index_put_4
#   x_1 => _low_memory_max_pool2d_with_offsets_1
# Graph fragment:
#   %_low_memory_max_pool2d_with_offsets_1 : [num_users=1] = call_function[target=torch.ops.prims._low_memory_max_pool2d_with_offsets.default](args = (%unsqueeze_1, [1, 2], [1, 1], [0, 0], [1, 1], False), kwargs = {})
#   %index_put_4 : [num_users=1] = call_function[target=torch.ops.aten.index_put_.default](args = (%index_put_2, [None, None, %lift_fresh_copy_12, %lift_fresh_copy_13], %squeeze_2), kwargs = {})
triton_poi_fused_index_put_max_pool2d_with_indices_3 = async_compile.triton('triton_poi_fused_index_put_max_pool2d_with_indices_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=[32], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_index_put_max_pool2d_with_indices_3', 'mutated_arg_names': ['out_ptr1'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_index_put_max_pool2d_with_indices_3(in_ptr0, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 32
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x1 = (xindex // 2)
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (3*x1)), xmask)
    tmp1 = tl.load(in_ptr0 + (1 + x0 + (3*x1)), xmask)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp3 = x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tl.full([1], 0, tl.int64)
    tmp7 = tl.where(tmp5, tmp6, tmp4)
    tmp8 = tl.full([1], 2, tl.int64)
    tmp9 = tl.full([1], 3, tl.int64)
    tmp10 = tl.where(tmp5, tmp8, tmp9)
    tl.store(out_ptr0 + (x2), tmp2, xmask)
    tl.store(out_ptr1 + (tmp10 + (4*tmp7) + (16*x1)), tmp2, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/t3/ct3jy6bo7isikipngetj4c7rkfh6o7gaemb3wzt2usaj3ukrkpmn.py
# Topologically Sorted Source Nodes: [setitem_6], Original ATen: [aten.index_put]
# Source node to ATen node mapping:
#   setitem_6 => index_put_6
# Graph fragment:
#   %index_put_6 : [num_users=1] = call_function[target=torch.ops.aten.index_put_.default](args = (%index_put_4, [None, None, %full_default_2, %full_default_3], %squeeze_4), kwargs = {})
triton_poi_fused_index_put_4 = async_compile.triton('triton_poi_fused_index_put_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=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_index_put_4', 'mutated_arg_names': ['out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_index_put_4(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (2*x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + (2*x0)), xmask, eviction_policy='evict_last')
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tl.store(out_ptr0 + (3 + (16*x0)), tmp2, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/rk/crk2aqpub5cu4vqgxe7cgebyr75yv52xg2z4s5qtybyjz5gcgb4o.py
# Topologically Sorted Source Nodes: [map_mask], Original ATen: [aten.new_zeros]
# Source node to ATen node mapping:
#   map_mask => full_default_1
# Graph fragment:
#   %full_default_1 : [num_users=2] = call_function[target=torch.ops.aten.full.default](args = ([4, 1, 4, 4], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
triton_poi_fused_new_zeros_5 = async_compile.triton('triton_poi_fused_new_zeros_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: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_new_zeros_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 0, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_new_zeros_5(out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = 0.0
    tl.store(out_ptr0 + (x0), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/kq/ckqkdi7yzrq5y2u3jt6hddlvw44kdgifjvpb6zy7gn3uqjtw77rv.py
# Topologically Sorted Source Nodes: [map_mask, getitem, iadd, setitem_1], Original ATen: [aten.new_zeros, aten.index, aten.add, aten.index_put]
# Source node to ATen node mapping:
#   getitem => index
#   iadd => add
#   map_mask => full_default_1
#   setitem_1 => index_put_1
# Graph fragment:
#   %full_default_1 : [num_users=2] = call_function[target=torch.ops.aten.full.default](args = ([4, 1, 4, 4], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %index : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%full_default_1, [None, None, %lift_fresh_copy_2, %lift_fresh_copy_3]), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%index, 1), kwargs = {})
#   %index_put_1 : [num_users=2] = call_function[target=torch.ops.aten.index_put_.default](args = (%full_default_1, [None, None, %lift_fresh_copy_4, %lift_fresh_copy_5], %add), kwargs = {})
triton_poi_fused_add_index_index_put_new_zeros_6 = async_compile.triton('triton_poi_fused_add_index_index_put_new_zeros_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=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_index_index_put_new_zeros_6', 'mutated_arg_names': ['out_ptr0'], 'no_x_dim': False, 'num_load': 0, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_index_index_put_new_zeros_6(out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = (xindex // 4)
    tmp0 = x0
    tmp1 = tl.full([1], 2, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.full([1], 0, tl.int64)
    tmp6 = tl.where(tmp4, tmp5, tmp3)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.where(tmp8, tmp1, tmp7)
    tmp10 = tl.where(tmp2, tmp6, tmp9)
    tmp11 = 1.0
    tl.store(out_ptr0 + ((5*tmp10) + (16*x1)), tmp11, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/yh/cyh4d473zu5fq3zvya4d54k32mgtgjmqfi434h7w34pu27wva22o.py
# Topologically Sorted Source Nodes: [getitem_1, iadd_1, setitem_3], Original ATen: [aten.index, aten.add, aten.index_put]
# Source node to ATen node mapping:
#   getitem_1 => index_1
#   iadd_1 => add_1
#   setitem_3 => index_put_3
# Graph fragment:
#   %index_1 : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%index_put_1, [None, None, %lift_fresh_copy_8, %lift_fresh_copy_9]), kwargs = {})
#   %add_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%index_1, 1), kwargs = {})
#   %index_put_3 : [num_users=2] = call_function[target=torch.ops.aten.index_put_.default](args = (%index_put_1, [None, None, %lift_fresh_copy_10, %lift_fresh_copy_11], %add_1), kwargs = {})
triton_poi_fused_add_index_index_put_7 = async_compile.triton('triton_poi_fused_add_index_index_put_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=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_index_index_put_7', 'mutated_arg_names': ['in_ptr0', 'out_ptr0'], 'no_x_dim': False, 'num_load': 0, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_index_index_put_7(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 12
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 3
    x1 = (xindex // 3)
    tmp0 = x0
    tmp1 = tl.full([1], 1, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 2, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.where(tmp4, tmp1, tmp3)
    tmp6 = tl.full([1], 0, tl.int64)
    tmp7 = tl.where(tmp2, tmp6, tmp5)
    tmp8 = tl.full([1], 3, tl.int64)
    tmp9 = tl.where(tmp4, tmp3, tmp8)
    tmp10 = tl.where(tmp2, tmp1, tmp9)
    tmp11 = tl.load(in_ptr0 + (tmp10 + (4*tmp7) + (16*x1)), xmask, eviction_policy='evict_last')
    tmp12 = 1.0
    tmp13 = tmp11 + tmp12
    tl.store(out_ptr0 + (tmp10 + (4*tmp7) + (16*x1)), tmp13, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/rx/crxdgu3cbwdxalwp2y4qfsqcgo77ly6gwe6f4f6cgp6tluldiivu.py
# Topologically Sorted Source Nodes: [getitem_2, iadd_2, setitem_5], Original ATen: [aten.index, aten.add, aten.index_put]
# Source node to ATen node mapping:
#   getitem_2 => index_2
#   iadd_2 => add_2
#   setitem_5 => index_put_5
# Graph fragment:
#   %index_2 : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%index_put_3, [None, None, %lift_fresh_copy_14, %lift_fresh_copy_15]), kwargs = {})
#   %add_2 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%index_2, 1), kwargs = {})
#   %index_put_5 : [num_users=2] = call_function[target=torch.ops.aten.index_put_.default](args = (%index_put_3, [None, None, %lift_fresh_copy_16, %lift_fresh_copy_17], %add_2), kwargs = {})
triton_poi_fused_add_index_index_put_8 = async_compile.triton('triton_poi_fused_add_index_index_put_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=[8], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_index_index_put_8', 'mutated_arg_names': ['in_ptr0', 'out_ptr0'], 'no_x_dim': False, 'num_load': 0, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_index_index_put_8(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x1 = (xindex // 2)
    tmp0 = x0
    tmp1 = tl.full([1], 1, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 0, tl.int64)
    tmp4 = tl.where(tmp2, tmp3, tmp1)
    tmp5 = tl.full([1], 2, tl.int64)
    tmp6 = tl.full([1], 3, tl.int64)
    tmp7 = tl.where(tmp2, tmp5, tmp6)
    tmp8 = tl.load(in_ptr0 + (tmp7 + (4*tmp4) + (16*x1)), xmask, eviction_policy='evict_last')
    tmp9 = 1.0
    tmp10 = tmp8 + tmp9
    tl.store(out_ptr0 + (tmp7 + (4*tmp4) + (16*x1)), tmp10, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_1/inductor_cache/cv/ccvvzhsqsa5cdebqqmpw52jbb6o2hpjsqzkzzl2zgw37x56bdno7.py
# Topologically Sorted Source Nodes: [getitem_3, iadd_3, setitem_7], Original ATen: [aten.index, aten.add, aten.index_put]
# Source node to ATen node mapping:
#   getitem_3 => index_3
#   iadd_3 => add_3
#   setitem_7 => index_put_7
# Graph fragment:
#   %index_3 : [num_users=1] = call_function[target=torch.ops.aten.index.Tensor](args = (%index_put_5, [None, None, %full_default_4, %full_default_5]), kwargs = {})
#   %add_3 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%index_3, 1), kwargs = {})
#   %index_put_7 : [num_users=1] = call_function[target=torch.ops.aten.index_put_.default](args = (%index_put_5, [None, None, %full_default_6, %full_default_7], %add_3), kwargs = {})
triton_poi_fused_add_index_index_put_9 = async_compile.triton('triton_poi_fused_add_index_index_put_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=[4], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_index_index_put_9', 'mutated_arg_names': ['in_ptr0', 'out_ptr0'], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_index_index_put_9(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (3 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp1 = 1.0
    tmp2 = tmp0 + tmp1
    tl.store(out_ptr0 + (3 + (16*x0)), tmp2, xmask)
''', 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), (16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf2 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [map_h], Original ATen: [aten.new_zeros]
        stream0 = get_raw_stream(0)
        triton_poi_fused_new_zeros_0.run(buf2, 256, grid=grid(256), stream=stream0)
        # Topologically Sorted Source Nodes: [map_h, setitem], Original ATen: [aten.new_zeros, aten.index_put]
        triton_poi_fused_index_put_new_zeros_1.run(arg0_1, buf2, 64, grid=grid(64), stream=stream0)
        buf0 = empty_strided_cuda((4, 4, 1, 3), (12, 3, 48, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x, setitem_2], Original ATen: [aten.max_pool2d_with_indices, aten.index_put]
        triton_poi_fused_index_put_max_pool2d_with_indices_2.run(arg0_1, buf0, buf2, 48, grid=grid(48), stream=stream0)
        del arg0_1
        buf1 = empty_strided_cuda((4, 4, 1, 2), (8, 2, 32, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x_1, setitem_4], Original ATen: [aten.max_pool2d_with_indices, aten.index_put]
        triton_poi_fused_index_put_max_pool2d_with_indices_3.run(buf0, buf1, buf2, 32, grid=grid(32), stream=stream0)
        del buf0
        # Topologically Sorted Source Nodes: [setitem_6], Original ATen: [aten.index_put]
        triton_poi_fused_index_put_4.run(buf1, buf2, 16, grid=grid(16), stream=stream0)
        del buf1
        buf7 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [map_mask], Original ATen: [aten.new_zeros]
        triton_poi_fused_new_zeros_5.run(buf7, 64, grid=grid(64), stream=stream0)
        # Topologically Sorted Source Nodes: [map_mask, getitem, iadd, setitem_1], Original ATen: [aten.new_zeros, aten.index, aten.add, aten.index_put]
        triton_poi_fused_add_index_index_put_new_zeros_6.run(buf7, 16, grid=grid(16), stream=stream0)
        # Topologically Sorted Source Nodes: [getitem_1, iadd_1, setitem_3], Original ATen: [aten.index, aten.add, aten.index_put]
        triton_poi_fused_add_index_index_put_7.run(buf7, buf7, 12, grid=grid(12), stream=stream0)
        # Topologically Sorted Source Nodes: [getitem_2, iadd_2, setitem_5], Original ATen: [aten.index, aten.add, aten.index_put]
        triton_poi_fused_add_index_index_put_8.run(buf7, buf7, 8, grid=grid(8), stream=stream0)
        # Topologically Sorted Source Nodes: [getitem_3, iadd_3, setitem_7], Original ATen: [aten.index, aten.add, aten.index_put]
        triton_poi_fused_add_index_index_put_9.run(buf7, buf7, 4, grid=grid(4), stream=stream0)
    return (buf2, buf7, )


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), (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)

from _paritybench_helpers import _mock_config
import torch
import torch.nn.parallel
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn


class PropMaxPool(nn.Module):

    def __init__(self, cfg):
        super(PropMaxPool, self).__init__()
        num_layers = cfg.NUM_LAYERS
        self.layers = nn.ModuleList([nn.Identity()] + [nn.MaxPool1d(2,
            stride=1) for _ in range(num_layers - 1)])
        self.num_layers = num_layers

    def forward(self, x):
        batch_size, hidden_size, num_clips = x.shape
        map_h = x.new_zeros(batch_size, hidden_size, num_clips, num_clips)
        map_mask = x.new_zeros(batch_size, 1, num_clips, num_clips)
        for dig_idx, pool in enumerate(self.layers):
            x = pool(x)
            start_idxs = [s_idx for s_idx in range(0, num_clips - dig_idx, 1)]
            end_idxs = [(s_idx + dig_idx) for s_idx in start_idxs]
            map_h[:, :, start_idxs, end_idxs] = x
            map_mask[:, :, start_idxs, end_idxs] += 1
        return map_h, map_mask


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


def get_init_inputs():
    return [[], {'cfg': _mock_config(NUM_LAYERS=4)}]

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
import torch.nn.parallel
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn
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_new_zeros_0(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = 0.0
    tl.store(out_ptr0 + x0, tmp0, xmask)


@triton.jit
def triton_poi_fused_index_put_new_zeros_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
    x0 = xindex % 4
    x2 = xindex
    x1 = xindex // 4
    tmp11 = tl.load(in_ptr0 + x2, xmask)
    tmp0 = x0
    tmp1 = tl.full([1], 2, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.full([1], 0, tl.int64)
    tmp6 = tl.where(tmp4, tmp5, tmp3)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.where(tmp8, tmp1, tmp7)
    tmp10 = tl.where(tmp2, tmp6, tmp9)
    tl.store(out_ptr0 + (5 * tmp10 + 16 * x1), tmp11, xmask)


@triton.jit
def triton_poi_fused_index_put_max_pool2d_with_indices_2(in_ptr0, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 48
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 3
    x1 = xindex // 3
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 4 * x1), xmask)
    tmp1 = tl.load(in_ptr0 + (1 + x0 + 4 * x1), xmask)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp3 = x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tl.full([1], 2, tl.int64)
    tmp7 = tmp3 < tmp6
    tmp8 = tl.where(tmp7, tmp4, tmp6)
    tmp9 = tl.full([1], 0, tl.int64)
    tmp10 = tl.where(tmp5, tmp9, tmp8)
    tmp11 = tl.full([1], 3, tl.int64)
    tmp12 = tl.where(tmp7, tmp6, tmp11)
    tmp13 = tl.where(tmp5, tmp4, tmp12)
    tl.store(out_ptr0 + x2, tmp2, xmask)
    tl.store(out_ptr1 + (tmp13 + 4 * tmp10 + 16 * x1), tmp2, xmask)


@triton.jit
def triton_poi_fused_index_put_max_pool2d_with_indices_3(in_ptr0, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 32
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x1 = xindex // 2
    x2 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 3 * x1), xmask)
    tmp1 = tl.load(in_ptr0 + (1 + x0 + 3 * x1), xmask)
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tmp3 = x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tl.full([1], 0, tl.int64)
    tmp7 = tl.where(tmp5, tmp6, tmp4)
    tmp8 = tl.full([1], 2, tl.int64)
    tmp9 = tl.full([1], 3, tl.int64)
    tmp10 = tl.where(tmp5, tmp8, tmp9)
    tl.store(out_ptr0 + x2, tmp2, xmask)
    tl.store(out_ptr1 + (tmp10 + 4 * tmp7 + 16 * x1), tmp2, xmask)


@triton.jit
def triton_poi_fused_index_put_4(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 2 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0), xmask, eviction_policy='evict_last')
    tmp2 = triton_helpers.maximum(tmp1, tmp0)
    tl.store(out_ptr0 + (3 + 16 * x0), tmp2, xmask)


@triton.jit
def triton_poi_fused_new_zeros_5(out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = 0.0
    tl.store(out_ptr0 + x0, tmp0, xmask)


@triton.jit
def triton_poi_fused_add_index_index_put_new_zeros_6(out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = x0
    tmp1 = tl.full([1], 2, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.full([1], 0, tl.int64)
    tmp6 = tl.where(tmp4, tmp5, tmp3)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 < tmp7
    tmp9 = tl.where(tmp8, tmp1, tmp7)
    tmp10 = tl.where(tmp2, tmp6, tmp9)
    tmp11 = 1.0
    tl.store(out_ptr0 + (5 * tmp10 + 16 * x1), tmp11, xmask)


@triton.jit
def triton_poi_fused_add_index_index_put_7(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 12
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 3
    x1 = xindex // 3
    tmp0 = x0
    tmp1 = tl.full([1], 1, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 2, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.where(tmp4, tmp1, tmp3)
    tmp6 = tl.full([1], 0, tl.int64)
    tmp7 = tl.where(tmp2, tmp6, tmp5)
    tmp8 = tl.full([1], 3, tl.int64)
    tmp9 = tl.where(tmp4, tmp3, tmp8)
    tmp10 = tl.where(tmp2, tmp1, tmp9)
    tmp11 = tl.load(in_ptr0 + (tmp10 + 4 * tmp7 + 16 * x1), xmask,
        eviction_policy='evict_last')
    tmp12 = 1.0
    tmp13 = tmp11 + tmp12
    tl.store(out_ptr0 + (tmp10 + 4 * tmp7 + 16 * x1), tmp13, xmask)


@triton.jit
def triton_poi_fused_add_index_index_put_8(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 8
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x1 = xindex // 2
    tmp0 = x0
    tmp1 = tl.full([1], 1, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.full([1], 0, tl.int64)
    tmp4 = tl.where(tmp2, tmp3, tmp1)
    tmp5 = tl.full([1], 2, tl.int64)
    tmp6 = tl.full([1], 3, tl.int64)
    tmp7 = tl.where(tmp2, tmp5, tmp6)
    tmp8 = tl.load(in_ptr0 + (tmp7 + 4 * tmp4 + 16 * x1), xmask,
        eviction_policy='evict_last')
    tmp9 = 1.0
    tmp10 = tmp8 + tmp9
    tl.store(out_ptr0 + (tmp7 + 4 * tmp4 + 16 * x1), tmp10, xmask)


@triton.jit
def triton_poi_fused_add_index_index_put_9(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (3 + 16 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 1.0
    tmp2 = tmp0 + tmp1
    tl.store(out_ptr0 + (3 + 16 * x0), tmp2, xmask)


def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4), (16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf2 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_new_zeros_0[grid(256)](buf2, 256, XBLOCK=128,
            num_warps=4, num_stages=1)
        triton_poi_fused_index_put_new_zeros_1[grid(64)](arg0_1, buf2, 64,
            XBLOCK=64, num_warps=1, num_stages=1)
        buf0 = empty_strided_cuda((4, 4, 1, 3), (12, 3, 48, 1), torch.float32)
        triton_poi_fused_index_put_max_pool2d_with_indices_2[grid(48)](arg0_1,
            buf0, buf2, 48, XBLOCK=64, num_warps=1, num_stages=1)
        del arg0_1
        buf1 = empty_strided_cuda((4, 4, 1, 2), (8, 2, 32, 1), torch.float32)
        triton_poi_fused_index_put_max_pool2d_with_indices_3[grid(32)](buf0,
            buf1, buf2, 32, XBLOCK=32, num_warps=1, num_stages=1)
        del buf0
        triton_poi_fused_index_put_4[grid(16)](buf1, buf2, 16, XBLOCK=16,
            num_warps=1, num_stages=1)
        del buf1
        buf7 = empty_strided_cuda((4, 1, 4, 4), (16, 16, 4, 1), torch.float32)
        triton_poi_fused_new_zeros_5[grid(64)](buf7, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        triton_poi_fused_add_index_index_put_new_zeros_6[grid(16)](buf7, 16,
            XBLOCK=16, num_warps=1, num_stages=1)
        triton_poi_fused_add_index_index_put_7[grid(12)](buf7, buf7, 12,
            XBLOCK=16, num_warps=1, num_stages=1)
        triton_poi_fused_add_index_index_put_8[grid(8)](buf7, buf7, 8,
            XBLOCK=8, num_warps=1, num_stages=1)
        triton_poi_fused_add_index_index_put_9[grid(4)](buf7, buf7, 4,
            XBLOCK=4, num_warps=1, num_stages=1)
    return buf2, buf7


class PropMaxPoolNew(nn.Module):

    def __init__(self, cfg):
        super(PropMaxPoolNew, self).__init__()
        num_layers = cfg.NUM_LAYERS
        self.layers = nn.ModuleList([nn.Identity()] + [nn.MaxPool1d(2,
            stride=1) for _ in range(num_layers - 1)])
        self.num_layers = num_layers

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