# AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _align as align
from torch import device, empty_strided
from torch._inductor.async_compile import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels
from torch._inductor.codegen.multi_kernel import MultiKernelCall
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid, split_scan_grid, grid_combo_kernels, start_graph, end_graph
from torch._C import _cuda_getCurrentRawStream as get_raw_stream

aten = torch.ops.aten
inductor_ops = torch.ops.inductor
_quantized = torch.ops._quantized
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor
alloc_from_pool = torch.ops.inductor._alloc_from_pool
async_compile = AsyncCompile()


# kernel path: runs/run_shard_6/inductor_cache/d5/cd5m3j5auxbszyzvbqqxqrtrkrxq26jxju4ar5ny6zgmqowfs5hg.py
# Topologically Sorted Source Nodes: [pad], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   pad => copy
# Graph fragment:
#   %copy : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_3, %slice_4), kwargs = {})
#   %slice_scatter_default : [num_users=1] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_tensor, %copy, 2, 1, 5), kwargs = {})
#   %slice_scatter_default_1 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%empty, %slice_scatter_default, 3, 1, 5), kwargs = {})
#   %slice_scatter_default_2 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_1, %slice_11, 3, 0, 1), kwargs = {})
#   %slice_scatter_default_3 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_2, %slice_16, 3, 5, 6), kwargs = {})
triton_poi_fused_copy_0 = async_compile.triton('triton_poi_fused_copy_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=[1024], 
    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_copy_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 8, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_copy_0(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 576
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = (xindex // 6) % 6
    x2 = (xindex // 36)
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp15 & xmask, other=0.0)
    tmp17 = tl.load(in_ptr1 + (x4), tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float("nan")
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + ((-9) + x0 + (4*x1) + (16*x2)), tmp29 & xmask, other=0.0)
    tmp31 = tl.load(in_ptr1 + ((-4) + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + ((-1) + x0 + (4*x1) + (16*x2)), tmp45 & xmask, other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp54 & xmask, other=0.0)
    tmp56 = tl.load(in_ptr1 + (x4), tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + (x4), tmp62, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/w6/cw6our4iotwhi2wfr4hvczz23dzsphqyor2wfejso3djq53u3bto.py
# Topologically Sorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
# Graph fragment:
#   %slice_scatter_default_4 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_3, %slice_21, 2, 0, 1), kwargs = {})
#   %slice_scatter_default_5 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_4, %slice_26, 2, 5, 6), kwargs = {})
triton_poi_fused_1 = async_compile.triton('triton_poi_fused_1', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[1024], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '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_1', '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_1(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 576
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 6) % 6
    x0 = xindex % 6
    x2 = (xindex // 36)
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + ((-24) + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp12 & xmask, eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + (x3), tmp16, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/pf/cpfj2j5thtmk2ayd6xbswuvgaicbzkut5yj72bijwuwed2t2c6lr.py
# Topologically Sorted Source Nodes: [x1, x1_2, x2, x3, x4], Original ATen: [aten.convolution, aten.repeat, aten._native_batch_norm_legit, aten.cat]
# Source node to ATen node mapping:
#   x1 => convolution
#   x1_2 => add, add_1, mul, mul_1, repeat, rsqrt, sub, var_mean
#   x2 => cat
#   x3 => cat_1
#   x4 => cat_2
# Graph fragment:
#   %convolution : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%slice_scatter_default_5, %primals_1, %primals_2, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
#   %repeat : [num_users=2] = call_function[target=torch.ops.aten.repeat.default](args = (%primals_4, [4]), kwargs = {})
#   %var_mean : [num_users=2] = call_function[target=torch.ops.aten.var_mean.correction](args = (%view_1, [0, 2, 3]), kwargs = {correction: 0, keepdim: True})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem, 1e-05), kwargs = {})
#   %rsqrt : [num_users=2] = call_function[target=torch.ops.aten.rsqrt.default](args = (%add,), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%view_1, %getitem_1), kwargs = {})
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub, %rsqrt), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul, %unsqueeze_1), kwargs = {})
#   %add_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_1, %unsqueeze_3), kwargs = {})
#   %cat : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_2, %primals_3], 1), kwargs = {})
#   %cat_1 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_5, %view_2, %primals_3], 1), kwargs = {})
#   %cat_2 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_8, %view_5, %view_2, %primals_3], 1), kwargs = {})
triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_2 = async_compile.triton('triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_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=[16, 16],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: '*fp32', 10: 'i32', 11: '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, 6, 7, 8, 9, 10, 11), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_2', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 4, '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__native_batch_norm_legit_cat_convolution_repeat_2(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr4, out_ptr5, out_ptr6, out_ptr7, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    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
    r3 = rindex
    x1 = xindex % 4
    x2 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x0 % 4), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_out_ptr0 + (r3 + (16*x0)), xmask, other=0.0)
    tmp2 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + (x0 % 4), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tl.full([1, 1], 0, tl.int32)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.where(xmask, tmp6, 0)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp11 = tl.where(xmask, tmp9, 0)
    tmp12 = tl.sum(tmp11, 1)[:, None]
    tmp13 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp14 = tmp13.to(tl.float32)
    tmp15 = tmp12 / tmp14
    tmp16 = tmp6 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tl.broadcast_to(tmp17, [XBLOCK, RBLOCK])
    tmp20 = tl.where(xmask, tmp18, 0)
    tmp21 = tl.sum(tmp20, 1)[:, None]
    tmp22 = tmp5 - tmp15
    tmp23 = 16.0
    tmp24 = tmp21 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tmp28 = tmp22 * tmp27
    tmp29 = tmp28 * tmp0
    tmp31 = tmp29 + tmp30
    tl.store(out_ptr0 + (x0), tmp0, xmask)
    tl.store(in_out_ptr0 + (r3 + (16*x0)), tmp3, xmask)
    tl.store(out_ptr4 + (r3 + (16*x1) + (128*x2)), tmp31, xmask)
    tl.store(out_ptr5 + (r3 + (16*x1) + (192*x2)), tmp31, xmask)
    tl.store(out_ptr6 + (r3 + (16*x1) + (256*x2)), tmp31, xmask)
    tl.store(out_ptr7 + (x0), tmp27, xmask)
    tl.store(out_ptr1 + (x0), tmp15, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/u5/cu5x2dkgixpjrtx2uup2z6jkyeuyvwihgzv3zh3yrl7i2lpwyzyk.py
# Topologically Sorted Source Nodes: [x2, x3, x4], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   x2 => cat
#   x3 => cat_1
#   x4 => cat_2
# Graph fragment:
#   %cat : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_2, %primals_3], 1), kwargs = {})
#   %cat_1 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_5, %view_2, %primals_3], 1), kwargs = {})
#   %cat_2 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_8, %view_5, %view_2, %primals_3], 1), kwargs = {})
triton_poi_fused_cat_3 = async_compile.triton('triton_poi_fused_cat_3', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[256], 
    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_cat_3', '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},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_cat_3(in_ptr0, out_ptr0, out_ptr1, out_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 64
    x1 = (xindex // 64)
    tmp0 = tl.load(in_ptr0 + (x2), xmask)
    tl.store(out_ptr0 + (x0 + (128*x1)), tmp0, xmask)
    tl.store(out_ptr1 + (x0 + (192*x1)), tmp0, xmask)
    tl.store(out_ptr2 + (x0 + (256*x1)), tmp0, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/v2/cv266dyuvwuox4q2yeqcnngiopdemgeb2jg4czamcu6e6ikcpbts.py
# Topologically Sorted Source Nodes: [pad_1], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   pad_1 => copy_5
# Graph fragment:
#   %copy_5 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_30, %slice_31), kwargs = {})
#   %slice_scatter_default_6 : [num_users=1] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_tensor_1, %copy_5, 2, 1, 5), kwargs = {})
#   %slice_scatter_default_7 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%empty_1, %slice_scatter_default_6, 3, 1, 5), kwargs = {})
#   %slice_scatter_default_8 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_7, %slice_40, 3, 0, 1), kwargs = {})
#   %slice_scatter_default_9 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_8, %slice_46, 3, 5, 6), kwargs = {})
triton_poi_fused_copy_4 = async_compile.triton('triton_poi_fused_copy_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=[2048], 
    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_copy_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 8, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_copy_4(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = (xindex // 6) % 6
    x2 = (xindex // 36)
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp15 & xmask, other=0.0)
    tmp17 = tl.load(in_ptr1 + (x4), tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float("nan")
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + ((-9) + x0 + (4*x1) + (16*x2)), tmp29 & xmask, other=0.0)
    tmp31 = tl.load(in_ptr1 + ((-4) + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + ((-1) + x0 + (4*x1) + (16*x2)), tmp45 & xmask, other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp54 & xmask, other=0.0)
    tmp56 = tl.load(in_ptr1 + (x4), tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + (x4), tmp62, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/bl/cbl4dw6ni4z3enptw2gt5tprqiovmm6hmoggmo6wqf3c2ph6hccs.py
# Topologically Sorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
# Graph fragment:
#   %slice_scatter_default_10 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_9, %slice_52, 2, 0, 1), kwargs = {})
#   %slice_scatter_default_11 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_10, %slice_58, 2, 5, 6), kwargs = {})
triton_poi_fused_5 = async_compile.triton('triton_poi_fused_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=[2048], 
    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_5', '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_5(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 6) % 6
    x0 = xindex % 6
    x2 = (xindex // 36)
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + ((-24) + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp12 & xmask, eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + (x3), tmp16, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/5k/c5kfm2w5wf3ffipda5umbqwjxacqgc5nw37meorne5sojjxx2abp.py
# Topologically Sorted Source Nodes: [x2_1, x2_3, x3, x4], Original ATen: [aten.convolution, aten.repeat, aten._native_batch_norm_legit, aten.cat]
# Source node to ATen node mapping:
#   x2_1 => convolution_1
#   x2_3 => add_2, add_3, mul_2, mul_3, repeat_2, rsqrt_1, sub_1, var_mean_1
#   x3 => cat_1
#   x4 => cat_2
# Graph fragment:
#   %convolution_1 : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%slice_scatter_default_11, %primals_6, %primals_7, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
#   %repeat_2 : [num_users=2] = call_function[target=torch.ops.aten.repeat.default](args = (%primals_8, [4]), kwargs = {})
#   %var_mean_1 : [num_users=2] = call_function[target=torch.ops.aten.var_mean.correction](args = (%view_4, [0, 2, 3]), kwargs = {correction: 0, keepdim: True})
#   %add_2 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_2, 1e-05), kwargs = {})
#   %rsqrt_1 : [num_users=2] = call_function[target=torch.ops.aten.rsqrt.default](args = (%add_2,), kwargs = {})
#   %sub_1 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%view_4, %getitem_3), kwargs = {})
#   %mul_2 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_1, %rsqrt_1), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_2, %unsqueeze_5), kwargs = {})
#   %add_3 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_3, %unsqueeze_7), kwargs = {})
#   %cat_1 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_5, %view_2, %primals_3], 1), kwargs = {})
#   %cat_2 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_8, %view_5, %view_2, %primals_3], 1), kwargs = {})
triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_6 = async_compile.triton('triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_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.persistent_reduction(
    size_hints=[16, 16],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: '*fp32', 9: 'i32', 10: '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, 6, 7, 8, 9, 10), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_6', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 4, '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__native_batch_norm_legit_cat_convolution_repeat_6(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr4, out_ptr5, out_ptr6, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    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
    r3 = rindex
    x1 = xindex % 4
    x2 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x0 % 4), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_out_ptr0 + (r3 + (16*x0)), xmask, other=0.0)
    tmp2 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + (x0 % 4), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tl.full([1, 1], 0, tl.int32)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.where(xmask, tmp6, 0)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp11 = tl.where(xmask, tmp9, 0)
    tmp12 = tl.sum(tmp11, 1)[:, None]
    tmp13 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp14 = tmp13.to(tl.float32)
    tmp15 = tmp12 / tmp14
    tmp16 = tmp6 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tl.broadcast_to(tmp17, [XBLOCK, RBLOCK])
    tmp20 = tl.where(xmask, tmp18, 0)
    tmp21 = tl.sum(tmp20, 1)[:, None]
    tmp22 = tmp5 - tmp15
    tmp23 = 16.0
    tmp24 = tmp21 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tmp28 = tmp22 * tmp27
    tmp29 = tmp28 * tmp0
    tmp31 = tmp29 + tmp30
    tl.store(out_ptr0 + (x0), tmp0, xmask)
    tl.store(in_out_ptr0 + (r3 + (16*x0)), tmp3, xmask)
    tl.store(out_ptr4 + (r3 + (16*x1) + (192*x2)), tmp31, xmask)
    tl.store(out_ptr5 + (r3 + (16*x1) + (256*x2)), tmp31, xmask)
    tl.store(out_ptr6 + (x0), tmp27, xmask)
    tl.store(out_ptr1 + (x0), tmp15, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/7e/c7eo2pwbxu4vcfb4udblnmwaeqalnsdr2qphijyhavbhdhwvfmcs.py
# Topologically Sorted Source Nodes: [pad_2], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   pad_2 => copy_10
# Graph fragment:
#   %copy_10 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_63, %slice_64), kwargs = {})
#   %slice_scatter_default_12 : [num_users=1] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_tensor_2, %copy_10, 2, 1, 5), kwargs = {})
#   %slice_scatter_default_13 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%empty_2, %slice_scatter_default_12, 3, 1, 5), kwargs = {})
#   %slice_scatter_default_14 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_13, %slice_73, 3, 0, 1), kwargs = {})
#   %slice_scatter_default_15 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_14, %slice_79, 3, 5, 6), kwargs = {})
triton_poi_fused_copy_7 = async_compile.triton('triton_poi_fused_copy_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=[2048], 
    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_copy_7', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 8, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_copy_7(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1728
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = (xindex // 6) % 6
    x2 = (xindex // 36)
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp15 & xmask, other=0.0)
    tmp17 = tl.load(in_ptr1 + (x4), tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float("nan")
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + ((-9) + x0 + (4*x1) + (16*x2)), tmp29 & xmask, other=0.0)
    tmp31 = tl.load(in_ptr1 + ((-4) + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + ((-1) + x0 + (4*x1) + (16*x2)), tmp45 & xmask, other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp54 & xmask, other=0.0)
    tmp56 = tl.load(in_ptr1 + (x4), tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + (x4), tmp62, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/x4/cx4swemiiq5ss7dkzi3fqqflwd4l3wds4gwvstjyiejfxigsymok.py
# Topologically Sorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
# Graph fragment:
#   %slice_scatter_default_16 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_15, %slice_85, 2, 0, 1), kwargs = {})
#   %slice_scatter_default_17 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_16, %slice_91, 2, 5, 6), kwargs = {})
triton_poi_fused_8 = async_compile.triton('triton_poi_fused_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=[2048], 
    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_8', '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_8(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 1728
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 6) % 6
    x0 = xindex % 6
    x2 = (xindex // 36)
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + ((-24) + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp12 & xmask, eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + (x3), tmp16, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/tu/ctuulksaeggyrw7cyhr37rdzzxlul6j2pscc7n4gedj32vagu5jl.py
# Topologically Sorted Source Nodes: [x3_1, x3_3, x4], Original ATen: [aten.convolution, aten.repeat, aten._native_batch_norm_legit, aten.cat]
# Source node to ATen node mapping:
#   x3_1 => convolution_2
#   x3_3 => add_4, repeat_4, rsqrt_2, var_mean_2
#   x4 => cat_2
# Graph fragment:
#   %convolution_2 : [num_users=2] = call_function[target=torch.ops.aten.convolution.default](args = (%slice_scatter_default_17, %primals_10, %primals_11, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
#   %repeat_4 : [num_users=2] = call_function[target=torch.ops.aten.repeat.default](args = (%primals_12, [4]), kwargs = {})
#   %var_mean_2 : [num_users=2] = call_function[target=torch.ops.aten.var_mean.correction](args = (%view_7, [0, 2, 3]), kwargs = {correction: 0, keepdim: True})
#   %add_4 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%getitem_4, 1e-05), kwargs = {})
#   %rsqrt_2 : [num_users=2] = call_function[target=torch.ops.aten.rsqrt.default](args = (%add_4,), kwargs = {})
#   %cat_2 : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%view_8, %view_5, %view_2, %primals_3], 1), kwargs = {})
triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_9 = async_compile.triton('triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_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.persistent_reduction(
    size_hints=[16, 16],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 7: '*fp32', 8: 'i32', 9: '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, 6, 7, 8, 9), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_9', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 4, '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__native_batch_norm_legit_cat_convolution_repeat_9(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3, out_ptr4, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    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
    r3 = rindex
    x1 = xindex % 4
    x2 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x0 % 4), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_out_ptr0 + (r3 + (16*x0)), xmask, other=0.0)
    tmp2 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tl.full([1, 1], 0, tl.int32)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.where(xmask, tmp6, 0)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp11 = tl.where(xmask, tmp9, 0)
    tmp12 = tl.sum(tmp11, 1)[:, None]
    tmp13 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp14 = tmp13.to(tl.float32)
    tmp15 = tmp12 / tmp14
    tmp16 = tmp6 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tl.broadcast_to(tmp17, [XBLOCK, RBLOCK])
    tmp20 = tl.where(xmask, tmp18, 0)
    tmp21 = tl.sum(tmp20, 1)[:, None]
    tmp22 = tmp5 - tmp15
    tmp23 = 16.0
    tmp24 = tmp21 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tmp28 = tmp22 * tmp27
    tmp29 = tmp28 * tmp0
    tmp31 = tmp29 + tmp30
    tl.store(out_ptr0 + (x0), tmp0, xmask)
    tl.store(in_out_ptr0 + (r3 + (16*x0)), tmp3, xmask)
    tl.store(out_ptr3 + (r3 + (16*x1) + (256*x2)), tmp31, xmask)
    tl.store(out_ptr4 + (x0), tmp27, xmask)
    tl.store(out_ptr1 + (x0), tmp15, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/2b/c2bkgnd3cuthxjljazr4mj42avg33dzpmylkadwq2fkytdy5pisd.py
# Topologically Sorted Source Nodes: [pad_3], Original ATen: [aten.copy]
# Source node to ATen node mapping:
#   pad_3 => copy_15
# Graph fragment:
#   %copy_15 : [num_users=1] = call_function[target=torch.ops.aten.copy.default](args = (%slice_96, %slice_97), kwargs = {})
#   %slice_scatter_default_18 : [num_users=1] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_tensor_3, %copy_15, 2, 1, 5), kwargs = {})
#   %slice_scatter_default_19 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%empty_3, %slice_scatter_default_18, 3, 1, 5), kwargs = {})
#   %slice_scatter_default_20 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_19, %slice_106, 3, 0, 1), kwargs = {})
#   %slice_scatter_default_21 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_20, %slice_112, 3, 5, 6), kwargs = {})
triton_poi_fused_copy_10 = async_compile.triton('triton_poi_fused_copy_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=[4096], 
    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_copy_10', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 8, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_copy_10(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = (xindex // 6) % 6
    x2 = (xindex // 36)
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp15 & xmask, other=0.0)
    tmp17 = tl.load(in_ptr1 + (x4), tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float("nan")
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + ((-9) + x0 + (4*x1) + (16*x2)), tmp29 & xmask, other=0.0)
    tmp31 = tl.load(in_ptr1 + ((-4) + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + ((-1) + x0 + (4*x1) + (16*x2)), tmp45 & xmask, other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + ((-5) + x0 + (4*x1) + (16*x2)), tmp54 & xmask, other=0.0)
    tmp56 = tl.load(in_ptr1 + (x4), tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + (x4), tmp62, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/yq/cyqia2t74oth2xmpw3wy67dajhytppay533s3qznmeunx7sbnrf5.py
# Topologically Sorted Source Nodes: [], Original ATen: []
# Source node to ATen node mapping:
# Graph fragment:
#   %slice_scatter_default_22 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_21, %slice_118, 2, 0, 1), kwargs = {})
#   %slice_scatter_default_23 : [num_users=2] = call_function[target=torch.ops.aten.slice_scatter.default](args = (%slice_scatter_default_22, %slice_124, 2, 5, 6), kwargs = {})
triton_poi_fused_11 = async_compile.triton('triton_poi_fused_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=[4096], 
    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_11', '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_11(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = (xindex // 6) % 6
    x0 = xindex % 6
    x2 = (xindex // 36)
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + (x3), xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = (-4) + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp6 & xmask, eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + ((-24) + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + (36*x2)), tmp12 & xmask, eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + (x3), tmp16, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/3z/c3z7somucyhaymf7nx4yl5ne7522e2dc6gxs2vz3qdu6shtmayoa.py
# Topologically Sorted Source Nodes: [out], Original ATen: [aten.convolution]
# Source node to ATen node mapping:
#   out => convolution_3
# Graph fragment:
#   %convolution_3 : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%slice_scatter_default_23, %primals_14, %primals_15, [1, 1], [0, 0], [1, 1], False, [0, 0], 1), kwargs = {})
triton_poi_fused_convolution_12 = async_compile.triton('triton_poi_fused_convolution_12', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[256], 
    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_convolution_12', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_convolution_12(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = (xindex // 16) % 4
    tmp0 = tl.load(in_out_ptr0 + (x3), xmask)
    tmp1 = tl.load(in_ptr0 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x3), tmp2, xmask)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 3, 3), (36, 9, 3, 1))
    assert_size_stride(primals_2, (4, ), (1, ))
    assert_size_stride(primals_3, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_4, (4, ), (1, ))
    assert_size_stride(primals_5, (4, ), (1, ))
    assert_size_stride(primals_6, (4, 8, 3, 3), (72, 9, 3, 1))
    assert_size_stride(primals_7, (4, ), (1, ))
    assert_size_stride(primals_8, (4, ), (1, ))
    assert_size_stride(primals_9, (4, ), (1, ))
    assert_size_stride(primals_10, (4, 12, 3, 3), (108, 9, 3, 1))
    assert_size_stride(primals_11, (4, ), (1, ))
    assert_size_stride(primals_12, (4, ), (1, ))
    assert_size_stride(primals_13, (4, ), (1, ))
    assert_size_stride(primals_14, (4, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_15, (4, ), (1, ))
    buf0 = empty_strided_cuda((4, 4, 6, 6), (144, 36, 6, 1), torch.float32)
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((4, 4, 6, 6), (144, 36, 6, 1), torch.float32)
        # Topologically Sorted Source Nodes: [pad], Original ATen: [aten.copy]
        stream0 = get_raw_stream(0)
        triton_poi_fused_copy_0.run(primals_3, buf0, buf1, 576, grid=grid(576), stream=stream0)
        buf2 = buf0; del buf0  # reuse
        # Topologically Sorted Source Nodes: [], Original ATen: []
        triton_poi_fused_1.run(buf1, buf2, 576, grid=grid(576), stream=stream0)
        del buf1
        # Topologically Sorted Source Nodes: [x1], Original ATen: [aten.convolution]
        buf3 = extern_kernels.convolution(buf2, primals_1, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 4, 4, 4), (64, 16, 4, 1))
        buf5 = empty_strided_cuda((16, ), (1, ), torch.float32)
        buf4 = buf3; del buf3  # reuse
        buf6 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32)
        buf13 = empty_strided_cuda((4, 8, 4, 4), (128, 16, 4, 1), torch.float32)
        buf11 = reinterpret_tensor(buf13, (4, 4, 4, 4), (128, 16, 4, 1), 0)  # alias
        buf28 = empty_strided_cuda((4, 12, 4, 4), (192, 16, 4, 1), torch.float32)
        buf26 = reinterpret_tensor(buf28, (4, 4, 4, 4), (192, 16, 4, 1), 64)  # alias
        buf43 = empty_strided_cuda((4, 16, 4, 4), (256, 16, 4, 1), torch.float32)
        buf41 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 128)  # alias
        buf9 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32)
        # Topologically Sorted Source Nodes: [x1, x1_2, x2, x3, x4], Original ATen: [aten.convolution, aten.repeat, aten._native_batch_norm_legit, aten.cat]
        triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_2.run(buf4, primals_4, primals_2, primals_5, buf5, buf6, buf11, buf26, buf41, buf9, 16, 16, grid=grid(16), stream=stream0)
        del primals_2
        del primals_4
        del primals_5
        buf12 = reinterpret_tensor(buf13, (4, 4, 4, 4), (128, 16, 4, 1), 64)  # alias
        buf27 = reinterpret_tensor(buf28, (4, 4, 4, 4), (192, 16, 4, 1), 128)  # alias
        buf42 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 192)  # alias
        # Topologically Sorted Source Nodes: [x2, x3, x4], Original ATen: [aten.cat]
        triton_poi_fused_cat_3.run(primals_3, buf12, buf27, buf42, 256, grid=grid(256), stream=stream0)
        del primals_3
        buf14 = empty_strided_cuda((4, 8, 6, 6), (288, 36, 6, 1), torch.float32)
        buf15 = empty_strided_cuda((4, 8, 6, 6), (288, 36, 6, 1), torch.float32)
        # Topologically Sorted Source Nodes: [pad_1], Original ATen: [aten.copy]
        triton_poi_fused_copy_4.run(buf13, buf14, buf15, 1152, grid=grid(1152), stream=stream0)
        del buf11
        del buf12
        del buf13
        buf16 = buf14; del buf14  # reuse
        # Topologically Sorted Source Nodes: [], Original ATen: []
        triton_poi_fused_5.run(buf15, buf16, 1152, grid=grid(1152), stream=stream0)
        del buf15
        # Topologically Sorted Source Nodes: [x2_1], Original ATen: [aten.convolution]
        buf17 = extern_kernels.convolution(buf16, primals_6, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 4, 4, 4), (64, 16, 4, 1))
        buf19 = empty_strided_cuda((16, ), (1, ), torch.float32)
        buf18 = buf17; del buf17  # reuse
        buf20 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32)
        buf25 = reinterpret_tensor(buf28, (4, 4, 4, 4), (192, 16, 4, 1), 0)  # alias
        buf40 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 64)  # alias
        buf23 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32)
        # Topologically Sorted Source Nodes: [x2_1, x2_3, x3, x4], Original ATen: [aten.convolution, aten.repeat, aten._native_batch_norm_legit, aten.cat]
        triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_6.run(buf18, primals_8, primals_7, primals_9, buf19, buf20, buf25, buf40, buf23, 16, 16, grid=grid(16), stream=stream0)
        del primals_7
        del primals_8
        del primals_9
        buf29 = empty_strided_cuda((4, 12, 6, 6), (432, 36, 6, 1), torch.float32)
        buf30 = empty_strided_cuda((4, 12, 6, 6), (432, 36, 6, 1), torch.float32)
        # Topologically Sorted Source Nodes: [pad_2], Original ATen: [aten.copy]
        triton_poi_fused_copy_7.run(buf28, buf29, buf30, 1728, grid=grid(1728), stream=stream0)
        del buf25
        del buf26
        del buf27
        del buf28
        buf31 = buf29; del buf29  # reuse
        # Topologically Sorted Source Nodes: [], Original ATen: []
        triton_poi_fused_8.run(buf30, buf31, 1728, grid=grid(1728), stream=stream0)
        del buf30
        # Topologically Sorted Source Nodes: [x3_1], Original ATen: [aten.convolution]
        buf32 = extern_kernels.convolution(buf31, primals_10, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf32, (4, 4, 4, 4), (64, 16, 4, 1))
        buf34 = empty_strided_cuda((16, ), (1, ), torch.float32)
        buf33 = buf32; del buf32  # reuse
        buf35 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32)
        buf39 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 0)  # alias
        buf38 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32)
        # Topologically Sorted Source Nodes: [x3_1, x3_3, x4], Original ATen: [aten.convolution, aten.repeat, aten._native_batch_norm_legit, aten.cat]
        triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_9.run(buf33, primals_12, primals_11, primals_13, buf34, buf35, buf39, buf38, 16, 16, grid=grid(16), stream=stream0)
        del primals_11
        del primals_12
        del primals_13
        buf44 = empty_strided_cuda((4, 16, 6, 6), (576, 36, 6, 1), torch.float32)
        buf45 = empty_strided_cuda((4, 16, 6, 6), (576, 36, 6, 1), torch.float32)
        # Topologically Sorted Source Nodes: [pad_3], Original ATen: [aten.copy]
        triton_poi_fused_copy_10.run(buf43, buf44, buf45, 2304, grid=grid(2304), stream=stream0)
        del buf39
        del buf40
        del buf41
        del buf42
        del buf43
        buf46 = buf44; del buf44  # reuse
        # Topologically Sorted Source Nodes: [], Original ATen: []
        triton_poi_fused_11.run(buf45, buf46, 2304, grid=grid(2304), stream=stream0)
        del buf45
        # Topologically Sorted Source Nodes: [out], Original ATen: [aten.convolution]
        buf47 = extern_kernels.convolution(buf46, primals_14, stride=(1, 1), padding=(0, 0), dilation=(1, 1), transposed=False, output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf47, (4, 4, 4, 4), (64, 16, 4, 1))
        buf48 = buf47; del buf47  # reuse
        # Topologically Sorted Source Nodes: [out], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_12.run(buf48, primals_15, 256, grid=grid(256), stream=stream0)
        del primals_15
    return (buf48, primals_1, primals_6, primals_10, primals_14, buf2, buf4, buf5, reinterpret_tensor(buf9, (16, ), (1, ), 0), buf16, buf18, buf19, reinterpret_tensor(buf23, (16, ), (1, ), 0), buf31, buf33, buf34, reinterpret_tensor(buf38, (16, ), (1, ), 0), buf46, reinterpret_tensor(buf35, (1, 16, 1, 1), (16, 1, 1, 1), 0), reinterpret_tensor(buf20, (1, 16, 1, 1), (16, 1, 1, 1), 0), reinterpret_tensor(buf6, (1, 16, 1, 1), (16, 1, 1, 1), 0), )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((4, 4, 3, 3), (36, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((4, 8, 3, 3), (72, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_7 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_8 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((4, 12, 3, 3), (108, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((4, 16, 3, 3), (144, 9, 3, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, primals_11, primals_12, primals_13, primals_14, primals_15])
    return print_performance(fn, times=times, repeat=repeat)


if __name__ == "__main__":
    from torch._inductor.wrapper_benchmark import compiled_module_main
    compiled_module_main('None', benchmark_compiled_module)

import torch
from torch import nn
from torch.nn import init as init


class ConvBlockINEDense(nn.Module):

    def __init__(self, n_ch, act='relu', ksize=3, norm='in', padding_mode=
        'circular'):
        super().__init__()
        padding = (ksize - 1) // 2
        if act == 'lrelu':
            self.act = nn.LeakyReLU(0.2, True)
        else:
            self.act = nn.ReLU(True)
        self.conv1 = nn.Conv2d(n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.conv2 = nn.Conv2d(2 * n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.conv3 = nn.Conv2d(3 * n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.conv4 = nn.Conv2d(4 * n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.norm = norm
        if norm == 'in':
            self.norm1 = nn.InstanceNorm2d(n_ch, affine=True)
            self.norm2 = nn.InstanceNorm2d(n_ch, affine=True)
            self.norm3 = nn.InstanceNorm2d(n_ch, affine=True)

    def forward(self, x, g=None, b=None):
        x1 = self.conv1(x)
        x1 = self.act(x1)
        if self.norm == 'in':
            x1 = self.norm1(x1)
        x2 = torch.cat([x1, x], dim=1)
        x2 = self.conv2(x2)
        x2 = self.act(x2)
        if self.norm == 'in':
            x2 = self.norm2(x2)
        x3 = torch.cat([x2, x1, x], dim=1)
        x3 = self.conv3(x3)
        x3 = self.act(x3)
        if self.norm == 'in':
            x3 = self.norm3(x3)
        x4 = torch.cat([x3, x2, x1, x], dim=1)
        out = self.conv4(x4)
        return out


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


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

import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch import nn
from torch.nn import init as init
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_poi_fused_copy_0(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 576
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 6
    x2 = xindex // 36
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp15 & xmask,
        other=0.0)
    tmp17 = tl.load(in_ptr1 + x4, tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float('nan')
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + (-9 + x0 + 4 * x1 + 16 * x2), tmp29 & xmask,
        other=0.0)
    tmp31 = tl.load(in_ptr1 + (-4 + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + (-1 + x0 + 4 * x1 + 16 * x2), tmp45 & xmask,
        other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp54 & xmask,
        other=0.0)
    tmp56 = tl.load(in_ptr1 + x4, tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + x4, tmp62, xmask)


@triton.jit
def triton_poi_fused_1(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 576
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 6 % 6
    x0 = xindex % 6
    x2 = xindex // 36
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp6 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + (-24 + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp12 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + x3, tmp16, xmask)


@triton.jit
def triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_2(
    in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr4,
    out_ptr5, out_ptr6, out_ptr7, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    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
    r3 = rindex
    x1 = xindex % 4
    x2 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0 % 4, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_out_ptr0 + (r3 + 16 * x0), xmask, other=0.0)
    tmp2 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + x0 % 4, xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tl.full([1, 1], 0, tl.int32)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tl.where(xmask, tmp6, 0)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp11 = tl.where(xmask, tmp9, 0)
    tmp12 = tl.sum(tmp11, 1)[:, None]
    tmp13 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp14 = tmp13.to(tl.float32)
    tmp15 = tmp12 / tmp14
    tmp16 = tmp6 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tl.broadcast_to(tmp17, [XBLOCK, RBLOCK])
    tmp20 = tl.where(xmask, tmp18, 0)
    tmp21 = tl.sum(tmp20, 1)[:, None]
    tmp22 = tmp5 - tmp15
    tmp23 = 16.0
    tmp24 = tmp21 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tmp28 = tmp22 * tmp27
    tmp29 = tmp28 * tmp0
    tmp31 = tmp29 + tmp30
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tl.store(in_out_ptr0 + (r3 + 16 * x0), tmp3, xmask)
    tl.store(out_ptr4 + (r3 + 16 * x1 + 128 * x2), tmp31, xmask)
    tl.store(out_ptr5 + (r3 + 16 * x1 + 192 * x2), tmp31, xmask)
    tl.store(out_ptr6 + (r3 + 16 * x1 + 256 * x2), tmp31, xmask)
    tl.store(out_ptr7 + x0, tmp27, xmask)
    tl.store(out_ptr1 + x0, tmp15, xmask)


@triton.jit
def triton_poi_fused_cat_3(in_ptr0, out_ptr0, out_ptr1, out_ptr2, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 64
    x1 = xindex // 64
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tl.store(out_ptr0 + (x0 + 128 * x1), tmp0, xmask)
    tl.store(out_ptr1 + (x0 + 192 * x1), tmp0, xmask)
    tl.store(out_ptr2 + (x0 + 256 * x1), tmp0, xmask)


@triton.jit
def triton_poi_fused_copy_4(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 6
    x2 = xindex // 36
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp15 & xmask,
        other=0.0)
    tmp17 = tl.load(in_ptr1 + x4, tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float('nan')
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + (-9 + x0 + 4 * x1 + 16 * x2), tmp29 & xmask,
        other=0.0)
    tmp31 = tl.load(in_ptr1 + (-4 + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + (-1 + x0 + 4 * x1 + 16 * x2), tmp45 & xmask,
        other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp54 & xmask,
        other=0.0)
    tmp56 = tl.load(in_ptr1 + x4, tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + x4, tmp62, xmask)


@triton.jit
def triton_poi_fused_5(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 6 % 6
    x0 = xindex % 6
    x2 = xindex // 36
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp6 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + (-24 + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp12 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + x3, tmp16, xmask)


@triton.jit
def triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_6(
    in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr4,
    out_ptr5, out_ptr6, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    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
    r3 = rindex
    x1 = xindex % 4
    x2 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0 % 4, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_out_ptr0 + (r3 + 16 * x0), xmask, other=0.0)
    tmp2 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + x0 % 4, xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tl.full([1, 1], 0, tl.int32)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tl.where(xmask, tmp6, 0)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp11 = tl.where(xmask, tmp9, 0)
    tmp12 = tl.sum(tmp11, 1)[:, None]
    tmp13 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp14 = tmp13.to(tl.float32)
    tmp15 = tmp12 / tmp14
    tmp16 = tmp6 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tl.broadcast_to(tmp17, [XBLOCK, RBLOCK])
    tmp20 = tl.where(xmask, tmp18, 0)
    tmp21 = tl.sum(tmp20, 1)[:, None]
    tmp22 = tmp5 - tmp15
    tmp23 = 16.0
    tmp24 = tmp21 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tmp28 = tmp22 * tmp27
    tmp29 = tmp28 * tmp0
    tmp31 = tmp29 + tmp30
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tl.store(in_out_ptr0 + (r3 + 16 * x0), tmp3, xmask)
    tl.store(out_ptr4 + (r3 + 16 * x1 + 192 * x2), tmp31, xmask)
    tl.store(out_ptr5 + (r3 + 16 * x1 + 256 * x2), tmp31, xmask)
    tl.store(out_ptr6 + x0, tmp27, xmask)
    tl.store(out_ptr1 + x0, tmp15, xmask)


@triton.jit
def triton_poi_fused_copy_7(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 1728
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 6
    x2 = xindex // 36
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp15 & xmask,
        other=0.0)
    tmp17 = tl.load(in_ptr1 + x4, tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float('nan')
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + (-9 + x0 + 4 * x1 + 16 * x2), tmp29 & xmask,
        other=0.0)
    tmp31 = tl.load(in_ptr1 + (-4 + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + (-1 + x0 + 4 * x1 + 16 * x2), tmp45 & xmask,
        other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp54 & xmask,
        other=0.0)
    tmp56 = tl.load(in_ptr1 + x4, tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + x4, tmp62, xmask)


@triton.jit
def triton_poi_fused_8(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1728
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 6 % 6
    x0 = xindex % 6
    x2 = xindex // 36
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp6 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + (-24 + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp12 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + x3, tmp16, xmask)


@triton.jit
def triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_9(
    in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr3,
    out_ptr4, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    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
    r3 = rindex
    x1 = xindex % 4
    x2 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x0 % 4, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_out_ptr0 + (r3 + 16 * x0), xmask, other=0.0)
    tmp2 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp30 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp4 = tl.full([1, 1], 0, tl.int32)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tl.where(xmask, tmp6, 0)
    tmp9 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp11 = tl.where(xmask, tmp9, 0)
    tmp12 = tl.sum(tmp11, 1)[:, None]
    tmp13 = tl.full([XBLOCK, 1], 16, tl.int32)
    tmp14 = tmp13.to(tl.float32)
    tmp15 = tmp12 / tmp14
    tmp16 = tmp6 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tl.broadcast_to(tmp17, [XBLOCK, RBLOCK])
    tmp20 = tl.where(xmask, tmp18, 0)
    tmp21 = tl.sum(tmp20, 1)[:, None]
    tmp22 = tmp5 - tmp15
    tmp23 = 16.0
    tmp24 = tmp21 / tmp23
    tmp25 = 1e-05
    tmp26 = tmp24 + tmp25
    tmp27 = libdevice.rsqrt(tmp26)
    tmp28 = tmp22 * tmp27
    tmp29 = tmp28 * tmp0
    tmp31 = tmp29 + tmp30
    tl.store(out_ptr0 + x0, tmp0, xmask)
    tl.store(in_out_ptr0 + (r3 + 16 * x0), tmp3, xmask)
    tl.store(out_ptr3 + (r3 + 16 * x1 + 256 * x2), tmp31, xmask)
    tl.store(out_ptr4 + x0, tmp27, xmask)
    tl.store(out_ptr1 + x0, tmp15, xmask)


@triton.jit
def triton_poi_fused_copy_10(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 6
    x2 = xindex // 36
    x4 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x0
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tmp0 >= tmp4
    tmp8 = tmp0 < tmp1
    tmp9 = tmp7 & tmp8
    tmp10 = tmp9 & tmp6
    tmp11 = x1
    tmp12 = tmp11 >= tmp4
    tmp13 = tmp11 < tmp1
    tmp14 = tmp12 & tmp13
    tmp15 = tmp14 & tmp10
    tmp16 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp15 & xmask,
        other=0.0)
    tmp17 = tl.load(in_ptr1 + x4, tmp10 & xmask, other=0.0)
    tmp18 = tl.where(tmp14, tmp16, tmp17)
    tmp19 = tl.full(tmp18.shape, 0.0, tmp18.dtype)
    tmp20 = tl.where(tmp10, tmp18, tmp19)
    tmp21 = float('nan')
    tmp22 = tl.where(tmp9, tmp20, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp6, tmp22, tmp23)
    tmp25 = tmp3 >= tmp4
    tmp26 = tmp3 < tmp1
    tmp27 = tmp25 & tmp26
    tmp28 = tmp27 & tmp2
    tmp29 = tmp14 & tmp28
    tmp30 = tl.load(in_ptr0 + (-9 + x0 + 4 * x1 + 16 * x2), tmp29 & xmask,
        other=0.0)
    tmp31 = tl.load(in_ptr1 + (-4 + x4), tmp28 & xmask, other=0.0)
    tmp32 = tl.where(tmp14, tmp30, tmp31)
    tmp33 = tl.full(tmp32.shape, 0.0, tmp32.dtype)
    tmp34 = tl.where(tmp28, tmp32, tmp33)
    tmp35 = tl.where(tmp27, tmp34, tmp21)
    tmp36 = tl.where(tmp5, tmp24, tmp35)
    tmp37 = tl.full(tmp36.shape, 0.0, tmp36.dtype)
    tmp38 = tl.where(tmp2, tmp36, tmp37)
    tmp39 = tmp0 < tmp4
    tmp40 = 4 + x0
    tmp41 = tmp40 >= tmp4
    tmp42 = tmp40 < tmp1
    tmp43 = tmp41 & tmp42
    tmp44 = tmp43 & tmp39
    tmp45 = tmp14 & tmp44
    tmp46 = tl.load(in_ptr0 + (-1 + x0 + 4 * x1 + 16 * x2), tmp45 & xmask,
        other=0.0)
    tmp47 = tl.load(in_ptr1 + (4 + x4), tmp44 & xmask, other=0.0)
    tmp48 = tl.where(tmp14, tmp46, tmp47)
    tmp49 = tl.full(tmp48.shape, 0.0, tmp48.dtype)
    tmp50 = tl.where(tmp44, tmp48, tmp49)
    tmp51 = tl.where(tmp43, tmp50, tmp21)
    tmp52 = tl.full(tmp51.shape, 0.0, tmp51.dtype)
    tmp53 = tl.where(tmp39, tmp51, tmp52)
    tmp54 = tmp14 & tmp9
    tmp55 = tl.load(in_ptr0 + (-5 + x0 + 4 * x1 + 16 * x2), tmp54 & xmask,
        other=0.0)
    tmp56 = tl.load(in_ptr1 + x4, tmp9 & xmask, other=0.0)
    tmp57 = tl.where(tmp14, tmp55, tmp56)
    tmp58 = tl.full(tmp57.shape, 0.0, tmp57.dtype)
    tmp59 = tl.where(tmp9, tmp57, tmp58)
    tmp60 = tl.where(tmp9, tmp59, tmp21)
    tmp61 = tl.where(tmp39, tmp53, tmp60)
    tmp62 = tl.where(tmp2, tmp38, tmp61)
    tl.store(out_ptr0 + x4, tmp62, xmask)


@triton.jit
def triton_poi_fused_11(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 6 % 6
    x0 = xindex % 6
    x2 = xindex // 36
    x3 = xindex
    tmp14 = tl.load(in_ptr0 + x3, xmask)
    tmp0 = x1
    tmp1 = tl.full([1], 5, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = -4 + x1
    tmp4 = tl.full([1], 1, tl.int64)
    tmp5 = tmp3 < tmp4
    tmp6 = tmp5 & tmp2
    tmp7 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp6 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp8 = tl.load(in_ptr0 + (-24 + x3), tmp2 & xmask, other=0.0)
    tmp9 = tl.where(tmp5, tmp7, tmp8)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tmp12 = tmp0 < tmp4
    tmp13 = tl.load(in_ptr0 + (24 + x0 + 36 * x2), tmp12 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp15 = tl.where(tmp12, tmp13, tmp14)
    tmp16 = tl.where(tmp2, tmp11, tmp15)
    tl.store(out_ptr0 + x3, tmp16, xmask)


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


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15) = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 3, 3), (36, 9, 3, 1))
    assert_size_stride(primals_2, (4,), (1,))
    assert_size_stride(primals_3, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_4, (4,), (1,))
    assert_size_stride(primals_5, (4,), (1,))
    assert_size_stride(primals_6, (4, 8, 3, 3), (72, 9, 3, 1))
    assert_size_stride(primals_7, (4,), (1,))
    assert_size_stride(primals_8, (4,), (1,))
    assert_size_stride(primals_9, (4,), (1,))
    assert_size_stride(primals_10, (4, 12, 3, 3), (108, 9, 3, 1))
    assert_size_stride(primals_11, (4,), (1,))
    assert_size_stride(primals_12, (4,), (1,))
    assert_size_stride(primals_13, (4,), (1,))
    assert_size_stride(primals_14, (4, 16, 3, 3), (144, 9, 3, 1))
    assert_size_stride(primals_15, (4,), (1,))
    buf0 = empty_strided_cuda((4, 4, 6, 6), (144, 36, 6, 1), torch.float32)
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((4, 4, 6, 6), (144, 36, 6, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_copy_0[grid(576)](primals_3, buf0, buf1, 576,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf2 = buf0
        del buf0
        triton_poi_fused_1[grid(576)](buf1, buf2, 576, XBLOCK=256,
            num_warps=4, num_stages=1)
        del buf1
        buf3 = extern_kernels.convolution(buf2, primals_1, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 4, 4, 4), (64, 16, 4, 1))
        buf5 = empty_strided_cuda((16,), (1,), torch.float32)
        buf4 = buf3
        del buf3
        buf6 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32
            )
        buf13 = empty_strided_cuda((4, 8, 4, 4), (128, 16, 4, 1), torch.float32
            )
        buf11 = reinterpret_tensor(buf13, (4, 4, 4, 4), (128, 16, 4, 1), 0)
        buf28 = empty_strided_cuda((4, 12, 4, 4), (192, 16, 4, 1), torch.
            float32)
        buf26 = reinterpret_tensor(buf28, (4, 4, 4, 4), (192, 16, 4, 1), 64)
        buf43 = empty_strided_cuda((4, 16, 4, 4), (256, 16, 4, 1), torch.
            float32)
        buf41 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 128)
        buf9 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.float32
            )
        triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_2[grid
            (16)](buf4, primals_4, primals_2, primals_5, buf5, buf6, buf11,
            buf26, buf41, buf9, 16, 16, XBLOCK=1, num_warps=2, num_stages=1)
        del primals_2
        del primals_4
        del primals_5
        buf12 = reinterpret_tensor(buf13, (4, 4, 4, 4), (128, 16, 4, 1), 64)
        buf27 = reinterpret_tensor(buf28, (4, 4, 4, 4), (192, 16, 4, 1), 128)
        buf42 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 192)
        triton_poi_fused_cat_3[grid(256)](primals_3, buf12, buf27, buf42, 
            256, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_3
        buf14 = empty_strided_cuda((4, 8, 6, 6), (288, 36, 6, 1), torch.float32
            )
        buf15 = empty_strided_cuda((4, 8, 6, 6), (288, 36, 6, 1), torch.float32
            )
        triton_poi_fused_copy_4[grid(1152)](buf13, buf14, buf15, 1152,
            XBLOCK=128, num_warps=4, num_stages=1)
        del buf11
        del buf12
        del buf13
        buf16 = buf14
        del buf14
        triton_poi_fused_5[grid(1152)](buf15, buf16, 1152, XBLOCK=128,
            num_warps=4, num_stages=1)
        del buf15
        buf17 = extern_kernels.convolution(buf16, primals_6, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf17, (4, 4, 4, 4), (64, 16, 4, 1))
        buf19 = empty_strided_cuda((16,), (1,), torch.float32)
        buf18 = buf17
        del buf17
        buf20 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.
            float32)
        buf25 = reinterpret_tensor(buf28, (4, 4, 4, 4), (192, 16, 4, 1), 0)
        buf40 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 64)
        buf23 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.
            float32)
        triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_6[grid
            (16)](buf18, primals_8, primals_7, primals_9, buf19, buf20,
            buf25, buf40, buf23, 16, 16, XBLOCK=8, num_warps=2, num_stages=1)
        del primals_7
        del primals_8
        del primals_9
        buf29 = empty_strided_cuda((4, 12, 6, 6), (432, 36, 6, 1), torch.
            float32)
        buf30 = empty_strided_cuda((4, 12, 6, 6), (432, 36, 6, 1), torch.
            float32)
        triton_poi_fused_copy_7[grid(1728)](buf28, buf29, buf30, 1728,
            XBLOCK=256, num_warps=4, num_stages=1)
        del buf25
        del buf26
        del buf27
        del buf28
        buf31 = buf29
        del buf29
        triton_poi_fused_8[grid(1728)](buf30, buf31, 1728, XBLOCK=256,
            num_warps=4, num_stages=1)
        del buf30
        buf32 = extern_kernels.convolution(buf31, primals_10, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf32, (4, 4, 4, 4), (64, 16, 4, 1))
        buf34 = empty_strided_cuda((16,), (1,), torch.float32)
        buf33 = buf32
        del buf32
        buf35 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.
            float32)
        buf39 = reinterpret_tensor(buf43, (4, 4, 4, 4), (256, 16, 4, 1), 0)
        buf38 = empty_strided_cuda((1, 16, 1, 1), (16, 1, 16, 16), torch.
            float32)
        triton_per_fused__native_batch_norm_legit_cat_convolution_repeat_9[grid
            (16)](buf33, primals_12, primals_11, primals_13, buf34, buf35,
            buf39, buf38, 16, 16, XBLOCK=8, num_warps=2, num_stages=1)
        del primals_11
        del primals_12
        del primals_13
        buf44 = empty_strided_cuda((4, 16, 6, 6), (576, 36, 6, 1), torch.
            float32)
        buf45 = empty_strided_cuda((4, 16, 6, 6), (576, 36, 6, 1), torch.
            float32)
        triton_poi_fused_copy_10[grid(2304)](buf43, buf44, buf45, 2304,
            XBLOCK=256, num_warps=4, num_stages=1)
        del buf39
        del buf40
        del buf41
        del buf42
        del buf43
        buf46 = buf44
        del buf44
        triton_poi_fused_11[grid(2304)](buf45, buf46, 2304, XBLOCK=256,
            num_warps=4, num_stages=1)
        del buf45
        buf47 = extern_kernels.convolution(buf46, primals_14, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf47, (4, 4, 4, 4), (64, 16, 4, 1))
        buf48 = buf47
        del buf47
        triton_poi_fused_convolution_12[grid(256)](buf48, primals_15, 256,
            XBLOCK=256, num_warps=4, num_stages=1)
        del primals_15
    return (buf48, primals_1, primals_6, primals_10, primals_14, buf2, buf4,
        buf5, reinterpret_tensor(buf9, (16,), (1,), 0), buf16, buf18, buf19,
        reinterpret_tensor(buf23, (16,), (1,), 0), buf31, buf33, buf34,
        reinterpret_tensor(buf38, (16,), (1,), 0), buf46,
        reinterpret_tensor(buf35, (1, 16, 1, 1), (16, 1, 1, 1), 0),
        reinterpret_tensor(buf20, (1, 16, 1, 1), (16, 1, 1, 1), 0),
        reinterpret_tensor(buf6, (1, 16, 1, 1), (16, 1, 1, 1), 0))


class ConvBlockINEDenseNew(nn.Module):

    def __init__(self, n_ch, act='relu', ksize=3, norm='in', padding_mode=
        'circular'):
        super().__init__()
        padding = (ksize - 1) // 2
        if act == 'lrelu':
            self.act = nn.LeakyReLU(0.2, True)
        else:
            self.act = nn.ReLU(True)
        self.conv1 = nn.Conv2d(n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.conv2 = nn.Conv2d(2 * n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.conv3 = nn.Conv2d(3 * n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.conv4 = nn.Conv2d(4 * n_ch, n_ch, kernel_size=ksize, padding=
            padding, padding_mode=padding_mode)
        self.norm = norm
        if norm == 'in':
            self.norm1 = nn.InstanceNorm2d(n_ch, affine=True)
            self.norm2 = nn.InstanceNorm2d(n_ch, affine=True)
            self.norm3 = nn.InstanceNorm2d(n_ch, affine=True)

    def forward(self, input_0):
        primals_1 = self.conv1.weight
        primals_2 = self.conv1.bias
        primals_6 = self.conv2.weight
        primals_4 = self.conv2.bias
        primals_10 = self.conv3.weight
        primals_5 = self.conv3.bias
        primals_14 = self.conv4.weight
        primals_7 = self.conv4.bias
        primals_8 = self.norm1.weight
        primals_9 = self.norm1.bias
        primals_11 = self.norm2.weight
        primals_12 = self.norm2.bias
        primals_13 = self.norm3.weight
        primals_15 = self.norm3.bias
        primals_3 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9,
            primals_10, primals_11, primals_12, primals_13, primals_14,
            primals_15])
        return output[0]
