Imported Upstream version 1.8.0
[platform/core/ml/nnfw.git] / tests / nnapi / specs / Ex / stateless_random_uniform_ex_nnfw.mod.py
1 #
2 # Copyright (C) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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 #
16
17
18 model = Model()
19
20 i1 = Input("input1", "TENSOR_INT32", "{1}")
21 i2 = Input("input2", "TENSOR_INT32", "{2}")
22
23 o1 = Output("output0", "TENSOR_FLOAT32", "{10}")
24
25 model = model.Operation("STATELESS_RANDOM_UNIFORM_EX", i1, i2).To(o1)
26
27 # Example.
28 input0 = {
29   i1 : [10],  #input1
30   i2 : [1, 1] #input2
31 }
32
33 output0 = {
34   o1: [0.09827709, 0.14063823, 0.4553436,
35       0.10658443, 0.2075988, 0.30841374,
36       0.7489233, 0.90613365, 0.63342273, 
37       0.37854457]
38 }
39
40 Example((input0, output0))