diff options
author | Lev Proleev <levp@google.com> | 2020-04-02 17:51:40 +0100 |
---|---|---|
committer | Lev Proleev <levp@google.com> | 2020-04-06 13:39:26 +0100 |
commit | d7540567556011e6fff39135a13d041150bd26f3 (patch) | |
tree | 5461667852d35665e1e5872000eef99ff4737d45 /nn/runtime/test/specs | |
parent | cd6cb96f6db150c821d135142341f31f641b30ca (diff) | |
download | ml-d7540567556011e6fff39135a13d041150bd26f3.tar.gz |
Add POW op test with same inputs shapes to increase code coverage
Fix: 129571542
Test: NNTest_static
Change-Id: Ie94a0a36b1df10afff6a5269f9375f99bc6ffba7
Diffstat (limited to 'nn/runtime/test/specs')
-rw-r--r-- | nn/runtime/test/specs/V1_3/pow_same_shape.mod.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nn/runtime/test/specs/V1_3/pow_same_shape.mod.py b/nn/runtime/test/specs/V1_3/pow_same_shape.mod.py new file mode 100644 index 000000000..f44f167ce --- /dev/null +++ b/nn/runtime/test/specs/V1_3/pow_same_shape.mod.py @@ -0,0 +1,29 @@ +# +# Copyright (C) 2020 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +base = Input("base", "TENSOR_FLOAT32", "{3, 2, 1}") +exponent = Input("exponent", "TENSOR_FLOAT32", "{3, 2, 1}") +output = Output("output", "TENSOR_FLOAT32", "{3, 2, 1}") + +base_data = [1, 2, 3, 4, 5, 6] +exponent_data = [4, 3, 2, 1, 0.5, 0] +output_data = [base_data[i]**exponent_data[i] for i in range(len(base_data))] + +model = Model().Operation("POW", base, exponent).To(output).IntroducedIn("V1_2") +Example({ + base: base_data, + exponent: exponent_data, + output: output_data +}, model=model).AddVariations("relaxed", "float16") |