Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](bangc-ops): fix focal_loss_sigmoid_backward gamma range precheck #705

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bangc-ops/kernels/focal_loss_sigmoid/focal_loss_sigmoid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ mluOpStatus_t MLUOP_WIN_API mluOpFocalLossSigmoidBackward(
return MLUOP_STATUS_NOT_SUPPORTED;
}

if (gamma < 0) {
if (gamma < 0 || gamma > 10000) {
LOG(ERROR) << interface_name
<< "gamma should be greater than or equal to 0."
<< "gamma should be in the range of [0, 10000]. "
<< "But now gamma is " << gamma << ".";
return MLUOP_STATUS_NOT_SUPPORTED;
}
Expand Down
2 changes: 1 addition & 1 deletion bangc-ops/mlu_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -7450,7 +7450,7 @@ mluOpFocalLossSigmoidForward(mluOpHandle_t handle,
* \b weight is NULL on MLU500 series. The length of C should be in the range of [0, 8864] when
* \b weight is not NULL on MLU500 series.
* - \b weight does not support positive infinity and negative infinity currently.
* - \b gamma should be in the range of [0, 10000] on MLU300 series.
* - \b gamma should be in the range of [0, 10000].
*
* @par Example
* - None.
Expand Down