logicalor bug fix

This commit is contained in:
lzk 2021-10-12 01:50:24 -07:00
parent a0a8ef729d
commit 27bcd5f981
1 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ int ElementLogicalOr(const float *in0, const float *in1, float *out, int size) {
}
#endif
for (; index < size; index++) {
out[index] = (float)((unsigned int)(in0[index]) | (unsigned int)(in1[index]));
out[index] = (float)((bool)(in0[index]) | (bool)(in1[index]));
}
return NNACL_OK;
}
@ -157,7 +157,7 @@ int ElementLogicalOr(const float *in0, const float *in1, float *out, int size) {
int ElementLogicalOrBool(const bool *in0, const bool *in1, bool *out, int size) {
int index = 0;
for (; index < size; index++) {
out[index] = (bool)((unsigned int)(in0[index]) | (unsigned int)(in1[index]));
out[index] = (bool)(in0[index] | in1[index]);
}
return NNACL_OK;
}