# 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/vw/cvwzmrf7u7j4rr5x5bjsxorzvl7rkn2io72j5uk3mjnapf4ukldf.py
# Topologically Sorted Source Nodes: [_weight_norm], Original ATen: [aten._weight_norm_interface]
# Source node to ATen node mapping:
#   _weight_norm => div, mul, pow_1, pow_2, sum_1
# Graph fragment:
#   %pow_1 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%primals_3, 2), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_1, [1, 2], True), kwargs = {})
#   %pow_2 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sum_1, 0.5), kwargs = {})
#   %div : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%primals_2, %pow_2), kwargs = {})
#   %mul : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_3, %div), kwargs = {})
triton_per_fused__weight_norm_interface_0 = async_compile.triton('triton_per_fused__weight_norm_interface_0', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.persistent_reduction(
    size_hints=[4, 16],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 5), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused__weight_norm_interface_0', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 1, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused__weight_norm_interface_0(in_out_ptr0, in_ptr0, in_ptr1, out_ptr0, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    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)
    r1 = rindex
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (r1 + (16*x0)), xmask, other=0.0)
    tmp7 = tl.load(in_ptr1 + (x0), xmask, eviction_policy='evict_last')
    tmp1 = tmp0 * tmp0
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp4 = tl.where(xmask, tmp2, 0)
    tmp5 = tl.sum(tmp4, 1)[:, None]
    tmp6 = libdevice.sqrt(tmp5)
    tmp8 = tmp7 / tmp6
    tmp9 = tmp0 * tmp8
    tl.debug_barrier()
    tl.store(in_out_ptr0 + (x0), tmp6, xmask)
    tl.store(out_ptr0 + (r1 + (16*x0)), tmp9, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/5i/c5iuv6v7eggudqpwvokzc6nbwpfull4j36zkwmtjfwwtnhluvvhi.py
# Topologically Sorted Source Nodes: [input_1], Original ATen: [aten.convolution]
# Source node to ATen node mapping:
#   input_1 => convolution
# Graph fragment:
#   %convolution : [num_users=1] = call_function[target=torch.ops.aten.convolution.default](args = (%permute, %mul, %primals_4, [1], [3], [1], False, [0], 1), kwargs = {})
triton_poi_fused_convolution_1 = async_compile.triton('triton_poi_fused_convolution_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=[16, 4], tile_hint=TileHint.SQUARE,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32', 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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_convolution_1', '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_convolution_1(in_ptr0, out_ptr0, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 16
    xnumel = 4
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y0 = yindex % 4
    y1 = (yindex // 4)
    y3 = yindex
    tmp0 = tl.load(in_ptr0 + (y0 + (4*x2) + (16*y1)), xmask & ymask, eviction_policy='evict_last')
    tl.store(out_ptr0 + (x2 + (4*y3)), tmp0, xmask & ymask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/s6/cs6esq4gxutdvfqbp5wxymmqmea4w5gmnweryjopnykrdwm5amk2.py
# Topologically Sorted Source Nodes: [input_2, input_3], Original ATen: [aten.clone, aten.leaky_relu]
# Source node to ATen node mapping:
#   input_2 => clone
#   input_3 => gt, mul_1, where
# Graph fragment:
#   %clone : [num_users=3] = call_function[target=torch.ops.aten.clone.default](args = (%slice_3,), kwargs = {memory_format: torch.contiguous_format})
#   %gt : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%clone, 0), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%clone, 0.01), kwargs = {})
#   %where : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%gt, %clone, %mul_1), kwargs = {})
triton_poi_fused_clone_leaky_relu_2 = async_compile.triton('triton_poi_fused_clone_leaky_relu_2', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i1', 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_clone_leaky_relu_2', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_clone_leaky_relu_2(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x3 = (xindex // 4)
    x1 = (xindex // 4) % 4
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (7*x3)), xmask)
    tmp1 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tl.store(out_ptr0 + (x4), tmp4, xmask)
    tl.store(out_ptr1 + (x4), tmp7, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/6w/c6wlczr472hjjxcqvwmsumjysp3ezdoa3khpkk64bjpckccevqn2.py
# Topologically Sorted Source Nodes: [input_6, input_7, add, input_9], Original ATen: [aten.clone, aten.leaky_relu, aten.add]
# Source node to ATen node mapping:
#   add => add
#   input_6 => clone_2
#   input_7 => gt_1, mul_3, where_1
#   input_9 => gt_2, mul_4, where_2
# Graph fragment:
#   %clone_2 : [num_users=3] = call_function[target=torch.ops.aten.clone.default](args = (%slice_6,), kwargs = {memory_format: torch.contiguous_format})
#   %gt_1 : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%clone_2, 0), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%clone_2, 0.01), kwargs = {})
#   %where_1 : [num_users=1] = call_function[target=torch.ops.aten.where.self](args = (%gt_1, %clone_2, %mul_3), kwargs = {})
#   %add : [num_users=3] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_1, %permute), kwargs = {})
#   %gt_2 : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%add, 0), kwargs = {})
#   %mul_4 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%add, 0.01), kwargs = {})
#   %where_2 : [num_users=3] = call_function[target=torch.ops.aten.where.self](args = (%gt_2, %add, %mul_4), kwargs = {})
triton_poi_fused_add_clone_leaky_relu_3 = async_compile.triton('triton_poi_fused_add_clone_leaky_relu_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=[16, 4], tile_hint=TileHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*i1', 4: '*i1', 5: '*fp32', 6: 'i32', 7: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clone_leaky_relu_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 3, '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_add_clone_leaky_relu_3(in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr2, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 16
    xnumel = 4
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 4
    y1 = (yindex // 4)
    tmp0 = tl.load(in_ptr0 + (x2 + (7*y3)), xmask & ymask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (y0), ymask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr2 + (y0 + (4*x2) + (16*y1)), xmask & ymask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tmp9 = tmp7 + tmp8
    tmp10 = tmp9 > tmp3
    tmp11 = tmp9 * tmp5
    tmp12 = tl.where(tmp10, tmp9, tmp11)
    tl.store(out_ptr0 + (x2 + (4*y3)), tmp4, xmask & ymask)
    tl.store(out_ptr1 + (x2 + (4*y3)), tmp10, xmask & ymask)
    tl.store(out_ptr2 + (x2 + (4*y3)), tmp12, xmask & ymask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/tp/ctpv3tuhzvgnz3fs3yalkieisgps2k7khhxg5wwtzynv4t2lclo3.py
# Topologically Sorted Source Nodes: [input_11, input_12], Original ATen: [aten.clone, aten.leaky_relu]
# Source node to ATen node mapping:
#   input_11 => clone_4
#   input_12 => gt_3, mul_6, where_3
# Graph fragment:
#   %clone_4 : [num_users=3] = call_function[target=torch.ops.aten.clone.default](args = (%slice_9,), kwargs = {memory_format: torch.contiguous_format})
#   %gt_3 : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%clone_4, 0), kwargs = {})
#   %mul_6 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%clone_4, 0.01), kwargs = {})
#   %where_3 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%gt_3, %clone_4, %mul_6), kwargs = {})
triton_poi_fused_clone_leaky_relu_4 = async_compile.triton('triton_poi_fused_clone_leaky_relu_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*i1', 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_clone_leaky_relu_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_clone_leaky_relu_4(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x3 = (xindex // 4)
    x1 = (xindex // 4) % 4
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (10*x3)), xmask)
    tmp1 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tl.store(out_ptr0 + (x4), tmp4, xmask)
    tl.store(out_ptr1 + (x4), tmp7, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/fm/cfm4u32cggrpem5h3pn67wgrrvk2uivsamfskoaau3hr4tcydxf3.py
# Topologically Sorted Source Nodes: [input_15, input_16, add_1, input_18, output], Original ATen: [aten.clone, aten.leaky_relu, aten.add]
# Source node to ATen node mapping:
#   add_1 => add_1
#   input_15 => clone_6
#   input_16 => gt_4, mul_8, where_4
#   input_18 => gt_5
#   output => clone_8
# Graph fragment:
#   %clone_6 : [num_users=3] = call_function[target=torch.ops.aten.clone.default](args = (%slice_12,), kwargs = {memory_format: torch.contiguous_format})
#   %gt_4 : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%clone_6, 0), kwargs = {})
#   %mul_8 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%clone_6, 0.01), kwargs = {})
#   %where_4 : [num_users=1] = call_function[target=torch.ops.aten.where.self](args = (%gt_4, %clone_6, %mul_8), kwargs = {})
#   %add_1 : [num_users=3] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_4, %where_2), kwargs = {})
#   %gt_5 : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%add_1, 0), kwargs = {})
#   %clone_8 : [num_users=1] = call_function[target=torch.ops.aten.clone.default](args = (%permute_1,), kwargs = {memory_format: torch.contiguous_format})
triton_poi_fused_add_clone_leaky_relu_5 = async_compile.triton('triton_poi_fused_add_clone_leaky_relu_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=[16, 4], tile_hint=TileHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*i1', 4: '*i1', 5: '*fp32', 6: 'i32', 7: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clone_leaky_relu_5', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 3, '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_add_clone_leaky_relu_5(in_ptr0, in_ptr1, in_ptr2, out_ptr0, out_ptr1, out_ptr2, ynumel, xnumel, YBLOCK : tl.constexpr, XBLOCK : tl.constexpr):
    ynumel = 16
    xnumel = 4
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 4
    y1 = (yindex // 4)
    tmp0 = tl.load(in_ptr0 + (x2 + (10*y3)), xmask & ymask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr1 + (y0), ymask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr2 + (x2 + (4*y3)), xmask & ymask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tmp9 = tmp7 + tmp8
    tmp10 = tmp9 > tmp3
    tmp11 = tmp9 * tmp5
    tmp12 = tl.where(tmp10, tmp9, tmp11)
    tl.store(out_ptr0 + (x2 + (4*y3)), tmp4, xmask & ymask)
    tl.store(out_ptr1 + (x2 + (4*y3)), tmp10, xmask & ymask)
    tl.store(out_ptr2 + (y0 + (4*x2) + (16*y1)), tmp12, xmask & ymask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/bo/cboqxids2gle6skb62l6liqzdlripa535afaq5m42o7yizs2pqca.py
# Topologically Sorted Source Nodes: [output], Original ATen: [aten.add]
# Source node to ATen node mapping:
#   output => add_2
# Graph fragment:
#   %add_2 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%view_1, %primals_15), kwargs = {})
triton_poi_fused_add_6 = async_compile.triton('triton_poi_fused_add_6', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[32], 
    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_add_6', '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_add_6(in_out_ptr0, in_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 32
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 2
    tmp0 = tl.load(in_out_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (x0), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + (x2), tmp2, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/5r/c5r72jrislian373vvdicl3vxivbxnru6mpq5yitki3iwjxfb6pw.py
# Topologically Sorted Source Nodes: [output_3], Original ATen: [aten._softmax]
# Source node to ATen node mapping:
#   output_3 => amax, exp, sub
# Graph fragment:
#   %amax : [num_users=1] = call_function[target=torch.ops.aten.amax.default](args = (%view_5, [2], True), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%view_5, %amax), kwargs = {})
#   %exp : [num_users=2] = call_function[target=torch.ops.aten.exp.default](args = (%sub,), kwargs = {})
triton_poi_fused__softmax_7 = async_compile.triton('triton_poi_fused__softmax_7', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__softmax_7', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused__softmax_7(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (4*x1), xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp3 = triton_helpers.maximum(tmp1, tmp2)
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp0 - tmp7
    tmp9 = tl_math.exp(tmp8)
    tl.store(out_ptr0 + (x2), tmp9, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/ss/cssikys23rjgyx6zuolkgxgpp37foi237kzuvcgpbva6fztyiuc6.py
# Topologically Sorted Source Nodes: [output_3], Original ATen: [aten._softmax]
# Source node to ATen node mapping:
#   output_3 => div_4, sum_5
# Graph fragment:
#   %sum_5 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%exp, [2], True), kwargs = {})
#   %div_4 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%exp, %sum_5), kwargs = {})
triton_poi_fused__softmax_8 = async_compile.triton('triton_poi_fused__softmax_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused__softmax_8', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused__softmax_8(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = (xindex // 4)
    tmp0 = tl.load(in_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr0 + (4*x1), xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + (4*x1)), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp5 = tmp3 + tmp4
    tmp7 = tmp5 + tmp6
    tmp8 = tmp0 / tmp7
    tl.store(out_ptr0 + (x2), tmp8, 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, primals_16, primals_17, primals_18, primals_19 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_2, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_3, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_4, (4, ), (1, ))
    assert_size_stride(primals_5, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_6, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_7, (4, ), (1, ))
    assert_size_stride(primals_8, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_9, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_10, (4, ), (1, ))
    assert_size_stride(primals_11, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_12, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_13, (4, ), (1, ))
    assert_size_stride(primals_14, (2, 4), (4, 1))
    assert_size_stride(primals_15, (2, ), (1, ))
    assert_size_stride(primals_16, (1, 2), (2, 1))
    assert_size_stride(primals_17, (1, ), (1, ))
    assert_size_stride(primals_18, (4, 1), (1, 1))
    assert_size_stride(primals_19, (4, ), (1, ))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf1 = reinterpret_tensor(buf0, (4, 1, 1), (1, 1, 1), 0); del buf0  # reuse
        buf2 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [_weight_norm], Original ATen: [aten._weight_norm_interface]
        stream0 = get_raw_stream(0)
        triton_per_fused__weight_norm_interface_0.run(buf1, primals_3, primals_2, buf2, 4, 16, grid=grid(4), stream=stream0)
        buf3 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [input_1], Original ATen: [aten.convolution]
        triton_poi_fused_convolution_1.run(primals_1, buf3, 16, 4, grid=grid(16, 4), stream=stream0)
        # Topologically Sorted Source Nodes: [input_1], Original ATen: [aten.convolution]
        buf4 = extern_kernels.convolution(buf3, buf2, stride=(1,), padding=(3,), dilation=(1,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf4, (4, 4, 7), (28, 7, 1))
        buf5 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf6 = buf3; del buf3  # reuse
        # Topologically Sorted Source Nodes: [input_2, input_3], Original ATen: [aten.clone, aten.leaky_relu]
        triton_poi_fused_clone_leaky_relu_2.run(buf4, primals_4, buf5, buf6, 64, grid=grid(64), stream=stream0)
        del buf4
        del primals_4
        buf7 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf8 = reinterpret_tensor(buf7, (4, 1, 1), (1, 1, 1), 0); del buf7  # reuse
        buf9 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [_weight_norm_1], Original ATen: [aten._weight_norm_interface]
        triton_per_fused__weight_norm_interface_0.run(buf8, primals_6, primals_5, buf9, 4, 16, grid=grid(4), stream=stream0)
        # Topologically Sorted Source Nodes: [input_5], Original ATen: [aten.convolution]
        buf10 = extern_kernels.convolution(buf6, buf9, stride=(1,), padding=(3,), dilation=(1,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf10, (4, 4, 7), (28, 7, 1))
        buf11 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf12 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf13 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [input_6, input_7, add, input_9], Original ATen: [aten.clone, aten.leaky_relu, aten.add]
        triton_poi_fused_add_clone_leaky_relu_3.run(buf10, primals_7, primals_1, buf11, buf12, buf13, 16, 4, grid=grid(16, 4), stream=stream0)
        del buf10
        del primals_7
        buf14 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf15 = reinterpret_tensor(buf14, (4, 1, 1), (1, 1, 1), 0); del buf14  # reuse
        buf16 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [_weight_norm_2], Original ATen: [aten._weight_norm_interface]
        triton_per_fused__weight_norm_interface_0.run(buf15, primals_9, primals_8, buf16, 4, 16, grid=grid(4), stream=stream0)
        # Topologically Sorted Source Nodes: [input_10], Original ATen: [aten.convolution]
        buf17 = extern_kernels.convolution(buf13, buf16, stride=(1,), padding=(6,), dilation=(2,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf17, (4, 4, 10), (40, 10, 1))
        buf18 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf19 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [input_11, input_12], Original ATen: [aten.clone, aten.leaky_relu]
        triton_poi_fused_clone_leaky_relu_4.run(buf17, primals_10, buf18, buf19, 64, grid=grid(64), stream=stream0)
        del buf17
        del primals_10
        buf20 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf21 = reinterpret_tensor(buf20, (4, 1, 1), (1, 1, 1), 0); del buf20  # reuse
        buf22 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [_weight_norm_3], Original ATen: [aten._weight_norm_interface]
        triton_per_fused__weight_norm_interface_0.run(buf21, primals_12, primals_11, buf22, 4, 16, grid=grid(4), stream=stream0)
        # Topologically Sorted Source Nodes: [input_14], Original ATen: [aten.convolution]
        buf23 = extern_kernels.convolution(buf19, buf22, stride=(1,), padding=(6,), dilation=(2,), transposed=False, output_padding=(0,), groups=1, bias=None)
        assert_size_stride(buf23, (4, 4, 10), (40, 10, 1))
        buf24 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf25 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf26 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [input_15, input_16, add_1, input_18, output], Original ATen: [aten.clone, aten.leaky_relu, aten.add]
        triton_poi_fused_add_clone_leaky_relu_5.run(buf23, primals_13, buf13, buf24, buf25, buf26, 16, 4, grid=grid(16, 4), stream=stream0)
        del buf23
        del primals_13
        buf27 = empty_strided_cuda((16, 2), (2, 1), torch.float32)
        # Topologically Sorted Source Nodes: [output], Original ATen: [aten.mm]
        extern_kernels.mm(reinterpret_tensor(buf26, (16, 4), (4, 1), 0), reinterpret_tensor(primals_14, (4, 2), (1, 4), 0), out=buf27)
        buf28 = reinterpret_tensor(buf27, (4, 4, 2), (8, 2, 1), 0); del buf27  # reuse
        # Topologically Sorted Source Nodes: [output], Original ATen: [aten.add]
        triton_poi_fused_add_6.run(buf28, primals_15, 32, grid=grid(32), stream=stream0)
        del primals_15
        buf30 = empty_strided_cuda((16, 1), (1, 1), torch.float32)
        # Topologically Sorted Source Nodes: [output_1], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_17, reinterpret_tensor(buf28, (16, 2), (2, 1), 0), reinterpret_tensor(primals_16, (2, 1), (1, 2), 0), alpha=1, beta=1, out=buf30)
        del primals_17
        buf31 = empty_strided_cuda((16, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [output_2], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_19, buf30, reinterpret_tensor(primals_18, (1, 4), (1, 1), 0), alpha=1, beta=1, out=buf31)
        del primals_19
        buf32 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [output_3], Original ATen: [aten._softmax]
        triton_poi_fused__softmax_7.run(buf31, buf32, 64, grid=grid(64), stream=stream0)
        buf33 = reinterpret_tensor(buf31, (4, 4, 4), (16, 4, 1), 0); del buf31  # reuse
        # Topologically Sorted Source Nodes: [output_3], Original ATen: [aten._softmax]
        triton_poi_fused__softmax_8.run(buf32, buf33, 64, grid=grid(64), stream=stream0)
        del buf32
    return (reinterpret_tensor(buf33, (4, 4, 4), (16, 1, 4), 0), buf2, buf9, buf16, buf22, primals_2, primals_3, primals_5, primals_6, primals_8, primals_9, primals_11, primals_12, reinterpret_tensor(primals_1, (4, 4, 4), (16, 1, 4), 0), buf1, buf2, buf5, buf6, buf8, buf9, buf11, buf12, buf13, buf15, buf16, buf18, buf19, buf21, buf22, buf24, buf25, reinterpret_tensor(buf26, (16, 4), (4, 1), 0), reinterpret_tensor(buf28, (16, 2), (2, 1), 0), buf30, buf33, primals_18, primals_16, primals_14, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((4, 1, 1), (1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_5 = rand_strided((4, 1, 1), (1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_6 = rand_strided((4, 4, 4), (16, 4, 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, 1), (1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_9 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_10 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_11 = rand_strided((4, 1, 1), (1, 1, 1), device='cuda:0', dtype=torch.float32)
    primals_12 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_13 = rand_strided((4, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_14 = rand_strided((2, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    primals_15 = rand_strided((2, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_16 = rand_strided((1, 2), (2, 1), device='cuda:0', dtype=torch.float32)
    primals_17 = rand_strided((1, ), (1, ), device='cuda:0', dtype=torch.float32)
    primals_18 = rand_strided((4, 1), (1, 1), device='cuda:0', dtype=torch.float32)
    primals_19 = 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, primals_16, primals_17, primals_18, primals_19])
    return print_performance(fn, times=times, repeat=repeat)


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

import torch
import torch.nn as nn
from torch.nn.utils import weight_norm


class Chomp1d(nn.Module):

    def __init__(self, chomp_size):
        super(Chomp1d, self).__init__()
        self.chomp_size = chomp_size

    def forward(self, x, pad_right=True):
        return x[:, :, :-self.chomp_size].contiguous() if pad_right else x[
            :, :, self.chomp_size:]


class TemporalBlock(nn.Module):

    def __init__(self, n_inputs, n_outputs, kernel_size, stride, dilation,
        padding, dropout):
        super(TemporalBlock, self).__init__()
        self.conv1 = weight_norm(nn.Conv1d(n_inputs, n_outputs, kernel_size,
            stride=stride, padding=padding, dilation=dilation))
        self.chomp1 = Chomp1d(padding)
        self.relu1 = nn.LeakyReLU(negative_slope=0.01, inplace=False)
        self.dropout1 = nn.Dropout(dropout)
        self.conv2 = weight_norm(nn.Conv1d(n_outputs, n_outputs,
            kernel_size, stride=stride, padding=padding, dilation=dilation))
        self.chomp2 = Chomp1d(padding)
        self.relu2 = nn.LeakyReLU(negative_slope=0.01, inplace=False)
        self.dropout2 = nn.Dropout(dropout)
        self.net = nn.Sequential(self.conv1, self.chomp1, self.relu1, self.
            dropout1, self.conv2, self.chomp2, self.relu2, self.dropout2)
        self.downsample = nn.Conv1d(n_inputs, n_outputs, 1
            ) if n_inputs != n_outputs else None
        self.relu = nn.LeakyReLU(negative_slope=0.01, inplace=False)
        self.init_weights()

    def init_weights(self):
        self.conv1.weight.data.normal_(0, 0.01)
        self.conv2.weight.data.normal_(0, 0.01)
        if self.downsample is not None:
            self.downsample.weight.data.normal_(0, 0.01)

    def forward(self, x):
        out = self.net(x)
        res = x if self.downsample is None else self.downsample(x)
        return self.relu(out + res)


class TemporalConvNet(nn.Module):

    def __init__(self, num_inputs, num_channels, kernel_size, stride, dropout):
        super(TemporalConvNet, self).__init__()
        self.network = nn.Sequential()
        for i, nch in enumerate(num_channels):
            dilation = 2 ** i
            in_channels = num_inputs if i == 0 else num_channels[i - 1]
            out_channels = num_channels[i]
            padding = (kernel_size - 1) * dilation
            self.network.add_module('tblock' + str(i), TemporalBlock(
                n_inputs=in_channels, n_outputs=out_channels, kernel_size=
                kernel_size, stride=stride, dilation=dilation, padding=
                padding, dropout=dropout))

    def forward(self, x):
        return self.network(x)


class TCN_SLID(nn.Module):

    def __init__(self, size_in, size_out, list_conv_depths, size_kernel,
        stride, dropout):
        super(TCN_SLID, self).__init__()
        self.tcn = TemporalConvNet(num_inputs=size_in, num_channels=
            list_conv_depths, kernel_size=size_kernel, stride=stride,
            dropout=dropout)
        self.linear1 = nn.Linear(list_conv_depths[-1], list_conv_depths[-1] //
            2)
        self.linear2 = nn.Linear(list_conv_depths[-1] // 2, 
            list_conv_depths[-1] // 4)
        self.linear3 = nn.Linear(list_conv_depths[-1] // 4, size_out)
        self.softmax = nn.Softmax(dim=2)

    def forward(self, x):
        output = self.tcn(x.transpose(1, 2))
        output = self.linear1(output.transpose(1, 2))
        output = self.linear2(output)
        output = self.linear3(output)
        output = self.softmax(output)
        return output.transpose(1, 2)


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


def get_init_inputs():
    return [[], {'size_in': 4, 'size_out': 4, 'list_conv_depths': [4, 4],
        'size_kernel': 4, 'stride': 1, 'dropout': 0.5}]

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, math as tl_math
import torch.nn as nn
from torch.nn.utils import weight_norm
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_per_fused__weight_norm_interface_0(in_out_ptr0, in_ptr0, in_ptr1,
    out_ptr0, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    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)
    r1 = rindex
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (r1 + 16 * x0), xmask, other=0.0)
    tmp7 = tl.load(in_ptr1 + x0, xmask, eviction_policy='evict_last')
    tmp1 = tmp0 * tmp0
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp4 = tl.where(xmask, tmp2, 0)
    tmp5 = tl.sum(tmp4, 1)[:, None]
    tmp6 = libdevice.sqrt(tmp5)
    tmp8 = tmp7 / tmp6
    tmp9 = tmp0 * tmp8
    tl.debug_barrier()
    tl.store(in_out_ptr0 + x0, tmp6, xmask)
    tl.store(out_ptr0 + (r1 + 16 * x0), tmp9, xmask)


@triton.jit
def triton_poi_fused_convolution_1(in_ptr0, out_ptr0, ynumel, xnumel,
    YBLOCK: tl.constexpr, XBLOCK: tl.constexpr):
    ynumel = 16
    xnumel = 4
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y0 = yindex % 4
    y1 = yindex // 4
    y3 = yindex
    tmp0 = tl.load(in_ptr0 + (y0 + 4 * x2 + 16 * y1), xmask & ymask,
        eviction_policy='evict_last')
    tl.store(out_ptr0 + (x2 + 4 * y3), tmp0, xmask & ymask)


@triton.jit
def triton_poi_fused_clone_leaky_relu_2(in_ptr0, in_ptr1, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x3 = xindex // 4
    x1 = xindex // 4 % 4
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 7 * x3), xmask)
    tmp1 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tl.store(out_ptr0 + x4, tmp4, xmask)
    tl.store(out_ptr1 + x4, tmp7, xmask)


@triton.jit
def triton_poi_fused_add_clone_leaky_relu_3(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, out_ptr1, out_ptr2, ynumel, xnumel, YBLOCK: tl.constexpr,
    XBLOCK: tl.constexpr):
    ynumel = 16
    xnumel = 4
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 4
    y1 = yindex // 4
    tmp0 = tl.load(in_ptr0 + (x2 + 7 * y3), xmask & ymask, eviction_policy=
        'evict_last')
    tmp1 = tl.load(in_ptr1 + y0, ymask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr2 + (y0 + 4 * x2 + 16 * y1), xmask & ymask,
        eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tmp9 = tmp7 + tmp8
    tmp10 = tmp9 > tmp3
    tmp11 = tmp9 * tmp5
    tmp12 = tl.where(tmp10, tmp9, tmp11)
    tl.store(out_ptr0 + (x2 + 4 * y3), tmp4, xmask & ymask)
    tl.store(out_ptr1 + (x2 + 4 * y3), tmp10, xmask & ymask)
    tl.store(out_ptr2 + (x2 + 4 * y3), tmp12, xmask & ymask)


@triton.jit
def triton_poi_fused_clone_leaky_relu_4(in_ptr0, in_ptr1, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x3 = xindex // 4
    x1 = xindex // 4 % 4
    x4 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 10 * x3), xmask)
    tmp1 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tl.store(out_ptr0 + x4, tmp4, xmask)
    tl.store(out_ptr1 + x4, tmp7, xmask)


@triton.jit
def triton_poi_fused_add_clone_leaky_relu_5(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, out_ptr1, out_ptr2, ynumel, xnumel, YBLOCK: tl.constexpr,
    XBLOCK: tl.constexpr):
    ynumel = 16
    xnumel = 4
    yoffset = tl.program_id(1) * YBLOCK
    yindex = yoffset + tl.arange(0, YBLOCK)[None, :]
    ymask = yindex < ynumel
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    x2 = xindex
    y3 = yindex
    y0 = yindex % 4
    y1 = yindex // 4
    tmp0 = tl.load(in_ptr0 + (x2 + 10 * y3), xmask & ymask, eviction_policy
        ='evict_last')
    tmp1 = tl.load(in_ptr1 + y0, ymask, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr2 + (x2 + 4 * y3), xmask & ymask, eviction_policy=
        'evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = 0.0
    tmp4 = tmp2 > tmp3
    tmp5 = 0.01
    tmp6 = tmp2 * tmp5
    tmp7 = tl.where(tmp4, tmp2, tmp6)
    tmp9 = tmp7 + tmp8
    tmp10 = tmp9 > tmp3
    tmp11 = tmp9 * tmp5
    tmp12 = tl.where(tmp10, tmp9, tmp11)
    tl.store(out_ptr0 + (x2 + 4 * y3), tmp4, xmask & ymask)
    tl.store(out_ptr1 + (x2 + 4 * y3), tmp10, xmask & ymask)
    tl.store(out_ptr2 + (y0 + 4 * x2 + 16 * y1), tmp12, xmask & ymask)


@triton.jit
def triton_poi_fused_add_6(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 32
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 2
    tmp0 = tl.load(in_out_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + x0, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x2, tmp2, xmask)


@triton.jit
def triton_poi_fused__softmax_7(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr
    ):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + 4 * x1, xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp3 = triton_helpers.maximum(tmp1, tmp2)
    tmp5 = triton_helpers.maximum(tmp3, tmp4)
    tmp7 = triton_helpers.maximum(tmp5, tmp6)
    tmp8 = tmp0 - tmp7
    tmp9 = tl_math.exp(tmp8)
    tl.store(out_ptr0 + x2, tmp9, xmask)


@triton.jit
def triton_poi_fused__softmax_8(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr
    ):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + 4 * x1, xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp5 = tmp3 + tmp4
    tmp7 = tmp5 + tmp6
    tmp8 = tmp0 / tmp7
    tl.store(out_ptr0 + x2, tmp8, 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, primals_16, primals_17,
        primals_18, primals_19) = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_2, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_3, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_4, (4,), (1,))
    assert_size_stride(primals_5, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_6, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_7, (4,), (1,))
    assert_size_stride(primals_8, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_9, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_10, (4,), (1,))
    assert_size_stride(primals_11, (4, 1, 1), (1, 1, 1))
    assert_size_stride(primals_12, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_13, (4,), (1,))
    assert_size_stride(primals_14, (2, 4), (4, 1))
    assert_size_stride(primals_15, (2,), (1,))
    assert_size_stride(primals_16, (1, 2), (2, 1))
    assert_size_stride(primals_17, (1,), (1,))
    assert_size_stride(primals_18, (4, 1), (1, 1))
    assert_size_stride(primals_19, (4,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf1 = reinterpret_tensor(buf0, (4, 1, 1), (1, 1, 1), 0)
        del buf0
        buf2 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        get_raw_stream(0)
        triton_per_fused__weight_norm_interface_0[grid(4)](buf1, primals_3,
            primals_2, buf2, 4, 16, XBLOCK=1, num_warps=2, num_stages=1)
        buf3 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_convolution_1[grid(16, 4)](primals_1, buf3, 16, 4,
            XBLOCK=4, YBLOCK=16, num_warps=1, num_stages=1)
        buf4 = extern_kernels.convolution(buf3, buf2, stride=(1,), padding=
            (3,), dilation=(1,), transposed=False, output_padding=(0,),
            groups=1, bias=None)
        assert_size_stride(buf4, (4, 4, 7), (28, 7, 1))
        buf5 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf6 = buf3
        del buf3
        triton_poi_fused_clone_leaky_relu_2[grid(64)](buf4, primals_4, buf5,
            buf6, 64, XBLOCK=64, num_warps=1, num_stages=1)
        del buf4
        del primals_4
        buf7 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf8 = reinterpret_tensor(buf7, (4, 1, 1), (1, 1, 1), 0)
        del buf7
        buf9 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_per_fused__weight_norm_interface_0[grid(4)](buf8, primals_6,
            primals_5, buf9, 4, 16, XBLOCK=1, num_warps=2, num_stages=1)
        buf10 = extern_kernels.convolution(buf6, buf9, stride=(1,), padding
            =(3,), dilation=(1,), transposed=False, output_padding=(0,),
            groups=1, bias=None)
        assert_size_stride(buf10, (4, 4, 7), (28, 7, 1))
        buf11 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf12 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf13 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_add_clone_leaky_relu_3[grid(16, 4)](buf10,
            primals_7, primals_1, buf11, buf12, buf13, 16, 4, XBLOCK=4,
            YBLOCK=16, num_warps=1, num_stages=1)
        del buf10
        del primals_7
        buf14 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf15 = reinterpret_tensor(buf14, (4, 1, 1), (1, 1, 1), 0)
        del buf14
        buf16 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_per_fused__weight_norm_interface_0[grid(4)](buf15, primals_9,
            primals_8, buf16, 4, 16, XBLOCK=1, num_warps=2, num_stages=1)
        buf17 = extern_kernels.convolution(buf13, buf16, stride=(1,),
            padding=(6,), dilation=(2,), transposed=False, output_padding=(
            0,), groups=1, bias=None)
        assert_size_stride(buf17, (4, 4, 10), (40, 10, 1))
        buf18 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf19 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_clone_leaky_relu_4[grid(64)](buf17, primals_10,
            buf18, buf19, 64, XBLOCK=64, num_warps=1, num_stages=1)
        del buf17
        del primals_10
        buf20 = empty_strided_cuda((4, 1, 1), (1, 4, 4), torch.float32)
        buf21 = reinterpret_tensor(buf20, (4, 1, 1), (1, 1, 1), 0)
        del buf20
        buf22 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_per_fused__weight_norm_interface_0[grid(4)](buf21,
            primals_12, primals_11, buf22, 4, 16, XBLOCK=1, num_warps=2,
            num_stages=1)
        buf23 = extern_kernels.convolution(buf19, buf22, stride=(1,),
            padding=(6,), dilation=(2,), transposed=False, output_padding=(
            0,), groups=1, bias=None)
        assert_size_stride(buf23, (4, 4, 10), (40, 10, 1))
        buf24 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf25 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.bool)
        buf26 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_add_clone_leaky_relu_5[grid(16, 4)](buf23,
            primals_13, buf13, buf24, buf25, buf26, 16, 4, XBLOCK=4, YBLOCK
            =16, num_warps=1, num_stages=1)
        del buf23
        del primals_13
        buf27 = empty_strided_cuda((16, 2), (2, 1), torch.float32)
        extern_kernels.mm(reinterpret_tensor(buf26, (16, 4), (4, 1), 0),
            reinterpret_tensor(primals_14, (4, 2), (1, 4), 0), out=buf27)
        buf28 = reinterpret_tensor(buf27, (4, 4, 2), (8, 2, 1), 0)
        del buf27
        triton_poi_fused_add_6[grid(32)](buf28, primals_15, 32, XBLOCK=32,
            num_warps=1, num_stages=1)
        del primals_15
        buf30 = empty_strided_cuda((16, 1), (1, 1), torch.float32)
        extern_kernels.addmm(primals_17, reinterpret_tensor(buf28, (16, 2),
            (2, 1), 0), reinterpret_tensor(primals_16, (2, 1), (1, 2), 0),
            alpha=1, beta=1, out=buf30)
        del primals_17
        buf31 = empty_strided_cuda((16, 4), (4, 1), torch.float32)
        extern_kernels.addmm(primals_19, buf30, reinterpret_tensor(
            primals_18, (1, 4), (1, 1), 0), alpha=1, beta=1, out=buf31)
        del primals_19
        buf32 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused__softmax_7[grid(64)](buf31, buf32, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf33 = reinterpret_tensor(buf31, (4, 4, 4), (16, 4, 1), 0)
        del buf31
        triton_poi_fused__softmax_8[grid(64)](buf32, buf33, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        del buf32
    return (reinterpret_tensor(buf33, (4, 4, 4), (16, 1, 4), 0), buf2, buf9,
        buf16, buf22, primals_2, primals_3, primals_5, primals_6, primals_8,
        primals_9, primals_11, primals_12, reinterpret_tensor(primals_1, (4,
        4, 4), (16, 1, 4), 0), buf1, buf2, buf5, buf6, buf8, buf9, buf11,
        buf12, buf13, buf15, buf16, buf18, buf19, buf21, buf22, buf24,
        buf25, reinterpret_tensor(buf26, (16, 4), (4, 1), 0),
        reinterpret_tensor(buf28, (16, 2), (2, 1), 0), buf30, buf33,
        primals_18, primals_16, primals_14)


class Chomp1d(nn.Module):

    def __init__(self, chomp_size):
        super(Chomp1d, self).__init__()
        self.chomp_size = chomp_size

    def forward(self, x, pad_right=True):
        return x[:, :, :-self.chomp_size].contiguous() if pad_right else x[
            :, :, self.chomp_size:]


class TemporalBlock(nn.Module):

    def __init__(self, n_inputs, n_outputs, kernel_size, stride, dilation,
        padding, dropout):
        super(TemporalBlock, self).__init__()
        self.conv1 = weight_norm(nn.Conv1d(n_inputs, n_outputs, kernel_size,
            stride=stride, padding=padding, dilation=dilation))
        self.chomp1 = Chomp1d(padding)
        self.relu1 = nn.LeakyReLU(negative_slope=0.01, inplace=False)
        self.dropout1 = nn.Dropout(dropout)
        self.conv2 = weight_norm(nn.Conv1d(n_outputs, n_outputs,
            kernel_size, stride=stride, padding=padding, dilation=dilation))
        self.chomp2 = Chomp1d(padding)
        self.relu2 = nn.LeakyReLU(negative_slope=0.01, inplace=False)
        self.dropout2 = nn.Dropout(dropout)
        self.net = nn.Sequential(self.conv1, self.chomp1, self.relu1, self.
            dropout1, self.conv2, self.chomp2, self.relu2, self.dropout2)
        self.downsample = nn.Conv1d(n_inputs, n_outputs, 1
            ) if n_inputs != n_outputs else None
        self.relu = nn.LeakyReLU(negative_slope=0.01, inplace=False)
        self.init_weights()

    def init_weights(self):
        self.conv1.weight.data.normal_(0, 0.01)
        self.conv2.weight.data.normal_(0, 0.01)
        if self.downsample is not None:
            self.downsample.weight.data.normal_(0, 0.01)

    def forward(self, x):
        out = self.net(x)
        res = x if self.downsample is None else self.downsample(x)
        return self.relu(out + res)


class TemporalConvNet(nn.Module):

    def __init__(self, num_inputs, num_channels, kernel_size, stride, dropout):
        super(TemporalConvNet, self).__init__()
        self.network = nn.Sequential()
        for i, nch in enumerate(num_channels):
            dilation = 2 ** i
            in_channels = num_inputs if i == 0 else num_channels[i - 1]
            out_channels = num_channels[i]
            padding = (kernel_size - 1) * dilation
            self.network.add_module('tblock' + str(i), TemporalBlock(
                n_inputs=in_channels, n_outputs=out_channels, kernel_size=
                kernel_size, stride=stride, dilation=dilation, padding=
                padding, dropout=dropout))

    def forward(self, x):
        return self.network(x)


class TCN_SLIDNew(nn.Module):

    def __init__(self, size_in, size_out, list_conv_depths, size_kernel,
        stride, dropout):
        super(TCN_SLIDNew, self).__init__()
        self.tcn = TemporalConvNet(num_inputs=size_in, num_channels=
            list_conv_depths, kernel_size=size_kernel, stride=stride,
            dropout=dropout)
        self.linear1 = nn.Linear(list_conv_depths[-1], list_conv_depths[-1] //
            2)
        self.linear2 = nn.Linear(list_conv_depths[-1] // 2, 
            list_conv_depths[-1] // 4)
        self.linear3 = nn.Linear(list_conv_depths[-1] // 4, size_out)
        self.softmax = nn.Softmax(dim=2)

    def forward(self, input_0):
        primals_4 = self.tcn.network.tblock0.conv1.bias
        primals_2 = self.tcn.network.tblock0.conv1.weight_g
        primals_1 = self.tcn.network.tblock0.conv1.weight_v
        primals_7 = self.tcn.network.tblock0.conv2.bias
        primals_5 = self.tcn.network.tblock0.conv2.weight_g
        primals_3 = self.tcn.network.tblock0.conv2.weight_v
        primals_10 = self.tcn.network.tblock1.conv1.bias
        primals_8 = self.tcn.network.tblock1.conv1.weight_g
        primals_6 = self.tcn.network.tblock1.conv1.weight_v
        primals_13 = self.tcn.network.tblock1.conv2.bias
        primals_11 = self.tcn.network.tblock1.conv2.weight_g
        primals_9 = self.tcn.network.tblock1.conv2.weight_v
        primals_14 = self.linear1.weight
        primals_15 = self.linear1.bias
        primals_16 = self.linear2.weight
        primals_17 = self.linear2.bias
        primals_18 = self.linear3.weight
        primals_19 = self.linear3.bias
        primals_12 = 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, primals_16, primals_17, primals_18, primals_19])
        return output[0]
