Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / tests / nnapi / specs / V1_0 / add_broadcast_4D_2D_after_nops_float_nnfw.mod.py
1 # model
2 model = Model()
3
4 i1 = Input("op1", "TENSOR_FLOAT32", "{1, 1, 3, 4}")
5 axis0 = Int32Scalar("axis0", 0)
6
7 i3 = Input("op3", "TENSOR_FLOAT32", "{1, 2, 1, 1}")
8 i4 = Parameter("op4", "TENSOR_INT32", "{4}", [1, 2, 1, 1])
9
10 i5 = Internal("op5", "TENSOR_FLOAT32", "{1, 1, 3, 4}")
11 i6 = Internal("op6", "TENSOR_FLOAT32", "{1, 2, 1, 1}")
12
13 i7 = Output("op7", "TENSOR_FLOAT32", "{1, 2, 3, 4}")
14
15 act = Int32Scalar("act", 0)
16
17 model = model.Operation("CONCATENATION", i1, axis0).To(i5) # Actually NOP
18 model = model.Operation("RESHAPE", i3, i4).To(i6) # Actually NOP
19 model = model.Operation("ADD", i5, i6, act).To(i7)
20
21 # Example 1. Input in operand 0,
22 input0 = {i1: # input 0
23           [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
24           i3: # input 1
25           [100, 200]}
26
27 output0 = {i7: # output 0
28            [101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212]}
29
30 # Instantiate an example
31 Example((input0, output0))