# 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_6/inductor_cache/w4/cw47hqyegjtpbj76g3m6wdm5y3basxa4forj3ogmivmltvv2n6l5.py
# Topologically Sorted Source Nodes: [heatmap_pred_1, mul_1, sub, pow_1, sum_1], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   heatmap_pred_1 => mul
#   mul_1 => mul_1
#   pow_1 => pow_1
#   sub => sub
#   sum_1 => sum_1
# Graph fragment:
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze, %select), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_1, %select_1), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul, %mul_1), kwargs = {})
#   %pow_1 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sub, 2), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_1, [1]), kwargs = {})
triton_poi_fused_mul_pow_sub_sum_0 = async_compile.triton('triton_poi_fused_mul_pow_sub_sum_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=[4], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_pow_sub_sum_0', 'mutated_arg_names': [], '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_mul_pow_sub_sum_0(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (0))
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK])
    tmp2 = tl.load(in_ptr1 + (16*x0), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (0))
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (4))
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK])
    tmp11 = tl.load(in_ptr1 + (1 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + (4))
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK])
    tmp19 = tl.load(in_ptr0 + (8))
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp21 = tl.load(in_ptr1 + (2 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr2 + (8))
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK])
    tmp29 = tl.load(in_ptr0 + (12))
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr1 + (3 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr2 + (12))
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp3 = tmp1 * tmp2
    tmp6 = tmp5 * tmp2
    tmp7 = tmp3 - tmp6
    tmp8 = tmp7 * tmp7
    tmp12 = tmp10 * tmp11
    tmp15 = tmp14 * tmp11
    tmp16 = tmp12 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tmp8 + tmp17
    tmp22 = tmp20 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp22 - tmp25
    tmp27 = tmp26 * tmp26
    tmp28 = tmp18 + tmp27
    tmp32 = tmp30 * tmp31
    tmp35 = tmp34 * tmp31
    tmp36 = tmp32 - tmp35
    tmp37 = tmp36 * tmp36
    tmp38 = tmp28 + tmp37
    tl.store(out_ptr0 + (x0), tmp38, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/gf/cgfdg57m2kq25gjnusrmcqfjbxfmsvhnozc46s4wultemkiwbfv3.py
# Topologically Sorted Source Nodes: [heatmap_pred_3, mul_4, sub_1, pow_2, sum_2], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   heatmap_pred_3 => mul_3
#   mul_4 => mul_4
#   pow_2 => pow_2
#   sub_1 => sub_1
#   sum_2 => sum_2
# Graph fragment:
#   %mul_3 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_2, %select_2), kwargs = {})
#   %mul_4 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_3, %select_3), kwargs = {})
#   %sub_1 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul_3, %mul_4), kwargs = {})
#   %pow_2 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sub_1, 2), kwargs = {})
#   %sum_2 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_2, [1]), kwargs = {})
triton_poi_fused_mul_pow_sub_sum_1 = async_compile.triton('triton_poi_fused_mul_pow_sub_sum_1', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[4], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_pow_sub_sum_1', 'mutated_arg_names': [], '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_mul_pow_sub_sum_1(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (1))
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK])
    tmp2 = tl.load(in_ptr1 + (4 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (1))
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (5))
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK])
    tmp11 = tl.load(in_ptr1 + (5 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + (5))
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK])
    tmp19 = tl.load(in_ptr0 + (9))
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp21 = tl.load(in_ptr1 + (6 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr2 + (9))
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK])
    tmp29 = tl.load(in_ptr0 + (13))
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr1 + (7 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr2 + (13))
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp3 = tmp1 * tmp2
    tmp6 = tmp5 * tmp2
    tmp7 = tmp3 - tmp6
    tmp8 = tmp7 * tmp7
    tmp12 = tmp10 * tmp11
    tmp15 = tmp14 * tmp11
    tmp16 = tmp12 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tmp8 + tmp17
    tmp22 = tmp20 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp22 - tmp25
    tmp27 = tmp26 * tmp26
    tmp28 = tmp18 + tmp27
    tmp32 = tmp30 * tmp31
    tmp35 = tmp34 * tmp31
    tmp36 = tmp32 - tmp35
    tmp37 = tmp36 * tmp36
    tmp38 = tmp28 + tmp37
    tl.store(out_ptr0 + (x0), tmp38, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/ud/cudmstgzhe4d5hgeycx5jjjsr7p3mlugt2thu4sph43qkmo2yhuw.py
# Topologically Sorted Source Nodes: [heatmap_pred_5, mul_7, sub_2, pow_3, sum_3], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   heatmap_pred_5 => mul_6
#   mul_7 => mul_7
#   pow_3 => pow_3
#   sub_2 => sub_2
#   sum_3 => sum_3
# Graph fragment:
#   %mul_6 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_4, %select_4), kwargs = {})
#   %mul_7 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_5, %select_5), kwargs = {})
#   %sub_2 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul_6, %mul_7), kwargs = {})
#   %pow_3 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sub_2, 2), kwargs = {})
#   %sum_3 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_3, [1]), kwargs = {})
triton_poi_fused_mul_pow_sub_sum_2 = async_compile.triton('triton_poi_fused_mul_pow_sub_sum_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=[4], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_pow_sub_sum_2', 'mutated_arg_names': [], '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_mul_pow_sub_sum_2(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (2))
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK])
    tmp2 = tl.load(in_ptr1 + (8 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (2))
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (6))
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK])
    tmp11 = tl.load(in_ptr1 + (9 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + (6))
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK])
    tmp19 = tl.load(in_ptr0 + (10))
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp21 = tl.load(in_ptr1 + (10 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr2 + (10))
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK])
    tmp29 = tl.load(in_ptr0 + (14))
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr1 + (11 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr2 + (14))
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp3 = tmp1 * tmp2
    tmp6 = tmp5 * tmp2
    tmp7 = tmp3 - tmp6
    tmp8 = tmp7 * tmp7
    tmp12 = tmp10 * tmp11
    tmp15 = tmp14 * tmp11
    tmp16 = tmp12 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tmp8 + tmp17
    tmp22 = tmp20 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp22 - tmp25
    tmp27 = tmp26 * tmp26
    tmp28 = tmp18 + tmp27
    tmp32 = tmp30 * tmp31
    tmp35 = tmp34 * tmp31
    tmp36 = tmp32 - tmp35
    tmp37 = tmp36 * tmp36
    tmp38 = tmp28 + tmp37
    tl.store(out_ptr0 + (x0), tmp38, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/fe/cfe55sltrebf2lbsv5frianiofe6asqmd35tky7ipprmweivgp3c.py
# Topologically Sorted Source Nodes: [heatmap_pred_7, mul_10, sub_3, pow_4, sum_4], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
# Source node to ATen node mapping:
#   heatmap_pred_7 => mul_9
#   mul_10 => mul_10
#   pow_4 => pow_4
#   sub_3 => sub_3
#   sum_4 => sum_4
# Graph fragment:
#   %mul_9 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_6, %select_6), kwargs = {})
#   %mul_10 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%squeeze_7, %select_7), kwargs = {})
#   %sub_3 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul_9, %mul_10), kwargs = {})
#   %pow_4 : [num_users=1] = call_function[target=torch.ops.aten.pow.Tensor_Scalar](args = (%sub_3, 2), kwargs = {})
#   %sum_4 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%pow_4, [1]), kwargs = {})
triton_poi_fused_mul_pow_sub_sum_3 = async_compile.triton('triton_poi_fused_mul_pow_sub_sum_3', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[4], 
    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), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_mul_pow_sub_sum_3', 'mutated_arg_names': [], '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_mul_pow_sub_sum_3(in_ptr0, in_ptr1, in_ptr2, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + (3))
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK])
    tmp2 = tl.load(in_ptr1 + (12 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + (3))
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + (7))
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK])
    tmp11 = tl.load(in_ptr1 + (13 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr2 + (7))
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK])
    tmp19 = tl.load(in_ptr0 + (11))
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp21 = tl.load(in_ptr1 + (14 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr2 + (11))
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK])
    tmp29 = tl.load(in_ptr0 + (15))
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr1 + (15 + (16*x0)), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr2 + (15))
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp3 = tmp1 * tmp2
    tmp6 = tmp5 * tmp2
    tmp7 = tmp3 - tmp6
    tmp8 = tmp7 * tmp7
    tmp12 = tmp10 * tmp11
    tmp15 = tmp14 * tmp11
    tmp16 = tmp12 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tmp8 + tmp17
    tmp22 = tmp20 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp22 - tmp25
    tmp27 = tmp26 * tmp26
    tmp28 = tmp18 + tmp27
    tmp32 = tmp30 * tmp31
    tmp35 = tmp34 * tmp31
    tmp36 = tmp32 - tmp35
    tmp37 = tmp36 * tmp36
    tmp38 = tmp28 + tmp37
    tl.store(out_ptr0 + (x0), tmp38, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_6/inductor_cache/gd/cgdrg63pr72f73rp5nnrjrvij7iiwg77mw4d5cjipod5c5henjos.py
# Topologically Sorted Source Nodes: [loss], Original ATen: [aten.cat]
# Source node to ATen node mapping:
#   loss => cat
# Graph fragment:
#   %cat : [num_users=1] = call_function[target=torch.ops.aten.cat.default](args = ([%mul_2, %mul_5, %mul_8, %mul_11], 1), kwargs = {})
triton_poi_fused_cat_4 = async_compile.triton('triton_poi_fused_cat_4', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

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

@triton_heuristics.pointwise(
    size_hints=[16], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*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_cat_4', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 4, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_cat_4(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = (xindex // 4)
    x2 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x1), tmp4 & xmask, eviction_policy='evict_last', other=0.0)
    tmp6 = 0.5
    tmp7 = tmp5 * tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tmp11 = tl.full([1], 2, tl.int64)
    tmp12 = tmp0 < tmp11
    tmp13 = tmp10 & tmp12
    tmp14 = tl.load(in_ptr1 + (x1), tmp13 & xmask, eviction_policy='evict_last', other=0.0)
    tmp15 = tmp14 * tmp6
    tmp16 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp17 = tl.where(tmp13, tmp15, tmp16)
    tmp18 = tmp0 >= tmp11
    tmp19 = tl.full([1], 3, tl.int64)
    tmp20 = tmp0 < tmp19
    tmp21 = tmp18 & tmp20
    tmp22 = tl.load(in_ptr2 + (x1), tmp21 & xmask, eviction_policy='evict_last', other=0.0)
    tmp23 = tmp22 * tmp6
    tmp24 = tl.full(tmp23.shape, 0.0, tmp23.dtype)
    tmp25 = tl.where(tmp21, tmp23, tmp24)
    tmp26 = tmp0 >= tmp19
    tmp27 = tl.full([1], 4, tl.int64)
    tmp28 = tmp0 < tmp27
    tmp29 = tl.load(in_ptr3 + (x1), tmp26 & xmask, eviction_policy='evict_last', other=0.0)
    tmp30 = tmp29 * tmp6
    tmp31 = tl.full(tmp30.shape, 0.0, tmp30.dtype)
    tmp32 = tl.where(tmp26, tmp30, tmp31)
    tmp33 = tl.where(tmp21, tmp25, tmp32)
    tmp34 = tl.where(tmp13, tmp17, tmp33)
    tmp35 = tl.where(tmp4, tmp9, tmp34)
    tl.store(out_ptr0 + (x2), tmp35, xmask)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    arg0_1, arg1_1, arg2_1 = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4), (4, 1))
    assert_size_stride(arg1_1, (4, 4), (4, 1))
    assert_size_stride(arg2_1, (4, 4, 4), (16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [heatmap_pred_1, mul_1, sub, pow_1, sum_1], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
        stream0 = get_raw_stream(0)
        triton_poi_fused_mul_pow_sub_sum_0.run(arg0_1, arg2_1, arg1_1, buf0, 4, grid=grid(4), stream=stream0)
        buf1 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [heatmap_pred_3, mul_4, sub_1, pow_2, sum_2], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
        triton_poi_fused_mul_pow_sub_sum_1.run(arg0_1, arg2_1, arg1_1, buf1, 4, grid=grid(4), stream=stream0)
        buf2 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [heatmap_pred_5, mul_7, sub_2, pow_3, sum_3], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
        triton_poi_fused_mul_pow_sub_sum_2.run(arg0_1, arg2_1, arg1_1, buf2, 4, grid=grid(4), stream=stream0)
        buf3 = empty_strided_cuda((4, ), (1, ), torch.float32)
        # Topologically Sorted Source Nodes: [heatmap_pred_7, mul_10, sub_3, pow_4, sum_4], Original ATen: [aten.mul, aten.sub, aten.pow, aten.sum]
        triton_poi_fused_mul_pow_sub_sum_3.run(arg0_1, arg2_1, arg1_1, buf3, 4, grid=grid(4), stream=stream0)
        del arg0_1
        del arg1_1
        del arg2_1
        buf4 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        # Topologically Sorted Source Nodes: [loss], Original ATen: [aten.cat]
        triton_poi_fused_cat_4.run(buf0, buf1, buf2, buf3, buf4, 16, grid=grid(16), stream=stream0)
        del buf0
        del buf1
        del buf2
        del buf3
    return (buf4, )


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, 1), device='cuda:0', dtype=torch.float32)
    arg1_1 = rand_strided((4, 4), (4, 1), device='cuda:0', dtype=torch.float32)
    arg2_1 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([arg0_1, arg1_1, arg2_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)

import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed


class JointsMSELossNoReduction(nn.Module):

    def __init__(self, use_target_weight, logger):
        super(JointsMSELossNoReduction, self).__init__()
        self.criterion = lambda x, y: ((x - y) ** 2).sum(1).unsqueeze(1)
        self.use_target_weight = use_target_weight
        self.logger = logger

    def forward(self, output, target, target_weight):
        batch_size = output.size(0)
        num_joints = output.size(1)
        heatmaps_pred = output.reshape((batch_size, num_joints, -1)).split(1, 1
            )
        heatmaps_gt = target.reshape((batch_size, num_joints, -1)).split(1, 1)
        loss = []
        for idx in range(num_joints):
            heatmap_pred = heatmaps_pred[idx].squeeze()
            heatmap_gt = heatmaps_gt[idx].squeeze()
            if self.use_target_weight:
                heatmap_pred = heatmap_pred.mul(target_weight[:, idx])
                loss_val = self.criterion(heatmap_pred, heatmap_gt.mul(
                    target_weight[:, idx]))
                loss.append(0.5 * loss_val)
            else:
                loss.append(0.5 * self.criterion(heatmap_pred, heatmap_gt))
        loss = torch.cat(loss, dim=1)
        return loss


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


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

import torch
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda


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


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


@triton.jit
def triton_poi_fused_mul_pow_sub_sum_2(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 2)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK])
    tmp2 = tl.load(in_ptr1 + (8 + 16 * x0), xmask, eviction_policy='evict_last'
        )
    tmp4 = tl.load(in_ptr2 + 2)
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + 6)
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK])
    tmp11 = tl.load(in_ptr1 + (9 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp13 = tl.load(in_ptr2 + 6)
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK])
    tmp19 = tl.load(in_ptr0 + 10)
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp21 = tl.load(in_ptr1 + (10 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp23 = tl.load(in_ptr2 + 10)
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK])
    tmp29 = tl.load(in_ptr0 + 14)
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr1 + (11 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp33 = tl.load(in_ptr2 + 14)
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp3 = tmp1 * tmp2
    tmp6 = tmp5 * tmp2
    tmp7 = tmp3 - tmp6
    tmp8 = tmp7 * tmp7
    tmp12 = tmp10 * tmp11
    tmp15 = tmp14 * tmp11
    tmp16 = tmp12 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tmp8 + tmp17
    tmp22 = tmp20 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp22 - tmp25
    tmp27 = tmp26 * tmp26
    tmp28 = tmp18 + tmp27
    tmp32 = tmp30 * tmp31
    tmp35 = tmp34 * tmp31
    tmp36 = tmp32 - tmp35
    tmp37 = tmp36 * tmp36
    tmp38 = tmp28 + tmp37
    tl.store(out_ptr0 + x0, tmp38, xmask)


@triton.jit
def triton_poi_fused_mul_pow_sub_sum_3(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 3)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK])
    tmp2 = tl.load(in_ptr1 + (12 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp4 = tl.load(in_ptr2 + 3)
    tmp5 = tl.broadcast_to(tmp4, [XBLOCK])
    tmp9 = tl.load(in_ptr0 + 7)
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK])
    tmp11 = tl.load(in_ptr1 + (13 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp13 = tl.load(in_ptr2 + 7)
    tmp14 = tl.broadcast_to(tmp13, [XBLOCK])
    tmp19 = tl.load(in_ptr0 + 11)
    tmp20 = tl.broadcast_to(tmp19, [XBLOCK])
    tmp21 = tl.load(in_ptr1 + (14 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp23 = tl.load(in_ptr2 + 11)
    tmp24 = tl.broadcast_to(tmp23, [XBLOCK])
    tmp29 = tl.load(in_ptr0 + 15)
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK])
    tmp31 = tl.load(in_ptr1 + (15 + 16 * x0), xmask, eviction_policy=
        'evict_last')
    tmp33 = tl.load(in_ptr2 + 15)
    tmp34 = tl.broadcast_to(tmp33, [XBLOCK])
    tmp3 = tmp1 * tmp2
    tmp6 = tmp5 * tmp2
    tmp7 = tmp3 - tmp6
    tmp8 = tmp7 * tmp7
    tmp12 = tmp10 * tmp11
    tmp15 = tmp14 * tmp11
    tmp16 = tmp12 - tmp15
    tmp17 = tmp16 * tmp16
    tmp18 = tmp8 + tmp17
    tmp22 = tmp20 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp22 - tmp25
    tmp27 = tmp26 * tmp26
    tmp28 = tmp18 + tmp27
    tmp32 = tmp30 * tmp31
    tmp35 = tmp34 * tmp31
    tmp36 = tmp32 - tmp35
    tmp37 = tmp36 * tmp36
    tmp38 = tmp28 + tmp37
    tl.store(out_ptr0 + x0, tmp38, xmask)


@triton.jit
def triton_poi_fused_cat_4(in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4
    x2 = xindex
    tmp0 = x0
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 1, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + x1, tmp4 & xmask, eviction_policy='evict_last',
        other=0.0)
    tmp6 = 0.5
    tmp7 = tmp5 * tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tmp11 = tl.full([1], 2, tl.int64)
    tmp12 = tmp0 < tmp11
    tmp13 = tmp10 & tmp12
    tmp14 = tl.load(in_ptr1 + x1, tmp13 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp15 = tmp14 * tmp6
    tmp16 = tl.full(tmp15.shape, 0.0, tmp15.dtype)
    tmp17 = tl.where(tmp13, tmp15, tmp16)
    tmp18 = tmp0 >= tmp11
    tmp19 = tl.full([1], 3, tl.int64)
    tmp20 = tmp0 < tmp19
    tmp21 = tmp18 & tmp20
    tmp22 = tl.load(in_ptr2 + x1, tmp21 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp23 = tmp22 * tmp6
    tmp24 = tl.full(tmp23.shape, 0.0, tmp23.dtype)
    tmp25 = tl.where(tmp21, tmp23, tmp24)
    tmp26 = tmp0 >= tmp19
    tl.full([1], 4, tl.int64)
    tmp29 = tl.load(in_ptr3 + x1, tmp26 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp30 = tmp29 * tmp6
    tmp31 = tl.full(tmp30.shape, 0.0, tmp30.dtype)
    tmp32 = tl.where(tmp26, tmp30, tmp31)
    tmp33 = tl.where(tmp21, tmp25, tmp32)
    tmp34 = tl.where(tmp13, tmp17, tmp33)
    tmp35 = tl.where(tmp4, tmp9, tmp34)
    tl.store(out_ptr0 + x2, tmp35, xmask)


def call(args):
    arg0_1, arg1_1, arg2_1 = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4), (4, 1))
    assert_size_stride(arg1_1, (4, 4), (4, 1))
    assert_size_stride(arg2_1, (4, 4, 4), (16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4,), (1,), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_mul_pow_sub_sum_0[grid(4)](arg0_1, arg2_1, arg1_1,
            buf0, 4, XBLOCK=4, num_warps=1, num_stages=1)
        buf1 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_mul_pow_sub_sum_1[grid(4)](arg0_1, arg2_1, arg1_1,
            buf1, 4, XBLOCK=4, num_warps=1, num_stages=1)
        buf2 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_mul_pow_sub_sum_2[grid(4)](arg0_1, arg2_1, arg1_1,
            buf2, 4, XBLOCK=4, num_warps=1, num_stages=1)
        buf3 = empty_strided_cuda((4,), (1,), torch.float32)
        triton_poi_fused_mul_pow_sub_sum_3[grid(4)](arg0_1, arg2_1, arg1_1,
            buf3, 4, XBLOCK=4, num_warps=1, num_stages=1)
        del arg0_1
        del arg1_1
        del arg2_1
        buf4 = empty_strided_cuda((4, 4), (4, 1), torch.float32)
        triton_poi_fused_cat_4[grid(16)](buf0, buf1, buf2, buf3, buf4, 16,
            XBLOCK=16, num_warps=1, num_stages=1)
        del buf0
        del buf1
        del buf2
        del buf3
    return buf4,


class JointsMSELossNoReductionNew(nn.Module):

    def __init__(self, use_target_weight, logger):
        super(JointsMSELossNoReductionNew, self).__init__()
        self.criterion = lambda x, y: ((x - y) ** 2).sum(1).unsqueeze(1)
        self.use_target_weight = use_target_weight
        self.logger = logger

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