# 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_1/inductor_cache/cv/ccvlk4yzzvsomtdpb7pmyki2zpkpvikdfjidje4om25y4dydxkgi.py
# Topologically Sorted Source Nodes: [neg_1, log_sigmoid_1, mul_1, log_sigmoid, neg, sub, neg_vals, vals, mul_2, sum_1, losses, mean], Original ATen: [aten.neg, aten.log_sigmoid_forward, aten.mul, aten.rsub, aten.sub, aten.sum, aten.div, aten.mean]
# Source node to ATen node mapping:
#   log_sigmoid => abs_1, exp, full_default, log1p, minimum, neg_1, sub
#   log_sigmoid_1 => abs_2, exp_1, full_default_1, log1p_1, minimum_1, neg_3, sub_2
#   losses => div
#   mean => mean
#   mul_1 => mul_1
#   mul_2 => mul_2
#   neg => neg
#   neg_1 => neg_2
#   neg_vals => mul
#   sub => sub_1
#   sum_1 => sum_1
#   vals => sub_3
# Graph fragment:
#   %neg_2 : [num_users=1] = call_function[target=torch.ops.aten.neg.default](args = (%arg1_1,), kwargs = {})
#   %full_default_1 : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %minimum_1 : [num_users=1] = call_function[target=torch.ops.aten.minimum.default](args = (%full_default_1, %arg0_1), kwargs = {})
#   %abs_2 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%arg0_1,), kwargs = {})
#   %neg_3 : [num_users=1] = call_function[target=torch.ops.aten.neg.default](args = (%abs_2,), kwargs = {})
#   %exp_1 : [num_users=1] = call_function[target=torch.ops.aten.exp.default](args = (%neg_3,), kwargs = {})
#   %log1p_1 : [num_users=1] = call_function[target=torch.ops.aten.log1p.default](args = (%exp_1,), kwargs = {})
#   %sub_2 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%minimum_1, %log1p_1), kwargs = {})
#   %mul_1 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%neg_2, %sub_2), kwargs = {})
#   %full_default : [num_users=1] = call_function[target=torch.ops.aten.full.default](args = ([], 0), kwargs = {dtype: torch.float32, layout: torch.strided, device: cuda:0, pin_memory: False})
#   %neg : [num_users=2] = call_function[target=torch.ops.aten.neg.default](args = (%arg0_1,), kwargs = {})
#   %minimum : [num_users=1] = call_function[target=torch.ops.aten.minimum.default](args = (%full_default, %neg), kwargs = {})
#   %abs_1 : [num_users=1] = call_function[target=torch.ops.aten.abs.default](args = (%neg,), kwargs = {})
#   %neg_1 : [num_users=1] = call_function[target=torch.ops.aten.neg.default](args = (%abs_1,), kwargs = {})
#   %exp : [num_users=1] = call_function[target=torch.ops.aten.exp.default](args = (%neg_1,), kwargs = {})
#   %log1p : [num_users=1] = call_function[target=torch.ops.aten.log1p.default](args = (%exp,), kwargs = {})
#   %sub : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%minimum, %log1p), kwargs = {})
#   %sub_1 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (1, %arg1_1), kwargs = {})
#   %mul : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub, %sub_1), kwargs = {})
#   %sub_3 : [num_users=1] = call_function[target=torch.ops.aten.sub.Tensor](args = (%mul_1, %mul), kwargs = {})
#   %mul_2 : [num_users=1] = call_function[target=torch.ops.aten.mul.Tensor](args = (%sub_3, %arg2_1), kwargs = {})
#   %sum_1 : [num_users=1] = call_function[target=torch.ops.aten.sum.dim_IntList](args = (%mul_2, [-1]), kwargs = {})
#   %div : [num_users=1] = call_function[target=torch.ops.aten.div.Tensor](args = (%sum_1, 4), kwargs = {})
#   %mean : [num_users=1] = call_function[target=torch.ops.aten.mean.default](args = (%div,), kwargs = {})
triton_per_fused_div_log_sigmoid_forward_mean_mul_neg_rsub_sub_sum_0 = async_compile.triton('triton_per_fused_div_log_sigmoid_forward_mean_mul_neg_rsub_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.persistent_reduction(
    size_hints=[1, 64],
    reduction_hint=ReductionHint.DEFAULT,
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: '*fp32', 4: 'i32', 5: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=90, major=9, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=132), 'constants': {4: 1}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3, 5), equal_to_1=(4,))]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_per_fused_div_log_sigmoid_forward_mean_mul_neg_rsub_sub_sum_0', 'mutated_arg_names': ['in_out_ptr0'], 'no_x_dim': False, 'num_load': 12, 'num_reduction': 1, 'backend_hash': 'B098E03CDA7B8ADC90DAFFDF24A2956451D1B13F297756A5DCC209498AA53705', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False}
)
@triton.jit
def triton_per_fused_div_log_sigmoid_forward_mean_mul_neg_rsub_sub_sum_0(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, xnumel, rnumel, XBLOCK : tl.constexpr):
    xnumel = 1
    rnumel = 64
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    rindex = tl.arange(0, RBLOCK)[None, :]
    roffset = 0
    rmask = tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r0 = rindex
    tmp0 = tl.load(in_ptr0 + (4*r0), None, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr1 + (4*r0), None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr2 + (4*r0), None, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr0 + (1 + (4*r0)), None, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr1 + (1 + (4*r0)), None, eviction_policy='evict_last')
    tmp44 = tl.load(in_ptr2 + (1 + (4*r0)), None, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (2 + (4*r0)), None, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (2 + (4*r0)), None, eviction_policy='evict_last')
    tmp67 = tl.load(in_ptr2 + (2 + (4*r0)), None, eviction_policy='evict_last')
    tmp70 = tl.load(in_ptr0 + (3 + (4*r0)), None, eviction_policy='evict_last')
    tmp72 = tl.load(in_ptr1 + (3 + (4*r0)), None, eviction_policy='evict_last')
    tmp90 = tl.load(in_ptr2 + (3 + (4*r0)), None, eviction_policy='evict_last')
    tmp1 = -tmp0
    tmp3 = 0.0
    tmp4 = triton_helpers.minimum(tmp3, tmp2)
    tmp5 = tl_math.abs(tmp2)
    tmp6 = -tmp5
    tmp7 = tl_math.exp(tmp6)
    tmp8 = libdevice.log1p(tmp7)
    tmp9 = tmp4 - tmp8
    tmp10 = tmp1 * tmp9
    tmp11 = -tmp2
    tmp12 = triton_helpers.minimum(tmp3, tmp11)
    tmp13 = tl_math.abs(tmp11)
    tmp14 = -tmp13
    tmp15 = tl_math.exp(tmp14)
    tmp16 = libdevice.log1p(tmp15)
    tmp17 = tmp12 - tmp16
    tmp18 = 1.0
    tmp19 = tmp18 - tmp0
    tmp20 = tmp17 * tmp19
    tmp21 = tmp10 - tmp20
    tmp23 = tmp21 * tmp22
    tmp25 = -tmp24
    tmp27 = triton_helpers.minimum(tmp3, tmp26)
    tmp28 = tl_math.abs(tmp26)
    tmp29 = -tmp28
    tmp30 = tl_math.exp(tmp29)
    tmp31 = libdevice.log1p(tmp30)
    tmp32 = tmp27 - tmp31
    tmp33 = tmp25 * tmp32
    tmp34 = -tmp26
    tmp35 = triton_helpers.minimum(tmp3, tmp34)
    tmp36 = tl_math.abs(tmp34)
    tmp37 = -tmp36
    tmp38 = tl_math.exp(tmp37)
    tmp39 = libdevice.log1p(tmp38)
    tmp40 = tmp35 - tmp39
    tmp41 = tmp18 - tmp24
    tmp42 = tmp40 * tmp41
    tmp43 = tmp33 - tmp42
    tmp45 = tmp43 * tmp44
    tmp46 = tmp23 + tmp45
    tmp48 = -tmp47
    tmp50 = triton_helpers.minimum(tmp3, tmp49)
    tmp51 = tl_math.abs(tmp49)
    tmp52 = -tmp51
    tmp53 = tl_math.exp(tmp52)
    tmp54 = libdevice.log1p(tmp53)
    tmp55 = tmp50 - tmp54
    tmp56 = tmp48 * tmp55
    tmp57 = -tmp49
    tmp58 = triton_helpers.minimum(tmp3, tmp57)
    tmp59 = tl_math.abs(tmp57)
    tmp60 = -tmp59
    tmp61 = tl_math.exp(tmp60)
    tmp62 = libdevice.log1p(tmp61)
    tmp63 = tmp58 - tmp62
    tmp64 = tmp18 - tmp47
    tmp65 = tmp63 * tmp64
    tmp66 = tmp56 - tmp65
    tmp68 = tmp66 * tmp67
    tmp69 = tmp46 + tmp68
    tmp71 = -tmp70
    tmp73 = triton_helpers.minimum(tmp3, tmp72)
    tmp74 = tl_math.abs(tmp72)
    tmp75 = -tmp74
    tmp76 = tl_math.exp(tmp75)
    tmp77 = libdevice.log1p(tmp76)
    tmp78 = tmp73 - tmp77
    tmp79 = tmp71 * tmp78
    tmp80 = -tmp72
    tmp81 = triton_helpers.minimum(tmp3, tmp80)
    tmp82 = tl_math.abs(tmp80)
    tmp83 = -tmp82
    tmp84 = tl_math.exp(tmp83)
    tmp85 = libdevice.log1p(tmp84)
    tmp86 = tmp81 - tmp85
    tmp87 = tmp18 - tmp70
    tmp88 = tmp86 * tmp87
    tmp89 = tmp79 - tmp88
    tmp91 = tmp89 * tmp90
    tmp92 = tmp69 + tmp91
    tmp93 = 0.25
    tmp94 = tmp92 * tmp93
    tmp95 = tl.broadcast_to(tmp94, [XBLOCK, RBLOCK])
    tmp97 = tl.sum(tmp95, 1)[:, None]
    tmp98 = 64.0
    tmp99 = tmp97 / tmp98
    tl.debug_barrier()
    tl.store(in_out_ptr0 + (tl.full([XBLOCK, 1], 0, tl.int32)), tmp99, None)
''', 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, 4), (64, 16, 4, 1))
    assert_size_stride(arg1_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(arg2_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((), (), torch.float32)
        buf2 = buf1; del buf1  # reuse
        # Topologically Sorted Source Nodes: [neg_1, log_sigmoid_1, mul_1, log_sigmoid, neg, sub, neg_vals, vals, mul_2, sum_1, losses, mean], Original ATen: [aten.neg, aten.log_sigmoid_forward, aten.mul, aten.rsub, aten.sub, aten.sum, aten.div, aten.mean]
        stream0 = get_raw_stream(0)
        triton_per_fused_div_log_sigmoid_forward_mean_mul_neg_rsub_sub_sum_0.run(buf2, arg1_1, arg0_1, arg2_1, 1, 64, grid=grid(1), stream=stream0)
        del arg0_1
        del arg1_1
        del arg2_1
    return (buf2, )


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)
    arg1_1 = rand_strided((4, 4, 4, 4), (64, 16, 4, 1), device='cuda:0', dtype=torch.float32)
    arg2_1 = rand_strided((4, 4, 4, 4), (64, 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


class WeightedBCELoss(torch.nn.Module):

    def __init__(self, neg_scale=-1, bce_sum=False):
        super(WeightedBCELoss, self).__init__()
        self.log_sigmoid = torch.nn.LogSigmoid()
        self.neg_scale = neg_scale
        self.bce_sum = bce_sum

    def forward(self, logits, targets, target_weights):
        neg_vals = self.log_sigmoid(-logits) * (1 - targets)
        if self.neg_scale > 0:
            neg_vals *= self.neg_scale
        vals = -targets * self.log_sigmoid(logits) - neg_vals
        if self.bce_sum:
            losses = torch.sum(vals * target_weights, dim=-1)
        else:
            losses = torch.sum(vals * target_weights, dim=-1) / logits.size()[1
                ]
        return torch.mean(losses)


def get_inputs():
    return [torch.rand([4, 4, 4, 4]), torch.rand([4, 4, 4, 4]), 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, math as tl_math
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_div_log_sigmoid_forward_mean_mul_neg_rsub_sub_sum_0(
    in_out_ptr0, in_ptr0, in_ptr1, in_ptr2, 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 + 4 * r0, None, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr1 + 4 * r0, None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr2 + 4 * r0, None, eviction_policy='evict_last')
    tmp24 = tl.load(in_ptr0 + (1 + 4 * r0), None, eviction_policy='evict_last')
    tmp26 = tl.load(in_ptr1 + (1 + 4 * r0), None, eviction_policy='evict_last')
    tmp44 = tl.load(in_ptr2 + (1 + 4 * r0), None, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr0 + (2 + 4 * r0), None, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (2 + 4 * r0), None, eviction_policy='evict_last')
    tmp67 = tl.load(in_ptr2 + (2 + 4 * r0), None, eviction_policy='evict_last')
    tmp70 = tl.load(in_ptr0 + (3 + 4 * r0), None, eviction_policy='evict_last')
    tmp72 = tl.load(in_ptr1 + (3 + 4 * r0), None, eviction_policy='evict_last')
    tmp90 = tl.load(in_ptr2 + (3 + 4 * r0), None, eviction_policy='evict_last')
    tmp1 = -tmp0
    tmp3 = 0.0
    tmp4 = triton_helpers.minimum(tmp3, tmp2)
    tmp5 = tl_math.abs(tmp2)
    tmp6 = -tmp5
    tmp7 = tl_math.exp(tmp6)
    tmp8 = libdevice.log1p(tmp7)
    tmp9 = tmp4 - tmp8
    tmp10 = tmp1 * tmp9
    tmp11 = -tmp2
    tmp12 = triton_helpers.minimum(tmp3, tmp11)
    tmp13 = tl_math.abs(tmp11)
    tmp14 = -tmp13
    tmp15 = tl_math.exp(tmp14)
    tmp16 = libdevice.log1p(tmp15)
    tmp17 = tmp12 - tmp16
    tmp18 = 1.0
    tmp19 = tmp18 - tmp0
    tmp20 = tmp17 * tmp19
    tmp21 = tmp10 - tmp20
    tmp23 = tmp21 * tmp22
    tmp25 = -tmp24
    tmp27 = triton_helpers.minimum(tmp3, tmp26)
    tmp28 = tl_math.abs(tmp26)
    tmp29 = -tmp28
    tmp30 = tl_math.exp(tmp29)
    tmp31 = libdevice.log1p(tmp30)
    tmp32 = tmp27 - tmp31
    tmp33 = tmp25 * tmp32
    tmp34 = -tmp26
    tmp35 = triton_helpers.minimum(tmp3, tmp34)
    tmp36 = tl_math.abs(tmp34)
    tmp37 = -tmp36
    tmp38 = tl_math.exp(tmp37)
    tmp39 = libdevice.log1p(tmp38)
    tmp40 = tmp35 - tmp39
    tmp41 = tmp18 - tmp24
    tmp42 = tmp40 * tmp41
    tmp43 = tmp33 - tmp42
    tmp45 = tmp43 * tmp44
    tmp46 = tmp23 + tmp45
    tmp48 = -tmp47
    tmp50 = triton_helpers.minimum(tmp3, tmp49)
    tmp51 = tl_math.abs(tmp49)
    tmp52 = -tmp51
    tmp53 = tl_math.exp(tmp52)
    tmp54 = libdevice.log1p(tmp53)
    tmp55 = tmp50 - tmp54
    tmp56 = tmp48 * tmp55
    tmp57 = -tmp49
    tmp58 = triton_helpers.minimum(tmp3, tmp57)
    tmp59 = tl_math.abs(tmp57)
    tmp60 = -tmp59
    tmp61 = tl_math.exp(tmp60)
    tmp62 = libdevice.log1p(tmp61)
    tmp63 = tmp58 - tmp62
    tmp64 = tmp18 - tmp47
    tmp65 = tmp63 * tmp64
    tmp66 = tmp56 - tmp65
    tmp68 = tmp66 * tmp67
    tmp69 = tmp46 + tmp68
    tmp71 = -tmp70
    tmp73 = triton_helpers.minimum(tmp3, tmp72)
    tmp74 = tl_math.abs(tmp72)
    tmp75 = -tmp74
    tmp76 = tl_math.exp(tmp75)
    tmp77 = libdevice.log1p(tmp76)
    tmp78 = tmp73 - tmp77
    tmp79 = tmp71 * tmp78
    tmp80 = -tmp72
    tmp81 = triton_helpers.minimum(tmp3, tmp80)
    tmp82 = tl_math.abs(tmp80)
    tmp83 = -tmp82
    tmp84 = tl_math.exp(tmp83)
    tmp85 = libdevice.log1p(tmp84)
    tmp86 = tmp81 - tmp85
    tmp87 = tmp18 - tmp70
    tmp88 = tmp86 * tmp87
    tmp89 = tmp79 - tmp88
    tmp91 = tmp89 * tmp90
    tmp92 = tmp69 + tmp91
    tmp93 = 0.25
    tmp94 = tmp92 * tmp93
    tmp95 = tl.broadcast_to(tmp94, [XBLOCK, RBLOCK])
    tmp97 = tl.sum(tmp95, 1)[:, None]
    tmp98 = 64.0
    tmp99 = tmp97 / tmp98
    tl.debug_barrier()
    tl.store(in_out_ptr0 + tl.full([XBLOCK, 1], 0, tl.int32), tmp99, None)


def call(args):
    arg0_1, arg1_1, arg2_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))
    assert_size_stride(arg2_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((), (), torch.float32)
        buf2 = buf1
        del buf1
        get_raw_stream(0)
        triton_per_fused_div_log_sigmoid_forward_mean_mul_neg_rsub_sub_sum_0[
            grid(1)](buf2, arg1_1, arg0_1, arg2_1, 1, 64, XBLOCK=1,
            num_warps=2, num_stages=1)
        del arg0_1
        del arg1_1
        del arg2_1
    return buf2,


class WeightedBCELossNew(torch.nn.Module):

    def __init__(self, neg_scale=-1, bce_sum=False):
        super(WeightedBCELossNew, self).__init__()
        self.log_sigmoid = torch.nn.LogSigmoid()
        self.neg_scale = neg_scale
        self.bce_sum = bce_sum

    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]
