From 33ecde9af1cc38634f6431d2f1124502a46e20c9 Mon Sep 17 00:00:00 2001 From: xhcao Date: Wed, 16 Aug 2023 12:18:13 +0800 Subject: [PATCH] [js/webgpu] Fix reshape int32 test case (#17113) Co-authored-by: Xing Xu Co-authored-by: Xing Xu --- js/web/test/data/ops/reshape.jsonc | 97 +++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/js/web/test/data/ops/reshape.jsonc b/js/web/test/data/ops/reshape.jsonc index a7639040f1..7f16d26914 100644 --- a/js/web/test/data/ops/reshape.jsonc +++ b/js/web/test/data/ops/reshape.jsonc @@ -1,6 +1,6 @@ [ { - "name": "Reshape with '0' and '-1' in the shape tensor input", + "name": "Reshape float32 with '0' and '-1' in the shape tensor input", "operator": "Reshape", "attributes": [], "cases": [ @@ -93,5 +93,100 @@ ] } ] + }, + { + "name": "Reshape int32 with '0' and '-1' in the shape tensor input", + "operator": "Reshape", + "attributes": [], + "cases": [ + { + "name": "T[0]", + "inputs": [ + { + "data": [1, 1, 1, 1], + "dims": [2, 2], + "type": "int32" + }, + { + "data": [-1, 0], + "dims": [2], + "type": "int64" + } + ], + "outputs": [ + { + "data": [1, 1, 1, 1], + "dims": [2, 2], + "type": "int32" + } + ] + }, + { + "name": "Scalar to 1D", + "inputs": [ + { + "data": [1], + "dims": [], + "type": "int32" + }, + { + "data": [1], + "dims": [1], + "type": "int64" + } + ], + "outputs": [ + { + "data": [1], + "dims": [1], + "type": "int32" + } + ] + }, + { + "name": "Scalar to 2D", + "inputs": [ + { + "data": [1], + "dims": [], + "type": "int32" + }, + { + "data": [1, 1], + "dims": [2], + "type": "int64" + } + ], + "outputs": [ + { + "data": [1], + "dims": [1, 1], + "type": "int32" + } + ] + }, + { + "name": "Scalar to 2D with -1 in shape hints", + "inputs": [ + { + "data": [1], + "dims": [], + "type": "int32" + }, + { + "data": [-1, 1], + "dims": [2], + "type": "int64" + } + ], + "outputs": [ + { + "data": [1], + "dims": [1, 1], + "type": "int32" + } + ] + } + ] } ]