Skip to content

Commit

Permalink
fix round
Browse files Browse the repository at this point in the history
  • Loading branch information
hejunchao committed Aug 4, 2023
1 parent 8120c99 commit 9617cdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Native/src/kernels/stackvm/optimized/x86_64/unary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct unary_op_neg {
}
};

float round_onnx(float v) {
static float round_onnx(float v) {
if (v > 0 && v - (int32_t)v == 0.5) {
float result = (int32_t)v + 1.0;
if ((int32_t)result % 2 == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/Native/src/kernels/stackvm/reference/unary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ result<void> unary_impl(TOp &&op, const T *input, T *output,
return unary_impl(funct, input, output, input_shape, input_strides, \
out_shape, out_strides, context)

float round_onnx(float v) {
static float round_onnx(float v) {
if (v > 0 && v - (int32_t)v == 0.5) {
float result = (int32_t)v + 1.0;
if ((int32_t)result % 2 == 0)
Expand Down

0 comments on commit 9617cdc

Please sign in to comment.