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

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


# kernel path: runs/run_shard_4/inductor_cache/jl/cjlewkazu5swf57ve2vqouzokbgz2nyjl3wq5slxk6ufxvzdg2y4.py
# Topologically Sorted Source Nodes: [sub, X, max_1, pow_2, tau_hi, pow_1, tau_lo, dm, dm_1, tau_m, sub_9, clamp_1, truediv_1, p_m, sum_2, sub_5, clamp, truediv, pow_3, sum_1, f_lo, tau_lo_1, dm_2, tau_m_1, sub_12, clamp_2, truediv_2, p_m_1, sum_3, f_m_1, mul_2, tau_lo_2, dm_3, tau_m_2, sub_15, clamp_3, truediv_3, p_m_2, sum_4, f_m_2, mul_3, tau_lo_3, dm_4, tau_m_3, sub_18, clamp_4, truediv_4, p_m_3, sum_5, f_m_3, mul_4, tau_lo_4, dm_5, tau_m_4, sub_21, clamp_5, truediv_5, p_m_4, sum_6, f_m_4, mul_5, tau_lo_5, dm_6, tau_m_5, sub_24, clamp_6, truediv_6, p_m_5, sum_7, f_m_5, mul_6, tau_lo_6, dm_7, tau_m_6, sub_27, clamp_7, truediv_7, p_m_6, sum_8, f_m_6, mul_7, tau_lo_7, dm_8, tau_m_7, sub_30, clamp_8, truediv_8, p_m_7, sum_9, f_m_7, mul_8, tau_lo_8, dm_9, tau_m_8, sub_33, clamp_9, truediv_9, p_m_8, sum_10, f_m_8, mul_9, tau_lo_9, dm_10, tau_m_9, sub_36, clamp_10, truediv_10, p_m_9, sum_11, f_m_9, mul_10, tau_lo_10, dm_11, tau_m_10, sub_39, clamp_11, truediv_11, p_m_10, sum_12, f_m_10, mul_11, tau_lo_11, dm_12, tau_m_11, sub_42, clamp_12, truediv_12, p_m_11, sum_13, f_m_11, mul_12, tau_lo_12, dm_13, tau_m_12, sub_45, clamp_13, truediv_13, p_m_12, sum_14, f_m_12, mul_13, tau_lo_13, dm_14, tau_m_13, sub_48, clamp_14, truediv_14, p_m_13, sum_15, f_m_13, mul_14, tau_lo_14, dm_15, tau_m_14, sub_51, clamp_15, truediv_15, p_m_14, sum_16, tau_lo_15, dm_16, tau_m_15, sub_54, clamp_16, truediv_16, p_m_15, sum_17, f_m_15, tau_lo_16, dm_17, tau_m_16, sub_57, clamp_17, truediv_17, p_m_16, sum_18, tau_lo_17, dm_18, tau_m_17, sub_60, clamp_18, truediv_18, p_m_17, sum_19, tau_lo_18, dm_19, tau_m_18, sub_63, clamp_19, truediv_19, p_m_18, sum_20, tau_lo_19, dm_20, tau_m_19, sub_66, clamp_20, truediv_20, p_m_19, sum_21, tau_lo_20, dm_21, tau_m_20, sub_69, clamp_21, truediv_21, p_m_20, sum_22, tau_lo_21, dm_22, tau_m_21, sub_72, clamp_22, truediv_22, p_m_21, sum_23, tau_lo_22, dm_23, tau_m_22, sub_75, clamp_23, truediv_23, p_m_22, sum_24, tau_lo_23, dm_24, tau_m_23, sub_78, clamp_24, truediv_24, p_m_23, sum_25, tau_lo_24, dm_25, tau_m_24, sub_81, clamp_25, truediv_25, p_m_24, sum_26, tau_lo_25, dm_26, tau_m_25, sub_84, clamp_26, truediv_26, p_m_25, sum_27], Original ATen: [aten.sub, aten.mul, aten.max, aten.pow, aten.div, aten.add, aten.clamp, aten.sum, aten.where]
# Source node to ATen node mapping:
#   X => mul
#   clamp => clamp_min
#   clamp_1 => clamp_min_1
#   clamp_10 => clamp_min_10
#   clamp_11 => clamp_min_11
#   clamp_12 => clamp_min_12
#   clamp_13 => clamp_min_13
#   clamp_14 => clamp_min_14
#   clamp_15 => clamp_min_15
#   clamp_16 => clamp_min_16
#   clamp_17 => clamp_min_17
#   clamp_18 => clamp_min_18
#   clamp_19 => clamp_min_19
#   clamp_2 => clamp_min_2
#   clamp_20 => clamp_min_20
#   clamp_21 => clamp_min_21
#   clamp_22 => clamp_min_22
#   clamp_23 => clamp_min_23
#   clamp_24 => clamp_min_24
#   clamp_25 => clamp_min_25
#   clamp_26 => clamp_min_26
#   clamp_3 => clamp_min_3
#   clamp_4 => clamp_min_4
#   clamp_5 => clamp_min_5
#   clamp_6 => clamp_min_6
#   clamp_7 => clamp_min_7
#   clamp_8 => clamp_min_8
#   clamp_9 => clamp_min_9
#   dm => sub_8
#   dm_1 => div
#   dm_10 => div_9
#   dm_11 => div_10
#   dm_12 => div_11
#   dm_13 => div_12
#   dm_14 => div_13
#   dm_15 => div_14
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_2 => div_1
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_3 => div_2
#   dm_4 => div_3
#   dm_5 => div_4
#   dm_6 => div_5
#   dm_7 => div_6
#   dm_8 => div_7
#   dm_9 => div_8
#   f_lo => sub_7
#   f_m_1 => sub_14
#   f_m_10 => sub_41
#   f_m_11 => sub_44
#   f_m_12 => sub_47
#   f_m_13 => sub_50
#   f_m_15 => sub_56
#   f_m_2 => sub_17
#   f_m_3 => sub_20
#   f_m_4 => sub_23
#   f_m_5 => sub_26
#   f_m_6 => sub_29
#   f_m_7 => sub_32
#   f_m_8 => sub_35
#   f_m_9 => sub_38
#   max_1 => max_1
#   mul_10 => mul_21
#   mul_11 => mul_23
#   mul_12 => mul_25
#   mul_13 => mul_27
#   mul_14 => mul_29
#   mul_2 => mul_5
#   mul_3 => mul_7
#   mul_4 => mul_9
#   mul_5 => mul_11
#   mul_6 => mul_13
#   mul_7 => mul_15
#   mul_8 => mul_17
#   mul_9 => mul_19
#   p_m => pow_4
#   p_m_1 => pow_5
#   p_m_10 => pow_14
#   p_m_11 => pow_15
#   p_m_12 => pow_16
#   p_m_13 => pow_17
#   p_m_14 => pow_18
#   p_m_15 => pow_19
#   p_m_16 => pow_20
#   p_m_17 => pow_21
#   p_m_18 => pow_22
#   p_m_19 => pow_23
#   p_m_2 => pow_6
#   p_m_20 => pow_24
#   p_m_21 => pow_25
#   p_m_22 => pow_26
#   p_m_23 => pow_27
#   p_m_24 => pow_28
#   p_m_25 => pow_29
#   p_m_3 => pow_7
#   p_m_4 => pow_8
#   p_m_5 => pow_9
#   p_m_6 => pow_10
#   p_m_7 => pow_11
#   p_m_8 => pow_12
#   p_m_9 => pow_13
#   pow_1 => full_default_1
#   pow_2 => full_default_2
#   pow_3 => pow_3
#   sub => full_default
#   sub_12 => sub_12
#   sub_15 => sub_15
#   sub_18 => sub_18
#   sub_21 => sub_21
#   sub_24 => sub_24
#   sub_27 => sub_27
#   sub_30 => sub_30
#   sub_33 => sub_33
#   sub_36 => sub_36
#   sub_39 => sub_39
#   sub_42 => sub_42
#   sub_45 => sub_45
#   sub_48 => sub_48
#   sub_5 => sub_5
#   sub_51 => sub_51
#   sub_54 => sub_54
#   sub_57 => sub_57
#   sub_60 => sub_60
#   sub_63 => sub_63
#   sub_66 => sub_66
#   sub_69 => sub_69
#   sub_72 => sub_72
#   sub_75 => sub_75
#   sub_78 => sub_78
#   sub_81 => sub_81
#   sub_84 => sub_84
#   sub_9 => sub_9
#   sum_1 => sum_1
#   sum_10 => sum_10
#   sum_11 => sum_11
#   sum_12 => sum_12
#   sum_13 => sum_13
#   sum_14 => sum_14
#   sum_15 => sum_15
#   sum_16 => sum_16
#   sum_17 => sum_17
#   sum_18 => sum_18
#   sum_19 => sum_19
#   sum_2 => sum_2
#   sum_20 => sum_20
#   sum_21 => sum_21
#   sum_22 => sum_22
#   sum_23 => sum_23
#   sum_24 => sum_24
#   sum_25 => sum_25
#   sum_26 => sum_26
#   sum_27 => sum_27
#   sum_3 => sum_3
#   sum_4 => sum_4
#   sum_5 => sum_5
#   sum_6 => sum_6
#   sum_7 => sum_7
#   sum_8 => sum_8
#   sum_9 => sum_9
#   tau_hi => sub_4
#   tau_lo => sub_2
#   tau_lo_1 => where
#   tau_lo_10 => where_9
#   tau_lo_11 => where_10
#   tau_lo_12 => where_11
#   tau_lo_13 => where_12
#   tau_lo_14 => where_13
#   tau_lo_15 => where_14
#   tau_lo_16 => where_15
#   tau_lo_17 => where_16
#   tau_lo_18 => where_17
#   tau_lo_19 => where_18
#   tau_lo_2 => where_1
#   tau_lo_20 => where_19
#   tau_lo_21 => where_20
#   tau_lo_22 => where_21
#   tau_lo_23 => where_22
#   tau_lo_24 => where_23
#   tau_lo_25 => where_24
#   tau_lo_3 => where_2
#   tau_lo_4 => where_3
#   tau_lo_5 => where_4
#   tau_lo_6 => where_5
#   tau_lo_7 => where_6
#   tau_lo_8 => where_7
#   tau_lo_9 => where_8
#   tau_m => add
#   tau_m_1 => add_1
#   tau_m_10 => add_10
#   tau_m_11 => add_11
#   tau_m_12 => add_12
#   tau_m_13 => add_13
#   tau_m_14 => add_14
#   tau_m_15 => add_15
#   tau_m_16 => add_16
#   tau_m_17 => add_17
#   tau_m_18 => add_18
#   tau_m_19 => add_19
#   tau_m_2 => add_2
#   tau_m_20 => add_20
#   tau_m_21 => add_21
#   tau_m_22 => add_22
#   tau_m_23 => add_23
#   tau_m_24 => add_24
#   tau_m_25 => add_25
#   tau_m_3 => add_3
#   tau_m_4 => add_4
#   tau_m_5 => add_5
#   tau_m_6 => add_6
#   tau_m_7 => add_7
#   tau_m_8 => add_8
#   tau_m_9 => add_9
#   truediv => full_default_3
#   truediv_1 => full_default_4
#   truediv_10 => full_default_13
#   truediv_11 => full_default_14
#   truediv_12 => full_default_15
#   truediv_13 => full_default_16
#   truediv_14 => full_default_17
#   truediv_15 => full_default_18
#   truediv_16 => full_default_19
#   truediv_17 => full_default_20
#   truediv_18 => full_default_21
#   truediv_19 => full_default_22
#   truediv_2 => full_default_5
#   truediv_20 => full_default_23
#   truediv_21 => full_default_24
#   truediv_22 => full_default_25
#   truediv_23 => full_default_26
#   truediv_24 => full_default_27
#   truediv_25 => full_default_28
#   truediv_26 => full_default_29
#   truediv_3 => full_default_6
#   truediv_4 => full_default_7
#   truediv_5 => full_default_8
#   truediv_6 => full_default_9
#   truediv_7 => full_default_10
#   truediv_8 => full_default_11
#   truediv_9 => full_default_12
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %max_1 : [num_users=1] = call_function[target=torch.ops.aten.max.dim](args = (%mul, -1, True), kwargs = {})
#   %full_default_2 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %sub_4 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%getitem, %full_default_2), kwargs = {})
#   %full_default_1 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 1.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %sub_2 : [num_users=4] = call_function[target=torch.ops.aten.sub.Tensor](args = (%getitem, %full_default_1), kwargs = {})
#   %sub_8 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sub_4, %sub_2), kwargs = {})
#   %div : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%sub_8, 2), kwargs = {})
#   %add : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%sub_2, %div), kwargs = {})
#   %sub_9 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add), kwargs = {})
#   %clamp_min_1 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_9, 0), kwargs = {})
#   %full_default_4 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_4 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_1, %full_default_4), kwargs = {})
#   %sum_2 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_4, [-1]), kwargs = {})
#   %sub_5 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %sub_2), kwargs = {})
#   %clamp_min : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_5, 0), kwargs = {})
#   %full_default_3 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_3 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min, %full_default_3), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_3, [-1]), kwargs = {})
#   %sub_7 : [num_users=49] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_1, 1), kwargs = {})
#   %where : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze, %add, %sub_2), kwargs = {})
#   %div_1 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div, 2), kwargs = {})
#   %add_1 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where, %div_1), kwargs = {})
#   %sub_12 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_1), kwargs = {})
#   %clamp_min_2 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_12, 0), kwargs = {})
#   %full_default_5 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_5 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_2, %full_default_5), kwargs = {})
#   %sum_3 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_5, [-1]), kwargs = {})
#   %sub_14 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_3, 1), kwargs = {})
#   %mul_5 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_14, %sub_7), kwargs = {})
#   %where_1 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_1, %add_1, %where), kwargs = {})
#   %div_2 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_1, 2), kwargs = {})
#   %add_2 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_1, %div_2), kwargs = {})
#   %sub_15 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_2), kwargs = {})
#   %clamp_min_3 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_15, 0), kwargs = {})
#   %full_default_6 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_6 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_3, %full_default_6), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_6, [-1]), kwargs = {})
#   %sub_17 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_4, 1), kwargs = {})
#   %mul_7 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_17, %sub_7), kwargs = {})
#   %where_2 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_2, %add_2, %where_1), kwargs = {})
#   %div_3 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_2, 2), kwargs = {})
#   %add_3 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_2, %div_3), kwargs = {})
#   %sub_18 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_3), kwargs = {})
#   %clamp_min_4 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_18, 0), kwargs = {})
#   %full_default_7 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_7 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_4, %full_default_7), kwargs = {})
#   %sum_5 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_7, [-1]), kwargs = {})
#   %sub_20 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_5, 1), kwargs = {})
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_20, %sub_7), kwargs = {})
#   %where_3 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_3, %add_3, %where_2), kwargs = {})
#   %div_4 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_3, 2), kwargs = {})
#   %add_4 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_3, %div_4), kwargs = {})
#   %sub_21 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_4), kwargs = {})
#   %clamp_min_5 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_21, 0), kwargs = {})
#   %full_default_8 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_8 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_5, %full_default_8), kwargs = {})
#   %sum_6 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_8, [-1]), kwargs = {})
#   %sub_23 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_6, 1), kwargs = {})
#   %mul_11 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_23, %sub_7), kwargs = {})
#   %where_4 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_4, %add_4, %where_3), kwargs = {})
#   %div_5 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_4, 2), kwargs = {})
#   %add_5 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_4, %div_5), kwargs = {})
#   %sub_24 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_5), kwargs = {})
#   %clamp_min_6 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_24, 0), kwargs = {})
#   %full_default_9 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_9 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_6, %full_default_9), kwargs = {})
#   %sum_7 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_9, [-1]), kwargs = {})
#   %sub_26 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_7, 1), kwargs = {})
#   %mul_13 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_26, %sub_7), kwargs = {})
#   %where_5 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_5, %add_5, %where_4), kwargs = {})
#   %div_6 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_5, 2), kwargs = {})
#   %add_6 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_5, %div_6), kwargs = {})
#   %sub_27 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_6), kwargs = {})
#   %clamp_min_7 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_27, 0), kwargs = {})
#   %full_default_10 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_10 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_7, %full_default_10), kwargs = {})
#   %sum_8 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_10, [-1]), kwargs = {})
#   %sub_29 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_8, 1), kwargs = {})
#   %mul_15 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_29, %sub_7), kwargs = {})
#   %where_6 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_6, %add_6, %where_5), kwargs = {})
#   %div_7 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_6, 2), kwargs = {})
#   %add_7 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_6, %div_7), kwargs = {})
#   %sub_30 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_7), kwargs = {})
#   %clamp_min_8 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_30, 0), kwargs = {})
#   %full_default_11 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_11 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_8, %full_default_11), kwargs = {})
#   %sum_9 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_11, [-1]), kwargs = {})
#   %sub_32 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_9, 1), kwargs = {})
#   %mul_17 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_32, %sub_7), kwargs = {})
#   %where_7 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_7, %add_7, %where_6), kwargs = {})
#   %div_8 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_7, 2), kwargs = {})
#   %add_8 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_7, %div_8), kwargs = {})
#   %sub_33 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_8), kwargs = {})
#   %clamp_min_9 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_33, 0), kwargs = {})
#   %full_default_12 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_12 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_9, %full_default_12), kwargs = {})
#   %sum_10 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_12, [-1]), kwargs = {})
#   %sub_35 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_10, 1), kwargs = {})
#   %mul_19 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_35, %sub_7), kwargs = {})
#   %where_8 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_8, %add_8, %where_7), kwargs = {})
#   %div_9 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_8, 2), kwargs = {})
#   %add_9 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_8, %div_9), kwargs = {})
#   %sub_36 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_9), kwargs = {})
#   %clamp_min_10 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_36, 0), kwargs = {})
#   %full_default_13 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_13 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_10, %full_default_13), kwargs = {})
#   %sum_11 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_13, [-1]), kwargs = {})
#   %sub_38 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_11, 1), kwargs = {})
#   %mul_21 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_38, %sub_7), kwargs = {})
#   %where_9 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_9, %add_9, %where_8), kwargs = {})
#   %div_10 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_9, 2), kwargs = {})
#   %add_10 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_9, %div_10), kwargs = {})
#   %sub_39 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_10), kwargs = {})
#   %clamp_min_11 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_39, 0), kwargs = {})
#   %full_default_14 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_14 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_11, %full_default_14), kwargs = {})
#   %sum_12 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_14, [-1]), kwargs = {})
#   %sub_41 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_12, 1), kwargs = {})
#   %mul_23 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_41, %sub_7), kwargs = {})
#   %where_10 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_10, %add_10, %where_9), kwargs = {})
#   %div_11 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_10, 2), kwargs = {})
#   %add_11 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_10, %div_11), kwargs = {})
#   %sub_42 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_11), kwargs = {})
#   %clamp_min_12 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_42, 0), kwargs = {})
#   %full_default_15 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_15 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_12, %full_default_15), kwargs = {})
#   %sum_13 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_15, [-1]), kwargs = {})
#   %sub_44 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_13, 1), kwargs = {})
#   %mul_25 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_44, %sub_7), kwargs = {})
#   %where_11 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_11, %add_11, %where_10), kwargs = {})
#   %div_12 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_11, 2), kwargs = {})
#   %add_12 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_11, %div_12), kwargs = {})
#   %sub_45 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_12), kwargs = {})
#   %clamp_min_13 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_45, 0), kwargs = {})
#   %full_default_16 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_16 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_13, %full_default_16), kwargs = {})
#   %sum_14 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_16, [-1]), kwargs = {})
#   %sub_47 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_14, 1), kwargs = {})
#   %mul_27 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_47, %sub_7), kwargs = {})
#   %where_12 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_12, %add_12, %where_11), kwargs = {})
#   %div_13 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_12, 2), kwargs = {})
#   %add_13 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_12, %div_13), kwargs = {})
#   %sub_48 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_13), kwargs = {})
#   %clamp_min_14 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_48, 0), kwargs = {})
#   %full_default_17 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_17 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_14, %full_default_17), kwargs = {})
#   %sum_15 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_17, [-1]), kwargs = {})
#   %sub_50 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_15, 1), kwargs = {})
#   %mul_29 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_50, %sub_7), kwargs = {})
#   %where_13 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_13, %add_13, %where_12), kwargs = {})
#   %div_14 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_13, 2), kwargs = {})
#   %add_14 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_13, %div_14), kwargs = {})
#   %sub_51 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_14), kwargs = {})
#   %clamp_min_15 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_51, 0), kwargs = {})
#   %full_default_18 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_18 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_15, %full_default_18), kwargs = {})
#   %sum_16 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_18, [-1]), kwargs = {})
#   %where_14 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_14, %add_14, %where_13), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %add_15 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_14, %div_15), kwargs = {})
#   %sub_54 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_15), kwargs = {})
#   %clamp_min_16 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_54, 0), kwargs = {})
#   %full_default_19 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_19 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_16, %full_default_19), kwargs = {})
#   %sum_17 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_19, [-1]), kwargs = {})
#   %sub_56 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_17, 1), kwargs = {})
#   %where_15 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_15, %add_15, %where_14), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %add_16 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_15, %div_16), kwargs = {})
#   %sub_57 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_16), kwargs = {})
#   %clamp_min_17 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_57, 0), kwargs = {})
#   %full_default_20 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_20 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_17, %full_default_20), kwargs = {})
#   %sum_18 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_20, [-1]), kwargs = {})
#   %where_16 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_16, %add_16, %where_15), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %add_17 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_16, %div_17), kwargs = {})
#   %sub_60 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_17), kwargs = {})
#   %clamp_min_18 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_60, 0), kwargs = {})
#   %full_default_21 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_21 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_18, %full_default_21), kwargs = {})
#   %sum_19 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_21, [-1]), kwargs = {})
#   %where_17 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_17, %add_17, %where_16), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %add_18 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_17, %div_18), kwargs = {})
#   %sub_63 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_18), kwargs = {})
#   %clamp_min_19 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_63, 0), kwargs = {})
#   %full_default_22 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_22 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_19, %full_default_22), kwargs = {})
#   %sum_20 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_22, [-1]), kwargs = {})
#   %where_18 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_18, %add_18, %where_17), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %add_19 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_18, %div_19), kwargs = {})
#   %sub_66 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_19), kwargs = {})
#   %clamp_min_20 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_66, 0), kwargs = {})
#   %full_default_23 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_23 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_20, %full_default_23), kwargs = {})
#   %sum_21 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_23, [-1]), kwargs = {})
#   %where_19 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_19, %add_19, %where_18), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %add_20 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_19, %div_20), kwargs = {})
#   %sub_69 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_20), kwargs = {})
#   %clamp_min_21 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_69, 0), kwargs = {})
#   %full_default_24 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_24 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_21, %full_default_24), kwargs = {})
#   %sum_22 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_24, [-1]), kwargs = {})
#   %where_20 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_20, %add_20, %where_19), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %add_21 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_20, %div_21), kwargs = {})
#   %sub_72 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_21), kwargs = {})
#   %clamp_min_22 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_72, 0), kwargs = {})
#   %full_default_25 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_25 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_22, %full_default_25), kwargs = {})
#   %sum_23 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_25, [-1]), kwargs = {})
#   %where_21 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_21, %add_21, %where_20), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %add_22 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_21, %div_22), kwargs = {})
#   %sub_75 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_22), kwargs = {})
#   %clamp_min_23 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_75, 0), kwargs = {})
#   %full_default_26 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_26 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_23, %full_default_26), kwargs = {})
#   %sum_24 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_26, [-1]), kwargs = {})
#   %where_22 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_22, %add_22, %where_21), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %add_23 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_22, %div_23), kwargs = {})
#   %sub_78 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_23), kwargs = {})
#   %clamp_min_24 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_78, 0), kwargs = {})
#   %full_default_27 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_27 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_24, %full_default_27), kwargs = {})
#   %sum_25 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_27, [-1]), kwargs = {})
#   %where_23 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_23, %add_23, %where_22), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %add_24 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_23, %div_24), kwargs = {})
#   %sub_81 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_24), kwargs = {})
#   %clamp_min_25 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_81, 0), kwargs = {})
#   %full_default_28 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_28 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_25, %full_default_28), kwargs = {})
#   %sum_26 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_28, [-1]), kwargs = {})
#   %where_24 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_24, %add_24, %where_23), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %add_25 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_24, %div_25), kwargs = {})
#   %sub_84 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_25), kwargs = {})
#   %clamp_min_26 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_84, 0), kwargs = {})
#   %full_default_29 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_29 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_26, %full_default_29), kwargs = {})
#   %sum_27 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_29, [-1]), kwargs = {})
triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0 = async_compile.triton('triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 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, 4, 5), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0', 'mutated_arg_names': ['in_out_ptr12'], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0(in_out_ptr12, in_ptr0, out_ptr0, out_ptr19, out_ptr27, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = tmp3 * tmp1
    tmp5 = triton_helpers.maximum(tmp2, tmp4)
    tmp7 = tmp6 * tmp1
    tmp8 = triton_helpers.maximum(tmp5, tmp7)
    tmp10 = tmp9 * tmp1
    tmp11 = triton_helpers.maximum(tmp8, tmp10)
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp14 = tmp11 - tmp1
    tmp15 = tmp14 - tmp13
    tmp16 = tmp15 * tmp1
    tmp17 = tmp13 + tmp16
    tmp18 = tmp2 - tmp17
    tmp19 = 0.0
    tmp20 = triton_helpers.maximum(tmp18, tmp19)
    tmp21 = 2.0
    tmp22 = libdevice.pow(tmp20, tmp21)
    tmp23 = tmp4 - tmp17
    tmp24 = triton_helpers.maximum(tmp23, tmp19)
    tmp25 = libdevice.pow(tmp24, tmp21)
    tmp26 = tmp22 + tmp25
    tmp27 = tmp7 - tmp17
    tmp28 = triton_helpers.maximum(tmp27, tmp19)
    tmp29 = libdevice.pow(tmp28, tmp21)
    tmp30 = tmp26 + tmp29
    tmp31 = tmp10 - tmp17
    tmp32 = triton_helpers.maximum(tmp31, tmp19)
    tmp33 = libdevice.pow(tmp32, tmp21)
    tmp34 = tmp30 + tmp33
    tmp35 = tmp2 - tmp13
    tmp36 = triton_helpers.maximum(tmp35, tmp19)
    tmp37 = libdevice.pow(tmp36, tmp21)
    tmp38 = tmp4 - tmp13
    tmp39 = triton_helpers.maximum(tmp38, tmp19)
    tmp40 = libdevice.pow(tmp39, tmp21)
    tmp41 = tmp37 + tmp40
    tmp42 = tmp7 - tmp13
    tmp43 = triton_helpers.maximum(tmp42, tmp19)
    tmp44 = libdevice.pow(tmp43, tmp21)
    tmp45 = tmp41 + tmp44
    tmp46 = tmp10 - tmp13
    tmp47 = triton_helpers.maximum(tmp46, tmp19)
    tmp48 = libdevice.pow(tmp47, tmp21)
    tmp49 = tmp45 + tmp48
    tmp50 = tmp34 - tmp12
    tmp51 = tmp49 - tmp12
    tmp52 = tmp50 * tmp51
    tmp53 = tmp52 >= tmp19
    tmp54 = tl.where(tmp53, tmp17, tmp13)
    tmp55 = tmp16 * tmp1
    tmp56 = tmp54 + tmp55
    tmp57 = tmp2 - tmp56
    tmp58 = triton_helpers.maximum(tmp57, tmp19)
    tmp59 = libdevice.pow(tmp58, tmp21)
    tmp60 = tmp4 - tmp56
    tmp61 = triton_helpers.maximum(tmp60, tmp19)
    tmp62 = libdevice.pow(tmp61, tmp21)
    tmp63 = tmp59 + tmp62
    tmp64 = tmp7 - tmp56
    tmp65 = triton_helpers.maximum(tmp64, tmp19)
    tmp66 = libdevice.pow(tmp65, tmp21)
    tmp67 = tmp63 + tmp66
    tmp68 = tmp10 - tmp56
    tmp69 = triton_helpers.maximum(tmp68, tmp19)
    tmp70 = libdevice.pow(tmp69, tmp21)
    tmp71 = tmp67 + tmp70
    tmp72 = tmp71 - tmp12
    tmp73 = tmp72 * tmp51
    tmp74 = tmp73 >= tmp19
    tmp75 = tl.where(tmp74, tmp56, tmp54)
    tmp76 = tmp55 * tmp1
    tmp77 = tmp75 + tmp76
    tmp78 = tmp2 - tmp77
    tmp79 = triton_helpers.maximum(tmp78, tmp19)
    tmp80 = libdevice.pow(tmp79, tmp21)
    tmp81 = tmp4 - tmp77
    tmp82 = triton_helpers.maximum(tmp81, tmp19)
    tmp83 = libdevice.pow(tmp82, tmp21)
    tmp84 = tmp80 + tmp83
    tmp85 = tmp7 - tmp77
    tmp86 = triton_helpers.maximum(tmp85, tmp19)
    tmp87 = libdevice.pow(tmp86, tmp21)
    tmp88 = tmp84 + tmp87
    tmp89 = tmp10 - tmp77
    tmp90 = triton_helpers.maximum(tmp89, tmp19)
    tmp91 = libdevice.pow(tmp90, tmp21)
    tmp92 = tmp88 + tmp91
    tmp93 = tmp92 - tmp12
    tmp94 = tmp93 * tmp51
    tmp95 = tmp94 >= tmp19
    tmp96 = tl.where(tmp95, tmp77, tmp75)
    tmp97 = tmp76 * tmp1
    tmp98 = tmp96 + tmp97
    tmp99 = tmp2 - tmp98
    tmp100 = triton_helpers.maximum(tmp99, tmp19)
    tmp101 = libdevice.pow(tmp100, tmp21)
    tmp102 = tmp4 - tmp98
    tmp103 = triton_helpers.maximum(tmp102, tmp19)
    tmp104 = libdevice.pow(tmp103, tmp21)
    tmp105 = tmp101 + tmp104
    tmp106 = tmp7 - tmp98
    tmp107 = triton_helpers.maximum(tmp106, tmp19)
    tmp108 = libdevice.pow(tmp107, tmp21)
    tmp109 = tmp105 + tmp108
    tmp110 = tmp10 - tmp98
    tmp111 = triton_helpers.maximum(tmp110, tmp19)
    tmp112 = libdevice.pow(tmp111, tmp21)
    tmp113 = tmp109 + tmp112
    tmp114 = tmp113 - tmp12
    tmp115 = tmp114 * tmp51
    tmp116 = tmp115 >= tmp19
    tmp117 = tl.where(tmp116, tmp98, tmp96)
    tmp118 = tmp97 * tmp1
    tmp119 = tmp117 + tmp118
    tmp120 = tmp2 - tmp119
    tmp121 = triton_helpers.maximum(tmp120, tmp19)
    tmp122 = libdevice.pow(tmp121, tmp21)
    tmp123 = tmp4 - tmp119
    tmp124 = triton_helpers.maximum(tmp123, tmp19)
    tmp125 = libdevice.pow(tmp124, tmp21)
    tmp126 = tmp122 + tmp125
    tmp127 = tmp7 - tmp119
    tmp128 = triton_helpers.maximum(tmp127, tmp19)
    tmp129 = libdevice.pow(tmp128, tmp21)
    tmp130 = tmp126 + tmp129
    tmp131 = tmp10 - tmp119
    tmp132 = triton_helpers.maximum(tmp131, tmp19)
    tmp133 = libdevice.pow(tmp132, tmp21)
    tmp134 = tmp130 + tmp133
    tmp135 = tmp134 - tmp12
    tmp136 = tmp135 * tmp51
    tmp137 = tmp136 >= tmp19
    tmp138 = tl.where(tmp137, tmp119, tmp117)
    tmp139 = tmp118 * tmp1
    tmp140 = tmp138 + tmp139
    tmp141 = tmp2 - tmp140
    tmp142 = triton_helpers.maximum(tmp141, tmp19)
    tmp143 = libdevice.pow(tmp142, tmp21)
    tmp144 = tmp4 - tmp140
    tmp145 = triton_helpers.maximum(tmp144, tmp19)
    tmp146 = libdevice.pow(tmp145, tmp21)
    tmp147 = tmp143 + tmp146
    tmp148 = tmp7 - tmp140
    tmp149 = triton_helpers.maximum(tmp148, tmp19)
    tmp150 = libdevice.pow(tmp149, tmp21)
    tmp151 = tmp147 + tmp150
    tmp152 = tmp10 - tmp140
    tmp153 = triton_helpers.maximum(tmp152, tmp19)
    tmp154 = libdevice.pow(tmp153, tmp21)
    tmp155 = tmp151 + tmp154
    tmp156 = tmp155 - tmp12
    tmp157 = tmp156 * tmp51
    tmp158 = tmp157 >= tmp19
    tmp159 = tl.where(tmp158, tmp140, tmp138)
    tmp160 = tmp139 * tmp1
    tmp161 = tmp159 + tmp160
    tmp162 = tmp2 - tmp161
    tmp163 = triton_helpers.maximum(tmp162, tmp19)
    tmp164 = libdevice.pow(tmp163, tmp21)
    tmp165 = tmp4 - tmp161
    tmp166 = triton_helpers.maximum(tmp165, tmp19)
    tmp167 = libdevice.pow(tmp166, tmp21)
    tmp168 = tmp164 + tmp167
    tmp169 = tmp7 - tmp161
    tmp170 = triton_helpers.maximum(tmp169, tmp19)
    tmp171 = libdevice.pow(tmp170, tmp21)
    tmp172 = tmp168 + tmp171
    tmp173 = tmp10 - tmp161
    tmp174 = triton_helpers.maximum(tmp173, tmp19)
    tmp175 = libdevice.pow(tmp174, tmp21)
    tmp176 = tmp172 + tmp175
    tmp177 = tmp176 - tmp12
    tmp178 = tmp177 * tmp51
    tmp179 = tmp178 >= tmp19
    tmp180 = tl.where(tmp179, tmp161, tmp159)
    tmp181 = tmp160 * tmp1
    tmp182 = tmp180 + tmp181
    tmp183 = tmp2 - tmp182
    tmp184 = triton_helpers.maximum(tmp183, tmp19)
    tmp185 = libdevice.pow(tmp184, tmp21)
    tmp186 = tmp4 - tmp182
    tmp187 = triton_helpers.maximum(tmp186, tmp19)
    tmp188 = libdevice.pow(tmp187, tmp21)
    tmp189 = tmp185 + tmp188
    tmp190 = tmp7 - tmp182
    tmp191 = triton_helpers.maximum(tmp190, tmp19)
    tmp192 = libdevice.pow(tmp191, tmp21)
    tmp193 = tmp189 + tmp192
    tmp194 = tmp10 - tmp182
    tmp195 = triton_helpers.maximum(tmp194, tmp19)
    tmp196 = libdevice.pow(tmp195, tmp21)
    tmp197 = tmp193 + tmp196
    tmp198 = tmp197 - tmp12
    tmp199 = tmp198 * tmp51
    tmp200 = tmp199 >= tmp19
    tmp201 = tl.where(tmp200, tmp182, tmp180)
    tmp202 = tmp181 * tmp1
    tmp203 = tmp201 + tmp202
    tmp204 = tmp2 - tmp203
    tmp205 = triton_helpers.maximum(tmp204, tmp19)
    tmp206 = libdevice.pow(tmp205, tmp21)
    tmp207 = tmp4 - tmp203
    tmp208 = triton_helpers.maximum(tmp207, tmp19)
    tmp209 = libdevice.pow(tmp208, tmp21)
    tmp210 = tmp206 + tmp209
    tmp211 = tmp7 - tmp203
    tmp212 = triton_helpers.maximum(tmp211, tmp19)
    tmp213 = libdevice.pow(tmp212, tmp21)
    tmp214 = tmp210 + tmp213
    tmp215 = tmp10 - tmp203
    tmp216 = triton_helpers.maximum(tmp215, tmp19)
    tmp217 = libdevice.pow(tmp216, tmp21)
    tmp218 = tmp214 + tmp217
    tmp219 = tmp218 - tmp12
    tmp220 = tmp219 * tmp51
    tmp221 = tmp220 >= tmp19
    tmp222 = tl.where(tmp221, tmp203, tmp201)
    tmp223 = tmp202 * tmp1
    tmp224 = tmp222 + tmp223
    tmp225 = tmp2 - tmp224
    tmp226 = triton_helpers.maximum(tmp225, tmp19)
    tmp227 = libdevice.pow(tmp226, tmp21)
    tmp228 = tmp4 - tmp224
    tmp229 = triton_helpers.maximum(tmp228, tmp19)
    tmp230 = libdevice.pow(tmp229, tmp21)
    tmp231 = tmp227 + tmp230
    tmp232 = tmp7 - tmp224
    tmp233 = triton_helpers.maximum(tmp232, tmp19)
    tmp234 = libdevice.pow(tmp233, tmp21)
    tmp235 = tmp231 + tmp234
    tmp236 = tmp10 - tmp224
    tmp237 = triton_helpers.maximum(tmp236, tmp19)
    tmp238 = libdevice.pow(tmp237, tmp21)
    tmp239 = tmp235 + tmp238
    tmp240 = tmp239 - tmp12
    tmp241 = tmp240 * tmp51
    tmp242 = tmp241 >= tmp19
    tmp243 = tl.where(tmp242, tmp224, tmp222)
    tmp244 = tmp223 * tmp1
    tmp245 = tmp243 + tmp244
    tmp246 = tmp2 - tmp245
    tmp247 = triton_helpers.maximum(tmp246, tmp19)
    tmp248 = libdevice.pow(tmp247, tmp21)
    tmp249 = tmp4 - tmp245
    tmp250 = triton_helpers.maximum(tmp249, tmp19)
    tmp251 = libdevice.pow(tmp250, tmp21)
    tmp252 = tmp248 + tmp251
    tmp253 = tmp7 - tmp245
    tmp254 = triton_helpers.maximum(tmp253, tmp19)
    tmp255 = libdevice.pow(tmp254, tmp21)
    tmp256 = tmp252 + tmp255
    tmp257 = tmp10 - tmp245
    tmp258 = triton_helpers.maximum(tmp257, tmp19)
    tmp259 = libdevice.pow(tmp258, tmp21)
    tmp260 = tmp256 + tmp259
    tmp261 = tmp260 - tmp12
    tmp262 = tmp261 * tmp51
    tmp263 = tmp262 >= tmp19
    tmp264 = tl.where(tmp263, tmp245, tmp243)
    tmp265 = tmp244 * tmp1
    tmp266 = tmp264 + tmp265
    tmp267 = tmp2 - tmp266
    tmp268 = triton_helpers.maximum(tmp267, tmp19)
    tmp269 = libdevice.pow(tmp268, tmp21)
    tmp270 = tmp4 - tmp266
    tmp271 = triton_helpers.maximum(tmp270, tmp19)
    tmp272 = libdevice.pow(tmp271, tmp21)
    tmp273 = tmp269 + tmp272
    tmp274 = tmp7 - tmp266
    tmp275 = triton_helpers.maximum(tmp274, tmp19)
    tmp276 = libdevice.pow(tmp275, tmp21)
    tmp277 = tmp273 + tmp276
    tmp278 = tmp10 - tmp266
    tmp279 = triton_helpers.maximum(tmp278, tmp19)
    tmp280 = libdevice.pow(tmp279, tmp21)
    tmp281 = tmp277 + tmp280
    tmp282 = tmp281 - tmp12
    tmp283 = tmp282 * tmp51
    tmp284 = tmp283 >= tmp19
    tmp285 = tl.where(tmp284, tmp266, tmp264)
    tmp286 = tmp265 * tmp1
    tmp287 = tmp285 + tmp286
    tmp288 = tmp2 - tmp287
    tmp289 = triton_helpers.maximum(tmp288, tmp19)
    tmp290 = libdevice.pow(tmp289, tmp21)
    tmp291 = tmp4 - tmp287
    tmp292 = triton_helpers.maximum(tmp291, tmp19)
    tmp293 = libdevice.pow(tmp292, tmp21)
    tmp294 = tmp290 + tmp293
    tmp295 = tmp7 - tmp287
    tmp296 = triton_helpers.maximum(tmp295, tmp19)
    tmp297 = libdevice.pow(tmp296, tmp21)
    tmp298 = tmp294 + tmp297
    tmp299 = tmp10 - tmp287
    tmp300 = triton_helpers.maximum(tmp299, tmp19)
    tmp301 = libdevice.pow(tmp300, tmp21)
    tmp302 = tmp298 + tmp301
    tmp303 = tmp302 - tmp12
    tmp304 = tmp303 * tmp51
    tmp305 = tmp304 >= tmp19
    tmp306 = tl.where(tmp305, tmp287, tmp285)
    tmp307 = tmp286 * tmp1
    tmp308 = tmp307 * tmp1
    tmp309 = tmp306 + tmp307
    tmp310 = tmp2 - tmp309
    tmp311 = triton_helpers.maximum(tmp310, tmp19)
    tmp312 = libdevice.pow(tmp311, tmp21)
    tmp313 = tmp4 - tmp309
    tmp314 = triton_helpers.maximum(tmp313, tmp19)
    tmp315 = libdevice.pow(tmp314, tmp21)
    tmp316 = tmp312 + tmp315
    tmp317 = tmp7 - tmp309
    tmp318 = triton_helpers.maximum(tmp317, tmp19)
    tmp319 = libdevice.pow(tmp318, tmp21)
    tmp320 = tmp316 + tmp319
    tmp321 = tmp10 - tmp309
    tmp322 = triton_helpers.maximum(tmp321, tmp19)
    tmp323 = libdevice.pow(tmp322, tmp21)
    tmp324 = tmp320 + tmp323
    tmp325 = tmp324 - tmp12
    tmp326 = tmp325 * tmp51
    tmp327 = tmp326 >= tmp19
    tmp328 = tl.where(tmp327, tmp309, tmp306)
    tmp329 = tmp328 + tmp308
    tmp330 = tmp2 - tmp329
    tmp331 = triton_helpers.maximum(tmp330, tmp19)
    tmp332 = libdevice.pow(tmp331, tmp21)
    tmp333 = tmp4 - tmp329
    tmp334 = triton_helpers.maximum(tmp333, tmp19)
    tmp335 = libdevice.pow(tmp334, tmp21)
    tmp336 = tmp332 + tmp335
    tmp337 = tmp7 - tmp329
    tmp338 = triton_helpers.maximum(tmp337, tmp19)
    tmp339 = libdevice.pow(tmp338, tmp21)
    tmp340 = tmp336 + tmp339
    tmp341 = tmp10 - tmp329
    tmp342 = triton_helpers.maximum(tmp341, tmp19)
    tmp343 = libdevice.pow(tmp342, tmp21)
    tmp344 = tmp340 + tmp343
    tmp345 = tmp344 - tmp12
    tmp346 = tmp345 * tmp51
    tmp347 = tmp346 >= tmp19
    tmp348 = tl.where(tmp347, tmp329, tmp328)
    tmp349 = tmp308 * tmp1
    tmp350 = tmp348 + tmp349
    tmp351 = tmp2 - tmp350
    tmp352 = triton_helpers.maximum(tmp351, tmp19)
    tmp353 = libdevice.pow(tmp352, tmp21)
    tmp354 = tmp4 - tmp350
    tmp355 = triton_helpers.maximum(tmp354, tmp19)
    tmp356 = libdevice.pow(tmp355, tmp21)
    tmp357 = tmp353 + tmp356
    tmp358 = tmp7 - tmp350
    tmp359 = triton_helpers.maximum(tmp358, tmp19)
    tmp360 = libdevice.pow(tmp359, tmp21)
    tmp361 = tmp357 + tmp360
    tmp362 = tmp10 - tmp350
    tmp363 = triton_helpers.maximum(tmp362, tmp19)
    tmp364 = libdevice.pow(tmp363, tmp21)
    tmp365 = tmp361 + tmp364
    tmp366 = tmp365 - tmp12
    tmp367 = tmp366 * tmp51
    tmp368 = tmp367 >= tmp19
    tmp369 = tl.where(tmp368, tmp350, tmp348)
    tmp370 = tmp349 * tmp1
    tmp371 = tmp369 + tmp370
    tmp372 = tmp2 - tmp371
    tmp373 = triton_helpers.maximum(tmp372, tmp19)
    tmp374 = libdevice.pow(tmp373, tmp21)
    tmp375 = tmp4 - tmp371
    tmp376 = triton_helpers.maximum(tmp375, tmp19)
    tmp377 = libdevice.pow(tmp376, tmp21)
    tmp378 = tmp374 + tmp377
    tmp379 = tmp7 - tmp371
    tmp380 = triton_helpers.maximum(tmp379, tmp19)
    tmp381 = libdevice.pow(tmp380, tmp21)
    tmp382 = tmp378 + tmp381
    tmp383 = tmp10 - tmp371
    tmp384 = triton_helpers.maximum(tmp383, tmp19)
    tmp385 = libdevice.pow(tmp384, tmp21)
    tmp386 = tmp382 + tmp385
    tmp387 = tmp386 - tmp12
    tmp388 = tmp387 * tmp51
    tmp389 = tmp388 >= tmp19
    tmp390 = tl.where(tmp389, tmp371, tmp369)
    tmp391 = tmp370 * tmp1
    tmp392 = tmp390 + tmp391
    tmp393 = tmp2 - tmp392
    tmp394 = triton_helpers.maximum(tmp393, tmp19)
    tmp395 = libdevice.pow(tmp394, tmp21)
    tmp396 = tmp4 - tmp392
    tmp397 = triton_helpers.maximum(tmp396, tmp19)
    tmp398 = libdevice.pow(tmp397, tmp21)
    tmp399 = tmp395 + tmp398
    tmp400 = tmp7 - tmp392
    tmp401 = triton_helpers.maximum(tmp400, tmp19)
    tmp402 = libdevice.pow(tmp401, tmp21)
    tmp403 = tmp399 + tmp402
    tmp404 = tmp10 - tmp392
    tmp405 = triton_helpers.maximum(tmp404, tmp19)
    tmp406 = libdevice.pow(tmp405, tmp21)
    tmp407 = tmp403 + tmp406
    tmp408 = tmp407 - tmp12
    tmp409 = tmp408 * tmp51
    tmp410 = tmp409 >= tmp19
    tmp411 = tl.where(tmp410, tmp392, tmp390)
    tmp412 = tmp391 * tmp1
    tmp413 = tmp411 + tmp412
    tmp414 = tmp2 - tmp413
    tmp415 = triton_helpers.maximum(tmp414, tmp19)
    tmp416 = libdevice.pow(tmp415, tmp21)
    tmp417 = tmp4 - tmp413
    tmp418 = triton_helpers.maximum(tmp417, tmp19)
    tmp419 = libdevice.pow(tmp418, tmp21)
    tmp420 = tmp416 + tmp419
    tmp421 = tmp7 - tmp413
    tmp422 = triton_helpers.maximum(tmp421, tmp19)
    tmp423 = libdevice.pow(tmp422, tmp21)
    tmp424 = tmp420 + tmp423
    tmp425 = tmp10 - tmp413
    tmp426 = triton_helpers.maximum(tmp425, tmp19)
    tmp427 = libdevice.pow(tmp426, tmp21)
    tmp428 = tmp424 + tmp427
    tmp429 = tmp428 - tmp12
    tmp430 = tmp429 * tmp51
    tmp431 = tmp430 >= tmp19
    tmp432 = tl.where(tmp431, tmp413, tmp411)
    tmp433 = tmp412 * tmp1
    tmp434 = tmp432 + tmp433
    tmp435 = tmp2 - tmp434
    tmp436 = triton_helpers.maximum(tmp435, tmp19)
    tmp437 = libdevice.pow(tmp436, tmp21)
    tmp438 = tmp4 - tmp434
    tmp439 = triton_helpers.maximum(tmp438, tmp19)
    tmp440 = libdevice.pow(tmp439, tmp21)
    tmp441 = tmp437 + tmp440
    tmp442 = tmp7 - tmp434
    tmp443 = triton_helpers.maximum(tmp442, tmp19)
    tmp444 = libdevice.pow(tmp443, tmp21)
    tmp445 = tmp441 + tmp444
    tmp446 = tmp10 - tmp434
    tmp447 = triton_helpers.maximum(tmp446, tmp19)
    tmp448 = libdevice.pow(tmp447, tmp21)
    tmp449 = tmp445 + tmp448
    tmp450 = tmp449 - tmp12
    tmp451 = tmp450 * tmp51
    tmp452 = tmp451 >= tmp19
    tmp453 = tl.where(tmp452, tmp434, tmp432)
    tmp454 = tmp433 * tmp1
    tmp455 = tmp453 + tmp454
    tmp456 = tmp2 - tmp455
    tmp457 = triton_helpers.maximum(tmp456, tmp19)
    tmp458 = libdevice.pow(tmp457, tmp21)
    tmp459 = tmp4 - tmp455
    tmp460 = triton_helpers.maximum(tmp459, tmp19)
    tmp461 = libdevice.pow(tmp460, tmp21)
    tmp462 = tmp458 + tmp461
    tmp463 = tmp7 - tmp455
    tmp464 = triton_helpers.maximum(tmp463, tmp19)
    tmp465 = libdevice.pow(tmp464, tmp21)
    tmp466 = tmp462 + tmp465
    tmp467 = tmp10 - tmp455
    tmp468 = triton_helpers.maximum(tmp467, tmp19)
    tmp469 = libdevice.pow(tmp468, tmp21)
    tmp470 = tmp466 + tmp469
    tmp471 = tmp470 - tmp12
    tmp472 = tmp471 * tmp51
    tmp473 = tmp472 >= tmp19
    tmp474 = tl.where(tmp473, tmp455, tmp453)
    tmp475 = tmp454 * tmp1
    tmp476 = tmp474 + tmp475
    tmp477 = tmp2 - tmp476
    tmp478 = triton_helpers.maximum(tmp477, tmp19)
    tmp479 = libdevice.pow(tmp478, tmp21)
    tmp480 = tmp4 - tmp476
    tmp481 = triton_helpers.maximum(tmp480, tmp19)
    tmp482 = libdevice.pow(tmp481, tmp21)
    tmp483 = tmp479 + tmp482
    tmp484 = tmp7 - tmp476
    tmp485 = triton_helpers.maximum(tmp484, tmp19)
    tmp486 = libdevice.pow(tmp485, tmp21)
    tmp487 = tmp483 + tmp486
    tmp488 = tmp10 - tmp476
    tmp489 = triton_helpers.maximum(tmp488, tmp19)
    tmp490 = libdevice.pow(tmp489, tmp21)
    tmp491 = tmp487 + tmp490
    tmp492 = tmp491 - tmp12
    tmp493 = tmp492 * tmp51
    tmp494 = tmp493 >= tmp19
    tmp495 = tl.where(tmp494, tmp476, tmp474)
    tmp496 = tmp475 * tmp1
    tmp497 = tmp495 + tmp496
    tmp498 = tmp2 - tmp497
    tmp499 = triton_helpers.maximum(tmp498, tmp19)
    tmp500 = libdevice.pow(tmp499, tmp21)
    tmp501 = tmp4 - tmp497
    tmp502 = triton_helpers.maximum(tmp501, tmp19)
    tmp503 = libdevice.pow(tmp502, tmp21)
    tmp504 = tmp500 + tmp503
    tmp505 = tmp7 - tmp497
    tmp506 = triton_helpers.maximum(tmp505, tmp19)
    tmp507 = libdevice.pow(tmp506, tmp21)
    tmp508 = tmp504 + tmp507
    tmp509 = tmp10 - tmp497
    tmp510 = triton_helpers.maximum(tmp509, tmp19)
    tmp511 = libdevice.pow(tmp510, tmp21)
    tmp512 = tmp508 + tmp511
    tmp513 = tmp512 - tmp12
    tmp514 = tmp513 * tmp51
    tmp515 = tmp514 >= tmp19
    tmp516 = tl.where(tmp515, tmp497, tmp495)
    tmp517 = tmp496 * tmp1
    tmp518 = tmp516 + tmp517
    tmp519 = tmp2 - tmp518
    tmp520 = triton_helpers.maximum(tmp519, tmp19)
    tmp521 = libdevice.pow(tmp520, tmp21)
    tmp522 = tmp4 - tmp518
    tmp523 = triton_helpers.maximum(tmp522, tmp19)
    tmp524 = libdevice.pow(tmp523, tmp21)
    tmp525 = tmp521 + tmp524
    tmp526 = tmp7 - tmp518
    tmp527 = triton_helpers.maximum(tmp526, tmp19)
    tmp528 = libdevice.pow(tmp527, tmp21)
    tmp529 = tmp525 + tmp528
    tmp530 = tmp10 - tmp518
    tmp531 = triton_helpers.maximum(tmp530, tmp19)
    tmp532 = libdevice.pow(tmp531, tmp21)
    tmp533 = tmp529 + tmp532
    tmp534 = tmp533 - tmp12
    tmp535 = tmp534 * tmp51
    tmp536 = tmp535 >= tmp19
    tmp537 = tl.where(tmp536, tmp518, tmp516)
    tmp538 = tmp517 * tmp1
    tmp539 = tmp537 + tmp538
    tmp540 = tmp2 - tmp539
    tmp541 = triton_helpers.maximum(tmp540, tmp19)
    tmp542 = libdevice.pow(tmp541, tmp21)
    tmp543 = tmp4 - tmp539
    tmp544 = triton_helpers.maximum(tmp543, tmp19)
    tmp545 = libdevice.pow(tmp544, tmp21)
    tmp546 = tmp542 + tmp545
    tmp547 = tmp7 - tmp539
    tmp548 = triton_helpers.maximum(tmp547, tmp19)
    tmp549 = libdevice.pow(tmp548, tmp21)
    tmp550 = tmp546 + tmp549
    tmp551 = tmp10 - tmp539
    tmp552 = triton_helpers.maximum(tmp551, tmp19)
    tmp553 = libdevice.pow(tmp552, tmp21)
    tmp554 = tmp550 + tmp553
    tmp555 = tmp554 - tmp12
    tmp556 = tmp555 * tmp51
    tmp557 = tmp556 >= tmp19
    tmp558 = tl.where(tmp557, tmp539, tmp537)
    tmp559 = tmp538 * tmp1
    tmp560 = tmp558 + tmp559
    tmp561 = tmp2 - tmp560
    tmp562 = triton_helpers.maximum(tmp561, tmp19)
    tmp563 = libdevice.pow(tmp562, tmp21)
    tmp564 = tmp4 - tmp560
    tmp565 = triton_helpers.maximum(tmp564, tmp19)
    tmp566 = libdevice.pow(tmp565, tmp21)
    tmp567 = tmp563 + tmp566
    tmp568 = tmp7 - tmp560
    tmp569 = triton_helpers.maximum(tmp568, tmp19)
    tmp570 = libdevice.pow(tmp569, tmp21)
    tmp571 = tmp567 + tmp570
    tmp572 = tmp10 - tmp560
    tmp573 = triton_helpers.maximum(tmp572, tmp19)
    tmp574 = libdevice.pow(tmp573, tmp21)
    tmp575 = tmp571 + tmp574
    tl.store(out_ptr0 + (x0), tmp49, xmask)
    tl.store(out_ptr19 + (x0), tmp308, xmask)
    tl.store(in_out_ptr12 + (x0), tmp558, xmask)
    tl.store(out_ptr27 + (x0), tmp575, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/wp/cwps7jwo24axevjav4czdrzol2hcmol74gjjohufcaso6g5zh2my.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, tau_m_25, tau_lo_26, dm_27, tau_m_26, sub_87, clamp_27, truediv_27, p_m_26], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow]
# Source node to ATen node mapping:
#   X => mul
#   clamp_27 => clamp_min_27
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   p_m_26 => pow_30
#   sub => full_default
#   sub_87 => sub_87
#   tau_lo_26 => where_25
#   tau_m_25 => add_25
#   tau_m_26 => add_26
#   truediv_27 => full_default_30
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %add_25 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_24, %div_25), kwargs = {})
#   %where_25 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_25, %add_25, %where_24), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %add_26 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_25, %div_26), kwargs = {})
#   %sub_87 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_26), kwargs = {})
#   %clamp_min_27 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_87, 0), kwargs = {})
#   %full_default_30 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_30 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_27, %full_default_30), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_where_1 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_where_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_where_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 5, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_where_1(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + (x1), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp11 + tmp23
    tmp25 = tl.where(tmp10, tmp24, tmp11)
    tmp26 = tmp23 * tmp1
    tmp27 = tmp25 + tmp26
    tmp28 = tmp2 - tmp27
    tmp29 = triton_helpers.maximum(tmp28, tmp9)
    tmp30 = 2.0
    tmp31 = libdevice.pow(tmp29, tmp30)
    tl.store(out_ptr0 + (x2), tmp31, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/h7/ch7plngbxligq5e4vnkulisynihcx6p3zjpiwu3vq4ul6nzoouq7.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, tau_m_25, tau_lo_26, dm_27, tau_m_26, tau_lo_27, dm_28, tau_m_27, sub_90, clamp_28, truediv_28, p_m_27, sum_29], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   X => mul
#   clamp_28 => clamp_min_28
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   p_m_27 => pow_31
#   sub => full_default
#   sub_90 => sub_90
#   sum_29 => sum_29
#   tau_lo_26 => where_25
#   tau_lo_27 => where_26
#   tau_m_25 => add_25
#   tau_m_26 => add_26
#   tau_m_27 => add_27
#   truediv_28 => full_default_31
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %add_25 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_24, %div_25), kwargs = {})
#   %where_25 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_25, %add_25, %where_24), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %add_26 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_25, %div_26), kwargs = {})
#   %where_26 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_26, %add_26, %where_25), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %add_27 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_26, %div_27), kwargs = {})
#   %sub_90 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_27), kwargs = {})
#   %clamp_min_28 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_90, 0), kwargs = {})
#   %full_default_31 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_31 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_28, %full_default_31), kwargs = {})
#   %sum_29 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_31, [-1]), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 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, 7), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 12, '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_clamp_div_mul_pow_sub_sum_where_2(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (x0), xmask)
    tmp14 = tl.load(in_ptr2 + (x0), xmask)
    tmp18 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp19 = tl.load(in_ptr3 + (x0), xmask)
    tmp37 = tl.load(in_ptr4 + (4*x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr4 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr4 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr4 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp15 = tmp14 - tmp7
    tmp16 = tmp15 * tmp10
    tmp17 = tmp16 >= tmp12
    tmp20 = 0.5
    tmp21 = tmp19 * tmp20
    tmp22 = tmp21 * tmp20
    tmp23 = tmp22 * tmp20
    tmp24 = tmp23 * tmp20
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 * tmp20
    tmp27 = tmp26 * tmp20
    tmp28 = tmp27 * tmp20
    tmp29 = tmp28 * tmp20
    tmp30 = tmp29 * tmp20
    tmp31 = tmp30 * tmp20
    tmp32 = tmp18 + tmp31
    tmp33 = tl.where(tmp17, tmp32, tmp18)
    tmp34 = tmp31 * tmp20
    tmp35 = tmp33 + tmp34
    tmp36 = tl.where(tmp13, tmp35, tmp33)
    tmp38 = tmp37 * tmp20
    tmp39 = tmp34 * tmp20
    tmp40 = tmp36 + tmp39
    tmp41 = tmp38 - tmp40
    tmp42 = triton_helpers.maximum(tmp41, tmp12)
    tmp43 = 2.0
    tmp44 = libdevice.pow(tmp42, tmp43)
    tmp46 = tmp45 * tmp20
    tmp47 = tmp46 - tmp40
    tmp48 = triton_helpers.maximum(tmp47, tmp12)
    tmp49 = libdevice.pow(tmp48, tmp43)
    tmp50 = tmp44 + tmp49
    tmp52 = tmp51 * tmp20
    tmp53 = tmp52 - tmp40
    tmp54 = triton_helpers.maximum(tmp53, tmp12)
    tmp55 = libdevice.pow(tmp54, tmp43)
    tmp56 = tmp50 + tmp55
    tmp58 = tmp57 * tmp20
    tmp59 = tmp58 - tmp40
    tmp60 = triton_helpers.maximum(tmp59, tmp12)
    tmp61 = libdevice.pow(tmp60, tmp43)
    tmp62 = tmp56 + tmp61
    tl.store(in_out_ptr0 + (x0), tmp36, xmask)
    tl.store(out_ptr0 + (x0), tmp62, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/xe/cxe754wrl5sjitrmajy2srrq6d2mjokc5tmty2qkwvhzgcsuyn5m.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, tau_m_27, tau_lo_28, dm_29, tau_m_28, sub_93], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   X => mul
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   sub => full_default
#   sub_93 => sub_93
#   tau_lo_28 => where_27
#   tau_m_27 => add_27
#   tau_m_28 => add_28
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %add_27 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_26, %div_27), kwargs = {})
#   %where_27 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_27, %add_27, %where_26), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %add_28 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_27, %div_28), kwargs = {})
#   %sub_93 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_28), kwargs = {})
triton_poi_fused_add_div_mul_sub_where_3 = async_compile.triton('triton_poi_fused_add_div_mul_sub_where_3', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_mul_sub_where_3', '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_add_div_mul_sub_where_3(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + (x1), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp11 + tmp25
    tmp27 = tl.where(tmp10, tmp26, tmp11)
    tmp28 = tmp25 * tmp1
    tmp29 = tmp27 + tmp28
    tmp30 = tmp2 - tmp29
    tl.store(out_ptr0 + (x2), tmp30, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/if/cif3u3drxkf366ugeo7gtgyy55gcup24bhcpwne6p454cqre4263.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, tau_m_27, tau_lo_28, dm_29, tau_m_28, tau_lo_29, dm_30, tau_m_29, sub_96, clamp_30, truediv_30, p_m_29, sum_31], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   X => mul
#   clamp_30 => clamp_min_30
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   p_m_29 => pow_33
#   sub => full_default
#   sub_96 => sub_96
#   sum_31 => sum_31
#   tau_lo_28 => where_27
#   tau_lo_29 => where_28
#   tau_m_27 => add_27
#   tau_m_28 => add_28
#   tau_m_29 => add_29
#   truediv_30 => full_default_33
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %add_27 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_26, %div_27), kwargs = {})
#   %where_27 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_27, %add_27, %where_26), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %add_28 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_27, %div_28), kwargs = {})
#   %where_28 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_28, %add_28, %where_27), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %add_29 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_28, %div_29), kwargs = {})
#   %sub_96 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_29), kwargs = {})
#   %clamp_min_30 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_96, 0), kwargs = {})
#   %full_default_33 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_33 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_30, %full_default_33), kwargs = {})
#   %sum_31 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_33, [-1]), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_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: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 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, 7), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 12, '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_clamp_div_mul_pow_sub_sum_where_4(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (x0), xmask)
    tmp23 = tl.load(in_ptr2 + (x0), xmask)
    tmp27 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp28 = tl.load(in_ptr3 + (x0), xmask)
    tmp48 = tl.load(in_ptr4 + (4*x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr4 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp61 = tl.load(in_ptr4 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp67 = tl.load(in_ptr4 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp24 = tmp23 - tmp17
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 >= tmp1
    tmp29 = 0.5
    tmp30 = tmp28 * tmp29
    tmp31 = tmp30 * tmp29
    tmp32 = tmp31 * tmp29
    tmp33 = tmp32 * tmp29
    tmp34 = tmp33 * tmp29
    tmp35 = tmp34 * tmp29
    tmp36 = tmp35 * tmp29
    tmp37 = tmp36 * tmp29
    tmp38 = tmp37 * tmp29
    tmp39 = tmp38 * tmp29
    tmp40 = tmp39 * tmp29
    tmp41 = tmp40 * tmp29
    tmp42 = tmp41 * tmp29
    tmp43 = tmp27 + tmp42
    tmp44 = tl.where(tmp26, tmp43, tmp27)
    tmp45 = tmp42 * tmp29
    tmp46 = tmp44 + tmp45
    tmp47 = tl.where(tmp22, tmp46, tmp44)
    tmp49 = tmp48 * tmp29
    tmp50 = tmp45 * tmp29
    tmp51 = tmp47 + tmp50
    tmp52 = tmp49 - tmp51
    tmp53 = triton_helpers.maximum(tmp52, tmp1)
    tmp54 = libdevice.pow(tmp53, tmp3)
    tmp56 = tmp55 * tmp29
    tmp57 = tmp56 - tmp51
    tmp58 = triton_helpers.maximum(tmp57, tmp1)
    tmp59 = libdevice.pow(tmp58, tmp3)
    tmp60 = tmp54 + tmp59
    tmp62 = tmp61 * tmp29
    tmp63 = tmp62 - tmp51
    tmp64 = triton_helpers.maximum(tmp63, tmp1)
    tmp65 = libdevice.pow(tmp64, tmp3)
    tmp66 = tmp60 + tmp65
    tmp68 = tmp67 * tmp29
    tmp69 = tmp68 - tmp51
    tmp70 = triton_helpers.maximum(tmp69, tmp1)
    tmp71 = libdevice.pow(tmp70, tmp3)
    tmp72 = tmp66 + tmp71
    tl.store(in_out_ptr0 + (x0), tmp47, xmask)
    tl.store(out_ptr0 + (x0), tmp72, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/dr/cdrunpih7elheat4jd7sxrqywzlxcqzpus4s2kn3q77rb3owzmr3.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, tau_m_29, tau_lo_30, dm_31, tau_m_30, sub_99], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   X => mul
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   sub => full_default
#   sub_99 => sub_99
#   tau_lo_30 => where_29
#   tau_m_29 => add_29
#   tau_m_30 => add_30
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %add_29 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_28, %div_29), kwargs = {})
#   %where_29 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_29, %add_29, %where_28), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %add_30 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_29, %div_30), kwargs = {})
#   %sub_99 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_30), kwargs = {})
triton_poi_fused_add_div_mul_sub_where_5 = async_compile.triton('triton_poi_fused_add_div_mul_sub_where_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4, 5, 6), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_mul_sub_where_5', '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_add_div_mul_sub_where_5(in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + (x1), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp11 + tmp27
    tmp29 = tl.where(tmp10, tmp28, tmp11)
    tmp30 = tmp27 * tmp1
    tmp31 = tmp29 + tmp30
    tmp32 = tmp2 - tmp31
    tl.store(out_ptr0 + (x2), tmp32, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/6v/c6vga2tcnyteymwttvjbp5mmaopovt5iyiazfoj4b7d6pqavknf6.py
# Topologically Sorted Source Nodes: [sub, X, f_lo, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, tau_m_29, tau_lo_30, dm_31, tau_m_30, tau_lo_31, dm_32, tau_m_31, sub_102, clamp_32, truediv_32, p_m_31, sum_33, tau_lo_32, dm_33, tau_m_32, sub_105, clamp_33, truediv_33, p_m_32, sum_34, f_m_32, mul_33, tau_lo_33, dm_34, tau_m_33, sub_108, clamp_34, truediv_34, p_m_33, sum_35, tau_lo_34], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   X => mul
#   clamp_32 => clamp_min_32
#   clamp_33 => clamp_min_33
#   clamp_34 => clamp_min_34
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   f_lo => sub_7
#   f_m_32 => sub_107
#   mul_33 => mul_67
#   p_m_31 => pow_35
#   p_m_32 => pow_36
#   p_m_33 => pow_37
#   sub => full_default
#   sub_102 => sub_102
#   sub_105 => sub_105
#   sub_108 => sub_108
#   sum_33 => sum_33
#   sum_34 => sum_34
#   sum_35 => sum_35
#   tau_lo_30 => where_29
#   tau_lo_31 => where_30
#   tau_lo_32 => where_31
#   tau_lo_33 => where_32
#   tau_lo_34 => where_33
#   tau_m_29 => add_29
#   tau_m_30 => add_30
#   tau_m_31 => add_31
#   tau_m_32 => add_32
#   tau_m_33 => add_33
#   truediv_32 => full_default_35
#   truediv_33 => full_default_36
#   truediv_34 => full_default_37
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %sub_7 : [num_users=49] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_1, 1), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %add_29 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_28, %div_29), kwargs = {})
#   %where_29 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_29, %add_29, %where_28), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %add_30 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_29, %div_30), kwargs = {})
#   %where_30 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_30, %add_30, %where_29), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %add_31 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_30, %div_31), kwargs = {})
#   %sub_102 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_31), kwargs = {})
#   %clamp_min_32 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_102, 0), kwargs = {})
#   %full_default_35 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_35 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_32, %full_default_35), kwargs = {})
#   %sum_33 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_35, [-1]), kwargs = {})
#   %where_31 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_31, %add_31, %where_30), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %add_32 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_31, %div_32), kwargs = {})
#   %sub_105 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_32), kwargs = {})
#   %clamp_min_33 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_105, 0), kwargs = {})
#   %full_default_36 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_36 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_33, %full_default_36), kwargs = {})
#   %sum_34 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_36, [-1]), kwargs = {})
#   %sub_107 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_34, 1), kwargs = {})
#   %mul_67 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_107, %sub_7), kwargs = {})
#   %where_32 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_32, %add_32, %where_31), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %add_33 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_32, %div_33), kwargs = {})
#   %sub_108 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_33), kwargs = {})
#   %clamp_min_34 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_108, 0), kwargs = {})
#   %full_default_37 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_37 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_34, %full_default_37), kwargs = {})
#   %sum_35 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_37, [-1]), kwargs = {})
#   %where_33 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_33, %add_33, %where_32), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_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=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 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, 7), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6', 'mutated_arg_names': ['in_out_ptr0', 'in_out_ptr2'], 'no_x_dim': False, 'num_load': 12, '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_clamp_div_mul_pow_sub_sum_where_6(in_out_ptr0, in_out_ptr2, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (x0), xmask)
    tmp23 = tl.load(in_ptr2 + (x0), xmask)
    tmp27 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp28 = tl.load(in_ptr3 + (x0), xmask)
    tmp50 = tl.load(in_ptr4 + (4*x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr4 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp63 = tl.load(in_ptr4 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp69 = tl.load(in_ptr4 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp24 = tmp23 - tmp17
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 >= tmp1
    tmp29 = 0.5
    tmp30 = tmp28 * tmp29
    tmp31 = tmp30 * tmp29
    tmp32 = tmp31 * tmp29
    tmp33 = tmp32 * tmp29
    tmp34 = tmp33 * tmp29
    tmp35 = tmp34 * tmp29
    tmp36 = tmp35 * tmp29
    tmp37 = tmp36 * tmp29
    tmp38 = tmp37 * tmp29
    tmp39 = tmp38 * tmp29
    tmp40 = tmp39 * tmp29
    tmp41 = tmp40 * tmp29
    tmp42 = tmp41 * tmp29
    tmp43 = tmp42 * tmp29
    tmp44 = tmp43 * tmp29
    tmp45 = tmp27 + tmp44
    tmp46 = tl.where(tmp26, tmp45, tmp27)
    tmp47 = tmp44 * tmp29
    tmp48 = tmp46 + tmp47
    tmp49 = tl.where(tmp22, tmp48, tmp46)
    tmp51 = tmp50 * tmp29
    tmp52 = tmp47 * tmp29
    tmp53 = tmp49 + tmp52
    tmp54 = tmp51 - tmp53
    tmp55 = triton_helpers.maximum(tmp54, tmp1)
    tmp56 = libdevice.pow(tmp55, tmp3)
    tmp58 = tmp57 * tmp29
    tmp59 = tmp58 - tmp53
    tmp60 = triton_helpers.maximum(tmp59, tmp1)
    tmp61 = libdevice.pow(tmp60, tmp3)
    tmp62 = tmp56 + tmp61
    tmp64 = tmp63 * tmp29
    tmp65 = tmp64 - tmp53
    tmp66 = triton_helpers.maximum(tmp65, tmp1)
    tmp67 = libdevice.pow(tmp66, tmp3)
    tmp68 = tmp62 + tmp67
    tmp70 = tmp69 * tmp29
    tmp71 = tmp70 - tmp53
    tmp72 = triton_helpers.maximum(tmp71, tmp1)
    tmp73 = libdevice.pow(tmp72, tmp3)
    tmp74 = tmp68 + tmp73
    tmp75 = tmp74 - tmp17
    tmp76 = tmp75 * tmp20
    tmp77 = tmp76 >= tmp1
    tmp78 = tl.where(tmp77, tmp53, tmp49)
    tmp79 = tmp52 * tmp29
    tmp80 = tmp78 + tmp79
    tmp81 = tmp51 - tmp80
    tmp82 = triton_helpers.maximum(tmp81, tmp1)
    tmp83 = libdevice.pow(tmp82, tmp3)
    tmp84 = tmp58 - tmp80
    tmp85 = triton_helpers.maximum(tmp84, tmp1)
    tmp86 = libdevice.pow(tmp85, tmp3)
    tmp87 = tmp83 + tmp86
    tmp88 = tmp64 - tmp80
    tmp89 = triton_helpers.maximum(tmp88, tmp1)
    tmp90 = libdevice.pow(tmp89, tmp3)
    tmp91 = tmp87 + tmp90
    tmp92 = tmp70 - tmp80
    tmp93 = triton_helpers.maximum(tmp92, tmp1)
    tmp94 = libdevice.pow(tmp93, tmp3)
    tmp95 = tmp91 + tmp94
    tmp96 = tmp95 - tmp17
    tmp97 = tmp96 * tmp20
    tmp98 = tmp97 >= tmp1
    tmp99 = tl.where(tmp98, tmp80, tmp78)
    tmp100 = tmp79 * tmp29
    tmp101 = tmp99 + tmp100
    tmp102 = tmp51 - tmp101
    tmp103 = triton_helpers.maximum(tmp102, tmp1)
    tmp104 = libdevice.pow(tmp103, tmp3)
    tmp105 = tmp58 - tmp101
    tmp106 = triton_helpers.maximum(tmp105, tmp1)
    tmp107 = libdevice.pow(tmp106, tmp3)
    tmp108 = tmp104 + tmp107
    tmp109 = tmp64 - tmp101
    tmp110 = triton_helpers.maximum(tmp109, tmp1)
    tmp111 = libdevice.pow(tmp110, tmp3)
    tmp112 = tmp108 + tmp111
    tmp113 = tmp70 - tmp101
    tmp114 = triton_helpers.maximum(tmp113, tmp1)
    tmp115 = libdevice.pow(tmp114, tmp3)
    tmp116 = tmp112 + tmp115
    tmp117 = tmp116 - tmp17
    tmp118 = tmp117 * tmp20
    tmp119 = tmp118 >= tmp1
    tmp120 = tl.where(tmp119, tmp101, tmp99)
    tl.store(in_out_ptr2 + (x0), tmp120, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/qw/cqwjirql6abn7imghsni2jlkuybk4xkokodof2rpil4tssyex4uw.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, tau_m_34, sub_111, clamp_35, truediv_35, p_m_34], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp, aten.pow]
# Source node to ATen node mapping:
#   X => mul
#   clamp_35 => clamp_min_35
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   p_m_34 => pow_38
#   sub => full_default
#   sub_111 => sub_111
#   tau_m_34 => add_34
#   truediv_35 => full_default_38
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %add_34 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_33, %div_34), kwargs = {})
#   %sub_111 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_34), kwargs = {})
#   %clamp_min_35 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_111, 0), kwargs = {})
#   %full_default_38 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_38 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_35, %full_default_38), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_7 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_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=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_7', '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_clamp_div_mul_pow_sub_7(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp3 + tmp24
    tmp26 = tmp2 - tmp25
    tmp27 = 0.0
    tmp28 = triton_helpers.maximum(tmp26, tmp27)
    tmp29 = 2.0
    tmp30 = libdevice.pow(tmp28, tmp29)
    tl.store(out_ptr0 + (x2), tmp30, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/3q/c3qnhz5l3skrhqr43bpfxlmkw6kumz7pxqtyenon3vddp3cudnfx.py
# Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, tau_m_34, tau_lo_35], Original ATen: [aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   tau_lo_35 => where_34
#   tau_m_34 => add_34
# Graph fragment:
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %add_34 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_33, %div_34), kwargs = {})
#   %where_34 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_34, %add_34, %where_33), kwargs = {})
triton_poi_fused_add_div_where_8 = async_compile.triton('triton_poi_fused_add_div_where_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: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_where_8', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, '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_div_where_8(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (x0), xmask)
    tmp14 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp15 = tl.load(in_ptr2 + (x0), xmask)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp16 = 0.5
    tmp17 = tmp15 * tmp16
    tmp18 = tmp17 * tmp16
    tmp19 = tmp18 * tmp16
    tmp20 = tmp19 * tmp16
    tmp21 = tmp20 * tmp16
    tmp22 = tmp21 * tmp16
    tmp23 = tmp22 * tmp16
    tmp24 = tmp23 * tmp16
    tmp25 = tmp24 * tmp16
    tmp26 = tmp25 * tmp16
    tmp27 = tmp26 * tmp16
    tmp28 = tmp27 * tmp16
    tmp29 = tmp28 * tmp16
    tmp30 = tmp29 * tmp16
    tmp31 = tmp30 * tmp16
    tmp32 = tmp31 * tmp16
    tmp33 = tmp32 * tmp16
    tmp34 = tmp33 * tmp16
    tmp35 = tmp34 * tmp16
    tmp36 = tmp35 * tmp16
    tmp37 = tmp14 + tmp36
    tmp38 = tl.where(tmp13, tmp37, tmp14)
    tl.store(in_out_ptr0 + (x0), tmp38, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/65/c65c6rqbfpxnnf52lttfmjffp6c57rq5vh5zishetax476bzxbyn.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, tau_m_35, sub_114, clamp_36, truediv_36, p_m_35], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp, aten.pow]
# Source node to ATen node mapping:
#   X => mul
#   clamp_36 => clamp_min_36
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   p_m_35 => pow_39
#   sub => full_default
#   sub_114 => sub_114
#   tau_m_35 => add_35
#   truediv_36 => full_default_39
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %add_35 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_34, %div_35), kwargs = {})
#   %sub_114 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_35), kwargs = {})
#   %clamp_min_36 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_114, 0), kwargs = {})
#   %full_default_39 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_39 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_36, %full_default_39), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_9 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_9', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_9', '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_clamp_div_mul_pow_sub_9(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp3 + tmp25
    tmp27 = tmp2 - tmp26
    tmp28 = 0.0
    tmp29 = triton_helpers.maximum(tmp27, tmp28)
    tmp30 = 2.0
    tmp31 = libdevice.pow(tmp29, tmp30)
    tl.store(out_ptr0 + (x2), tmp31, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/hc/chcgwhxqzahejjnkomdddn3fpfvhgpal4i42dvbnrcw5fjtsuuip.py
# Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, tau_m_35, tau_lo_36], Original ATen: [aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   tau_lo_36 => where_35
#   tau_m_35 => add_35
# Graph fragment:
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %add_35 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_34, %div_35), kwargs = {})
#   %where_35 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_35, %add_35, %where_34), kwargs = {})
triton_poi_fused_add_div_where_10 = async_compile.triton('triton_poi_fused_add_div_where_10', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_where_10', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, '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_div_where_10(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (x0), xmask)
    tmp14 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp15 = tl.load(in_ptr2 + (x0), xmask)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp16 = 0.5
    tmp17 = tmp15 * tmp16
    tmp18 = tmp17 * tmp16
    tmp19 = tmp18 * tmp16
    tmp20 = tmp19 * tmp16
    tmp21 = tmp20 * tmp16
    tmp22 = tmp21 * tmp16
    tmp23 = tmp22 * tmp16
    tmp24 = tmp23 * tmp16
    tmp25 = tmp24 * tmp16
    tmp26 = tmp25 * tmp16
    tmp27 = tmp26 * tmp16
    tmp28 = tmp27 * tmp16
    tmp29 = tmp28 * tmp16
    tmp30 = tmp29 * tmp16
    tmp31 = tmp30 * tmp16
    tmp32 = tmp31 * tmp16
    tmp33 = tmp32 * tmp16
    tmp34 = tmp33 * tmp16
    tmp35 = tmp34 * tmp16
    tmp36 = tmp35 * tmp16
    tmp37 = tmp36 * tmp16
    tmp38 = tmp14 + tmp37
    tmp39 = tl.where(tmp13, tmp38, tmp14)
    tl.store(in_out_ptr0 + (x0), tmp39, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/hk/chkgkmcorveaoty2aubj4aiqs7c4icysi6i7uztapg7qoahqwomz.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, tau_m_36, sub_117, clamp_37], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp]
# Source node to ATen node mapping:
#   X => mul
#   clamp_37 => clamp_min_37
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   sub => full_default
#   sub_117 => sub_117
#   tau_m_36 => add_36
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %add_36 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_35, %div_36), kwargs = {})
#   %sub_117 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_36), kwargs = {})
#   %clamp_min_37 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_117, 0), kwargs = {})
triton_poi_fused_add_clamp_div_mul_sub_11 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_sub_11', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_sub_11', '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_clamp_div_mul_sub_11(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp3 + tmp26
    tmp28 = tmp2 - tmp27
    tmp29 = 0.0
    tmp30 = triton_helpers.maximum(tmp28, tmp29)
    tl.store(out_ptr0 + (x2), tmp30, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/6j/c6jx7jobgsfa3dnpqdh4py4h2yjwqcnyfrnfxf4y2pamiu6cwdpl.py
# Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, tau_m_36, tau_lo_37], Original ATen: [aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   tau_lo_37 => where_36
#   tau_m_36 => add_36
# Graph fragment:
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %add_36 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_35, %div_36), kwargs = {})
#   %where_36 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_36, %add_36, %where_35), kwargs = {})
triton_poi_fused_add_div_where_12 = async_compile.triton('triton_poi_fused_add_div_where_12', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_where_12', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, '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_div_where_12(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + (x0), xmask)
    tmp19 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp20 = tl.load(in_ptr2 + (x0), xmask)
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp21 = 0.5
    tmp22 = tmp20 * tmp21
    tmp23 = tmp22 * tmp21
    tmp24 = tmp23 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp25 * tmp21
    tmp27 = tmp26 * tmp21
    tmp28 = tmp27 * tmp21
    tmp29 = tmp28 * tmp21
    tmp30 = tmp29 * tmp21
    tmp31 = tmp30 * tmp21
    tmp32 = tmp31 * tmp21
    tmp33 = tmp32 * tmp21
    tmp34 = tmp33 * tmp21
    tmp35 = tmp34 * tmp21
    tmp36 = tmp35 * tmp21
    tmp37 = tmp36 * tmp21
    tmp38 = tmp37 * tmp21
    tmp39 = tmp38 * tmp21
    tmp40 = tmp39 * tmp21
    tmp41 = tmp40 * tmp21
    tmp42 = tmp41 * tmp21
    tmp43 = tmp42 * tmp21
    tmp44 = tmp19 + tmp43
    tmp45 = tl.where(tmp18, tmp44, tmp19)
    tl.store(in_out_ptr0 + (x0), tmp45, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/dg/cdgzbjixzgjbzoonwf327zqettjzik6jiaut4vfckxwzzrjpw4ci.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, tau_m_37, sub_120, clamp_38], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp]
# Source node to ATen node mapping:
#   X => mul
#   clamp_38 => clamp_min_38
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   sub => full_default
#   sub_120 => sub_120
#   tau_m_37 => add_37
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %add_37 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_36, %div_37), kwargs = {})
#   %sub_120 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_37), kwargs = {})
#   %clamp_min_38 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_120, 0), kwargs = {})
triton_poi_fused_add_clamp_div_mul_sub_13 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_sub_13', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_sub_13', '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_clamp_div_mul_sub_13(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp3 + tmp27
    tmp29 = tmp2 - tmp28
    tmp30 = 0.0
    tmp31 = triton_helpers.maximum(tmp29, tmp30)
    tl.store(out_ptr0 + (x2), tmp31, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/f2/cf2smd7msnlfnwkswpdfa2pro4t25uk7k6sqqtuhugmitppzjw2h.py
# Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, tau_m_37, tau_lo_38], Original ATen: [aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   tau_lo_38 => where_37
#   tau_m_37 => add_37
# Graph fragment:
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %add_37 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_36, %div_37), kwargs = {})
#   %where_37 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_37, %add_37, %where_36), kwargs = {})
triton_poi_fused_add_div_where_14 = async_compile.triton('triton_poi_fused_add_div_where_14', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*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_add_div_where_14', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, '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_div_where_14(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + (x0), xmask)
    tmp19 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp20 = tl.load(in_ptr2 + (x0), xmask)
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp21 = 0.5
    tmp22 = tmp20 * tmp21
    tmp23 = tmp22 * tmp21
    tmp24 = tmp23 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp25 * tmp21
    tmp27 = tmp26 * tmp21
    tmp28 = tmp27 * tmp21
    tmp29 = tmp28 * tmp21
    tmp30 = tmp29 * tmp21
    tmp31 = tmp30 * tmp21
    tmp32 = tmp31 * tmp21
    tmp33 = tmp32 * tmp21
    tmp34 = tmp33 * tmp21
    tmp35 = tmp34 * tmp21
    tmp36 = tmp35 * tmp21
    tmp37 = tmp36 * tmp21
    tmp38 = tmp37 * tmp21
    tmp39 = tmp38 * tmp21
    tmp40 = tmp39 * tmp21
    tmp41 = tmp40 * tmp21
    tmp42 = tmp41 * tmp21
    tmp43 = tmp42 * tmp21
    tmp44 = tmp43 * tmp21
    tmp45 = tmp19 + tmp44
    tmp46 = tl.where(tmp18, tmp45, tmp19)
    tl.store(in_out_ptr0 + (x0), tmp46, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/m6/cm6g7ftzm55nml3oy3bwbqmue7bg6inetry6yvug7w4kb6ev5rty.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, tau_m_38, sub_123], Original ATen: [aten.sub, aten.mul, aten.div, aten.add]
# Source node to ATen node mapping:
#   X => mul
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   dm_39 => div_38
#   sub => full_default
#   sub_123 => sub_123
#   tau_m_38 => add_38
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %div_38 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_37, 2), kwargs = {})
#   %add_38 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_37, %div_38), kwargs = {})
#   %sub_123 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_38), kwargs = {})
triton_poi_fused_add_div_mul_sub_15 = async_compile.triton('triton_poi_fused_add_div_mul_sub_15', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_mul_sub_15', '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_div_mul_sub_15(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp3 + tmp28
    tmp30 = tmp2 - tmp29
    tl.store(out_ptr0 + (x2), tmp30, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/it/citgidtovhh7ieg5w6kgdaztr74d5qimxq5xchpfcretvgwraeaz.py
# Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, tau_m_38, tau_lo_39], Original ATen: [aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   dm_39 => div_38
#   tau_lo_39 => where_38
#   tau_m_38 => add_38
# Graph fragment:
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %div_38 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_37, 2), kwargs = {})
#   %add_38 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_37, %div_38), kwargs = {})
#   %where_38 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_38, %add_38, %where_37), kwargs = {})
triton_poi_fused_add_div_where_16 = async_compile.triton('triton_poi_fused_add_div_where_16', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*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_add_div_where_16', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, '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_div_where_16(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (x0), xmask)
    tmp23 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp24 = tl.load(in_ptr2 + (x0), xmask)
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp23 + tmp49
    tmp51 = tl.where(tmp22, tmp50, tmp23)
    tl.store(in_out_ptr0 + (x0), tmp51, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/ow/cowrvlpr3aq5lvglsdero5kvdkcaqmnxh7ylqy6wg5asbxkwbugf.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, tau_m_39, sub_126], Original ATen: [aten.sub, aten.mul, aten.div, aten.add]
# Source node to ATen node mapping:
#   X => mul
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   dm_39 => div_38
#   dm_40 => div_39
#   sub => full_default
#   sub_126 => sub_126
#   tau_m_39 => add_39
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %div_38 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_37, 2), kwargs = {})
#   %div_39 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_38, 2), kwargs = {})
#   %add_39 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_38, %div_39), kwargs = {})
#   %sub_126 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_39), kwargs = {})
triton_poi_fused_add_div_mul_sub_17 = async_compile.triton('triton_poi_fused_add_div_mul_sub_17', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_mul_sub_17', '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_div_mul_sub_17(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp28 * tmp1
    tmp30 = tmp3 + tmp29
    tmp31 = tmp2 - tmp30
    tl.store(out_ptr0 + (x2), tmp31, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/z4/cz4ddiop67cjhvnymyeyxeouq7iyjrkpudsvnur2jqxca35zlu35.py
# Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, tau_m_39, tau_lo_40], Original ATen: [aten.div, aten.add, aten.where]
# Source node to ATen node mapping:
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   dm_39 => div_38
#   dm_40 => div_39
#   tau_lo_40 => where_39
#   tau_m_39 => add_39
# Graph fragment:
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %div_38 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_37, 2), kwargs = {})
#   %div_39 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_38, 2), kwargs = {})
#   %add_39 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_38, %div_39), kwargs = {})
#   %where_39 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_39, %add_39, %where_38), kwargs = {})
triton_poi_fused_add_div_where_18 = async_compile.triton('triton_poi_fused_add_div_where_18', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*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_add_div_where_18', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 7, '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_div_where_18(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (x0), xmask)
    tmp23 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp24 = tl.load(in_ptr2 + (x0), xmask)
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp49 * tmp25
    tmp51 = tmp23 + tmp50
    tmp52 = tl.where(tmp22, tmp51, tmp23)
    tl.store(in_out_ptr0 + (x0), tmp52, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/xp/cxphrrfdmolvfd4qixifhmbpdrlsdb6np4qopmkccumu7xs7u2vv.py
# Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, dm_41, tau_m_40, sub_129], Original ATen: [aten.sub, aten.mul, aten.div, aten.add]
# Source node to ATen node mapping:
#   X => mul
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   dm_39 => div_38
#   dm_40 => div_39
#   dm_41 => div_40
#   sub => full_default
#   sub_129 => sub_129
#   tau_m_40 => add_40
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %div_38 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_37, 2), kwargs = {})
#   %div_39 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_38, 2), kwargs = {})
#   %div_40 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_39, 2), kwargs = {})
#   %add_40 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_39, %div_40), kwargs = {})
#   %sub_129 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_40), kwargs = {})
triton_poi_fused_add_div_mul_sub_19 = async_compile.triton('triton_poi_fused_add_div_mul_sub_19', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_div_mul_sub_19', '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_div_mul_sub_19(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp28 * tmp1
    tmp30 = tmp29 * tmp1
    tmp31 = tmp3 + tmp30
    tmp32 = tmp2 - tmp31
    tl.store(out_ptr0 + (x2), tmp32, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/wa/cwaa5hzx7dhpx3ghsy7xh5ykl5hdag5jzcuoogoqdl4kgv7awvbb.py
# Topologically Sorted Source Nodes: [sub, X, f_lo, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, dm_41, tau_m_40, tau_lo_41, dm_42, tau_m_41, sub_132, clamp_42, truediv_42, p_m_41, sum_43, f_m_41, mul_42, tau_lo_42, dm_43, tau_m_42, sub_135, clamp_43, truediv_43, p_m_42, sum_44, f_m_42, mul_43, tau_lo_43, dm_44, tau_m_43, sub_138, clamp_44, truediv_44, p_m_43, sum_45, f_m_43, tau_lo_44, dm_45, tau_m_44, sub_141, clamp_45, truediv_45, p_m_44, sum_46, tau_lo_45, dm_46, tau_m_45, sub_144, clamp_46, truediv_46, p_m_45, sum_47, tau_lo_46, dm_47, tau_m_46, sub_147, clamp_47, truediv_47, p_m_46, sum_48, tau_lo_47, dm_48, tau_m_47, sub_150, clamp_48, truediv_48, p_m_47, sum_49, tau_lo_48, dm_49, tau_m_48, sub_153, clamp_49, truediv_49, p_m_48, sum_50, tau_lo_49, dm_50, tau_m_49, sub_156, clamp_50, truediv_50, p_m_49, sum_52], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   X => mul
#   clamp_42 => clamp_min_42
#   clamp_43 => clamp_min_43
#   clamp_44 => clamp_min_44
#   clamp_45 => clamp_min_45
#   clamp_46 => clamp_min_46
#   clamp_47 => clamp_min_47
#   clamp_48 => clamp_min_48
#   clamp_49 => clamp_min_49
#   clamp_50 => clamp_min_50
#   dm_16 => div_15
#   dm_17 => div_16
#   dm_18 => div_17
#   dm_19 => div_18
#   dm_20 => div_19
#   dm_21 => div_20
#   dm_22 => div_21
#   dm_23 => div_22
#   dm_24 => div_23
#   dm_25 => div_24
#   dm_26 => div_25
#   dm_27 => div_26
#   dm_28 => div_27
#   dm_29 => div_28
#   dm_30 => div_29
#   dm_31 => div_30
#   dm_32 => div_31
#   dm_33 => div_32
#   dm_34 => div_33
#   dm_35 => div_34
#   dm_36 => div_35
#   dm_37 => div_36
#   dm_38 => div_37
#   dm_39 => div_38
#   dm_40 => div_39
#   dm_41 => div_40
#   dm_42 => div_41
#   dm_43 => div_42
#   dm_44 => div_43
#   dm_45 => div_44
#   dm_46 => div_45
#   dm_47 => div_46
#   dm_48 => div_47
#   dm_49 => div_48
#   dm_50 => div_49
#   f_lo => sub_7
#   f_m_41 => sub_134
#   f_m_42 => sub_137
#   f_m_43 => sub_140
#   mul_42 => mul_85
#   mul_43 => mul_87
#   p_m_41 => pow_45
#   p_m_42 => pow_46
#   p_m_43 => pow_47
#   p_m_44 => pow_48
#   p_m_45 => pow_49
#   p_m_46 => pow_50
#   p_m_47 => pow_51
#   p_m_48 => pow_52
#   p_m_49 => pow_53
#   sub => full_default
#   sub_132 => sub_132
#   sub_135 => sub_135
#   sub_138 => sub_138
#   sub_141 => sub_141
#   sub_144 => sub_144
#   sub_147 => sub_147
#   sub_150 => sub_150
#   sub_153 => sub_153
#   sub_156 => sub_156
#   sum_43 => sum_43
#   sum_44 => sum_44
#   sum_45 => sum_45
#   sum_46 => sum_46
#   sum_47 => sum_47
#   sum_48 => sum_48
#   sum_49 => sum_49
#   sum_50 => sum_50
#   sum_52 => sum_52
#   tau_lo_41 => where_40
#   tau_lo_42 => where_41
#   tau_lo_43 => where_42
#   tau_lo_44 => where_43
#   tau_lo_45 => where_44
#   tau_lo_46 => where_45
#   tau_lo_47 => where_46
#   tau_lo_48 => where_47
#   tau_lo_49 => where_48
#   tau_m_40 => add_40
#   tau_m_41 => add_41
#   tau_m_42 => add_42
#   tau_m_43 => add_43
#   tau_m_44 => add_44
#   tau_m_45 => add_45
#   tau_m_46 => add_46
#   tau_m_47 => add_47
#   tau_m_48 => add_48
#   tau_m_49 => add_49
#   truediv_42 => full_default_45
#   truediv_43 => full_default_46
#   truediv_44 => full_default_47
#   truediv_45 => full_default_48
#   truediv_46 => full_default_49
#   truediv_47 => full_default_50
#   truediv_48 => full_default_51
#   truediv_49 => full_default_52
#   truediv_50 => full_default_53
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %sub_7 : [num_users=49] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_1, 1), kwargs = {})
#   %div_15 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_14, 2), kwargs = {})
#   %div_16 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_15, 2), kwargs = {})
#   %div_17 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_16, 2), kwargs = {})
#   %div_18 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_17, 2), kwargs = {})
#   %div_19 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_18, 2), kwargs = {})
#   %div_20 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_19, 2), kwargs = {})
#   %div_21 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_20, 2), kwargs = {})
#   %div_22 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_21, 2), kwargs = {})
#   %div_23 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_22, 2), kwargs = {})
#   %div_24 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_23, 2), kwargs = {})
#   %div_25 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_24, 2), kwargs = {})
#   %div_26 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_25, 2), kwargs = {})
#   %div_27 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_26, 2), kwargs = {})
#   %div_28 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_27, 2), kwargs = {})
#   %div_29 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_28, 2), kwargs = {})
#   %div_30 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_29, 2), kwargs = {})
#   %div_31 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_30, 2), kwargs = {})
#   %div_32 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_31, 2), kwargs = {})
#   %div_33 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_32, 2), kwargs = {})
#   %div_34 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_33, 2), kwargs = {})
#   %div_35 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_34, 2), kwargs = {})
#   %div_36 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_35, 2), kwargs = {})
#   %div_37 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_36, 2), kwargs = {})
#   %div_38 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_37, 2), kwargs = {})
#   %div_39 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_38, 2), kwargs = {})
#   %div_40 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_39, 2), kwargs = {})
#   %add_40 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_39, %div_40), kwargs = {})
#   %where_40 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_40, %add_40, %where_39), kwargs = {})
#   %div_41 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_40, 2), kwargs = {})
#   %add_41 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_40, %div_41), kwargs = {})
#   %sub_132 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_41), kwargs = {})
#   %clamp_min_42 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_132, 0), kwargs = {})
#   %full_default_45 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_45 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_42, %full_default_45), kwargs = {})
#   %sum_43 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_45, [-1]), kwargs = {})
#   %sub_134 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_43, 1), kwargs = {})
#   %mul_85 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_134, %sub_7), kwargs = {})
#   %where_41 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_41, %add_41, %where_40), kwargs = {})
#   %div_42 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_41, 2), kwargs = {})
#   %add_42 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_41, %div_42), kwargs = {})
#   %sub_135 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_42), kwargs = {})
#   %clamp_min_43 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_135, 0), kwargs = {})
#   %full_default_46 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_46 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_43, %full_default_46), kwargs = {})
#   %sum_44 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_46, [-1]), kwargs = {})
#   %sub_137 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_44, 1), kwargs = {})
#   %mul_87 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_137, %sub_7), kwargs = {})
#   %where_42 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_42, %add_42, %where_41), kwargs = {})
#   %div_43 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_42, 2), kwargs = {})
#   %add_43 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_42, %div_43), kwargs = {})
#   %sub_138 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_43), kwargs = {})
#   %clamp_min_44 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_138, 0), kwargs = {})
#   %full_default_47 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_47 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_44, %full_default_47), kwargs = {})
#   %sum_45 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_47, [-1]), kwargs = {})
#   %sub_140 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%sum_45, 1), kwargs = {})
#   %where_43 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_43, %add_43, %where_42), kwargs = {})
#   %div_44 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_43, 2), kwargs = {})
#   %add_44 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_43, %div_44), kwargs = {})
#   %sub_141 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_44), kwargs = {})
#   %clamp_min_45 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_141, 0), kwargs = {})
#   %full_default_48 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_48 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_45, %full_default_48), kwargs = {})
#   %sum_46 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_48, [-1]), kwargs = {})
#   %where_44 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_44, %add_44, %where_43), kwargs = {})
#   %div_45 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_44, 2), kwargs = {})
#   %add_45 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_44, %div_45), kwargs = {})
#   %sub_144 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_45), kwargs = {})
#   %clamp_min_46 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_144, 0), kwargs = {})
#   %full_default_49 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_49 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_46, %full_default_49), kwargs = {})
#   %sum_47 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_49, [-1]), kwargs = {})
#   %where_45 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_45, %add_45, %where_44), kwargs = {})
#   %div_46 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_45, 2), kwargs = {})
#   %add_46 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_45, %div_46), kwargs = {})
#   %sub_147 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_46), kwargs = {})
#   %clamp_min_47 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_147, 0), kwargs = {})
#   %full_default_50 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_50 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_47, %full_default_50), kwargs = {})
#   %sum_48 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_50, [-1]), kwargs = {})
#   %where_46 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_46, %add_46, %where_45), kwargs = {})
#   %div_47 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_46, 2), kwargs = {})
#   %add_47 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_46, %div_47), kwargs = {})
#   %sub_150 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_47), kwargs = {})
#   %clamp_min_48 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_150, 0), kwargs = {})
#   %full_default_51 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_51 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_48, %full_default_51), kwargs = {})
#   %sum_49 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_51, [-1]), kwargs = {})
#   %where_47 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_47, %add_47, %where_46), kwargs = {})
#   %div_48 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_47, 2), kwargs = {})
#   %add_48 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_47, %div_48), kwargs = {})
#   %sub_153 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_48), kwargs = {})
#   %clamp_min_49 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_153, 0), kwargs = {})
#   %full_default_52 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_52 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_49, %full_default_52), kwargs = {})
#   %sum_50 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_52, [-1]), kwargs = {})
#   %where_48 : [num_users=1] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_48, %add_48, %where_47), kwargs = {})
#   %div_49 : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_48, 2), kwargs = {})
#   %add_49 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_48, %div_49), kwargs = {})
#   %sub_156 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_49), kwargs = {})
#   %clamp_min_50 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_156, 0), kwargs = {})
#   %full_default_53 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_53 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_50, %full_default_53), kwargs = {})
#   %sum_52 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_53, [-1]), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[64], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: '*fp32', 5: '*fp32', 6: '*fp32', 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, 7), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20', 'mutated_arg_names': ['in_out_ptr0', 'in_out_ptr4'], 'no_x_dim': False, 'num_load': 11, '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_clamp_div_mul_pow_sub_sum_where_20(in_out_ptr0, in_out_ptr4, in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr7, xnumel, XBLOCK : tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (4*x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (x0), xmask)
    tmp23 = tl.load(in_out_ptr0 + (x0), xmask)
    tmp24 = tl.load(in_ptr2 + (x0), xmask)
    tmp56 = tl.load(in_ptr3 + (4*x0), xmask, eviction_policy='evict_last')
    tmp61 = tl.load(in_ptr3 + (1 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp67 = tl.load(in_ptr3 + (2 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp73 = tl.load(in_ptr3 + (3 + (4*x0)), xmask, eviction_policy='evict_last')
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp49 * tmp25
    tmp51 = tmp50 * tmp25
    tmp52 = tmp23 + tmp51
    tmp53 = tl.where(tmp22, tmp52, tmp23)
    tmp54 = tmp51 * tmp25
    tmp55 = tmp53 + tmp54
    tmp57 = tmp56 * tmp25
    tmp58 = tmp57 - tmp55
    tmp59 = triton_helpers.maximum(tmp58, tmp1)
    tmp60 = libdevice.pow(tmp59, tmp3)
    tmp62 = tmp61 * tmp25
    tmp63 = tmp62 - tmp55
    tmp64 = triton_helpers.maximum(tmp63, tmp1)
    tmp65 = libdevice.pow(tmp64, tmp3)
    tmp66 = tmp60 + tmp65
    tmp68 = tmp67 * tmp25
    tmp69 = tmp68 - tmp55
    tmp70 = triton_helpers.maximum(tmp69, tmp1)
    tmp71 = libdevice.pow(tmp70, tmp3)
    tmp72 = tmp66 + tmp71
    tmp74 = tmp73 * tmp25
    tmp75 = tmp74 - tmp55
    tmp76 = triton_helpers.maximum(tmp75, tmp1)
    tmp77 = libdevice.pow(tmp76, tmp3)
    tmp78 = tmp72 + tmp77
    tmp79 = tmp78 - tmp17
    tmp80 = tmp79 * tmp20
    tmp81 = tmp80 >= tmp1
    tmp82 = tl.where(tmp81, tmp55, tmp53)
    tmp83 = tmp54 * tmp25
    tmp84 = tmp82 + tmp83
    tmp85 = tmp57 - tmp84
    tmp86 = triton_helpers.maximum(tmp85, tmp1)
    tmp87 = libdevice.pow(tmp86, tmp3)
    tmp88 = tmp62 - tmp84
    tmp89 = triton_helpers.maximum(tmp88, tmp1)
    tmp90 = libdevice.pow(tmp89, tmp3)
    tmp91 = tmp87 + tmp90
    tmp92 = tmp68 - tmp84
    tmp93 = triton_helpers.maximum(tmp92, tmp1)
    tmp94 = libdevice.pow(tmp93, tmp3)
    tmp95 = tmp91 + tmp94
    tmp96 = tmp74 - tmp84
    tmp97 = triton_helpers.maximum(tmp96, tmp1)
    tmp98 = libdevice.pow(tmp97, tmp3)
    tmp99 = tmp95 + tmp98
    tmp100 = tmp99 - tmp17
    tmp101 = tmp100 * tmp20
    tmp102 = tmp101 >= tmp1
    tmp103 = tl.where(tmp102, tmp84, tmp82)
    tmp104 = tmp83 * tmp25
    tmp105 = tmp103 + tmp104
    tmp106 = tmp57 - tmp105
    tmp107 = triton_helpers.maximum(tmp106, tmp1)
    tmp108 = libdevice.pow(tmp107, tmp3)
    tmp109 = tmp62 - tmp105
    tmp110 = triton_helpers.maximum(tmp109, tmp1)
    tmp111 = libdevice.pow(tmp110, tmp3)
    tmp112 = tmp108 + tmp111
    tmp113 = tmp68 - tmp105
    tmp114 = triton_helpers.maximum(tmp113, tmp1)
    tmp115 = libdevice.pow(tmp114, tmp3)
    tmp116 = tmp112 + tmp115
    tmp117 = tmp74 - tmp105
    tmp118 = triton_helpers.maximum(tmp117, tmp1)
    tmp119 = libdevice.pow(tmp118, tmp3)
    tmp120 = tmp116 + tmp119
    tmp121 = tmp120 - tmp17
    tmp122 = tmp121 * tmp20
    tmp123 = tmp122 >= tmp1
    tmp124 = tl.where(tmp123, tmp105, tmp103)
    tmp125 = tmp104 * tmp25
    tmp126 = tmp124 + tmp125
    tmp127 = tmp57 - tmp126
    tmp128 = triton_helpers.maximum(tmp127, tmp1)
    tmp129 = libdevice.pow(tmp128, tmp3)
    tmp130 = tmp62 - tmp126
    tmp131 = triton_helpers.maximum(tmp130, tmp1)
    tmp132 = libdevice.pow(tmp131, tmp3)
    tmp133 = tmp129 + tmp132
    tmp134 = tmp68 - tmp126
    tmp135 = triton_helpers.maximum(tmp134, tmp1)
    tmp136 = libdevice.pow(tmp135, tmp3)
    tmp137 = tmp133 + tmp136
    tmp138 = tmp74 - tmp126
    tmp139 = triton_helpers.maximum(tmp138, tmp1)
    tmp140 = libdevice.pow(tmp139, tmp3)
    tmp141 = tmp137 + tmp140
    tmp142 = tmp141 - tmp17
    tmp143 = tmp142 * tmp20
    tmp144 = tmp143 >= tmp1
    tmp145 = tl.where(tmp144, tmp126, tmp124)
    tmp146 = tmp125 * tmp25
    tmp147 = tmp145 + tmp146
    tmp148 = tmp57 - tmp147
    tmp149 = triton_helpers.maximum(tmp148, tmp1)
    tmp150 = libdevice.pow(tmp149, tmp3)
    tmp151 = tmp62 - tmp147
    tmp152 = triton_helpers.maximum(tmp151, tmp1)
    tmp153 = libdevice.pow(tmp152, tmp3)
    tmp154 = tmp150 + tmp153
    tmp155 = tmp68 - tmp147
    tmp156 = triton_helpers.maximum(tmp155, tmp1)
    tmp157 = libdevice.pow(tmp156, tmp3)
    tmp158 = tmp154 + tmp157
    tmp159 = tmp74 - tmp147
    tmp160 = triton_helpers.maximum(tmp159, tmp1)
    tmp161 = libdevice.pow(tmp160, tmp3)
    tmp162 = tmp158 + tmp161
    tmp163 = tmp162 - tmp17
    tmp164 = tmp163 * tmp20
    tmp165 = tmp164 >= tmp1
    tmp166 = tl.where(tmp165, tmp147, tmp145)
    tmp167 = tmp146 * tmp25
    tmp168 = tmp166 + tmp167
    tmp169 = tmp57 - tmp168
    tmp170 = triton_helpers.maximum(tmp169, tmp1)
    tmp171 = libdevice.pow(tmp170, tmp3)
    tmp172 = tmp62 - tmp168
    tmp173 = triton_helpers.maximum(tmp172, tmp1)
    tmp174 = libdevice.pow(tmp173, tmp3)
    tmp175 = tmp171 + tmp174
    tmp176 = tmp68 - tmp168
    tmp177 = triton_helpers.maximum(tmp176, tmp1)
    tmp178 = libdevice.pow(tmp177, tmp3)
    tmp179 = tmp175 + tmp178
    tmp180 = tmp74 - tmp168
    tmp181 = triton_helpers.maximum(tmp180, tmp1)
    tmp182 = libdevice.pow(tmp181, tmp3)
    tmp183 = tmp179 + tmp182
    tmp184 = tmp183 - tmp17
    tmp185 = tmp184 * tmp20
    tmp186 = tmp185 >= tmp1
    tmp187 = tl.where(tmp186, tmp168, tmp166)
    tmp188 = tmp167 * tmp25
    tmp189 = tmp187 + tmp188
    tmp190 = tmp57 - tmp189
    tmp191 = triton_helpers.maximum(tmp190, tmp1)
    tmp192 = libdevice.pow(tmp191, tmp3)
    tmp193 = tmp62 - tmp189
    tmp194 = triton_helpers.maximum(tmp193, tmp1)
    tmp195 = libdevice.pow(tmp194, tmp3)
    tmp196 = tmp192 + tmp195
    tmp197 = tmp68 - tmp189
    tmp198 = triton_helpers.maximum(tmp197, tmp1)
    tmp199 = libdevice.pow(tmp198, tmp3)
    tmp200 = tmp196 + tmp199
    tmp201 = tmp74 - tmp189
    tmp202 = triton_helpers.maximum(tmp201, tmp1)
    tmp203 = libdevice.pow(tmp202, tmp3)
    tmp204 = tmp200 + tmp203
    tmp205 = tmp204 - tmp17
    tmp206 = tmp205 * tmp20
    tmp207 = tmp206 >= tmp1
    tmp208 = tl.where(tmp207, tmp189, tmp187)
    tmp209 = tmp188 * tmp25
    tmp210 = tmp208 + tmp209
    tmp211 = tmp57 - tmp210
    tmp212 = triton_helpers.maximum(tmp211, tmp1)
    tmp213 = libdevice.pow(tmp212, tmp3)
    tmp214 = tmp62 - tmp210
    tmp215 = triton_helpers.maximum(tmp214, tmp1)
    tmp216 = libdevice.pow(tmp215, tmp3)
    tmp217 = tmp213 + tmp216
    tmp218 = tmp68 - tmp210
    tmp219 = triton_helpers.maximum(tmp218, tmp1)
    tmp220 = libdevice.pow(tmp219, tmp3)
    tmp221 = tmp217 + tmp220
    tmp222 = tmp74 - tmp210
    tmp223 = triton_helpers.maximum(tmp222, tmp1)
    tmp224 = libdevice.pow(tmp223, tmp3)
    tmp225 = tmp221 + tmp224
    tmp226 = tmp225 - tmp17
    tmp227 = tmp226 * tmp20
    tmp228 = tmp227 >= tmp1
    tmp229 = tl.where(tmp228, tmp210, tmp208)
    tmp230 = tmp209 * tmp25
    tmp231 = tmp229 + tmp230
    tmp232 = tmp57 - tmp231
    tmp233 = triton_helpers.maximum(tmp232, tmp1)
    tmp234 = libdevice.pow(tmp233, tmp3)
    tmp235 = tmp62 - tmp231
    tmp236 = triton_helpers.maximum(tmp235, tmp1)
    tmp237 = libdevice.pow(tmp236, tmp3)
    tmp238 = tmp234 + tmp237
    tmp239 = tmp68 - tmp231
    tmp240 = triton_helpers.maximum(tmp239, tmp1)
    tmp241 = libdevice.pow(tmp240, tmp3)
    tmp242 = tmp238 + tmp241
    tmp243 = tmp74 - tmp231
    tmp244 = triton_helpers.maximum(tmp243, tmp1)
    tmp245 = libdevice.pow(tmp244, tmp3)
    tmp246 = tmp242 + tmp245
    tl.store(in_out_ptr4 + (x0), tmp231, xmask)
    tl.store(out_ptr7 + (x0), tmp246, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_4/inductor_cache/pm/cpmji3aw76p4a3ywro7icjwdbgchdizzkcjfhno53435xsk6mwfd.py
# Topologically Sorted Source Nodes: [sub, X, dm_45, dm_46, dm_47, dm_48, tau_m_47, tau_lo_48, dm_49, tau_m_48, tau_lo_49, dm_50, tau_m_49, sub_156, clamp_50, truediv_50, p_m_49, p_m_50], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow]
# Source node to ATen node mapping:
#   X => mul
#   clamp_50 => clamp_min_50
#   dm_45 => div_44
#   dm_46 => div_45
#   dm_47 => div_46
#   dm_48 => div_47
#   dm_49 => div_48
#   dm_50 => div_49
#   p_m_49 => pow_53
#   p_m_50 => div_50
#   sub => full_default
#   sub_156 => sub_156
#   tau_lo_48 => where_47
#   tau_lo_49 => where_48
#   tau_m_47 => add_47
#   tau_m_48 => add_48
#   tau_m_49 => add_49
#   truediv_50 => full_default_53
# Graph fragment:
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 0.5), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %mul : [num_users=52] = call_function[target=torch.ops.aten.mul.Tensor](args = (%arg0_1, %full_default), kwargs = {})
#   %div_44 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_43, 2), kwargs = {})
#   %div_45 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_44, 2), kwargs = {})
#   %div_46 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_45, 2), kwargs = {})
#   %div_47 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_46, 2), kwargs = {})
#   %add_47 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_46, %div_47), kwargs = {})
#   %where_47 : [num_users=2] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_47, %add_47, %where_46), kwargs = {})
#   %div_48 : [num_users=2] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_47, 2), kwargs = {})
#   %add_48 : [num_users=2] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_47, %div_48), kwargs = {})
#   %where_48 : [num_users=1] = call_function[target=torch.ops.aten.where.self](args = (%unsqueeze_48, %add_48, %where_47), kwargs = {})
#   %div_49 : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%div_48, 2), kwargs = {})
#   %add_49 : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%where_48, %div_49), kwargs = {})
#   %sub_156 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %add_49), kwargs = {})
#   %clamp_min_50 : [num_users=1] = call_function[target=torch.ops.aten.clamp_min.default](args = (%sub_156, 0), kwargs = {})
#   %full_default_53 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([4, 4, 4, 1], 2.0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %pow_53 : [num_users=2] = call_function[target=torch.ops.aten.pow.Tensor_Tensor](args = (%clamp_min_50, %full_default_53), kwargs = {})
#   %div_50 : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%pow_53, %unsqueeze_50), kwargs = {})
triton_poi_fused_add_clamp_div_mul_pow_sub_where_21 = async_compile.triton('triton_poi_fused_add_clamp_div_mul_pow_sub_where_21', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[256], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 4), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_clamp_div_mul_pow_sub_where_21', '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_clamp_div_mul_pow_sub_where_21(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + (x1), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr2 + (x1), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = tmp2 - tmp3
    tmp5 = 0.0
    tmp6 = triton_helpers.maximum(tmp4, tmp5)
    tmp7 = 2.0
    tmp8 = libdevice.pow(tmp6, tmp7)
    tmp10 = tmp8 / tmp9
    tl.store(out_ptr0 + (x2), tmp10, xmask)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf35 = empty_strided_cuda((4, 4, 4, 1), (16, 4, 1, 64), torch.float32)
        buf51 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf52 = reinterpret_tensor(buf51, (4, 4, 4, 1), (16, 4, 1, 64), 0); del buf51  # reuse
        buf53 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [sub, X, max_1, pow_2, tau_hi, pow_1, tau_lo, dm, dm_1, tau_m, sub_9, clamp_1, truediv_1, p_m, sum_2, sub_5, clamp, truediv, pow_3, sum_1, f_lo, tau_lo_1, dm_2, tau_m_1, sub_12, clamp_2, truediv_2, p_m_1, sum_3, f_m_1, mul_2, tau_lo_2, dm_3, tau_m_2, sub_15, clamp_3, truediv_3, p_m_2, sum_4, f_m_2, mul_3, tau_lo_3, dm_4, tau_m_3, sub_18, clamp_4, truediv_4, p_m_3, sum_5, f_m_3, mul_4, tau_lo_4, dm_5, tau_m_4, sub_21, clamp_5, truediv_5, p_m_4, sum_6, f_m_4, mul_5, tau_lo_5, dm_6, tau_m_5, sub_24, clamp_6, truediv_6, p_m_5, sum_7, f_m_5, mul_6, tau_lo_6, dm_7, tau_m_6, sub_27, clamp_7, truediv_7, p_m_6, sum_8, f_m_6, mul_7, tau_lo_7, dm_8, tau_m_7, sub_30, clamp_8, truediv_8, p_m_7, sum_9, f_m_7, mul_8, tau_lo_8, dm_9, tau_m_8, sub_33, clamp_9, truediv_9, p_m_8, sum_10, f_m_8, mul_9, tau_lo_9, dm_10, tau_m_9, sub_36, clamp_10, truediv_10, p_m_9, sum_11, f_m_9, mul_10, tau_lo_10, dm_11, tau_m_10, sub_39, clamp_11, truediv_11, p_m_10, sum_12, f_m_10, mul_11, tau_lo_11, dm_12, tau_m_11, sub_42, clamp_12, truediv_12, p_m_11, sum_13, f_m_11, mul_12, tau_lo_12, dm_13, tau_m_12, sub_45, clamp_13, truediv_13, p_m_12, sum_14, f_m_12, mul_13, tau_lo_13, dm_14, tau_m_13, sub_48, clamp_14, truediv_14, p_m_13, sum_15, f_m_13, mul_14, tau_lo_14, dm_15, tau_m_14, sub_51, clamp_15, truediv_15, p_m_14, sum_16, tau_lo_15, dm_16, tau_m_15, sub_54, clamp_16, truediv_16, p_m_15, sum_17, f_m_15, tau_lo_16, dm_17, tau_m_16, sub_57, clamp_17, truediv_17, p_m_16, sum_18, tau_lo_17, dm_18, tau_m_17, sub_60, clamp_18, truediv_18, p_m_17, sum_19, tau_lo_18, dm_19, tau_m_18, sub_63, clamp_19, truediv_19, p_m_18, sum_20, tau_lo_19, dm_20, tau_m_19, sub_66, clamp_20, truediv_20, p_m_19, sum_21, tau_lo_20, dm_21, tau_m_20, sub_69, clamp_21, truediv_21, p_m_20, sum_22, tau_lo_21, dm_22, tau_m_21, sub_72, clamp_22, truediv_22, p_m_21, sum_23, tau_lo_22, dm_23, tau_m_22, sub_75, clamp_23, truediv_23, p_m_22, sum_24, tau_lo_23, dm_24, tau_m_23, sub_78, clamp_24, truediv_24, p_m_23, sum_25, tau_lo_24, dm_25, tau_m_24, sub_81, clamp_25, truediv_25, p_m_24, sum_26, tau_lo_25, dm_26, tau_m_25, sub_84, clamp_26, truediv_26, p_m_25, sum_27], Original ATen: [aten.sub, aten.mul, aten.max, aten.pow, aten.div, aten.add, aten.clamp, aten.sum, aten.where]
        stream0 = get_raw_stream(0)
        triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0.run(buf52, arg0_1, buf1, buf35, buf53, 64, grid=grid(64), stream=stream0)
        buf54 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, tau_m_25, tau_lo_26, dm_27, tau_m_26, sub_87, clamp_27, truediv_27, p_m_26], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow]
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_1.run(arg0_1, buf53, buf1, buf52, buf35, buf54, 256, grid=grid(256), stream=stream0)
        buf55 = buf52; del buf52  # reuse
        buf56 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, tau_m_25, tau_lo_26, dm_27, tau_m_26, tau_lo_27, dm_28, tau_m_27, sub_90, clamp_28, truediv_28, p_m_27, sum_29], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2.run(buf55, buf54, buf1, buf53, buf35, arg0_1, buf56, 64, grid=grid(64), stream=stream0)
        buf57 = buf54; del buf54  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, tau_m_27, tau_lo_28, dm_29, tau_m_28, sub_93], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_mul_sub_where_3.run(arg0_1, buf56, buf1, buf55, buf35, buf57, 256, grid=grid(256), stream=stream0)
        buf58 = buf55; del buf55  # reuse
        buf59 = buf53; del buf53  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, tau_m_27, tau_lo_28, dm_29, tau_m_28, tau_lo_29, dm_30, tau_m_29, sub_96, clamp_30, truediv_30, p_m_29, sum_31], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4.run(buf58, buf57, buf1, buf56, buf35, arg0_1, buf59, 64, grid=grid(64), stream=stream0)
        buf60 = buf57; del buf57  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, tau_m_29, tau_lo_30, dm_31, tau_m_30, sub_99], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_mul_sub_where_5.run(arg0_1, buf59, buf1, buf58, buf35, buf60, 256, grid=grid(256), stream=stream0)
        buf61 = buf58; del buf58  # reuse
        buf66 = buf56; del buf56  # reuse
        buf67 = reinterpret_tensor(buf66, (4, 4, 4, 1), (16, 4, 1, 64), 0); del buf66  # reuse
        # Topologically Sorted Source Nodes: [sub, X, f_lo, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, tau_m_29, tau_lo_30, dm_31, tau_m_30, tau_lo_31, dm_32, tau_m_31, sub_102, clamp_32, truediv_32, p_m_31, sum_33, tau_lo_32, dm_33, tau_m_32, sub_105, clamp_33, truediv_33, p_m_32, sum_34, f_m_32, mul_33, tau_lo_33, dm_34, tau_m_33, sub_108, clamp_34, truediv_34, p_m_33, sum_35, tau_lo_34], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6.run(buf61, buf67, buf60, buf1, buf59, buf35, arg0_1, 64, grid=grid(64), stream=stream0)
        buf68 = buf60; del buf60  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, tau_m_34, sub_111, clamp_35, truediv_35, p_m_34], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp, aten.pow]
        triton_poi_fused_add_clamp_div_mul_pow_sub_7.run(arg0_1, buf67, buf35, buf68, 256, grid=grid(256), stream=stream0)
        buf69 = buf67; del buf67  # reuse
        # Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, tau_m_34, tau_lo_35], Original ATen: [aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_where_8.run(buf69, buf68, buf1, buf35, 64, grid=grid(64), stream=stream0)
        buf70 = buf68; del buf68  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, tau_m_35, sub_114, clamp_36, truediv_36, p_m_35], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp, aten.pow]
        triton_poi_fused_add_clamp_div_mul_pow_sub_9.run(arg0_1, buf69, buf35, buf70, 256, grid=grid(256), stream=stream0)
        buf71 = buf69; del buf69  # reuse
        # Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, tau_m_35, tau_lo_36], Original ATen: [aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_where_10.run(buf71, buf70, buf1, buf35, 64, grid=grid(64), stream=stream0)
        buf72 = buf70; del buf70  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, tau_m_36, sub_117, clamp_37], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp]
        triton_poi_fused_add_clamp_div_mul_sub_11.run(arg0_1, buf71, buf35, buf72, 256, grid=grid(256), stream=stream0)
        buf73 = buf71; del buf71  # reuse
        # Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, tau_m_36, tau_lo_37], Original ATen: [aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_where_12.run(buf73, buf72, buf1, buf35, 64, grid=grid(64), stream=stream0)
        buf74 = buf72; del buf72  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, tau_m_37, sub_120, clamp_38], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.clamp]
        triton_poi_fused_add_clamp_div_mul_sub_13.run(arg0_1, buf73, buf35, buf74, 256, grid=grid(256), stream=stream0)
        buf75 = buf73; del buf73  # reuse
        # Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, tau_m_37, tau_lo_38], Original ATen: [aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_where_14.run(buf75, buf74, buf1, buf35, 64, grid=grid(64), stream=stream0)
        buf76 = buf74; del buf74  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, tau_m_38, sub_123], Original ATen: [aten.sub, aten.mul, aten.div, aten.add]
        triton_poi_fused_add_div_mul_sub_15.run(arg0_1, buf75, buf35, buf76, 256, grid=grid(256), stream=stream0)
        buf77 = buf75; del buf75  # reuse
        # Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, tau_m_38, tau_lo_39], Original ATen: [aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_where_16.run(buf77, buf76, buf1, buf35, 64, grid=grid(64), stream=stream0)
        buf78 = buf76; del buf76  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, tau_m_39, sub_126], Original ATen: [aten.sub, aten.mul, aten.div, aten.add]
        triton_poi_fused_add_div_mul_sub_17.run(arg0_1, buf77, buf35, buf78, 256, grid=grid(256), stream=stream0)
        buf79 = buf77; del buf77  # reuse
        # Topologically Sorted Source Nodes: [dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, tau_m_39, tau_lo_40], Original ATen: [aten.div, aten.add, aten.where]
        triton_poi_fused_add_div_where_18.run(buf79, buf78, buf1, buf35, 64, grid=grid(64), stream=stream0)
        buf80 = buf78; del buf78  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, dm_41, tau_m_40, sub_129], Original ATen: [aten.sub, aten.mul, aten.div, aten.add]
        triton_poi_fused_add_div_mul_sub_19.run(arg0_1, buf79, buf35, buf80, 256, grid=grid(256), stream=stream0)
        buf81 = buf79; del buf79  # reuse
        buf95 = reinterpret_tensor(buf61, (4, 4, 4), (16, 4, 1), 0); del buf61  # reuse
        buf96 = reinterpret_tensor(buf95, (4, 4, 4, 1), (16, 4, 1, 64), 0); del buf95  # reuse
        buf97 = buf59; del buf59  # reuse
        # Topologically Sorted Source Nodes: [sub, X, f_lo, dm_16, dm_17, dm_18, dm_19, dm_20, dm_21, dm_22, dm_23, dm_24, dm_25, dm_26, dm_27, dm_28, dm_29, dm_30, dm_31, dm_32, dm_33, dm_34, dm_35, dm_36, dm_37, dm_38, dm_39, dm_40, dm_41, tau_m_40, tau_lo_41, dm_42, tau_m_41, sub_132, clamp_42, truediv_42, p_m_41, sum_43, f_m_41, mul_42, tau_lo_42, dm_43, tau_m_42, sub_135, clamp_43, truediv_43, p_m_42, sum_44, f_m_42, mul_43, tau_lo_43, dm_44, tau_m_43, sub_138, clamp_44, truediv_44, p_m_43, sum_45, f_m_43, tau_lo_44, dm_45, tau_m_44, sub_141, clamp_45, truediv_45, p_m_44, sum_46, tau_lo_45, dm_46, tau_m_45, sub_144, clamp_46, truediv_46, p_m_45, sum_47, tau_lo_46, dm_47, tau_m_46, sub_147, clamp_47, truediv_47, p_m_46, sum_48, tau_lo_47, dm_48, tau_m_47, sub_150, clamp_48, truediv_48, p_m_47, sum_49, tau_lo_48, dm_49, tau_m_48, sub_153, clamp_49, truediv_49, p_m_48, sum_50, tau_lo_49, dm_50, tau_m_49, sub_156, clamp_50, truediv_50, p_m_49, sum_52], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow, aten.sum]
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20.run(buf81, buf96, buf80, buf1, buf35, arg0_1, buf97, 64, grid=grid(64), stream=stream0)
        del buf1
        del buf35
        del buf81
        buf98 = buf80; del buf80  # reuse
        # Topologically Sorted Source Nodes: [sub, X, dm_45, dm_46, dm_47, dm_48, tau_m_47, tau_lo_48, dm_49, tau_m_48, tau_lo_49, dm_50, tau_m_49, sub_156, clamp_50, truediv_50, p_m_49, p_m_50], Original ATen: [aten.sub, aten.mul, aten.div, aten.add, aten.where, aten.clamp, aten.pow]
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_21.run(arg0_1, buf96, buf97, buf98, 256, grid=grid(256), stream=stream0)
        del arg0_1
        del buf96
        del buf97
    return (buf98, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    arg0_1 = rand_strided((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([arg0_1])
    return print_performance(fn, times=times, repeat=repeat)


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

from torch.autograd import Function
import torch
import torch.nn as nn


def entmax_bisect(X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True):
    """alpha-entmax: normalizing sparse transform (a la softmax).

    Solves the optimization problem:

        max_p <x, p> - H_a(p)    s.t.    p >= 0, sum(p) == 1.

    where H_a(p) is the Tsallis alpha-entropy with custom alpha >= 1,
    using a bisection (root finding, binary search) algorithm.

    This function is differentiable with respect to both X and alpha.

    Parameters
    ----------
    X : torch.Tensor
        The input tensor.

    alpha : float or torch.Tensor
        Tensor of alpha parameters (> 1) to use. If scalar
        or python float, the same value is used for all rows, otherwise,
        it must have shape (or be expandable to)
        alpha.shape[j] == (X.shape[j] if j != dim else 1)
        A value of alpha=2 corresponds to sparsemax, and alpha=1 corresponds to
        softmax (but computing it this way is likely unstable).

    dim : int
        The dimension along which to apply alpha-entmax.

    n_iter : int
        Number of bisection iterations. For float32, 24 iterations should
        suffice for machine precision.

    ensure_sum_one : bool,
        Whether to divide the result by its sum. If false, the result might
        sum to close but not exactly 1, which might cause downstream problems.

    Returns
    -------
    P : torch tensor, same shape as X
        The projection result, such that P.sum(dim=dim) == 1 elementwise.
    """
    return EntmaxBisectFunction.apply(X, alpha, dim, n_iter, ensure_sum_one)


class EntmaxBisectFunction(Function):

    @classmethod
    def _gp(cls, x, alpha):
        return x ** (alpha - 1)

    @classmethod
    def _gp_inv(cls, y, alpha):
        return y ** (1 / (alpha - 1))

    @classmethod
    def _p(cls, X, alpha):
        return cls._gp_inv(torch.clamp(X, min=0), alpha)

    @classmethod
    def forward(cls, ctx, X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True
        ):
        if not isinstance(alpha, torch.Tensor):
            alpha = torch.tensor(alpha, dtype=X.dtype, device=X.device)
        alpha_shape = list(X.shape)
        alpha_shape[dim] = 1
        alpha = alpha.expand(*alpha_shape)
        ctx.alpha = alpha
        ctx.dim = dim
        d = X.shape[dim]
        X = X * (alpha - 1)
        max_val, _ = X.max(dim=dim, keepdim=True)
        tau_lo = max_val - cls._gp(1, alpha)
        tau_hi = max_val - cls._gp(1 / d, alpha)
        f_lo = cls._p(X - tau_lo, alpha).sum(dim) - 1
        dm = tau_hi - tau_lo
        for it in range(n_iter):
            dm /= 2
            tau_m = tau_lo + dm
            p_m = cls._p(X - tau_m, alpha)
            f_m = p_m.sum(dim) - 1
            mask = (f_m * f_lo >= 0).unsqueeze(dim)
            tau_lo = torch.where(mask, tau_m, tau_lo)
        if ensure_sum_one:
            p_m /= p_m.sum(dim=dim).unsqueeze(dim=dim)
        ctx.save_for_backward(p_m)
        return p_m

    @classmethod
    def backward(cls, ctx, dY):
        Y, = ctx.saved_tensors
        gppr = torch.where(Y > 0, Y ** (2 - ctx.alpha), Y.new_zeros(1))
        dX = dY * gppr
        q = dX.sum(ctx.dim) / gppr.sum(ctx.dim)
        q = q.unsqueeze(ctx.dim)
        dX -= q * gppr
        d_alpha = None
        if ctx.needs_input_grad[1]:
            S = torch.where(Y > 0, Y * torch.log(Y), Y.new_zeros(1))
            ent = S.sum(ctx.dim).unsqueeze(ctx.dim)
            Y_skewed = gppr / gppr.sum(ctx.dim).unsqueeze(ctx.dim)
            d_alpha = dY * (Y - Y_skewed) / (ctx.alpha - 1) ** 2
            d_alpha -= dY * (S - Y_skewed * ent) / (ctx.alpha - 1)
            d_alpha = d_alpha.sum(ctx.dim).unsqueeze(ctx.dim)
        return dX, d_alpha, None, None, None


class EntmaxBisect(nn.Module):

    def __init__(self, alpha=1.5, dim=-1, n_iter=50):
        """alpha-entmax: normalizing sparse map (a la softmax) via bisection.

        Solves the optimization problem:

            max_p <x, p> - H_a(p)    s.t.    p >= 0, sum(p) == 1.

        where H_a(p) is the Tsallis alpha-entropy with custom alpha >= 1,
        using a bisection (root finding, binary search) algorithm.

        Parameters
        ----------
        alpha : float or torch.Tensor
            Tensor of alpha parameters (> 1) to use. If scalar
            or python float, the same value is used for all rows, otherwise,
            it must have shape (or be expandable to)
            alpha.shape[j] == (X.shape[j] if j != dim else 1)
            A value of alpha=2 corresponds to sparsemax; alpha=1 corresponds
            to softmax (but computing it this way is likely unstable).

        dim : int
            The dimension along which to apply alpha-entmax.

        n_iter : int
            Number of bisection iterations. For float32, 24 iterations should
            suffice for machine precision.

        """
        self.dim = dim
        self.n_iter = n_iter
        self.alpha = alpha
        super().__init__()

    def forward(self, X):
        return entmax_bisect(X, alpha=self.alpha, dim=self.dim, n_iter=self
            .n_iter)


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


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

import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice
from torch.autograd import Function
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_add_clamp_div_max_mul_pow_sub_sum_where_0(in_out_ptr12,
    in_ptr0, out_ptr0, out_ptr19, out_ptr27, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = tmp3 * tmp1
    tmp5 = triton_helpers.maximum(tmp2, tmp4)
    tmp7 = tmp6 * tmp1
    tmp8 = triton_helpers.maximum(tmp5, tmp7)
    tmp10 = tmp9 * tmp1
    tmp11 = triton_helpers.maximum(tmp8, tmp10)
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp14 = tmp11 - tmp1
    tmp15 = tmp14 - tmp13
    tmp16 = tmp15 * tmp1
    tmp17 = tmp13 + tmp16
    tmp18 = tmp2 - tmp17
    tmp19 = 0.0
    tmp20 = triton_helpers.maximum(tmp18, tmp19)
    tmp21 = 2.0
    tmp22 = libdevice.pow(tmp20, tmp21)
    tmp23 = tmp4 - tmp17
    tmp24 = triton_helpers.maximum(tmp23, tmp19)
    tmp25 = libdevice.pow(tmp24, tmp21)
    tmp26 = tmp22 + tmp25
    tmp27 = tmp7 - tmp17
    tmp28 = triton_helpers.maximum(tmp27, tmp19)
    tmp29 = libdevice.pow(tmp28, tmp21)
    tmp30 = tmp26 + tmp29
    tmp31 = tmp10 - tmp17
    tmp32 = triton_helpers.maximum(tmp31, tmp19)
    tmp33 = libdevice.pow(tmp32, tmp21)
    tmp34 = tmp30 + tmp33
    tmp35 = tmp2 - tmp13
    tmp36 = triton_helpers.maximum(tmp35, tmp19)
    tmp37 = libdevice.pow(tmp36, tmp21)
    tmp38 = tmp4 - tmp13
    tmp39 = triton_helpers.maximum(tmp38, tmp19)
    tmp40 = libdevice.pow(tmp39, tmp21)
    tmp41 = tmp37 + tmp40
    tmp42 = tmp7 - tmp13
    tmp43 = triton_helpers.maximum(tmp42, tmp19)
    tmp44 = libdevice.pow(tmp43, tmp21)
    tmp45 = tmp41 + tmp44
    tmp46 = tmp10 - tmp13
    tmp47 = triton_helpers.maximum(tmp46, tmp19)
    tmp48 = libdevice.pow(tmp47, tmp21)
    tmp49 = tmp45 + tmp48
    tmp50 = tmp34 - tmp12
    tmp51 = tmp49 - tmp12
    tmp52 = tmp50 * tmp51
    tmp53 = tmp52 >= tmp19
    tmp54 = tl.where(tmp53, tmp17, tmp13)
    tmp55 = tmp16 * tmp1
    tmp56 = tmp54 + tmp55
    tmp57 = tmp2 - tmp56
    tmp58 = triton_helpers.maximum(tmp57, tmp19)
    tmp59 = libdevice.pow(tmp58, tmp21)
    tmp60 = tmp4 - tmp56
    tmp61 = triton_helpers.maximum(tmp60, tmp19)
    tmp62 = libdevice.pow(tmp61, tmp21)
    tmp63 = tmp59 + tmp62
    tmp64 = tmp7 - tmp56
    tmp65 = triton_helpers.maximum(tmp64, tmp19)
    tmp66 = libdevice.pow(tmp65, tmp21)
    tmp67 = tmp63 + tmp66
    tmp68 = tmp10 - tmp56
    tmp69 = triton_helpers.maximum(tmp68, tmp19)
    tmp70 = libdevice.pow(tmp69, tmp21)
    tmp71 = tmp67 + tmp70
    tmp72 = tmp71 - tmp12
    tmp73 = tmp72 * tmp51
    tmp74 = tmp73 >= tmp19
    tmp75 = tl.where(tmp74, tmp56, tmp54)
    tmp76 = tmp55 * tmp1
    tmp77 = tmp75 + tmp76
    tmp78 = tmp2 - tmp77
    tmp79 = triton_helpers.maximum(tmp78, tmp19)
    tmp80 = libdevice.pow(tmp79, tmp21)
    tmp81 = tmp4 - tmp77
    tmp82 = triton_helpers.maximum(tmp81, tmp19)
    tmp83 = libdevice.pow(tmp82, tmp21)
    tmp84 = tmp80 + tmp83
    tmp85 = tmp7 - tmp77
    tmp86 = triton_helpers.maximum(tmp85, tmp19)
    tmp87 = libdevice.pow(tmp86, tmp21)
    tmp88 = tmp84 + tmp87
    tmp89 = tmp10 - tmp77
    tmp90 = triton_helpers.maximum(tmp89, tmp19)
    tmp91 = libdevice.pow(tmp90, tmp21)
    tmp92 = tmp88 + tmp91
    tmp93 = tmp92 - tmp12
    tmp94 = tmp93 * tmp51
    tmp95 = tmp94 >= tmp19
    tmp96 = tl.where(tmp95, tmp77, tmp75)
    tmp97 = tmp76 * tmp1
    tmp98 = tmp96 + tmp97
    tmp99 = tmp2 - tmp98
    tmp100 = triton_helpers.maximum(tmp99, tmp19)
    tmp101 = libdevice.pow(tmp100, tmp21)
    tmp102 = tmp4 - tmp98
    tmp103 = triton_helpers.maximum(tmp102, tmp19)
    tmp104 = libdevice.pow(tmp103, tmp21)
    tmp105 = tmp101 + tmp104
    tmp106 = tmp7 - tmp98
    tmp107 = triton_helpers.maximum(tmp106, tmp19)
    tmp108 = libdevice.pow(tmp107, tmp21)
    tmp109 = tmp105 + tmp108
    tmp110 = tmp10 - tmp98
    tmp111 = triton_helpers.maximum(tmp110, tmp19)
    tmp112 = libdevice.pow(tmp111, tmp21)
    tmp113 = tmp109 + tmp112
    tmp114 = tmp113 - tmp12
    tmp115 = tmp114 * tmp51
    tmp116 = tmp115 >= tmp19
    tmp117 = tl.where(tmp116, tmp98, tmp96)
    tmp118 = tmp97 * tmp1
    tmp119 = tmp117 + tmp118
    tmp120 = tmp2 - tmp119
    tmp121 = triton_helpers.maximum(tmp120, tmp19)
    tmp122 = libdevice.pow(tmp121, tmp21)
    tmp123 = tmp4 - tmp119
    tmp124 = triton_helpers.maximum(tmp123, tmp19)
    tmp125 = libdevice.pow(tmp124, tmp21)
    tmp126 = tmp122 + tmp125
    tmp127 = tmp7 - tmp119
    tmp128 = triton_helpers.maximum(tmp127, tmp19)
    tmp129 = libdevice.pow(tmp128, tmp21)
    tmp130 = tmp126 + tmp129
    tmp131 = tmp10 - tmp119
    tmp132 = triton_helpers.maximum(tmp131, tmp19)
    tmp133 = libdevice.pow(tmp132, tmp21)
    tmp134 = tmp130 + tmp133
    tmp135 = tmp134 - tmp12
    tmp136 = tmp135 * tmp51
    tmp137 = tmp136 >= tmp19
    tmp138 = tl.where(tmp137, tmp119, tmp117)
    tmp139 = tmp118 * tmp1
    tmp140 = tmp138 + tmp139
    tmp141 = tmp2 - tmp140
    tmp142 = triton_helpers.maximum(tmp141, tmp19)
    tmp143 = libdevice.pow(tmp142, tmp21)
    tmp144 = tmp4 - tmp140
    tmp145 = triton_helpers.maximum(tmp144, tmp19)
    tmp146 = libdevice.pow(tmp145, tmp21)
    tmp147 = tmp143 + tmp146
    tmp148 = tmp7 - tmp140
    tmp149 = triton_helpers.maximum(tmp148, tmp19)
    tmp150 = libdevice.pow(tmp149, tmp21)
    tmp151 = tmp147 + tmp150
    tmp152 = tmp10 - tmp140
    tmp153 = triton_helpers.maximum(tmp152, tmp19)
    tmp154 = libdevice.pow(tmp153, tmp21)
    tmp155 = tmp151 + tmp154
    tmp156 = tmp155 - tmp12
    tmp157 = tmp156 * tmp51
    tmp158 = tmp157 >= tmp19
    tmp159 = tl.where(tmp158, tmp140, tmp138)
    tmp160 = tmp139 * tmp1
    tmp161 = tmp159 + tmp160
    tmp162 = tmp2 - tmp161
    tmp163 = triton_helpers.maximum(tmp162, tmp19)
    tmp164 = libdevice.pow(tmp163, tmp21)
    tmp165 = tmp4 - tmp161
    tmp166 = triton_helpers.maximum(tmp165, tmp19)
    tmp167 = libdevice.pow(tmp166, tmp21)
    tmp168 = tmp164 + tmp167
    tmp169 = tmp7 - tmp161
    tmp170 = triton_helpers.maximum(tmp169, tmp19)
    tmp171 = libdevice.pow(tmp170, tmp21)
    tmp172 = tmp168 + tmp171
    tmp173 = tmp10 - tmp161
    tmp174 = triton_helpers.maximum(tmp173, tmp19)
    tmp175 = libdevice.pow(tmp174, tmp21)
    tmp176 = tmp172 + tmp175
    tmp177 = tmp176 - tmp12
    tmp178 = tmp177 * tmp51
    tmp179 = tmp178 >= tmp19
    tmp180 = tl.where(tmp179, tmp161, tmp159)
    tmp181 = tmp160 * tmp1
    tmp182 = tmp180 + tmp181
    tmp183 = tmp2 - tmp182
    tmp184 = triton_helpers.maximum(tmp183, tmp19)
    tmp185 = libdevice.pow(tmp184, tmp21)
    tmp186 = tmp4 - tmp182
    tmp187 = triton_helpers.maximum(tmp186, tmp19)
    tmp188 = libdevice.pow(tmp187, tmp21)
    tmp189 = tmp185 + tmp188
    tmp190 = tmp7 - tmp182
    tmp191 = triton_helpers.maximum(tmp190, tmp19)
    tmp192 = libdevice.pow(tmp191, tmp21)
    tmp193 = tmp189 + tmp192
    tmp194 = tmp10 - tmp182
    tmp195 = triton_helpers.maximum(tmp194, tmp19)
    tmp196 = libdevice.pow(tmp195, tmp21)
    tmp197 = tmp193 + tmp196
    tmp198 = tmp197 - tmp12
    tmp199 = tmp198 * tmp51
    tmp200 = tmp199 >= tmp19
    tmp201 = tl.where(tmp200, tmp182, tmp180)
    tmp202 = tmp181 * tmp1
    tmp203 = tmp201 + tmp202
    tmp204 = tmp2 - tmp203
    tmp205 = triton_helpers.maximum(tmp204, tmp19)
    tmp206 = libdevice.pow(tmp205, tmp21)
    tmp207 = tmp4 - tmp203
    tmp208 = triton_helpers.maximum(tmp207, tmp19)
    tmp209 = libdevice.pow(tmp208, tmp21)
    tmp210 = tmp206 + tmp209
    tmp211 = tmp7 - tmp203
    tmp212 = triton_helpers.maximum(tmp211, tmp19)
    tmp213 = libdevice.pow(tmp212, tmp21)
    tmp214 = tmp210 + tmp213
    tmp215 = tmp10 - tmp203
    tmp216 = triton_helpers.maximum(tmp215, tmp19)
    tmp217 = libdevice.pow(tmp216, tmp21)
    tmp218 = tmp214 + tmp217
    tmp219 = tmp218 - tmp12
    tmp220 = tmp219 * tmp51
    tmp221 = tmp220 >= tmp19
    tmp222 = tl.where(tmp221, tmp203, tmp201)
    tmp223 = tmp202 * tmp1
    tmp224 = tmp222 + tmp223
    tmp225 = tmp2 - tmp224
    tmp226 = triton_helpers.maximum(tmp225, tmp19)
    tmp227 = libdevice.pow(tmp226, tmp21)
    tmp228 = tmp4 - tmp224
    tmp229 = triton_helpers.maximum(tmp228, tmp19)
    tmp230 = libdevice.pow(tmp229, tmp21)
    tmp231 = tmp227 + tmp230
    tmp232 = tmp7 - tmp224
    tmp233 = triton_helpers.maximum(tmp232, tmp19)
    tmp234 = libdevice.pow(tmp233, tmp21)
    tmp235 = tmp231 + tmp234
    tmp236 = tmp10 - tmp224
    tmp237 = triton_helpers.maximum(tmp236, tmp19)
    tmp238 = libdevice.pow(tmp237, tmp21)
    tmp239 = tmp235 + tmp238
    tmp240 = tmp239 - tmp12
    tmp241 = tmp240 * tmp51
    tmp242 = tmp241 >= tmp19
    tmp243 = tl.where(tmp242, tmp224, tmp222)
    tmp244 = tmp223 * tmp1
    tmp245 = tmp243 + tmp244
    tmp246 = tmp2 - tmp245
    tmp247 = triton_helpers.maximum(tmp246, tmp19)
    tmp248 = libdevice.pow(tmp247, tmp21)
    tmp249 = tmp4 - tmp245
    tmp250 = triton_helpers.maximum(tmp249, tmp19)
    tmp251 = libdevice.pow(tmp250, tmp21)
    tmp252 = tmp248 + tmp251
    tmp253 = tmp7 - tmp245
    tmp254 = triton_helpers.maximum(tmp253, tmp19)
    tmp255 = libdevice.pow(tmp254, tmp21)
    tmp256 = tmp252 + tmp255
    tmp257 = tmp10 - tmp245
    tmp258 = triton_helpers.maximum(tmp257, tmp19)
    tmp259 = libdevice.pow(tmp258, tmp21)
    tmp260 = tmp256 + tmp259
    tmp261 = tmp260 - tmp12
    tmp262 = tmp261 * tmp51
    tmp263 = tmp262 >= tmp19
    tmp264 = tl.where(tmp263, tmp245, tmp243)
    tmp265 = tmp244 * tmp1
    tmp266 = tmp264 + tmp265
    tmp267 = tmp2 - tmp266
    tmp268 = triton_helpers.maximum(tmp267, tmp19)
    tmp269 = libdevice.pow(tmp268, tmp21)
    tmp270 = tmp4 - tmp266
    tmp271 = triton_helpers.maximum(tmp270, tmp19)
    tmp272 = libdevice.pow(tmp271, tmp21)
    tmp273 = tmp269 + tmp272
    tmp274 = tmp7 - tmp266
    tmp275 = triton_helpers.maximum(tmp274, tmp19)
    tmp276 = libdevice.pow(tmp275, tmp21)
    tmp277 = tmp273 + tmp276
    tmp278 = tmp10 - tmp266
    tmp279 = triton_helpers.maximum(tmp278, tmp19)
    tmp280 = libdevice.pow(tmp279, tmp21)
    tmp281 = tmp277 + tmp280
    tmp282 = tmp281 - tmp12
    tmp283 = tmp282 * tmp51
    tmp284 = tmp283 >= tmp19
    tmp285 = tl.where(tmp284, tmp266, tmp264)
    tmp286 = tmp265 * tmp1
    tmp287 = tmp285 + tmp286
    tmp288 = tmp2 - tmp287
    tmp289 = triton_helpers.maximum(tmp288, tmp19)
    tmp290 = libdevice.pow(tmp289, tmp21)
    tmp291 = tmp4 - tmp287
    tmp292 = triton_helpers.maximum(tmp291, tmp19)
    tmp293 = libdevice.pow(tmp292, tmp21)
    tmp294 = tmp290 + tmp293
    tmp295 = tmp7 - tmp287
    tmp296 = triton_helpers.maximum(tmp295, tmp19)
    tmp297 = libdevice.pow(tmp296, tmp21)
    tmp298 = tmp294 + tmp297
    tmp299 = tmp10 - tmp287
    tmp300 = triton_helpers.maximum(tmp299, tmp19)
    tmp301 = libdevice.pow(tmp300, tmp21)
    tmp302 = tmp298 + tmp301
    tmp303 = tmp302 - tmp12
    tmp304 = tmp303 * tmp51
    tmp305 = tmp304 >= tmp19
    tmp306 = tl.where(tmp305, tmp287, tmp285)
    tmp307 = tmp286 * tmp1
    tmp308 = tmp307 * tmp1
    tmp309 = tmp306 + tmp307
    tmp310 = tmp2 - tmp309
    tmp311 = triton_helpers.maximum(tmp310, tmp19)
    tmp312 = libdevice.pow(tmp311, tmp21)
    tmp313 = tmp4 - tmp309
    tmp314 = triton_helpers.maximum(tmp313, tmp19)
    tmp315 = libdevice.pow(tmp314, tmp21)
    tmp316 = tmp312 + tmp315
    tmp317 = tmp7 - tmp309
    tmp318 = triton_helpers.maximum(tmp317, tmp19)
    tmp319 = libdevice.pow(tmp318, tmp21)
    tmp320 = tmp316 + tmp319
    tmp321 = tmp10 - tmp309
    tmp322 = triton_helpers.maximum(tmp321, tmp19)
    tmp323 = libdevice.pow(tmp322, tmp21)
    tmp324 = tmp320 + tmp323
    tmp325 = tmp324 - tmp12
    tmp326 = tmp325 * tmp51
    tmp327 = tmp326 >= tmp19
    tmp328 = tl.where(tmp327, tmp309, tmp306)
    tmp329 = tmp328 + tmp308
    tmp330 = tmp2 - tmp329
    tmp331 = triton_helpers.maximum(tmp330, tmp19)
    tmp332 = libdevice.pow(tmp331, tmp21)
    tmp333 = tmp4 - tmp329
    tmp334 = triton_helpers.maximum(tmp333, tmp19)
    tmp335 = libdevice.pow(tmp334, tmp21)
    tmp336 = tmp332 + tmp335
    tmp337 = tmp7 - tmp329
    tmp338 = triton_helpers.maximum(tmp337, tmp19)
    tmp339 = libdevice.pow(tmp338, tmp21)
    tmp340 = tmp336 + tmp339
    tmp341 = tmp10 - tmp329
    tmp342 = triton_helpers.maximum(tmp341, tmp19)
    tmp343 = libdevice.pow(tmp342, tmp21)
    tmp344 = tmp340 + tmp343
    tmp345 = tmp344 - tmp12
    tmp346 = tmp345 * tmp51
    tmp347 = tmp346 >= tmp19
    tmp348 = tl.where(tmp347, tmp329, tmp328)
    tmp349 = tmp308 * tmp1
    tmp350 = tmp348 + tmp349
    tmp351 = tmp2 - tmp350
    tmp352 = triton_helpers.maximum(tmp351, tmp19)
    tmp353 = libdevice.pow(tmp352, tmp21)
    tmp354 = tmp4 - tmp350
    tmp355 = triton_helpers.maximum(tmp354, tmp19)
    tmp356 = libdevice.pow(tmp355, tmp21)
    tmp357 = tmp353 + tmp356
    tmp358 = tmp7 - tmp350
    tmp359 = triton_helpers.maximum(tmp358, tmp19)
    tmp360 = libdevice.pow(tmp359, tmp21)
    tmp361 = tmp357 + tmp360
    tmp362 = tmp10 - tmp350
    tmp363 = triton_helpers.maximum(tmp362, tmp19)
    tmp364 = libdevice.pow(tmp363, tmp21)
    tmp365 = tmp361 + tmp364
    tmp366 = tmp365 - tmp12
    tmp367 = tmp366 * tmp51
    tmp368 = tmp367 >= tmp19
    tmp369 = tl.where(tmp368, tmp350, tmp348)
    tmp370 = tmp349 * tmp1
    tmp371 = tmp369 + tmp370
    tmp372 = tmp2 - tmp371
    tmp373 = triton_helpers.maximum(tmp372, tmp19)
    tmp374 = libdevice.pow(tmp373, tmp21)
    tmp375 = tmp4 - tmp371
    tmp376 = triton_helpers.maximum(tmp375, tmp19)
    tmp377 = libdevice.pow(tmp376, tmp21)
    tmp378 = tmp374 + tmp377
    tmp379 = tmp7 - tmp371
    tmp380 = triton_helpers.maximum(tmp379, tmp19)
    tmp381 = libdevice.pow(tmp380, tmp21)
    tmp382 = tmp378 + tmp381
    tmp383 = tmp10 - tmp371
    tmp384 = triton_helpers.maximum(tmp383, tmp19)
    tmp385 = libdevice.pow(tmp384, tmp21)
    tmp386 = tmp382 + tmp385
    tmp387 = tmp386 - tmp12
    tmp388 = tmp387 * tmp51
    tmp389 = tmp388 >= tmp19
    tmp390 = tl.where(tmp389, tmp371, tmp369)
    tmp391 = tmp370 * tmp1
    tmp392 = tmp390 + tmp391
    tmp393 = tmp2 - tmp392
    tmp394 = triton_helpers.maximum(tmp393, tmp19)
    tmp395 = libdevice.pow(tmp394, tmp21)
    tmp396 = tmp4 - tmp392
    tmp397 = triton_helpers.maximum(tmp396, tmp19)
    tmp398 = libdevice.pow(tmp397, tmp21)
    tmp399 = tmp395 + tmp398
    tmp400 = tmp7 - tmp392
    tmp401 = triton_helpers.maximum(tmp400, tmp19)
    tmp402 = libdevice.pow(tmp401, tmp21)
    tmp403 = tmp399 + tmp402
    tmp404 = tmp10 - tmp392
    tmp405 = triton_helpers.maximum(tmp404, tmp19)
    tmp406 = libdevice.pow(tmp405, tmp21)
    tmp407 = tmp403 + tmp406
    tmp408 = tmp407 - tmp12
    tmp409 = tmp408 * tmp51
    tmp410 = tmp409 >= tmp19
    tmp411 = tl.where(tmp410, tmp392, tmp390)
    tmp412 = tmp391 * tmp1
    tmp413 = tmp411 + tmp412
    tmp414 = tmp2 - tmp413
    tmp415 = triton_helpers.maximum(tmp414, tmp19)
    tmp416 = libdevice.pow(tmp415, tmp21)
    tmp417 = tmp4 - tmp413
    tmp418 = triton_helpers.maximum(tmp417, tmp19)
    tmp419 = libdevice.pow(tmp418, tmp21)
    tmp420 = tmp416 + tmp419
    tmp421 = tmp7 - tmp413
    tmp422 = triton_helpers.maximum(tmp421, tmp19)
    tmp423 = libdevice.pow(tmp422, tmp21)
    tmp424 = tmp420 + tmp423
    tmp425 = tmp10 - tmp413
    tmp426 = triton_helpers.maximum(tmp425, tmp19)
    tmp427 = libdevice.pow(tmp426, tmp21)
    tmp428 = tmp424 + tmp427
    tmp429 = tmp428 - tmp12
    tmp430 = tmp429 * tmp51
    tmp431 = tmp430 >= tmp19
    tmp432 = tl.where(tmp431, tmp413, tmp411)
    tmp433 = tmp412 * tmp1
    tmp434 = tmp432 + tmp433
    tmp435 = tmp2 - tmp434
    tmp436 = triton_helpers.maximum(tmp435, tmp19)
    tmp437 = libdevice.pow(tmp436, tmp21)
    tmp438 = tmp4 - tmp434
    tmp439 = triton_helpers.maximum(tmp438, tmp19)
    tmp440 = libdevice.pow(tmp439, tmp21)
    tmp441 = tmp437 + tmp440
    tmp442 = tmp7 - tmp434
    tmp443 = triton_helpers.maximum(tmp442, tmp19)
    tmp444 = libdevice.pow(tmp443, tmp21)
    tmp445 = tmp441 + tmp444
    tmp446 = tmp10 - tmp434
    tmp447 = triton_helpers.maximum(tmp446, tmp19)
    tmp448 = libdevice.pow(tmp447, tmp21)
    tmp449 = tmp445 + tmp448
    tmp450 = tmp449 - tmp12
    tmp451 = tmp450 * tmp51
    tmp452 = tmp451 >= tmp19
    tmp453 = tl.where(tmp452, tmp434, tmp432)
    tmp454 = tmp433 * tmp1
    tmp455 = tmp453 + tmp454
    tmp456 = tmp2 - tmp455
    tmp457 = triton_helpers.maximum(tmp456, tmp19)
    tmp458 = libdevice.pow(tmp457, tmp21)
    tmp459 = tmp4 - tmp455
    tmp460 = triton_helpers.maximum(tmp459, tmp19)
    tmp461 = libdevice.pow(tmp460, tmp21)
    tmp462 = tmp458 + tmp461
    tmp463 = tmp7 - tmp455
    tmp464 = triton_helpers.maximum(tmp463, tmp19)
    tmp465 = libdevice.pow(tmp464, tmp21)
    tmp466 = tmp462 + tmp465
    tmp467 = tmp10 - tmp455
    tmp468 = triton_helpers.maximum(tmp467, tmp19)
    tmp469 = libdevice.pow(tmp468, tmp21)
    tmp470 = tmp466 + tmp469
    tmp471 = tmp470 - tmp12
    tmp472 = tmp471 * tmp51
    tmp473 = tmp472 >= tmp19
    tmp474 = tl.where(tmp473, tmp455, tmp453)
    tmp475 = tmp454 * tmp1
    tmp476 = tmp474 + tmp475
    tmp477 = tmp2 - tmp476
    tmp478 = triton_helpers.maximum(tmp477, tmp19)
    tmp479 = libdevice.pow(tmp478, tmp21)
    tmp480 = tmp4 - tmp476
    tmp481 = triton_helpers.maximum(tmp480, tmp19)
    tmp482 = libdevice.pow(tmp481, tmp21)
    tmp483 = tmp479 + tmp482
    tmp484 = tmp7 - tmp476
    tmp485 = triton_helpers.maximum(tmp484, tmp19)
    tmp486 = libdevice.pow(tmp485, tmp21)
    tmp487 = tmp483 + tmp486
    tmp488 = tmp10 - tmp476
    tmp489 = triton_helpers.maximum(tmp488, tmp19)
    tmp490 = libdevice.pow(tmp489, tmp21)
    tmp491 = tmp487 + tmp490
    tmp492 = tmp491 - tmp12
    tmp493 = tmp492 * tmp51
    tmp494 = tmp493 >= tmp19
    tmp495 = tl.where(tmp494, tmp476, tmp474)
    tmp496 = tmp475 * tmp1
    tmp497 = tmp495 + tmp496
    tmp498 = tmp2 - tmp497
    tmp499 = triton_helpers.maximum(tmp498, tmp19)
    tmp500 = libdevice.pow(tmp499, tmp21)
    tmp501 = tmp4 - tmp497
    tmp502 = triton_helpers.maximum(tmp501, tmp19)
    tmp503 = libdevice.pow(tmp502, tmp21)
    tmp504 = tmp500 + tmp503
    tmp505 = tmp7 - tmp497
    tmp506 = triton_helpers.maximum(tmp505, tmp19)
    tmp507 = libdevice.pow(tmp506, tmp21)
    tmp508 = tmp504 + tmp507
    tmp509 = tmp10 - tmp497
    tmp510 = triton_helpers.maximum(tmp509, tmp19)
    tmp511 = libdevice.pow(tmp510, tmp21)
    tmp512 = tmp508 + tmp511
    tmp513 = tmp512 - tmp12
    tmp514 = tmp513 * tmp51
    tmp515 = tmp514 >= tmp19
    tmp516 = tl.where(tmp515, tmp497, tmp495)
    tmp517 = tmp496 * tmp1
    tmp518 = tmp516 + tmp517
    tmp519 = tmp2 - tmp518
    tmp520 = triton_helpers.maximum(tmp519, tmp19)
    tmp521 = libdevice.pow(tmp520, tmp21)
    tmp522 = tmp4 - tmp518
    tmp523 = triton_helpers.maximum(tmp522, tmp19)
    tmp524 = libdevice.pow(tmp523, tmp21)
    tmp525 = tmp521 + tmp524
    tmp526 = tmp7 - tmp518
    tmp527 = triton_helpers.maximum(tmp526, tmp19)
    tmp528 = libdevice.pow(tmp527, tmp21)
    tmp529 = tmp525 + tmp528
    tmp530 = tmp10 - tmp518
    tmp531 = triton_helpers.maximum(tmp530, tmp19)
    tmp532 = libdevice.pow(tmp531, tmp21)
    tmp533 = tmp529 + tmp532
    tmp534 = tmp533 - tmp12
    tmp535 = tmp534 * tmp51
    tmp536 = tmp535 >= tmp19
    tmp537 = tl.where(tmp536, tmp518, tmp516)
    tmp538 = tmp517 * tmp1
    tmp539 = tmp537 + tmp538
    tmp540 = tmp2 - tmp539
    tmp541 = triton_helpers.maximum(tmp540, tmp19)
    tmp542 = libdevice.pow(tmp541, tmp21)
    tmp543 = tmp4 - tmp539
    tmp544 = triton_helpers.maximum(tmp543, tmp19)
    tmp545 = libdevice.pow(tmp544, tmp21)
    tmp546 = tmp542 + tmp545
    tmp547 = tmp7 - tmp539
    tmp548 = triton_helpers.maximum(tmp547, tmp19)
    tmp549 = libdevice.pow(tmp548, tmp21)
    tmp550 = tmp546 + tmp549
    tmp551 = tmp10 - tmp539
    tmp552 = triton_helpers.maximum(tmp551, tmp19)
    tmp553 = libdevice.pow(tmp552, tmp21)
    tmp554 = tmp550 + tmp553
    tmp555 = tmp554 - tmp12
    tmp556 = tmp555 * tmp51
    tmp557 = tmp556 >= tmp19
    tmp558 = tl.where(tmp557, tmp539, tmp537)
    tmp559 = tmp538 * tmp1
    tmp560 = tmp558 + tmp559
    tmp561 = tmp2 - tmp560
    tmp562 = triton_helpers.maximum(tmp561, tmp19)
    tmp563 = libdevice.pow(tmp562, tmp21)
    tmp564 = tmp4 - tmp560
    tmp565 = triton_helpers.maximum(tmp564, tmp19)
    tmp566 = libdevice.pow(tmp565, tmp21)
    tmp567 = tmp563 + tmp566
    tmp568 = tmp7 - tmp560
    tmp569 = triton_helpers.maximum(tmp568, tmp19)
    tmp570 = libdevice.pow(tmp569, tmp21)
    tmp571 = tmp567 + tmp570
    tmp572 = tmp10 - tmp560
    tmp573 = triton_helpers.maximum(tmp572, tmp19)
    tmp574 = libdevice.pow(tmp573, tmp21)
    tmp575 = tmp571 + tmp574
    tl.store(out_ptr0 + x0, tmp49, xmask)
    tl.store(out_ptr19 + x0, tmp308, xmask)
    tl.store(in_out_ptr12 + x0, tmp558, xmask)
    tl.store(out_ptr27 + x0, tmp575, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_where_1(in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp11 + tmp23
    tmp25 = tl.where(tmp10, tmp24, tmp11)
    tmp26 = tmp23 * tmp1
    tmp27 = tmp25 + tmp26
    tmp28 = tmp2 - tmp27
    tmp29 = triton_helpers.maximum(tmp28, tmp9)
    tmp30 = 2.0
    tmp31 = libdevice.pow(tmp29, tmp30)
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x0, xmask)
    tmp14 = tl.load(in_ptr2 + x0, xmask)
    tmp18 = tl.load(in_out_ptr0 + x0, xmask)
    tmp19 = tl.load(in_ptr3 + x0, xmask)
    tmp37 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp51 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp57 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp15 = tmp14 - tmp7
    tmp16 = tmp15 * tmp10
    tmp17 = tmp16 >= tmp12
    tmp20 = 0.5
    tmp21 = tmp19 * tmp20
    tmp22 = tmp21 * tmp20
    tmp23 = tmp22 * tmp20
    tmp24 = tmp23 * tmp20
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 * tmp20
    tmp27 = tmp26 * tmp20
    tmp28 = tmp27 * tmp20
    tmp29 = tmp28 * tmp20
    tmp30 = tmp29 * tmp20
    tmp31 = tmp30 * tmp20
    tmp32 = tmp18 + tmp31
    tmp33 = tl.where(tmp17, tmp32, tmp18)
    tmp34 = tmp31 * tmp20
    tmp35 = tmp33 + tmp34
    tmp36 = tl.where(tmp13, tmp35, tmp33)
    tmp38 = tmp37 * tmp20
    tmp39 = tmp34 * tmp20
    tmp40 = tmp36 + tmp39
    tmp41 = tmp38 - tmp40
    tmp42 = triton_helpers.maximum(tmp41, tmp12)
    tmp43 = 2.0
    tmp44 = libdevice.pow(tmp42, tmp43)
    tmp46 = tmp45 * tmp20
    tmp47 = tmp46 - tmp40
    tmp48 = triton_helpers.maximum(tmp47, tmp12)
    tmp49 = libdevice.pow(tmp48, tmp43)
    tmp50 = tmp44 + tmp49
    tmp52 = tmp51 * tmp20
    tmp53 = tmp52 - tmp40
    tmp54 = triton_helpers.maximum(tmp53, tmp12)
    tmp55 = libdevice.pow(tmp54, tmp43)
    tmp56 = tmp50 + tmp55
    tmp58 = tmp57 * tmp20
    tmp59 = tmp58 - tmp40
    tmp60 = triton_helpers.maximum(tmp59, tmp12)
    tmp61 = libdevice.pow(tmp60, tmp43)
    tmp62 = tmp56 + tmp61
    tl.store(in_out_ptr0 + x0, tmp36, xmask)
    tl.store(out_ptr0 + x0, tmp62, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_where_3(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp11 + tmp25
    tmp27 = tl.where(tmp10, tmp26, tmp11)
    tmp28 = tmp25 * tmp1
    tmp29 = tmp27 + tmp28
    tmp30 = tmp2 - tmp29
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_ptr2 + x0, xmask)
    tmp27 = tl.load(in_out_ptr0 + x0, xmask)
    tmp28 = tl.load(in_ptr3 + x0, xmask)
    tmp48 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp61 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp67 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp24 = tmp23 - tmp17
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 >= tmp1
    tmp29 = 0.5
    tmp30 = tmp28 * tmp29
    tmp31 = tmp30 * tmp29
    tmp32 = tmp31 * tmp29
    tmp33 = tmp32 * tmp29
    tmp34 = tmp33 * tmp29
    tmp35 = tmp34 * tmp29
    tmp36 = tmp35 * tmp29
    tmp37 = tmp36 * tmp29
    tmp38 = tmp37 * tmp29
    tmp39 = tmp38 * tmp29
    tmp40 = tmp39 * tmp29
    tmp41 = tmp40 * tmp29
    tmp42 = tmp41 * tmp29
    tmp43 = tmp27 + tmp42
    tmp44 = tl.where(tmp26, tmp43, tmp27)
    tmp45 = tmp42 * tmp29
    tmp46 = tmp44 + tmp45
    tmp47 = tl.where(tmp22, tmp46, tmp44)
    tmp49 = tmp48 * tmp29
    tmp50 = tmp45 * tmp29
    tmp51 = tmp47 + tmp50
    tmp52 = tmp49 - tmp51
    tmp53 = triton_helpers.maximum(tmp52, tmp1)
    tmp54 = libdevice.pow(tmp53, tmp3)
    tmp56 = tmp55 * tmp29
    tmp57 = tmp56 - tmp51
    tmp58 = triton_helpers.maximum(tmp57, tmp1)
    tmp59 = libdevice.pow(tmp58, tmp3)
    tmp60 = tmp54 + tmp59
    tmp62 = tmp61 * tmp29
    tmp63 = tmp62 - tmp51
    tmp64 = triton_helpers.maximum(tmp63, tmp1)
    tmp65 = libdevice.pow(tmp64, tmp3)
    tmp66 = tmp60 + tmp65
    tmp68 = tmp67 * tmp29
    tmp69 = tmp68 - tmp51
    tmp70 = triton_helpers.maximum(tmp69, tmp1)
    tmp71 = libdevice.pow(tmp70, tmp3)
    tmp72 = tmp66 + tmp71
    tl.store(in_out_ptr0 + x0, tmp47, xmask)
    tl.store(out_ptr0 + x0, tmp72, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_where_5(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp11 + tmp27
    tmp29 = tl.where(tmp10, tmp28, tmp11)
    tmp30 = tmp27 * tmp1
    tmp31 = tmp29 + tmp30
    tmp32 = tmp2 - tmp31
    tl.store(out_ptr0 + x2, tmp32, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6(in_out_ptr0,
    in_out_ptr2, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_ptr2 + x0, xmask)
    tmp27 = tl.load(in_out_ptr0 + x0, xmask)
    tmp28 = tl.load(in_ptr3 + x0, xmask)
    tmp50 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp63 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp69 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp24 = tmp23 - tmp17
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 >= tmp1
    tmp29 = 0.5
    tmp30 = tmp28 * tmp29
    tmp31 = tmp30 * tmp29
    tmp32 = tmp31 * tmp29
    tmp33 = tmp32 * tmp29
    tmp34 = tmp33 * tmp29
    tmp35 = tmp34 * tmp29
    tmp36 = tmp35 * tmp29
    tmp37 = tmp36 * tmp29
    tmp38 = tmp37 * tmp29
    tmp39 = tmp38 * tmp29
    tmp40 = tmp39 * tmp29
    tmp41 = tmp40 * tmp29
    tmp42 = tmp41 * tmp29
    tmp43 = tmp42 * tmp29
    tmp44 = tmp43 * tmp29
    tmp45 = tmp27 + tmp44
    tmp46 = tl.where(tmp26, tmp45, tmp27)
    tmp47 = tmp44 * tmp29
    tmp48 = tmp46 + tmp47
    tmp49 = tl.where(tmp22, tmp48, tmp46)
    tmp51 = tmp50 * tmp29
    tmp52 = tmp47 * tmp29
    tmp53 = tmp49 + tmp52
    tmp54 = tmp51 - tmp53
    tmp55 = triton_helpers.maximum(tmp54, tmp1)
    tmp56 = libdevice.pow(tmp55, tmp3)
    tmp58 = tmp57 * tmp29
    tmp59 = tmp58 - tmp53
    tmp60 = triton_helpers.maximum(tmp59, tmp1)
    tmp61 = libdevice.pow(tmp60, tmp3)
    tmp62 = tmp56 + tmp61
    tmp64 = tmp63 * tmp29
    tmp65 = tmp64 - tmp53
    tmp66 = triton_helpers.maximum(tmp65, tmp1)
    tmp67 = libdevice.pow(tmp66, tmp3)
    tmp68 = tmp62 + tmp67
    tmp70 = tmp69 * tmp29
    tmp71 = tmp70 - tmp53
    tmp72 = triton_helpers.maximum(tmp71, tmp1)
    tmp73 = libdevice.pow(tmp72, tmp3)
    tmp74 = tmp68 + tmp73
    tmp75 = tmp74 - tmp17
    tmp76 = tmp75 * tmp20
    tmp77 = tmp76 >= tmp1
    tmp78 = tl.where(tmp77, tmp53, tmp49)
    tmp79 = tmp52 * tmp29
    tmp80 = tmp78 + tmp79
    tmp81 = tmp51 - tmp80
    tmp82 = triton_helpers.maximum(tmp81, tmp1)
    tmp83 = libdevice.pow(tmp82, tmp3)
    tmp84 = tmp58 - tmp80
    tmp85 = triton_helpers.maximum(tmp84, tmp1)
    tmp86 = libdevice.pow(tmp85, tmp3)
    tmp87 = tmp83 + tmp86
    tmp88 = tmp64 - tmp80
    tmp89 = triton_helpers.maximum(tmp88, tmp1)
    tmp90 = libdevice.pow(tmp89, tmp3)
    tmp91 = tmp87 + tmp90
    tmp92 = tmp70 - tmp80
    tmp93 = triton_helpers.maximum(tmp92, tmp1)
    tmp94 = libdevice.pow(tmp93, tmp3)
    tmp95 = tmp91 + tmp94
    tmp96 = tmp95 - tmp17
    tmp97 = tmp96 * tmp20
    tmp98 = tmp97 >= tmp1
    tmp99 = tl.where(tmp98, tmp80, tmp78)
    tmp100 = tmp79 * tmp29
    tmp101 = tmp99 + tmp100
    tmp102 = tmp51 - tmp101
    tmp103 = triton_helpers.maximum(tmp102, tmp1)
    tmp104 = libdevice.pow(tmp103, tmp3)
    tmp105 = tmp58 - tmp101
    tmp106 = triton_helpers.maximum(tmp105, tmp1)
    tmp107 = libdevice.pow(tmp106, tmp3)
    tmp108 = tmp104 + tmp107
    tmp109 = tmp64 - tmp101
    tmp110 = triton_helpers.maximum(tmp109, tmp1)
    tmp111 = libdevice.pow(tmp110, tmp3)
    tmp112 = tmp108 + tmp111
    tmp113 = tmp70 - tmp101
    tmp114 = triton_helpers.maximum(tmp113, tmp1)
    tmp115 = libdevice.pow(tmp114, tmp3)
    tmp116 = tmp112 + tmp115
    tmp117 = tmp116 - tmp17
    tmp118 = tmp117 * tmp20
    tmp119 = tmp118 >= tmp1
    tmp120 = tl.where(tmp119, tmp101, tmp99)
    tl.store(in_out_ptr2 + x0, tmp120, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_7(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp3 + tmp24
    tmp26 = tmp2 - tmp25
    tmp27 = 0.0
    tmp28 = triton_helpers.maximum(tmp26, tmp27)
    tmp29 = 2.0
    tmp30 = libdevice.pow(tmp28, tmp29)
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_div_where_8(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x0, xmask)
    tmp14 = tl.load(in_out_ptr0 + x0, xmask)
    tmp15 = tl.load(in_ptr2 + x0, xmask)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp16 = 0.5
    tmp17 = tmp15 * tmp16
    tmp18 = tmp17 * tmp16
    tmp19 = tmp18 * tmp16
    tmp20 = tmp19 * tmp16
    tmp21 = tmp20 * tmp16
    tmp22 = tmp21 * tmp16
    tmp23 = tmp22 * tmp16
    tmp24 = tmp23 * tmp16
    tmp25 = tmp24 * tmp16
    tmp26 = tmp25 * tmp16
    tmp27 = tmp26 * tmp16
    tmp28 = tmp27 * tmp16
    tmp29 = tmp28 * tmp16
    tmp30 = tmp29 * tmp16
    tmp31 = tmp30 * tmp16
    tmp32 = tmp31 * tmp16
    tmp33 = tmp32 * tmp16
    tmp34 = tmp33 * tmp16
    tmp35 = tmp34 * tmp16
    tmp36 = tmp35 * tmp16
    tmp37 = tmp14 + tmp36
    tmp38 = tl.where(tmp13, tmp37, tmp14)
    tl.store(in_out_ptr0 + x0, tmp38, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_9(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp3 + tmp25
    tmp27 = tmp2 - tmp26
    tmp28 = 0.0
    tmp29 = triton_helpers.maximum(tmp27, tmp28)
    tmp30 = 2.0
    tmp31 = libdevice.pow(tmp29, tmp30)
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_div_where_10(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x0, xmask)
    tmp14 = tl.load(in_out_ptr0 + x0, xmask)
    tmp15 = tl.load(in_ptr2 + x0, xmask)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp16 = 0.5
    tmp17 = tmp15 * tmp16
    tmp18 = tmp17 * tmp16
    tmp19 = tmp18 * tmp16
    tmp20 = tmp19 * tmp16
    tmp21 = tmp20 * tmp16
    tmp22 = tmp21 * tmp16
    tmp23 = tmp22 * tmp16
    tmp24 = tmp23 * tmp16
    tmp25 = tmp24 * tmp16
    tmp26 = tmp25 * tmp16
    tmp27 = tmp26 * tmp16
    tmp28 = tmp27 * tmp16
    tmp29 = tmp28 * tmp16
    tmp30 = tmp29 * tmp16
    tmp31 = tmp30 * tmp16
    tmp32 = tmp31 * tmp16
    tmp33 = tmp32 * tmp16
    tmp34 = tmp33 * tmp16
    tmp35 = tmp34 * tmp16
    tmp36 = tmp35 * tmp16
    tmp37 = tmp36 * tmp16
    tmp38 = tmp14 + tmp37
    tmp39 = tl.where(tmp13, tmp38, tmp14)
    tl.store(in_out_ptr0 + x0, tmp39, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_sub_11(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp3 + tmp26
    tmp28 = tmp2 - tmp27
    tmp29 = 0.0
    tmp30 = triton_helpers.maximum(tmp28, tmp29)
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_div_where_12(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + x0, xmask)
    tmp19 = tl.load(in_out_ptr0 + x0, xmask)
    tmp20 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp21 = 0.5
    tmp22 = tmp20 * tmp21
    tmp23 = tmp22 * tmp21
    tmp24 = tmp23 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp25 * tmp21
    tmp27 = tmp26 * tmp21
    tmp28 = tmp27 * tmp21
    tmp29 = tmp28 * tmp21
    tmp30 = tmp29 * tmp21
    tmp31 = tmp30 * tmp21
    tmp32 = tmp31 * tmp21
    tmp33 = tmp32 * tmp21
    tmp34 = tmp33 * tmp21
    tmp35 = tmp34 * tmp21
    tmp36 = tmp35 * tmp21
    tmp37 = tmp36 * tmp21
    tmp38 = tmp37 * tmp21
    tmp39 = tmp38 * tmp21
    tmp40 = tmp39 * tmp21
    tmp41 = tmp40 * tmp21
    tmp42 = tmp41 * tmp21
    tmp43 = tmp42 * tmp21
    tmp44 = tmp19 + tmp43
    tmp45 = tl.where(tmp18, tmp44, tmp19)
    tl.store(in_out_ptr0 + x0, tmp45, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_sub_13(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp3 + tmp27
    tmp29 = tmp2 - tmp28
    tmp30 = 0.0
    tmp31 = triton_helpers.maximum(tmp29, tmp30)
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_div_where_14(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + x0, xmask)
    tmp19 = tl.load(in_out_ptr0 + x0, xmask)
    tmp20 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp21 = 0.5
    tmp22 = tmp20 * tmp21
    tmp23 = tmp22 * tmp21
    tmp24 = tmp23 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp25 * tmp21
    tmp27 = tmp26 * tmp21
    tmp28 = tmp27 * tmp21
    tmp29 = tmp28 * tmp21
    tmp30 = tmp29 * tmp21
    tmp31 = tmp30 * tmp21
    tmp32 = tmp31 * tmp21
    tmp33 = tmp32 * tmp21
    tmp34 = tmp33 * tmp21
    tmp35 = tmp34 * tmp21
    tmp36 = tmp35 * tmp21
    tmp37 = tmp36 * tmp21
    tmp38 = tmp37 * tmp21
    tmp39 = tmp38 * tmp21
    tmp40 = tmp39 * tmp21
    tmp41 = tmp40 * tmp21
    tmp42 = tmp41 * tmp21
    tmp43 = tmp42 * tmp21
    tmp44 = tmp43 * tmp21
    tmp45 = tmp19 + tmp44
    tmp46 = tl.where(tmp18, tmp45, tmp19)
    tl.store(in_out_ptr0 + x0, tmp46, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_15(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp3 + tmp28
    tmp30 = tmp2 - tmp29
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_div_where_16(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp23 + tmp49
    tmp51 = tl.where(tmp22, tmp50, tmp23)
    tl.store(in_out_ptr0 + x0, tmp51, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_17(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp28 * tmp1
    tmp30 = tmp3 + tmp29
    tmp31 = tmp2 - tmp30
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_div_where_18(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp49 * tmp25
    tmp51 = tmp23 + tmp50
    tmp52 = tl.where(tmp22, tmp51, tmp23)
    tl.store(in_out_ptr0 + x0, tmp52, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_19(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp28 * tmp1
    tmp30 = tmp29 * tmp1
    tmp31 = tmp3 + tmp30
    tmp32 = tmp2 - tmp31
    tl.store(out_ptr0 + x2, tmp32, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20(in_out_ptr0,
    in_out_ptr4, in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr7, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr2 + x0, xmask)
    tmp56 = tl.load(in_ptr3 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp61 = tl.load(in_ptr3 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp67 = tl.load(in_ptr3 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp73 = tl.load(in_ptr3 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp49 * tmp25
    tmp51 = tmp50 * tmp25
    tmp52 = tmp23 + tmp51
    tmp53 = tl.where(tmp22, tmp52, tmp23)
    tmp54 = tmp51 * tmp25
    tmp55 = tmp53 + tmp54
    tmp57 = tmp56 * tmp25
    tmp58 = tmp57 - tmp55
    tmp59 = triton_helpers.maximum(tmp58, tmp1)
    tmp60 = libdevice.pow(tmp59, tmp3)
    tmp62 = tmp61 * tmp25
    tmp63 = tmp62 - tmp55
    tmp64 = triton_helpers.maximum(tmp63, tmp1)
    tmp65 = libdevice.pow(tmp64, tmp3)
    tmp66 = tmp60 + tmp65
    tmp68 = tmp67 * tmp25
    tmp69 = tmp68 - tmp55
    tmp70 = triton_helpers.maximum(tmp69, tmp1)
    tmp71 = libdevice.pow(tmp70, tmp3)
    tmp72 = tmp66 + tmp71
    tmp74 = tmp73 * tmp25
    tmp75 = tmp74 - tmp55
    tmp76 = triton_helpers.maximum(tmp75, tmp1)
    tmp77 = libdevice.pow(tmp76, tmp3)
    tmp78 = tmp72 + tmp77
    tmp79 = tmp78 - tmp17
    tmp80 = tmp79 * tmp20
    tmp81 = tmp80 >= tmp1
    tmp82 = tl.where(tmp81, tmp55, tmp53)
    tmp83 = tmp54 * tmp25
    tmp84 = tmp82 + tmp83
    tmp85 = tmp57 - tmp84
    tmp86 = triton_helpers.maximum(tmp85, tmp1)
    tmp87 = libdevice.pow(tmp86, tmp3)
    tmp88 = tmp62 - tmp84
    tmp89 = triton_helpers.maximum(tmp88, tmp1)
    tmp90 = libdevice.pow(tmp89, tmp3)
    tmp91 = tmp87 + tmp90
    tmp92 = tmp68 - tmp84
    tmp93 = triton_helpers.maximum(tmp92, tmp1)
    tmp94 = libdevice.pow(tmp93, tmp3)
    tmp95 = tmp91 + tmp94
    tmp96 = tmp74 - tmp84
    tmp97 = triton_helpers.maximum(tmp96, tmp1)
    tmp98 = libdevice.pow(tmp97, tmp3)
    tmp99 = tmp95 + tmp98
    tmp100 = tmp99 - tmp17
    tmp101 = tmp100 * tmp20
    tmp102 = tmp101 >= tmp1
    tmp103 = tl.where(tmp102, tmp84, tmp82)
    tmp104 = tmp83 * tmp25
    tmp105 = tmp103 + tmp104
    tmp106 = tmp57 - tmp105
    tmp107 = triton_helpers.maximum(tmp106, tmp1)
    tmp108 = libdevice.pow(tmp107, tmp3)
    tmp109 = tmp62 - tmp105
    tmp110 = triton_helpers.maximum(tmp109, tmp1)
    tmp111 = libdevice.pow(tmp110, tmp3)
    tmp112 = tmp108 + tmp111
    tmp113 = tmp68 - tmp105
    tmp114 = triton_helpers.maximum(tmp113, tmp1)
    tmp115 = libdevice.pow(tmp114, tmp3)
    tmp116 = tmp112 + tmp115
    tmp117 = tmp74 - tmp105
    tmp118 = triton_helpers.maximum(tmp117, tmp1)
    tmp119 = libdevice.pow(tmp118, tmp3)
    tmp120 = tmp116 + tmp119
    tmp121 = tmp120 - tmp17
    tmp122 = tmp121 * tmp20
    tmp123 = tmp122 >= tmp1
    tmp124 = tl.where(tmp123, tmp105, tmp103)
    tmp125 = tmp104 * tmp25
    tmp126 = tmp124 + tmp125
    tmp127 = tmp57 - tmp126
    tmp128 = triton_helpers.maximum(tmp127, tmp1)
    tmp129 = libdevice.pow(tmp128, tmp3)
    tmp130 = tmp62 - tmp126
    tmp131 = triton_helpers.maximum(tmp130, tmp1)
    tmp132 = libdevice.pow(tmp131, tmp3)
    tmp133 = tmp129 + tmp132
    tmp134 = tmp68 - tmp126
    tmp135 = triton_helpers.maximum(tmp134, tmp1)
    tmp136 = libdevice.pow(tmp135, tmp3)
    tmp137 = tmp133 + tmp136
    tmp138 = tmp74 - tmp126
    tmp139 = triton_helpers.maximum(tmp138, tmp1)
    tmp140 = libdevice.pow(tmp139, tmp3)
    tmp141 = tmp137 + tmp140
    tmp142 = tmp141 - tmp17
    tmp143 = tmp142 * tmp20
    tmp144 = tmp143 >= tmp1
    tmp145 = tl.where(tmp144, tmp126, tmp124)
    tmp146 = tmp125 * tmp25
    tmp147 = tmp145 + tmp146
    tmp148 = tmp57 - tmp147
    tmp149 = triton_helpers.maximum(tmp148, tmp1)
    tmp150 = libdevice.pow(tmp149, tmp3)
    tmp151 = tmp62 - tmp147
    tmp152 = triton_helpers.maximum(tmp151, tmp1)
    tmp153 = libdevice.pow(tmp152, tmp3)
    tmp154 = tmp150 + tmp153
    tmp155 = tmp68 - tmp147
    tmp156 = triton_helpers.maximum(tmp155, tmp1)
    tmp157 = libdevice.pow(tmp156, tmp3)
    tmp158 = tmp154 + tmp157
    tmp159 = tmp74 - tmp147
    tmp160 = triton_helpers.maximum(tmp159, tmp1)
    tmp161 = libdevice.pow(tmp160, tmp3)
    tmp162 = tmp158 + tmp161
    tmp163 = tmp162 - tmp17
    tmp164 = tmp163 * tmp20
    tmp165 = tmp164 >= tmp1
    tmp166 = tl.where(tmp165, tmp147, tmp145)
    tmp167 = tmp146 * tmp25
    tmp168 = tmp166 + tmp167
    tmp169 = tmp57 - tmp168
    tmp170 = triton_helpers.maximum(tmp169, tmp1)
    tmp171 = libdevice.pow(tmp170, tmp3)
    tmp172 = tmp62 - tmp168
    tmp173 = triton_helpers.maximum(tmp172, tmp1)
    tmp174 = libdevice.pow(tmp173, tmp3)
    tmp175 = tmp171 + tmp174
    tmp176 = tmp68 - tmp168
    tmp177 = triton_helpers.maximum(tmp176, tmp1)
    tmp178 = libdevice.pow(tmp177, tmp3)
    tmp179 = tmp175 + tmp178
    tmp180 = tmp74 - tmp168
    tmp181 = triton_helpers.maximum(tmp180, tmp1)
    tmp182 = libdevice.pow(tmp181, tmp3)
    tmp183 = tmp179 + tmp182
    tmp184 = tmp183 - tmp17
    tmp185 = tmp184 * tmp20
    tmp186 = tmp185 >= tmp1
    tmp187 = tl.where(tmp186, tmp168, tmp166)
    tmp188 = tmp167 * tmp25
    tmp189 = tmp187 + tmp188
    tmp190 = tmp57 - tmp189
    tmp191 = triton_helpers.maximum(tmp190, tmp1)
    tmp192 = libdevice.pow(tmp191, tmp3)
    tmp193 = tmp62 - tmp189
    tmp194 = triton_helpers.maximum(tmp193, tmp1)
    tmp195 = libdevice.pow(tmp194, tmp3)
    tmp196 = tmp192 + tmp195
    tmp197 = tmp68 - tmp189
    tmp198 = triton_helpers.maximum(tmp197, tmp1)
    tmp199 = libdevice.pow(tmp198, tmp3)
    tmp200 = tmp196 + tmp199
    tmp201 = tmp74 - tmp189
    tmp202 = triton_helpers.maximum(tmp201, tmp1)
    tmp203 = libdevice.pow(tmp202, tmp3)
    tmp204 = tmp200 + tmp203
    tmp205 = tmp204 - tmp17
    tmp206 = tmp205 * tmp20
    tmp207 = tmp206 >= tmp1
    tmp208 = tl.where(tmp207, tmp189, tmp187)
    tmp209 = tmp188 * tmp25
    tmp210 = tmp208 + tmp209
    tmp211 = tmp57 - tmp210
    tmp212 = triton_helpers.maximum(tmp211, tmp1)
    tmp213 = libdevice.pow(tmp212, tmp3)
    tmp214 = tmp62 - tmp210
    tmp215 = triton_helpers.maximum(tmp214, tmp1)
    tmp216 = libdevice.pow(tmp215, tmp3)
    tmp217 = tmp213 + tmp216
    tmp218 = tmp68 - tmp210
    tmp219 = triton_helpers.maximum(tmp218, tmp1)
    tmp220 = libdevice.pow(tmp219, tmp3)
    tmp221 = tmp217 + tmp220
    tmp222 = tmp74 - tmp210
    tmp223 = triton_helpers.maximum(tmp222, tmp1)
    tmp224 = libdevice.pow(tmp223, tmp3)
    tmp225 = tmp221 + tmp224
    tmp226 = tmp225 - tmp17
    tmp227 = tmp226 * tmp20
    tmp228 = tmp227 >= tmp1
    tmp229 = tl.where(tmp228, tmp210, tmp208)
    tmp230 = tmp209 * tmp25
    tmp231 = tmp229 + tmp230
    tmp232 = tmp57 - tmp231
    tmp233 = triton_helpers.maximum(tmp232, tmp1)
    tmp234 = libdevice.pow(tmp233, tmp3)
    tmp235 = tmp62 - tmp231
    tmp236 = triton_helpers.maximum(tmp235, tmp1)
    tmp237 = libdevice.pow(tmp236, tmp3)
    tmp238 = tmp234 + tmp237
    tmp239 = tmp68 - tmp231
    tmp240 = triton_helpers.maximum(tmp239, tmp1)
    tmp241 = libdevice.pow(tmp240, tmp3)
    tmp242 = tmp238 + tmp241
    tmp243 = tmp74 - tmp231
    tmp244 = triton_helpers.maximum(tmp243, tmp1)
    tmp245 = libdevice.pow(tmp244, tmp3)
    tmp246 = tmp242 + tmp245
    tl.store(in_out_ptr4 + x0, tmp231, xmask)
    tl.store(out_ptr7 + x0, tmp246, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_where_21(in_ptr0, in_ptr1,
    in_ptr2, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    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)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = tmp2 - tmp3
    tmp5 = 0.0
    tmp6 = triton_helpers.maximum(tmp4, tmp5)
    tmp7 = 2.0
    tmp8 = libdevice.pow(tmp6, tmp7)
    tmp10 = tmp8 / tmp9
    tl.store(out_ptr0 + x2, tmp10, xmask)


def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf35 = empty_strided_cuda((4, 4, 4, 1), (16, 4, 1, 64), torch.float32)
        buf51 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf52 = reinterpret_tensor(buf51, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf51
        buf53 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0[grid(64)](
            buf52, arg0_1, buf1, buf35, buf53, 64, XBLOCK=64, num_warps=1,
            num_stages=1)
        buf54 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_1[grid(256)](arg0_1,
            buf53, buf1, buf52, buf35, buf54, 256, XBLOCK=128, num_warps=4,
            num_stages=1)
        buf55 = buf52
        del buf52
        buf56 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2[grid(64)](buf55,
            buf54, buf1, buf53, buf35, arg0_1, buf56, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf57 = buf54
        del buf54
        triton_poi_fused_add_div_mul_sub_where_3[grid(256)](arg0_1, buf56,
            buf1, buf55, buf35, buf57, 256, XBLOCK=256, num_warps=4,
            num_stages=1)
        buf58 = buf55
        del buf55
        buf59 = buf53
        del buf53
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4[grid(64)](buf58,
            buf57, buf1, buf56, buf35, arg0_1, buf59, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf60 = buf57
        del buf57
        triton_poi_fused_add_div_mul_sub_where_5[grid(256)](arg0_1, buf59,
            buf1, buf58, buf35, buf60, 256, XBLOCK=128, num_warps=4,
            num_stages=1)
        buf61 = buf58
        del buf58
        buf66 = buf56
        del buf56
        buf67 = reinterpret_tensor(buf66, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf66
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6[grid(64)](buf61,
            buf67, buf60, buf1, buf59, buf35, arg0_1, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf68 = buf60
        del buf60
        triton_poi_fused_add_clamp_div_mul_pow_sub_7[grid(256)](arg0_1,
            buf67, buf35, buf68, 256, XBLOCK=128, num_warps=4, num_stages=1)
        buf69 = buf67
        del buf67
        triton_poi_fused_add_div_where_8[grid(64)](buf69, buf68, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf70 = buf68
        del buf68
        triton_poi_fused_add_clamp_div_mul_pow_sub_9[grid(256)](arg0_1,
            buf69, buf35, buf70, 256, XBLOCK=128, num_warps=4, num_stages=1)
        buf71 = buf69
        del buf69
        triton_poi_fused_add_div_where_10[grid(64)](buf71, buf70, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf72 = buf70
        del buf70
        triton_poi_fused_add_clamp_div_mul_sub_11[grid(256)](arg0_1, buf71,
            buf35, buf72, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf73 = buf71
        del buf71
        triton_poi_fused_add_div_where_12[grid(64)](buf73, buf72, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf74 = buf72
        del buf72
        triton_poi_fused_add_clamp_div_mul_sub_13[grid(256)](arg0_1, buf73,
            buf35, buf74, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf75 = buf73
        del buf73
        triton_poi_fused_add_div_where_14[grid(64)](buf75, buf74, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf76 = buf74
        del buf74
        triton_poi_fused_add_div_mul_sub_15[grid(256)](arg0_1, buf75, buf35,
            buf76, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf77 = buf75
        del buf75
        triton_poi_fused_add_div_where_16[grid(64)](buf77, buf76, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf78 = buf76
        del buf76
        triton_poi_fused_add_div_mul_sub_17[grid(256)](arg0_1, buf77, buf35,
            buf78, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf79 = buf77
        del buf77
        triton_poi_fused_add_div_where_18[grid(64)](buf79, buf78, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf80 = buf78
        del buf78
        triton_poi_fused_add_div_mul_sub_19[grid(256)](arg0_1, buf79, buf35,
            buf80, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf81 = buf79
        del buf79
        buf95 = reinterpret_tensor(buf61, (4, 4, 4), (16, 4, 1), 0)
        del buf61
        buf96 = reinterpret_tensor(buf95, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf95
        buf97 = buf59
        del buf59
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20[grid(64)](buf81
            , buf96, buf80, buf1, buf35, arg0_1, buf97, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        del buf1
        del buf35
        del buf81
        buf98 = buf80
        del buf80
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_21[grid(256)](arg0_1,
            buf96, buf97, buf98, 256, XBLOCK=128, num_warps=4, num_stages=1)
        del arg0_1
        del buf96
        del buf97
    return buf98,


def entmax_bisect(X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True):
    """alpha-entmax: normalizing sparse transform (a la softmax).

    Solves the optimization problem:

        max_p <x, p> - H_a(p)    s.t.    p >= 0, sum(p) == 1.

    where H_a(p) is the Tsallis alpha-entropy with custom alpha >= 1,
    using a bisection (root finding, binary search) algorithm.

    This function is differentiable with respect to both X and alpha.

    Parameters
    ----------
    X : torch.Tensor
        The input tensor.

    alpha : float or torch.Tensor
        Tensor of alpha parameters (> 1) to use. If scalar
        or python float, the same value is used for all rows, otherwise,
        it must have shape (or be expandable to)
        alpha.shape[j] == (X.shape[j] if j != dim else 1)
        A value of alpha=2 corresponds to sparsemax, and alpha=1 corresponds to
        softmax (but computing it this way is likely unstable).

    dim : int
        The dimension along which to apply alpha-entmax.

    n_iter : int
        Number of bisection iterations. For float32, 24 iterations should
        suffice for machine precision.

    ensure_sum_one : bool,
        Whether to divide the result by its sum. If false, the result might
        sum to close but not exactly 1, which might cause downstream problems.

    Returns
    -------
    P : torch tensor, same shape as X
        The projection result, such that P.sum(dim=dim) == 1 elementwise.
    """
    return EntmaxBisectFunction.apply(X, alpha, dim, n_iter, ensure_sum_one)


class EntmaxBisectFunction(Function):

    @classmethod
    def _gp(cls, x, alpha):
        return x ** (alpha - 1)

    @classmethod
    def _gp_inv(cls, y, alpha):
        return y ** (1 / (alpha - 1))

    @classmethod
    def _p(cls, X, alpha):
        return cls._gp_inv(torch.clamp(X, min=0), alpha)

    @classmethod
    def forward(cls, ctx, X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True
        ):
        if not isinstance(alpha, torch.Tensor):
            alpha = torch.tensor(alpha, dtype=X.dtype, device=X.device)
        alpha_shape = list(X.shape)
        alpha_shape[dim] = 1
        alpha = alpha.expand(*alpha_shape)
        ctx.alpha = alpha
        ctx.dim = dim
        d = X.shape[dim]
        X = X * (alpha - 1)
        max_val, _ = X.max(dim=dim, keepdim=True)
        tau_lo = max_val - cls._gp(1, alpha)
        tau_hi = max_val - cls._gp(1 / d, alpha)
        f_lo = cls._p(X - tau_lo, alpha).sum(dim) - 1
        dm = tau_hi - tau_lo
        for it in range(n_iter):
            dm /= 2
            tau_m = tau_lo + dm
            p_m = cls._p(X - tau_m, alpha)
            f_m = p_m.sum(dim) - 1
            mask = (f_m * f_lo >= 0).unsqueeze(dim)
            tau_lo = torch.where(mask, tau_m, tau_lo)
        if ensure_sum_one:
            p_m /= p_m.sum(dim=dim).unsqueeze(dim=dim)
        ctx.save_for_backward(p_m)
        return p_m

    @classmethod
    def backward(cls, ctx, dY):
        Y, = ctx.saved_tensors
        gppr = torch.where(Y > 0, Y ** (2 - ctx.alpha), Y.new_zeros(1))
        dX = dY * gppr
        q = dX.sum(ctx.dim) / gppr.sum(ctx.dim)
        q = q.unsqueeze(ctx.dim)
        dX -= q * gppr
        d_alpha = None
        if ctx.needs_input_grad[1]:
            S = torch.where(Y > 0, Y * torch.log(Y), Y.new_zeros(1))
            ent = S.sum(ctx.dim).unsqueeze(ctx.dim)
            Y_skewed = gppr / gppr.sum(ctx.dim).unsqueeze(ctx.dim)
            d_alpha = dY * (Y - Y_skewed) / (ctx.alpha - 1) ** 2
            d_alpha -= dY * (S - Y_skewed * ent) / (ctx.alpha - 1)
            d_alpha = d_alpha.sum(ctx.dim).unsqueeze(ctx.dim)
        return dX, d_alpha, None, None, None


class EntmaxBisectNew(nn.Module):

    def __init__(self, alpha=1.5, dim=-1, n_iter=50):
        """alpha-entmax: normalizing sparse map (a la softmax) via bisection.

        Solves the optimization problem:

            max_p <x, p> - H_a(p)    s.t.    p >= 0, sum(p) == 1.

        where H_a(p) is the Tsallis alpha-entropy with custom alpha >= 1,
        using a bisection (root finding, binary search) algorithm.

        Parameters
        ----------
        alpha : float or torch.Tensor
            Tensor of alpha parameters (> 1) to use. If scalar
            or python float, the same value is used for all rows, otherwise,
            it must have shape (or be expandable to)
            alpha.shape[j] == (X.shape[j] if j != dim else 1)
            A value of alpha=2 corresponds to sparsemax; alpha=1 corresponds
            to softmax (but computing it this way is likely unstable).

        dim : int
            The dimension along which to apply alpha-entmax.

        n_iter : int
            Number of bisection iterations. For float32, 24 iterations should
            suffice for machine precision.

        """
        self.dim = dim
        self.n_iter = n_iter
        self.alpha = alpha
        super().__init__()

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