diff options
author | Slava Shklyaev <slavash@google.com> | 2020-03-27 11:52:54 +0000 |
---|---|---|
committer | Slava Shklyaev <slavash@google.com> | 2020-04-09 11:27:50 +0100 |
commit | 42066043b260bf5b965ad7b83a28628d9eb2f3c5 (patch) | |
tree | 8d048cce85bac4410b046407db6c12e9b902c3d1 /nn/runtime/test/specs/V1_3 | |
parent | aac77b0aab1d57b059aff97581a621d293dbe8bf (diff) | |
download | ml-42066043b260bf5b965ad7b83a28628d9eb2f3c5.tar.gz |
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
Diffstat (limited to 'nn/runtime/test/specs/V1_3')
-rw-r--r-- | nn/runtime/test/specs/V1_3/while_fib.mod.py | 14 | ||||
-rw-r--r-- | nn/runtime/test/specs/V1_3/while_sum_of_powers.mod.py | 11 |
2 files changed, 14 insertions, 11 deletions
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]) |