fn
bce_loss_op
→TensorImplPtrint bce_loss_op(const int & input, const int & target, const int & weight, int reduction, double eps)Public binary cross-entropy entry point.
Parameters
inputTensorImplPtrProbabilities in .
targetTensorImplPtrBinary targets in of the same shape.
weightTensorImplPtrPer-element weighting tensor; pass a ones tensor when unused.
reductionint0 (None), 1 (Mean), or 2 (Sum).epsdoubleClamp inside the logarithm to keep gradients finite.
Returns
TensorImplPtrReduced or per-element loss tensor.