// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include #include #include #include #include #include "gtest/gtest.h" #include "test/providers/provider_test_utils.h" #include "test/util/include/default_providers.h" namespace onnxruntime { namespace test { #ifdef USE_WEBGPU TEST(SoftmaxOperator, webgpu_nan) { OpTester test("Softmax", 13); // axis default is -1 std::vector x_vals = {-INFINITY, -INFINITY, -INFINITY}; std::vector expected_result = {0.0f, 0.0f, 0.0f}; std::vector dimensions = {1, 3}; test.AddInput("X", dimensions, x_vals); test.AddOutput("Y", dimensions, expected_result); // explicitly disable for EPs that do not handle NaN test.Run(OpTester::ExpectResult::kExpectSuccess, "", {kCpuExecutionProvider, kCoreMLExecutionProvider, kDmlExecutionProvider}); } #endif } // namespace test } // namespace onnxruntime