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.triton_helpers import libdevice
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda


@triton.jit
def triton_per_fused_add_div_mul_pow_rsub_sqrt_sub_sum_0(in_out_ptr0,
    in_ptr0, in_ptr1, xnumel, rnumel, XBLOCK: tl.constexpr):
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xoffset + tl.arange(0, XBLOCK)[:, None]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + (128 + r0), None)
    tmp1 = tl.load(in_ptr1 + (128 + r0), None)
    tmp20 = tl.load(in_ptr0 + r0, None)
    tmp21 = tl.load(in_ptr1 + r0, None)
    tmp40 = tl.load(in_ptr0 + (192 + r0), None)
    tmp41 = tl.load(in_ptr1 + (192 + r0), None)
    tmp60 = tl.load(in_ptr0 + (64 + r0), None)
    tmp61 = tl.load(in_ptr1 + (64 + r0), None)
    tmp2 = tmp0 * tmp1
    tmp3 = tl.broadcast_to(tmp2, [XBLOCK, RBLOCK])
    tmp5 = tl.sum(tmp3, 1)[:, None]
    tmp6 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp8 = tl.sum(tmp6, 1)[:, None]
    tmp9 = tmp0 * tmp0
    tmp10 = tl.broadcast_to(tmp9, [XBLOCK, RBLOCK])
    tmp12 = tl.sum(tmp10, 1)[:, None]
    tmp13 = tl.broadcast_to(tmp1, [XBLOCK, RBLOCK])
    tmp15 = tl.sum(tmp13, 1)[:, None]
    tmp16 = tmp1 * tmp1
    tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
    tmp19 = tl.sum(tmp17, 1)[:, None]
    tmp22 = tmp20 * tmp21
    tmp23 = tl.broadcast_to(tmp22, [XBLOCK, RBLOCK])
    tmp25 = tl.sum(tmp23, 1)[:, None]
    tmp26 = tl.broadcast_to(tmp20, [XBLOCK, RBLOCK])
    tmp28 = tl.sum(tmp26, 1)[:, None]
    tmp29 = tmp20 * tmp20
    tmp30 = tl.broadcast_to(tmp29, [XBLOCK, RBLOCK])
    tmp32 = tl.sum(tmp30, 1)[:, None]
    tmp33 = tl.broadcast_to(tmp21, [XBLOCK, RBLOCK])
    tmp35 = tl.sum(tmp33, 1)[:, None]
    tmp36 = tmp21 * tmp21
    tmp37 = tl.broadcast_to(tmp36, [XBLOCK, RBLOCK])
    tmp39 = tl.sum(tmp37, 1)[:, None]
    tmp42 = tmp40 * tmp41
    tmp43 = tl.broadcast_to(tmp42, [XBLOCK, RBLOCK])
    tmp45 = tl.sum(tmp43, 1)[:, None]
    tmp46 = tl.broadcast_to(tmp40, [XBLOCK, RBLOCK])
    tmp48 = tl.sum(tmp46, 1)[:, None]
    tmp49 = tmp40 * tmp40
    tmp50 = tl.broadcast_to(tmp49, [XBLOCK, RBLOCK])
    tmp52 = tl.sum(tmp50, 1)[:, None]
    tmp53 = tl.broadcast_to(tmp41, [XBLOCK, RBLOCK])
    tmp55 = tl.sum(tmp53, 1)[:, None]
    tmp56 = tmp41 * tmp41
    tmp57 = tl.broadcast_to(tmp56, [XBLOCK, RBLOCK])
    tmp59 = tl.sum(tmp57, 1)[:, None]
    tmp62 = tmp60 * tmp61
    tmp63 = tl.broadcast_to(tmp62, [XBLOCK, RBLOCK])
    tmp65 = tl.sum(tmp63, 1)[:, None]
    tmp66 = tl.broadcast_to(tmp60, [XBLOCK, RBLOCK])
    tmp68 = tl.sum(tmp66, 1)[:, None]
    tmp69 = tmp60 * tmp60
    tmp70 = tl.broadcast_to(tmp69, [XBLOCK, RBLOCK])
    tmp72 = tl.sum(tmp70, 1)[:, None]
    tmp73 = tl.broadcast_to(tmp61, [XBLOCK, RBLOCK])
    tmp75 = tl.sum(tmp73, 1)[:, None]
    tmp76 = tmp61 * tmp61
    tmp77 = tl.broadcast_to(tmp76, [XBLOCK, RBLOCK])
    tmp79 = tl.sum(tmp77, 1)[:, None]
    tmp80 = 4.0
    tmp81 = tmp25 * tmp80
    tmp82 = tmp28 * tmp35
    tmp83 = tmp81 - tmp82
    tmp84 = tmp32 * tmp80
    tmp85 = tmp28 * tmp28
    tmp86 = tmp84 - tmp85
    tmp87 = tmp39 * tmp80
    tmp88 = tmp35 * tmp35
    tmp89 = tmp87 - tmp88
    tmp90 = tmp86 * tmp89
    tmp91 = libdevice.sqrt(tmp90)
    tmp92 = tmp83 / tmp91
    tmp93 = 1.0
    tmp94 = tmp93 - tmp92
    tmp95 = 0.0
    tmp96 = tmp94 + tmp95
    tmp97 = tmp65 * tmp80
    tmp98 = tmp68 * tmp75
    tmp99 = tmp97 - tmp98
    tmp100 = tmp72 * tmp80
    tmp101 = tmp68 * tmp68
    tmp102 = tmp100 - tmp101
    tmp103 = tmp79 * tmp80
    tmp104 = tmp75 * tmp75
    tmp105 = tmp103 - tmp104
    tmp106 = tmp102 * tmp105
    tmp107 = libdevice.sqrt(tmp106)
    tmp108 = tmp99 / tmp107
    tmp109 = tmp93 - tmp108
    tmp110 = tmp96 + tmp109
    tmp111 = tmp5 * tmp80
    tmp112 = tmp8 * tmp15
    tmp113 = tmp111 - tmp112
    tmp114 = tmp12 * tmp80
    tmp115 = tmp8 * tmp8
    tmp116 = tmp114 - tmp115
    tmp117 = tmp19 * tmp80
    tmp118 = tmp15 * tmp15
    tmp119 = tmp117 - tmp118
    tmp120 = tmp116 * tmp119
    tmp121 = libdevice.sqrt(tmp120)
    tmp122 = tmp113 / tmp121
    tmp123 = tmp93 - tmp122
    tmp124 = tmp110 + tmp123
    tmp125 = tmp45 * tmp80
    tmp126 = tmp48 * tmp55
    tmp127 = tmp125 - tmp126
    tmp128 = tmp52 * tmp80
    tmp129 = tmp48 * tmp48
    tmp130 = tmp128 - tmp129
    tmp131 = tmp59 * tmp80
    tmp132 = tmp55 * tmp55
    tmp133 = tmp131 - tmp132
    tmp134 = tmp130 * tmp133
    tmp135 = libdevice.sqrt(tmp134)
    tmp136 = tmp127 / tmp135
    tmp137 = tmp93 - tmp136
    tmp138 = tmp124 + tmp137
    tmp139 = 0.25
    tmp140 = tmp138 * tmp139
    tl.debug_barrier()
    tl.store(in_out_ptr0 + tl.full([XBLOCK, 1], 0, tl.int32), tmp140, None)


def call(args):
    arg0_1, arg1_1 = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(arg1_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((), (), torch.float32)
        buf10 = buf0
        del buf0
        buf21 = buf10
        del buf10
        buf22 = buf21
        del buf21
        get_raw_stream(0)
        triton_per_fused_add_div_mul_pow_rsub_sqrt_sub_sum_0[grid(1)](buf22,
            arg0_1, arg1_1, 1, 64, XBLOCK=1, num_warps=2, num_stages=1)
        del arg0_1
        del arg1_1
    return buf22,


class NegPearsonNew(nn.Module):

    def __init__(self):
        super(NegPearsonNew, self).__init__()
        return

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


Measured latency_ms: 0.015407