summaryrefslogtreecommitdiff
path: root/nn/runtime/test/specs/V1_3
diff options
context:
space:
mode:
authorXusong Wang <xusongw@google.com>2020-03-19 12:15:10 -0700
committerXusong Wang <xusongw@google.com>2020-03-19 13:13:40 -0700
commit8136419ad3b1025fa383b3a4510abd4d427d7a4f (patch)
tree411052f3baa5f7e654688daa2d780ddb83a6e807 /nn/runtime/test/specs/V1_3
parent28bc28712ef9ae5fc2be41ae53582560c88d3f70 (diff)
downloadml-8136419ad3b1025fa383b3a4510abd4d427d7a4f.tar.gz
Fix SQUEEZE with optional squeeze dims.
Also added tests. Fixes: 116355758 Fixes: 151775127 Test: NNT_static Change-Id: I8904d7caf381970fc3b8869aa6aa09c03acbc6df
Diffstat (limited to 'nn/runtime/test/specs/V1_3')
-rw-r--r--nn/runtime/test/specs/V1_3/squeeze_quant8_signed.mod.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/nn/runtime/test/specs/V1_3/squeeze_quant8_signed.mod.py b/nn/runtime/test/specs/V1_3/squeeze_quant8_signed.mod.py
index e4fcb72e8..fac9bea89 100644
--- a/nn/runtime/test/specs/V1_3/squeeze_quant8_signed.mod.py
+++ b/nn/runtime/test/specs/V1_3/squeeze_quant8_signed.mod.py
@@ -21,24 +21,16 @@ output = Output("output", "TENSOR_QUANT8_ASYMM_SIGNED", "{1, 24}, 1.0, -128")
model = model.Operation("SQUEEZE", i1, squeezeDims).To(output)
-# Example 1. Input in operand 0,
-input0 = {
- i1: # input 0
- [
- -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117,
- -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106,
- -105, -104
- ]
-}
-
-output0 = {
- output: # output 0
- [
- -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117,
- -116, -115, -114, -113, -112, -111, -110, -109, -108, -107, -106,
- -105, -104
- ]
-}
+data = [
+ -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112,
+ -111, -110, -109, -108, -107, -106, -105, -104
+]
# Instantiate an example
-Example((input0, output0))
+Example({i1: data, output: data})
+
+# Test with omitted squeeze dims
+squeezeDims = Parameter("squeezeDims", ["TENSOR_INT32", [0]], value=None)
+output = Output("output", "TENSOR_QUANT8_ASYMM_SIGNED", "{24}, 1.0, -128")
+Model("omitted").Operation("SQUEEZE", i1, squeezeDims).To(output)
+Example({i1: data, output: data})