-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[js/web] allow op test to use f16 type for inputs/outputs (#21664)
### Description allow op test to use f16 type for inputs/outputs. This PR introduces "@petamoriken/float16" as Float16Array polyfill but restricts it to be only used for test runner.
- Loading branch information
Showing
5 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ | ||
"name": "constant 2D float16", | ||
"operator": "Pad", | ||
"opset": { "domain": "", "version": 10 }, | ||
"attributes": [ | ||
{ "name": "mode", "data": "constant", "type": "string" }, | ||
{ "name": "value", "data": 1.2, "type": "float" }, | ||
{ "name": "pads", "data": [3, 2, 2, 3], "type": "ints" } | ||
], | ||
"cases": [ | ||
{ | ||
"name": "[2,2]->[7,7]", | ||
"inputs": [ | ||
{ | ||
"data": [1.0, 2.0, 3.0, 4.5], | ||
"dims": [2, 2], | ||
"type": "float16" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [ | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.0, 2.0, 1.2, 1.2, 1.2, 1.2, 1.2, 3.0, 4.5, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2 | ||
], | ||
"dims": [7, 7], | ||
"type": "float16" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "constant 2D float16", | ||
"operator": "Pad", | ||
"opset": { "domain": "", "version": 19 }, | ||
"attributes": [{ "name": "mode", "data": "constant", "type": "string" }], | ||
"cases": [ | ||
{ | ||
"name": "[2,2]->[7,7]", | ||
"inputs": [ | ||
{ | ||
"data": [1.0, 2.0, 3.0, 4.5], | ||
"dims": [2, 2], | ||
"type": "float16" | ||
}, | ||
{ | ||
"data": [3, 2, 2, 3], | ||
"dims": [4], | ||
"type": "int64" | ||
}, | ||
{ | ||
"data": [1.2], | ||
"dims": [1], | ||
"type": "float16" | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"data": [ | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.0, 2.0, 1.2, 1.2, 1.2, 1.2, 1.2, 3.0, 4.5, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, | ||
1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2 | ||
], | ||
"dims": [7, 7], | ||
"type": "float16" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters