Skip to content

Commit

Permalink
[js/webgpu] Include Support for neg.int32 (microsoft#17374)
Browse files Browse the repository at this point in the history
### Description
Include Support for neg.int32



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
jchen351 authored Sep 6, 2023
1 parent a3a1237 commit 8914fe6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
File renamed without changes.
26 changes: 26 additions & 0 deletions js/web/test/data/ops/neg-int32.jsonc
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}
]
3 changes: 2 additions & 1 deletion js/web/test/suite-test-list.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@
],
"ops": [
"abs.jsonc",
"abs_int32.jsonc",
"abs-int32.jsonc",
"acos.jsonc",
"add.jsonc",
"add_int32.jsonc",
Expand Down Expand Up @@ -1351,6 +1351,7 @@
"mul.jsonc",
"mul_int32.jsonc",
//"neg.jsonc",
"neg-int32.jsonc",
"not.jsonc",
//"or.jsonc",
"layer-norm.jsonc",
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/js/operators/unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8914fe6

Please sign in to comment.