diff --git a/js/web/test/data/ops/abs_int32.jsonc b/js/web/test/data/ops/abs-int32.jsonc similarity index 100% rename from js/web/test/data/ops/abs_int32.jsonc rename to js/web/test/data/ops/abs-int32.jsonc diff --git a/js/web/test/data/ops/neg-int32.jsonc b/js/web/test/data/ops/neg-int32.jsonc new file mode 100644 index 0000000000000..807333db4a96d --- /dev/null +++ b/js/web/test/data/ops/neg-int32.jsonc @@ -0,0 +1,26 @@ +[ + { + "name": "neg with no attributes", + "operator": "Neg", + "attributes": [], + "cases": [ + { + "name": "T[2,4] (int32)", + "inputs": [ + { + "data": [1, 2, -1, -2, 0, 1, -1, 0], + "dims": [2, 4], + "type": "int32" + } + ], + "outputs": [ + { + "data": [-1, -2, 1, 2, 0, -1, 1, 0], + "dims": [2, 4], + "type": "int32" + } + ] + } + ] + } +] diff --git a/js/web/test/suite-test-list.jsonc b/js/web/test/suite-test-list.jsonc index 995df7381c795..52059eb38e6fc 100644 --- a/js/web/test/suite-test-list.jsonc +++ b/js/web/test/suite-test-list.jsonc @@ -1322,7 +1322,7 @@ ], "ops": [ "abs.jsonc", - "abs_int32.jsonc", + "abs-int32.jsonc", "acos.jsonc", "add.jsonc", "add_int32.jsonc", @@ -1351,6 +1351,7 @@ "mul.jsonc", "mul_int32.jsonc", //"neg.jsonc", + "neg-int32.jsonc", "not.jsonc", //"or.jsonc", "layer-norm.jsonc", diff --git a/onnxruntime/core/providers/js/operators/unary.cc b/onnxruntime/core/providers/js/operators/unary.cc index cf9433767c3d7..5e972e43e4566 100644 --- a/onnxruntime/core/providers/js/operators/unary.cc +++ b/onnxruntime/core/providers/js/operators/unary.cc @@ -38,8 +38,8 @@ JSEP_ELEMENTWISE_MULTI_TYPED_VERSIONED_KERNEL(Abs, 6, 12, Abs) JSEP_ELEMENTWISE_MULTI_TYPED_KERNEL(Abs, 13, Abs) JSEP_KERNEL_IMPL(Neg, Neg) -JSEP_ELEMENTWISE_VERSIONED_KERNEL(Neg, 6, 12, float, Neg) -JSEP_ELEMENTWISE_KERNEL(Neg, 13, float, Neg) +JSEP_ELEMENTWISE_MULTI_TYPED_VERSIONED_KERNEL(Neg, 6, 12, Neg) +JSEP_ELEMENTWISE_MULTI_TYPED_KERNEL(Neg, 13, Neg) JSEP_KERNEL_IMPL(Floor, Floor) JSEP_ELEMENTWISE_VERSIONED_KERNEL(Floor, 6, 12, float, Floor)