Fix bug for binary not equal float not imp

This commit is contained in:
xiaying 2024-04-19 12:54:03 +08:00
parent 5895243607
commit 8ba2c49380
2 changed files with 25 additions and 3 deletions

View File

@ -105,6 +105,8 @@ MNNBinaryExecute CPUBinary::selectForFloat(int type) {
return execute<float, float, BinaryFloorDiv<float, float, float>>;
case BinaryOpOperation_FLOORMOD:
return execute<float, float, BinaryFloorMod<float, float, float>>;
case BinaryOpOperation_NOTEQUAL:
return execute<float, int32_t, BinaryNotEqual<float, float, int32_t>>;
case BinaryOpOperation_POW:
return execute<float, float, BinaryPow<float, float, float>>;
case BinaryOpOperation_ATAN2:

View File

@ -464,7 +464,13 @@ public:
{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0},
{3.0, 4.0},
{0, 0, 1, 1, 0, 0, 0, 0},
{4, 2}, {2}, {4, 2});
{4, 2}, {2}, {4, 2}) &&
test<int, int>(MNN::Express::_Equal, "EqualIntTest", 0,
{1, 2, 3, 4, 5, 6, 7, 8},
{3, 4},
{0, 0, 1, 1, 0, 0, 0, 0},
{4, 2}, {2}, {4, 2});
;
}
};
class LessEqualTest : public BinaryTestCommon {
@ -475,7 +481,14 @@ public:
{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0},
{3.0, 4.0},
{1, 1, 1, 1, 0, 0, 0, 0},
{4, 2}, {2}, {4, 2});
{4, 2}, {2}, {4, 2})
&&
test<int, int>(_LessEqual, "LessEqualIntTest", 0,
{1, 2, 3, 4, 5, 6, 7, 8},
{3, 4},
{1, 1, 1, 1, 0, 0, 0, 0},
{4, 2}, {2}, {4, 2})
;
}
};
class FloorModTest : public BinaryTestCommon {
@ -539,7 +552,14 @@ public:
{true, false, true, false, false, true, true, false},
{true, false},
{false, false, false, false, true, true, false, false},
{4, 2}, {2}, {4, 2});
{4, 2}, {2}, {4, 2})
&&
test<float, int>(_NotEqual, "NotEqualTest", 0,
{1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0},
{1.0, 0.0},
{false, false, false, false, true, true, false, false},
{4, 2}, {2}, {4, 2})
;
}
};
class BitwiseAndTest : public BinaryTestCommon {