1#
2# Copyright (C) 2020 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16base = Input("base", "TENSOR_FLOAT32", "{3, 2, 1}")
17exponent = Input("exponent", "TENSOR_FLOAT32", "{3, 2, 1}")
18output = Output("output", "TENSOR_FLOAT32", "{3, 2, 1}")
19
20base_data = [1, 2, 3, 4, 5, 6]
21exponent_data = [4, 3, 2, 1, 0.5, 0]
22output_data = [base_data[i]**exponent_data[i] for i in range(len(base_data))]
23
24model = Model().Operation("POW", base, exponent).To(output).IntroducedIn("V1_2")
25Example({
26    base: base_data,
27    exponent: exponent_data,
28    output: output_data
29}, model=model).AddVariations("relaxed", "float16")
30