diff --git a/onnxruntime/core/providers/cpu/math/element_wise_ops.cc b/onnxruntime/core/providers/cpu/math/element_wise_ops.cc index b00de30dca..bfc6388954 100644 --- a/onnxruntime/core/providers/cpu/math/element_wise_ops.cc +++ b/onnxruntime/core/providers/cpu/math/element_wise_ops.cc @@ -898,7 +898,7 @@ Status Xor::Compute(OpKernelContext* context) const { ProcessBroadcastSpanFuncs funcs{ [](BroadcastHelper& per_iter_bh) { bool input0 = per_iter_bh.ScalarInput0(); - auto input1 = per_iter_bh.EigenInput0(); + auto input1 = per_iter_bh.EigenInput1(); auto output = per_iter_bh.OutputEigen(); if (input0) output.array() = !input1.array(); diff --git a/onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc b/onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc index f4047b2c88..c95f3daf5b 100644 --- a/onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc +++ b/onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc @@ -1553,6 +1553,15 @@ TEST(MathOpTest, Xor) { test.Run(); } + +TEST(MathOpTest, Xor_Issue8880) { + OpTester test("Xor"); + test.AddInput("A", {1}, {true}); + test.AddInput("B", {1}, {false}); + test.AddOutput("C", {1}, {true}); + test.Run(); +} + TEST(MathOpTest, Xor_bcast3v2d) { OpTester test("Xor");