[js/webgpu] Include Support for neg.int32 (#17374)

### 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. -->
This commit is contained in:
Jian Chen 2023-09-06 12:00:16 -07:00 committed by GitHub
parent a3a1237270
commit 8914fe687b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 3 deletions

View file

@ -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"
}
]
}
]
}
]

View file

@ -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",

View file

@ -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)