summaryrefslogtreecommitdiff
path: root/tests/nnapi/specs/Ex/transpose_conv_ex_int_1.mod.py
blob: fb8eb72beb51188e3651f842a00254d79d9e3cae (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
# model
model = Model()
i0 = Input("op_shape", "TENSOR_INT32", "{4}")
weights = Input("ker", "TENSOR_INT32", "{1, 3, 3, 1}")
i1 = Input("in", "TENSOR_INT32", "{1, 4, 4, 1}" )
pad = Int32Scalar("pad_same", 1)
s_x = Int32Scalar("stride_x", 1)
s_y = Int32Scalar("stride_y", 1)
i2 = Output("op", "TENSOR_INT32", "{1, 4, 4, 1}")
model = model.Operation("TRANSPOSE_CONV_EX", i0, weights, i1, pad, s_x, s_y).To(i2)

# Example 1. Input in operand 0,
input0 = {i0:  # output shape
          [1, 4, 4, 1],
          i1:  # input 0
          [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
          weights:  # input 1
          [1, 2, 3, 4, 5, 6, 7, 8, 9]}

output0 = {i2:  # output 0
           [29, 62, 83, 75, 99, 192, 237, 198, 207, 372, 417, 330, 263, 446, 485, 365]}

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