summaryrefslogtreecommitdiff
path: root/tests/nnapi/specs/Ex/equal_ex_broadcast_4D_2D_float.mod.py
blob: 5e31698a9c0182c091a4b5138d37d3692c23e5c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# model
model = Model()
i1 = Input("op1", "TENSOR_FLOAT32", "{3, 2, 2, 2}")
i2 = Input("op2", "TENSOR_FLOAT32", "{2, 2}")

i3 = Output("op3", "TENSOR_QUANT8_ASYMM", "{3, 2, 2, 2}, 1.f, 0")
model = model.Operation("EQUAL_EX", i1, i2).To(i3)

# Example 1. Input in operand 0,
input0 = {i1: # input 0
          [4.89, 11.0, 9.75, 10.20,
           8.25, 2.0, 1.15, 0.0,
           3.0, 1.0, 8.25, 6.0,
           8.45, 3.0, 8.25, 1.2,
           0.0, 3.0, 2.0, 7.34,
           4.3, 9.56, 11.0, 3.0],
          i2: # input 1
          [8.25, 3.0, 2.0, 10.20]}

output0 = {i3: # output 0
           [0, 0, 0, 255,
            255, 0, 0, 0,
            0, 0, 0, 0,
            0, 255, 0, 0,
            0, 255, 255, 0,
            0, 0, 0, 0]
          }

# Instantiate an example
Example((input0, output0))