mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-09 17:28:58 +00:00
Fix CPU Xor implementation (#8934)
This commit is contained in:
parent
1985616262
commit
ddbc8bc5fc
2 changed files with 10 additions and 1 deletions
|
|
@ -898,7 +898,7 @@ Status Xor::Compute(OpKernelContext* context) const {
|
|||
ProcessBroadcastSpanFuncs funcs{
|
||||
[](BroadcastHelper& per_iter_bh) {
|
||||
bool input0 = per_iter_bh.ScalarInput0<bool>();
|
||||
auto input1 = per_iter_bh.EigenInput0<bool>();
|
||||
auto input1 = per_iter_bh.EigenInput1<bool>();
|
||||
auto output = per_iter_bh.OutputEigen<bool>();
|
||||
if (input0)
|
||||
output.array() = !input1.array();
|
||||
|
|
|
|||
|
|
@ -1553,6 +1553,15 @@ TEST(MathOpTest, Xor) {
|
|||
test.Run();
|
||||
}
|
||||
|
||||
|
||||
TEST(MathOpTest, Xor_Issue8880) {
|
||||
OpTester test("Xor");
|
||||
test.AddInput<bool>("A", {1}, {true});
|
||||
test.AddInput<bool>("B", {1}, {false});
|
||||
test.AddOutput<bool>("C", {1}, {true});
|
||||
test.Run();
|
||||
}
|
||||
|
||||
TEST(MathOpTest, Xor_bcast3v2d) {
|
||||
OpTester test("Xor");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue