# 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/jo/cjoedcmy7gkzotfopp7atueg5hlb65rgyaj7o2wkgwedzdx5r26r.py
# Topologically Sorted Source Nodes: [t0], Original ATen: [aten.leaky_relu]
# Source node to ATen node mapping:
#   t0 => gt, mul, where
# Graph fragment:
#   %add_tensor_2 : [num_users=3] = call_function[target=torch.ops.aten.add.Tensor](args = (%mm_default_2, %primals_2), kwargs = {})
#   %gt : [num_users=2] = call_function[target=torch.ops.aten.gt.Scalar](args = (%add_tensor_2, 0), kwargs = {})
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%add_tensor_2, 0.01), kwargs = {})
#   %where : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%gt, %add_tensor_2, %mul), kwargs = {})
triton_poi_fused_leaky_relu_0 = async_compile.triton('triton_poi_fused_leaky_relu_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=[16], 
    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_leaky_relu_0', '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_leaky_relu_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 4
    tmp0 = tl.load(in_ptr0 + (x2), xmask)
    tmp1 = tl.load(in_ptr1 + (x0), 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 + (x2), tmp4, xmask)
    tl.store(out_ptr1 + (x2), tmp7, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/zc/czc7u2dq2vtql25zagxwmpr4hs6rlgasv7bt6hnyjlwyehn7iert.py
# Topologically Sorted Source Nodes: [t0_3, sub, mul_1, mul_2, mul_5, L_2nd], Original ATen: [aten.leaky_relu, aten.sub, aten.mul, aten.sum]
# Source node to ATen node mapping:
#   L_2nd => sum_2
#   mul_1 => mul_5
#   mul_2 => mul_6
#   mul_5 => mul_9
#   sub => sub
#   t0_3 => gt_3, mul_3, where_3
# Graph fragment:
#   %gt_3 : [num_users=1] = call_function[target=torch.ops.aten.gt.Scalar](args = (%addmm_3, 0), kwargs = {})
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%addmm_3, 0.01), kwargs = {})
#   %where_3 : [num_users=1] = call_function[target=torch.ops.aten.where.self](args = (%gt_3, %addmm_3, %mul_3), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%primals_3, %where_3), kwargs = {})
#   %mul_5 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub, %primals_3), kwargs = {})
#   %mul_6 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_5, 4), kwargs = {})
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_6, %mul_6), kwargs = {})
#   %sum_2 : [num_users=2] = call_function[target=torch.ops.aten.sum.default](args = (%mul_9,), kwargs = {})
triton_per_fused_leaky_relu_mul_sub_sum_1 = async_compile.triton('triton_per_fused_leaky_relu_mul_sub_sum_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.persistent_reduction(
    size_hints=[1, 16],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {3: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 4), equal_to_1=(3,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_leaky_relu_mul_sub_sum_1', 'mutated_arg_names': [], '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_leaky_relu_mul_sub_sum_1(in_ptr0, in_ptr1, out_ptr0, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + (r0), None)
    tmp1 = tl.load(in_ptr1 + (r0), None)
    tmp2 = 0.0
    tmp3 = tmp1 > tmp2
    tmp4 = 0.01
    tmp5 = tmp1 * tmp4
    tmp6 = tl.where(tmp3, tmp1, tmp5)
    tmp7 = tmp0 - tmp6
    tmp8 = tmp7 * tmp0
    tmp9 = 4.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp10
    tmp12 = tl.broadcast_to(tmp11, [XBLOCK, RBLOCK])
    tmp14 = tl.sum(tmp12, 1)[:, None]
    tl.store(out_ptr0 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp14, None)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/sj/csjofojkruavhzqz4olfzmhyc3z7nkdnkvkw2mil5b5g3poqp465.py
# Topologically Sorted Source Nodes: [trace, L_1st, mul_30, mul_31, add_9], Original ATen: [aten.trace, aten.mul, aten.add]
# Source node to ATen node mapping:
#   L_1st => mul_4
#   add_9 => add_16
#   mul_30 => mul_34
#   mul_31 => mul_35
#   trace => diagonal_copy, sum_1
# Graph fragment:
#   %diagonal_copy : [num_users=1] = call_function[target=torch.ops.aten.diagonal_copy.default](args = (%mm_1,), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%diagonal_copy,), kwargs = {})
#   %mul_4 : [num_users=2] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_1, 2), kwargs = {})
#   %mul_34 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_4, 4), kwargs = {})
#   %mul_35 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%mul_4, 4), kwargs = {})
#   %add_16 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_35, %sum_2), kwargs = {})
triton_per_fused_add_mul_trace_2 = async_compile.triton('triton_per_fused_add_mul_trace_2', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.persistent_reduction(
    size_hints=[1, 4],
    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': {4: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=(4,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_add_mul_trace_2', 'mutated_arg_names': [], '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_add_mul_trace_2(in_ptr0, in_ptr1, out_ptr1, out_ptr2, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 4
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + (5*r0), None, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr1 + (0))
    tmp9 = tl.broadcast_to(tmp8, [XBLOCK, 1])
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = tl.sum(tmp1, 1)[:, None]
    tmp4 = 2.0
    tmp5 = tmp3 * tmp4
    tmp6 = 4.0
    tmp7 = tmp5 * tmp6
    tmp10 = tmp7 + tmp9
    tl.store(out_ptr1 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp7, None)
    tl.store(out_ptr2 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp10, None)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/pm/cpmcm6vae4i5kfw32dc5glavrbpkpf57x2zxlc24hgiogzll476e.py
# Topologically Sorted Source Nodes: [abs_2, sum_4, mul_10, sum_5], Original ATen: [aten.abs, aten.sum, aten.mul]
# Source node to ATen node mapping:
#   abs_2 => abs_2
#   mul_10 => mul_14
#   sum_4 => sum_5
#   sum_5 => sum_6
# Graph fragment:
#   %abs_2 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%primals_2,), kwargs = {})
#   %sum_5 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%abs_2,), kwargs = {})
#   %mul_14 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_2, %primals_2), kwargs = {})
#   %sum_6 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%mul_14,), kwargs = {})
triton_per_fused_abs_mul_sum_3 = async_compile.triton('triton_per_fused_abs_mul_sum_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.persistent_reduction(
    size_hints=[1, 4],
    reduction_hint=ReductionHint.INNER,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {3: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=(3,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_abs_mul_sum_3', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 2, '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_abs_mul_sum_3(in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 4
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + (r0), None)
    tmp1 = tl_math.abs(tmp0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp4 = tl.sum(tmp2, 1)[:, None]
    tmp5 = tmp0 * tmp0
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tl.store(out_ptr0 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp4, None)
    tl.store(out_ptr1 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp8, None)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/e4/ce4hfyn5vohuqnghdltzoskekpfblvr522oitv6ouzcvnumqzc64.py
# Topologically Sorted Source Nodes: [abs_1, sum_2, mul_6, mul_7, sum_3, mul_8, add, L_reg, mul_9, mul_11, add_2, L_reg_1, abs_3, sum_6, mul_12, mul_13, sum_7, mul_14, add_3, L_reg_2, mul_15, mul_17, add_4, L_reg_3, abs_5, sum_10, mul_18, mul_19, sum_11, mul_20, add_5, L_reg_4, mul_21, mul_23, add_6, L_reg_5, abs_7, sum_14, mul_24, mul_25, sum_15, mul_26, add_7, L_reg_6, mul_27, mul_29, add_8, L_reg_7], Original ATen: [aten.abs, aten.sum, aten.mul, aten.add]
# Source node to ATen node mapping:
#   L_reg => add_1
#   L_reg_1 => add_3
#   L_reg_2 => add_5
#   L_reg_3 => add_7
#   L_reg_4 => add_9
#   L_reg_5 => add_11
#   L_reg_6 => add_13
#   L_reg_7 => add_15
#   abs_1 => abs_1
#   abs_3 => abs_3
#   abs_5 => abs_5
#   abs_7 => abs_7
#   add => add
#   add_2 => add_2
#   add_3 => add_4
#   add_4 => add_6
#   add_5 => add_8
#   add_6 => add_10
#   add_7 => add_12
#   add_8 => add_14
#   mul_11 => mul_15
#   mul_12 => mul_16
#   mul_13 => mul_17
#   mul_14 => mul_18
#   mul_15 => mul_19
#   mul_17 => mul_21
#   mul_18 => mul_22
#   mul_19 => mul_23
#   mul_20 => mul_24
#   mul_21 => mul_25
#   mul_23 => mul_27
#   mul_24 => mul_28
#   mul_25 => mul_29
#   mul_26 => mul_30
#   mul_27 => mul_31
#   mul_29 => mul_33
#   mul_6 => mul_10
#   mul_7 => mul_11
#   mul_8 => mul_12
#   mul_9 => mul_13
#   sum_10 => sum_11
#   sum_11 => sum_12
#   sum_14 => sum_15
#   sum_15 => sum_16
#   sum_2 => sum_3
#   sum_3 => sum_4
#   sum_6 => sum_7
#   sum_7 => sum_8
# Graph fragment:
#   %abs_1 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%primals_1,), kwargs = {})
#   %sum_3 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%abs_1,), kwargs = {})
#   %mul_10 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_3, 4), kwargs = {})
#   %mul_11 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_1, %primals_1), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%mul_11,), kwargs = {})
#   %mul_12 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_4, 4), kwargs = {})
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_10, %mul_12), kwargs = {})
#   %add_1 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add, 0), kwargs = {})
#   %mul_13 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_5, 4), kwargs = {})
#   %mul_15 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_6, 4), kwargs = {})
#   %add_2 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_13, %mul_15), kwargs = {})
#   %add_3 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_1, %add_2), kwargs = {})
#   %abs_3 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%primals_4,), kwargs = {})
#   %sum_7 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%abs_3,), kwargs = {})
#   %mul_16 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_7, 4), kwargs = {})
#   %mul_17 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_4, %primals_4), kwargs = {})
#   %sum_8 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%mul_17,), kwargs = {})
#   %mul_18 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_8, 4), kwargs = {})
#   %add_4 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_16, %mul_18), kwargs = {})
#   %add_5 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_3, %add_4), kwargs = {})
#   %mul_19 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_9, 4), kwargs = {})
#   %mul_21 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_10, 4), kwargs = {})
#   %add_6 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_19, %mul_21), kwargs = {})
#   %add_7 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_5, %add_6), kwargs = {})
#   %abs_5 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%primals_6,), kwargs = {})
#   %sum_11 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%abs_5,), kwargs = {})
#   %mul_22 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_11, 4), kwargs = {})
#   %mul_23 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_6, %primals_6), kwargs = {})
#   %sum_12 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%mul_23,), kwargs = {})
#   %mul_24 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_12, 4), kwargs = {})
#   %add_8 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_22, %mul_24), kwargs = {})
#   %add_9 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_7, %add_8), kwargs = {})
#   %mul_25 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_13, 4), kwargs = {})
#   %mul_27 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_14, 4), kwargs = {})
#   %add_10 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_25, %mul_27), kwargs = {})
#   %add_11 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_9, %add_10), kwargs = {})
#   %abs_7 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%primals_8,), kwargs = {})
#   %sum_15 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%abs_7,), kwargs = {})
#   %mul_28 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_15, 4), kwargs = {})
#   %mul_29 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%primals_8, %primals_8), kwargs = {})
#   %sum_16 : [num_users=1] = call_function[target=torch.ops.aten.sum.default](args = (%mul_29,), kwargs = {})
#   %mul_30 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_16, 4), kwargs = {})
#   %add_12 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_28, %mul_30), kwargs = {})
#   %add_13 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_11, %add_12), kwargs = {})
#   %mul_31 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_17, 4), kwargs = {})
#   %mul_33 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sum_18, 4), kwargs = {})
#   %add_14 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%mul_31, %mul_33), kwargs = {})
#   %add_15 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%add_13, %add_14), kwargs = {})
triton_per_fused_abs_add_mul_sum_4 = async_compile.triton('triton_per_fused_abs_add_mul_sum_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.persistent_reduction(
    size_hints=[1, 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: '*fp32', 11: '*fp32', 12: '*fp32', 13: 'i32', 14: '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': {13: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14), equal_to_1=(13,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_abs_add_mul_sum_4', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 12, 'num_reduction': 8, '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_abs_add_mul_sum_4(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10, in_ptr11, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + (r0), None)
    tmp9 = tl.load(in_ptr1 + (r0), None)
    tmp18 = tl.load(in_ptr2 + (r0), None)
    tmp27 = tl.load(in_ptr3 + (r0), None)
    tmp42 = tl.load(in_ptr4 + (0))
    tmp43 = tl.broadcast_to(tmp42, [XBLOCK, 1])
    tmp45 = tl.load(in_ptr5 + (0))
    tmp46 = tl.broadcast_to(tmp45, [XBLOCK, 1])
    tmp54 = tl.load(in_ptr6 + (0))
    tmp55 = tl.broadcast_to(tmp54, [XBLOCK, 1])
    tmp57 = tl.load(in_ptr7 + (0))
    tmp58 = tl.broadcast_to(tmp57, [XBLOCK, 1])
    tmp66 = tl.load(in_ptr8 + (0))
    tmp67 = tl.broadcast_to(tmp66, [XBLOCK, 1])
    tmp69 = tl.load(in_ptr9 + (0))
    tmp70 = tl.broadcast_to(tmp69, [XBLOCK, 1])
    tmp78 = tl.load(in_ptr10 + (0))
    tmp79 = tl.broadcast_to(tmp78, [XBLOCK, 1])
    tmp81 = tl.load(in_ptr11 + (0))
    tmp82 = tl.broadcast_to(tmp81, [XBLOCK, 1])
    tmp1 = tl_math.abs(tmp0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp4 = tl.sum(tmp2, 1)[:, None]
    tmp5 = tmp0 * tmp0
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tmp10 = tl_math.abs(tmp9)
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK, RBLOCK])
    tmp13 = tl.sum(tmp11, 1)[:, None]
    tmp14 = tmp9 * tmp9
    tmp15 = tl.broadcast_to(tmp14, [XBLOCK, RBLOCK])
    tmp17 = tl.sum(tmp15, 1)[:, None]
    tmp19 = tl_math.abs(tmp18)
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK, RBLOCK])
    tmp22 = tl.sum(tmp20, 1)[:, None]
    tmp23 = tmp18 * tmp18
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK, RBLOCK])
    tmp26 = tl.sum(tmp24, 1)[:, None]
    tmp28 = tl_math.abs(tmp27)
    tmp29 = tl.broadcast_to(tmp28, [XBLOCK, RBLOCK])
    tmp31 = tl.sum(tmp29, 1)[:, None]
    tmp32 = tmp27 * tmp27
    tmp33 = tl.broadcast_to(tmp32, [XBLOCK, RBLOCK])
    tmp35 = tl.sum(tmp33, 1)[:, None]
    tmp36 = 4.0
    tmp37 = tmp4 * tmp36
    tmp38 = tmp8 * tmp36
    tmp39 = tmp37 + tmp38
    tmp40 = 0.0
    tmp41 = tmp39 + tmp40
    tmp44 = tmp43 * tmp36
    tmp47 = tmp46 * tmp36
    tmp48 = tmp44 + tmp47
    tmp49 = tmp41 + tmp48
    tmp50 = tmp22 * tmp36
    tmp51 = tmp26 * tmp36
    tmp52 = tmp50 + tmp51
    tmp53 = tmp49 + tmp52
    tmp56 = tmp55 * tmp36
    tmp59 = tmp58 * tmp36
    tmp60 = tmp56 + tmp59
    tmp61 = tmp53 + tmp60
    tmp62 = tmp31 * tmp36
    tmp63 = tmp35 * tmp36
    tmp64 = tmp62 + tmp63
    tmp65 = tmp61 + tmp64
    tmp68 = tmp67 * tmp36
    tmp71 = tmp70 * tmp36
    tmp72 = tmp68 + tmp71
    tmp73 = tmp65 + tmp72
    tmp74 = tmp13 * tmp36
    tmp75 = tmp17 * tmp36
    tmp76 = tmp74 + tmp75
    tmp77 = tmp73 + tmp76
    tmp80 = tmp79 * tmp36
    tmp83 = tmp82 * tmp36
    tmp84 = tmp80 + tmp83
    tmp85 = tmp77 + tmp84
    tl.debug_barrier()
    tl.store(in_out_ptr0 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp85, None)
''', 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 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4), (4, 1))
    assert_size_stride(primals_2, (4, ), (1, ))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4, ), (1, ))
    assert_size_stride(primals_6, (4, 4), (4, 1))
    assert_size_stride(primals_7, (4, ), (1, ))
    assert_size_stride(primals_8, (4, 4), (4, 1))
    assert_size_stride(primals_9, (4, ), (1, ))
    assert_size_stride(primals_10, (4, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(primals_3, reinterpret_tensor(primals_1, (4, 4), (1, 4), 0), out=buf0)
        buf1 = empty_strided_cuda((4, 4), (4, 1), torch.bool)
        buf2 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [t0], Original ATen: [aten.leaky_relu]
        stream0 = get_raw_stream(0)
        triton_poi_fused_leaky_relu_0.run(buf0, primals_2, buf1, buf2, 16, grid=grid(16), stream=stream0)
        buf3 = buf0; del buf0  # reuse
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(buf2, reinterpret_tensor(primals_4, (4, 4), (1, 4), 0), out=buf3)
        buf4 = empty_strided_cuda((4, 4), (4, 1), torch.bool)
        buf5 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [t0_1], Original ATen: [aten.leaky_relu]
        triton_poi_fused_leaky_relu_0.run(buf3, primals_5, buf4, buf5, 16, grid=grid(16), stream=stream0)
        buf6 = buf3; del buf3  # reuse
        # Topologically Sorted Source Nodes: [], Original ATen: []
        extern_kernels.mm(buf5, reinterpret_tensor(primals_6, (4, 4), (1, 4), 0), out=buf6)
        buf7 = empty_strided_cuda((4, 4), (4, 1), torch.bool)
        buf8 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [t0_2], Original ATen: [aten.leaky_relu]
        triton_poi_fused_leaky_relu_0.run(buf6, primals_7, buf7, buf8, 16, grid=grid(16), stream=stream0)
        buf9 = buf6; del buf6  # reuse
        # Topologically Sorted Source Nodes: [linear_3], Original ATen: [aten.addmm]
        extern_kernels.addmm(primals_9, buf8, reinterpret_tensor(primals_8, (4, 4), (1, 4), 0), alpha=1, beta=1, out=buf9)
        buf10 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [mm], Original ATen: [aten.mm]
        extern_kernels.mm(reinterpret_tensor(buf5, (4, 4), (1, 4), 0), primals_10, out=buf10)
        buf11 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [mm_1], Original ATen: [aten.mm]
        extern_kernels.mm(buf10, buf5, out=buf11)
        buf13 = empty_strided_cuda((), (), torch.float32)
        # Topologically Sorted Source Nodes: [t0_3, sub, mul_1, mul_2, mul_5, L_2nd], Original ATen: [aten.leaky_relu, aten.sub, aten.mul, aten.sum]
        triton_per_fused_leaky_relu_mul_sub_sum_1.run(primals_3, buf9, buf13, 1, 16, grid=grid(1), stream=stream0)
        buf31 = empty_strided_cuda((), (), torch.float32)
        buf32 = empty_strided_cuda((), (), torch.float32)
        # Topologically Sorted Source Nodes: [trace, L_1st, mul_30, mul_31, add_9], Original ATen: [aten.trace, aten.mul, aten.add]
        triton_per_fused_add_mul_trace_2.run(buf11, buf13, buf31, buf32, 1, 4, grid=grid(1), stream=stream0)
        del buf11
        buf16 = empty_strided_cuda((), (), torch.float32)
        buf17 = empty_strided_cuda((), (), torch.float32)
        # Topologically Sorted Source Nodes: [abs_2, sum_4, mul_10, sum_5], Original ATen: [aten.abs, aten.sum, aten.mul]
        triton_per_fused_abs_mul_sum_3.run(primals_2, buf16, buf17, 1, 4, grid=grid(1), stream=stream0)
        buf20 = empty_strided_cuda((), (), torch.float32)
        buf21 = empty_strided_cuda((), (), torch.float32)
        # Topologically Sorted Source Nodes: [abs_4, sum_8, mul_16, sum_9], Original ATen: [aten.abs, aten.sum, aten.mul]
        triton_per_fused_abs_mul_sum_3.run(primals_5, buf20, buf21, 1, 4, grid=grid(1), stream=stream0)
        buf25 = empty_strided_cuda((), (), torch.float32)
        buf26 = empty_strided_cuda((), (), torch.float32)
        # Topologically Sorted Source Nodes: [abs_6, sum_12, mul_22, sum_13], Original ATen: [aten.abs, aten.sum, aten.mul]
        triton_per_fused_abs_mul_sum_3.run(primals_7, buf25, buf26, 1, 4, grid=grid(1), stream=stream0)
        buf29 = empty_strided_cuda((), (), torch.float32)
        buf30 = empty_strided_cuda((), (), torch.float32)
        # Topologically Sorted Source Nodes: [abs_8, sum_16, mul_28, sum_17], Original ATen: [aten.abs, aten.sum, aten.mul]
        triton_per_fused_abs_mul_sum_3.run(primals_9, buf29, buf30, 1, 4, grid=grid(1), stream=stream0)
        buf14 = empty_strided_cuda((), (), torch.float32)
        buf24 = buf14; del buf14  # reuse
        buf33 = buf24; del buf24  # reuse
        # Topologically Sorted Source Nodes: [abs_1, sum_2, mul_6, mul_7, sum_3, mul_8, add, L_reg, mul_9, mul_11, add_2, L_reg_1, abs_3, sum_6, mul_12, mul_13, sum_7, mul_14, add_3, L_reg_2, mul_15, mul_17, add_4, L_reg_3, abs_5, sum_10, mul_18, mul_19, sum_11, mul_20, add_5, L_reg_4, mul_21, mul_23, add_6, L_reg_5, abs_7, sum_14, mul_24, mul_25, sum_15, mul_26, add_7, L_reg_6, mul_27, mul_29, add_8, L_reg_7], Original ATen: [aten.abs, aten.sum, aten.mul, aten.add]
        triton_per_fused_abs_add_mul_sum_4.run(buf33, primals_1, primals_8, primals_4, primals_6, buf16, buf17, buf20, buf21, buf25, buf26, buf29, buf30, 1, 16, grid=grid(1), stream=stream0)
        del buf16
        del buf17
        del buf20
        del buf21
        del buf25
        del buf26
        del buf29
        del buf30
    return (buf31, buf13, buf32, buf33, buf5, primals_1, primals_2, primals_3, primals_4, primals_5, primals_6, primals_7, primals_8, primals_9, primals_10, buf1, buf2, buf4, buf5, buf7, buf8, buf9, reinterpret_tensor(buf10, (4, 4), (1, 4), 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), (4, 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, 1), device='cuda:0', dtype=torch.float32)
    primals_4 = rand_strided((4, 4), (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, 4), (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, 4), (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, 4), (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])
    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.utils.data
import torch.nn as nn
import torch.nn.functional as F


class SDNE_layer(nn.Module):

    def __init__(self, num_node, hidden_size1, hidden_size2, droput, alpha,
        beta, nu1, nu2):
        super(SDNE_layer, self).__init__()
        self.num_node = num_node
        self.hidden_size1 = hidden_size1
        self.hidden_size2 = hidden_size2
        self.droput = droput
        self.alpha = alpha
        self.beta = beta
        self.nu1 = nu1
        self.nu2 = nu2
        self.encode0 = nn.Linear(self.num_node, self.hidden_size1)
        self.encode1 = nn.Linear(self.hidden_size1, self.hidden_size2)
        self.decode0 = nn.Linear(self.hidden_size2, self.hidden_size1)
        self.decode1 = nn.Linear(self.hidden_size1, self.num_node)

    def forward(self, adj_mat, l_mat):
        t0 = F.leaky_relu(self.encode0(adj_mat))
        t0 = F.leaky_relu(self.encode1(t0))
        self.embedding = t0
        t0 = F.leaky_relu(self.decode0(t0))
        t0 = F.leaky_relu(self.decode1(t0))
        L_1st = 2 * torch.trace(torch.mm(torch.mm(torch.t(self.embedding),
            l_mat), self.embedding))
        L_2nd = torch.sum((adj_mat - t0) * adj_mat * self.beta * ((adj_mat -
            t0) * adj_mat * self.beta))
        L_reg = 0
        for param in self.parameters():
            L_reg += self.nu1 * torch.sum(torch.abs(param)
                ) + self.nu2 * torch.sum(param * param)
        return self.alpha * L_1st, L_2nd, self.alpha * L_1st + L_2nd, L_reg

    def get_emb(self, adj):
        t0 = self.encode0(adj)
        t0 = self.encode1(t0)
        return t0


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


def get_init_inputs():
    return [[], {'num_node': 4, 'hidden_size1': 4, 'hidden_size2': 4,
        'droput': 4, 'alpha': 4, 'beta': 4, 'nu1': 4, 'nu2': 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.triton_helpers import math as tl_math
import torch.utils.data
import torch.nn as nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_poi_fused_leaky_relu_0(in_ptr0, in_ptr1, out_ptr0, out_ptr1,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x0 = xindex % 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr1 + x0, 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 + x2, tmp4, xmask)
    tl.store(out_ptr1 + x2, tmp7, xmask)


@triton.jit
def triton_per_fused_leaky_relu_mul_sub_sum_1(in_ptr0, in_ptr1, out_ptr0,
    xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + r0, None)
    tmp1 = tl.load(in_ptr1 + r0, None)
    tmp2 = 0.0
    tmp3 = tmp1 > tmp2
    tmp4 = 0.01
    tmp5 = tmp1 * tmp4
    tmp6 = tl.where(tmp3, tmp1, tmp5)
    tmp7 = tmp0 - tmp6
    tmp8 = tmp7 * tmp0
    tmp9 = 4.0
    tmp10 = tmp8 * tmp9
    tmp11 = tmp10 * tmp10
    tmp12 = tl.broadcast_to(tmp11, [XBLOCK, RBLOCK])
    tmp14 = tl.sum(tmp12, 1)[:, None]
    tl.store(out_ptr0 + tl.full([XBLOCK, 1], 0, tl.int32), tmp14, None)


@triton.jit
def triton_per_fused_add_mul_trace_2(in_ptr0, in_ptr1, out_ptr1, out_ptr2,
    xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + 5 * r0, None, eviction_policy='evict_last')
    tmp8 = tl.load(in_ptr1 + 0)
    tmp9 = tl.broadcast_to(tmp8, [XBLOCK, 1])
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = tl.sum(tmp1, 1)[:, None]
    tmp4 = 2.0
    tmp5 = tmp3 * tmp4
    tmp6 = 4.0
    tmp7 = tmp5 * tmp6
    tmp10 = tmp7 + tmp9
    tl.store(out_ptr1 + tl.full([XBLOCK, 1], 0, tl.int32), tmp7, None)
    tl.store(out_ptr2 + tl.full([XBLOCK, 1], 0, tl.int32), tmp10, None)


@triton.jit
def triton_per_fused_abs_mul_sum_3(in_ptr0, out_ptr0, out_ptr1, xnumel,
    rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 4
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + r0, None)
    tmp1 = tl_math.abs(tmp0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp4 = tl.sum(tmp2, 1)[:, None]
    tmp5 = tmp0 * tmp0
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tl.store(out_ptr0 + tl.full([XBLOCK, 1], 0, tl.int32), tmp4, None)
    tl.store(out_ptr1 + tl.full([XBLOCK, 1], 0, tl.int32), tmp8, None)


@triton.jit
def triton_per_fused_abs_add_mul_sum_4(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9,
    in_ptr10, in_ptr11, xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + r0, None)
    tmp9 = tl.load(in_ptr1 + r0, None)
    tmp18 = tl.load(in_ptr2 + r0, None)
    tmp27 = tl.load(in_ptr3 + r0, None)
    tmp42 = tl.load(in_ptr4 + 0)
    tmp43 = tl.broadcast_to(tmp42, [XBLOCK, 1])
    tmp45 = tl.load(in_ptr5 + 0)
    tmp46 = tl.broadcast_to(tmp45, [XBLOCK, 1])
    tmp54 = tl.load(in_ptr6 + 0)
    tmp55 = tl.broadcast_to(tmp54, [XBLOCK, 1])
    tmp57 = tl.load(in_ptr7 + 0)
    tmp58 = tl.broadcast_to(tmp57, [XBLOCK, 1])
    tmp66 = tl.load(in_ptr8 + 0)
    tmp67 = tl.broadcast_to(tmp66, [XBLOCK, 1])
    tmp69 = tl.load(in_ptr9 + 0)
    tmp70 = tl.broadcast_to(tmp69, [XBLOCK, 1])
    tmp78 = tl.load(in_ptr10 + 0)
    tmp79 = tl.broadcast_to(tmp78, [XBLOCK, 1])
    tmp81 = tl.load(in_ptr11 + 0)
    tmp82 = tl.broadcast_to(tmp81, [XBLOCK, 1])
    tmp1 = tl_math.abs(tmp0)
    tmp2 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp4 = tl.sum(tmp2, 1)[:, None]
    tmp5 = tmp0 * tmp0
    tmp6 = tl.broadcast_to(tmp5, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tmp10 = tl_math.abs(tmp9)
    tmp11 = tl.broadcast_to(tmp10, [XBLOCK, RBLOCK])
    tmp13 = tl.sum(tmp11, 1)[:, None]
    tmp14 = tmp9 * tmp9
    tmp15 = tl.broadcast_to(tmp14, [XBLOCK, RBLOCK])
    tmp17 = tl.sum(tmp15, 1)[:, None]
    tmp19 = tl_math.abs(tmp18)
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK, RBLOCK])
    tmp22 = tl.sum(tmp20, 1)[:, None]
    tmp23 = tmp18 * tmp18
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK, RBLOCK])
    tmp26 = tl.sum(tmp24, 1)[:, None]
    tmp28 = tl_math.abs(tmp27)
    tmp29 = tl.broadcast_to(tmp28, [XBLOCK, RBLOCK])
    tmp31 = tl.sum(tmp29, 1)[:, None]
    tmp32 = tmp27 * tmp27
    tmp33 = tl.broadcast_to(tmp32, [XBLOCK, RBLOCK])
    tmp35 = tl.sum(tmp33, 1)[:, None]
    tmp36 = 4.0
    tmp37 = tmp4 * tmp36
    tmp38 = tmp8 * tmp36
    tmp39 = tmp37 + tmp38
    tmp40 = 0.0
    tmp41 = tmp39 + tmp40
    tmp44 = tmp43 * tmp36
    tmp47 = tmp46 * tmp36
    tmp48 = tmp44 + tmp47
    tmp49 = tmp41 + tmp48
    tmp50 = tmp22 * tmp36
    tmp51 = tmp26 * tmp36
    tmp52 = tmp50 + tmp51
    tmp53 = tmp49 + tmp52
    tmp56 = tmp55 * tmp36
    tmp59 = tmp58 * tmp36
    tmp60 = tmp56 + tmp59
    tmp61 = tmp53 + tmp60
    tmp62 = tmp31 * tmp36
    tmp63 = tmp35 * tmp36
    tmp64 = tmp62 + tmp63
    tmp65 = tmp61 + tmp64
    tmp68 = tmp67 * tmp36
    tmp71 = tmp70 * tmp36
    tmp72 = tmp68 + tmp71
    tmp73 = tmp65 + tmp72
    tmp74 = tmp13 * tmp36
    tmp75 = tmp17 * tmp36
    tmp76 = tmp74 + tmp75
    tmp77 = tmp73 + tmp76
    tmp80 = tmp79 * tmp36
    tmp83 = tmp82 * tmp36
    tmp84 = tmp80 + tmp83
    tmp85 = tmp77 + tmp84
    tl.debug_barrier()
    tl.store(in_out_ptr0 + tl.full([XBLOCK, 1], 0, tl.int32), tmp85, None)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10) = args
    args.clear()
    assert_size_stride(primals_1, (4, 4), (4, 1))
    assert_size_stride(primals_2, (4,), (1,))
    assert_size_stride(primals_3, (4, 4), (4, 1))
    assert_size_stride(primals_4, (4, 4), (4, 1))
    assert_size_stride(primals_5, (4,), (1,))
    assert_size_stride(primals_6, (4, 4), (4, 1))
    assert_size_stride(primals_7, (4,), (1,))
    assert_size_stride(primals_8, (4, 4), (4, 1))
    assert_size_stride(primals_9, (4,), (1,))
    assert_size_stride(primals_10, (4, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(primals_3, reinterpret_tensor(primals_1, (4, 4),
            (1, 4), 0), out=buf0)
        buf1 = empty_strided_cuda((4, 4), (4, 1), torch.bool)
        buf2 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_leaky_relu_0[grid(16)](buf0, primals_2, buf1, buf2,
            16, XBLOCK=16, num_warps=1, num_stages=1)
        buf3 = buf0
        del buf0
        extern_kernels.mm(buf2, reinterpret_tensor(primals_4, (4, 4), (1, 4
            ), 0), out=buf3)
        buf4 = empty_strided_cuda((4, 4), (4, 1), torch.bool)
        buf5 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_leaky_relu_0[grid(16)](buf3, primals_5, buf4, buf5,
            16, XBLOCK=16, num_warps=1, num_stages=1)
        buf6 = buf3
        del buf3
        extern_kernels.mm(buf5, reinterpret_tensor(primals_6, (4, 4), (1, 4
            ), 0), out=buf6)
        buf7 = empty_strided_cuda((4, 4), (4, 1), torch.bool)
        buf8 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_leaky_relu_0[grid(16)](buf6, primals_7, buf7, buf8,
            16, XBLOCK=16, num_warps=1, num_stages=1)
        buf9 = buf6
        del buf6
        extern_kernels.addmm(primals_9, buf8, reinterpret_tensor(primals_8,
            (4, 4), (1, 4), 0), alpha=1, beta=1, out=buf9)
        buf10 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(reinterpret_tensor(buf5, (4, 4), (1, 4), 0),
            primals_10, out=buf10)
        buf11 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        extern_kernels.mm(buf10, buf5, out=buf11)
        buf13 = empty_strided_cuda((), (), torch.float32)
        triton_per_fused_leaky_relu_mul_sub_sum_1[grid(1)](primals_3, buf9,
            buf13, 1, 16, XBLOCK=1, num_warps=2, num_stages=1)
        buf31 = empty_strided_cuda((), (), torch.float32)
        buf32 = empty_strided_cuda((), (), torch.float32)
        triton_per_fused_add_mul_trace_2[grid(1)](buf11, buf13, buf31,
            buf32, 1, 4, XBLOCK=1, num_warps=2, num_stages=1)
        del buf11
        buf16 = empty_strided_cuda((), (), torch.float32)
        buf17 = empty_strided_cuda((), (), torch.float32)
        triton_per_fused_abs_mul_sum_3[grid(1)](primals_2, buf16, buf17, 1,
            4, XBLOCK=1, num_warps=2, num_stages=1)
        buf20 = empty_strided_cuda((), (), torch.float32)
        buf21 = empty_strided_cuda((), (), torch.float32)
        triton_per_fused_abs_mul_sum_3[grid(1)](primals_5, buf20, buf21, 1,
            4, XBLOCK=1, num_warps=2, num_stages=1)
        buf25 = empty_strided_cuda((), (), torch.float32)
        buf26 = empty_strided_cuda((), (), torch.float32)
        triton_per_fused_abs_mul_sum_3[grid(1)](primals_7, buf25, buf26, 1,
            4, XBLOCK=1, num_warps=2, num_stages=1)
        buf29 = empty_strided_cuda((), (), torch.float32)
        buf30 = empty_strided_cuda((), (), torch.float32)
        triton_per_fused_abs_mul_sum_3[grid(1)](primals_9, buf29, buf30, 1,
            4, XBLOCK=1, num_warps=2, num_stages=1)
        buf14 = empty_strided_cuda((), (), torch.float32)
        buf24 = buf14
        del buf14
        buf33 = buf24
        del buf24
        triton_per_fused_abs_add_mul_sum_4[grid(1)](buf33, primals_1,
            primals_8, primals_4, primals_6, buf16, buf17, buf20, buf21,
            buf25, buf26, buf29, buf30, 1, 16, XBLOCK=1, num_warps=2,
            num_stages=1)
        del buf16
        del buf17
        del buf20
        del buf21
        del buf25
        del buf26
        del buf29
        del buf30
    return (buf31, buf13, buf32, buf33, buf5, primals_1, primals_2,
        primals_3, primals_4, primals_5, primals_6, primals_7, primals_8,
        primals_9, primals_10, buf1, buf2, buf4, buf5, buf7, buf8, buf9,
        reinterpret_tensor(buf10, (4, 4), (1, 4), 0))


class SDNE_layerNew(nn.Module):

    def __init__(self, num_node, hidden_size1, hidden_size2, droput, alpha,
        beta, nu1, nu2):
        super(SDNE_layerNew, self).__init__()
        self.num_node = num_node
        self.hidden_size1 = hidden_size1
        self.hidden_size2 = hidden_size2
        self.droput = droput
        self.alpha = alpha
        self.beta = beta
        self.nu1 = nu1
        self.nu2 = nu2
        self.encode0 = nn.Linear(self.num_node, self.hidden_size1)
        self.encode1 = nn.Linear(self.hidden_size1, self.hidden_size2)
        self.decode0 = nn.Linear(self.hidden_size2, self.hidden_size1)
        self.decode1 = nn.Linear(self.hidden_size1, self.num_node)

    def get_emb(self, adj):
        t0 = self.encode0(adj)
        t0 = self.encode1(t0)
        return t0

    def forward(self, input_0, input_1):
        primals_1 = self.encode0.weight
        primals_2 = self.encode0.bias
        primals_3 = self.encode1.weight
        primals_5 = self.encode1.bias
        primals_4 = self.decode0.weight
        primals_7 = self.decode0.bias
        primals_6 = self.decode1.weight
        primals_9 = self.decode1.bias
        primals_8 = input_0
        primals_10 = input_1
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9, primals_10])
        return output[0], output[1], output[2], output[3]
