From 42066043b260bf5b965ad7b83a28628d9eb2f3c5 Mon Sep 17 00:00:00 2001 From: Slava Shklyaev Date: Fri, 27 Mar 2020 11:52:54 +0000 Subject: Add WHILE tests with CONSTANT_REFERENCE inputs Before this change, we only had tests with CONSTANT_COPY constant inputs (the default). This change adds CONSTANT_REFERENCE counterparts of those tests. Bug: 137836124 Test: NNT_static Change-Id: If6a0b897636f49b19ac7ccc1bc7ded3eee764744 --- nn/runtime/test/specs/V1_3/while_fib.mod.py | 14 ++++++++------ nn/runtime/test/specs/V1_3/while_sum_of_powers.mod.py | 11 ++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'nn/runtime/test/specs/V1_3') diff --git a/nn/runtime/test/specs/V1_3/while_fib.mod.py b/nn/runtime/test/specs/V1_3/while_fib.mod.py index 16a75dff0..9555c678d 100644 --- a/nn/runtime/test/specs/V1_3/while_fib.mod.py +++ b/nn/runtime/test/specs/V1_3/while_fib.mod.py @@ -103,9 +103,11 @@ def Test(n, fib): example.AddVariations("relaxed", "float16", quant8, quant8_signed) example.AddVariations(AllOutputsAsInternalCoverter()) -# Fibonacci numbers: 1 1 2 3 5 8 -Test(n=1, fib=[1, 1]) -Test(n=2, fib=[1, 2]) -Test(n=3, fib=[2, 3]) -Test(n=4, fib=[3, 5]) -Test(n=5, fib=[5, 8]) +for use_shm_for_weights in [False, True]: + Configuration.use_shm_for_weights = use_shm_for_weights + # Fibonacci numbers: 1 1 2 3 5 8 + Test(n=1, fib=[1, 1]) + Test(n=2, fib=[1, 2]) + Test(n=3, fib=[2, 3]) + Test(n=4, fib=[3, 5]) + Test(n=5, fib=[5, 8]) diff --git a/nn/runtime/test/specs/V1_3/while_sum_of_powers.mod.py b/nn/runtime/test/specs/V1_3/while_sum_of_powers.mod.py index 0adaec476..057f19808 100644 --- a/nn/runtime/test/specs/V1_3/while_sum_of_powers.mod.py +++ b/nn/runtime/test/specs/V1_3/while_sum_of_powers.mod.py @@ -102,8 +102,9 @@ def Test(x, n, sum): example = Example({x: x_data, n: [n_data], sum: sum_data}, name=str(n_data)) example.AddVariations(AllOutputsAsInternalCoverter()) -Test(x=[2, 3], n=1, sum=[1 + 2, 1 + 3]) -Test(x=[2, 3], n=1, sum=[1 + 2, 1 + 3]) -Test(x=[2, 3], n=2, sum=[1 + 2 + 4, 1 + 3 + 9]) -Test(x=[2, 3], n=3, sum=[1 + 2 + 4 + 8, 1 + 3 + 9 + 27]) -Test(x=[2, 3], n=4, sum=[1 + 2 + 4 + 8 + 16, 1 + 3 + 9 + 27 + 81]) +for use_shm_for_weights in [False, True]: + Configuration.use_shm_for_weights = use_shm_for_weights + Test(x=[2, 3], n=1, sum=[1 + 2, 1 + 3]) + Test(x=[2, 3], n=2, sum=[1 + 2 + 4, 1 + 3 + 9]) + Test(x=[2, 3], n=3, sum=[1 + 2 + 4 + 8, 1 + 3 + 9 + 27]) + Test(x=[2, 3], n=4, sum=[1 + 2 + 4 + 8 + 16, 1 + 3 + 9 + 27 + 81]) -- cgit v1.2.3