Skip to content

Commit 1f0b8a7

Browse files
committed
fix fill inplace call for aclnn
1 parent f6baaf8 commit 1f0b8a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

impl/ascend/functions/nlllossv2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ diopiError_t diopiNLLLossV2(diopiContextHandle_t ctx, diopiTensorHandle_t out, d
1818
AscendTensor inputAt(input);
1919
if (inputAt.numel() <= 0) {
2020
if (diopiReduction_t::ReductionMean == reduction) {
21-
DIOPI_ASCEND_CALL_ACLNN(aclnnInpalceFillScalar, ctx, out, std::nanf(""));
21+
diopiScalar_t nans{diopi_dtype_float64, std::nanf("")};
22+
DIOPI_ASCEND_CALL_ACLNN(aclnnInplaceFillScalar, ctx, out, &nans);
2223
} else if (diopiReduction_t::ReductionSum == reduction || diopiReduction_t::ReductionNone == reduction) {
2324
DIOPI_ASCEND_CALL_ACLNN(aclnnInplaceZero, ctx, out);
2425
}

0 commit comments

Comments
 (0)