summaryrefslogtreecommitdiff
path: root/tests/nnapi/specs/V1_1/transpose_2D_nnfw.mod.py
blob: 2397aa0d7203af401d6d19da30861c6de6e82d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
model = Model()
i1 = Input("input", "TENSOR_FLOAT32", "{3,4}")
perms = Parameter("perms", "TENSOR_INT32", "{2}", [1, 0])
output = Output("output", "TENSOR_FLOAT32", "{4,3}")

model = model.Operation("TRANSPOSE", i1, perms).To(output)

# Example 1. Input in operand 0,
input0 = {i1: # input 0
          [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}

output0 = {output: # output 0
          [0, 4, 8, 1, 5, 9, 2,  6, 10,  3,  7, 11]}

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