1model = Model()
2i1 = Input("input", "TENSOR_FLOAT32", "{1, 4, 4, 2}")
3block = Int32Scalar("block_size", 2)
4output = Output("output", "TENSOR_FLOAT32", "{1, 2, 2, 8}")
5
6model = model.Operation("SPACE_TO_DEPTH", i1, block).To(output)
7
8# Example 1. Input in operand 0,
9input0 = {i1: # input 0
10          [10,   20,  11,  21,  12,  22, 13,   23,
11           14,   24,  15,  25,  16,  26, 17,   27,
12           18,   28,  19,  29, 110, 210, 111, 211,
13          112,  212, 113, 213, 114, 214, 115, 215]}
14
15output0 = {output: # output 0
16           [10,   20,  11,  21,  14,  24,  15,  25,
17            12,   22,  13,  23,  16,  26,  17,  27,
18            18,   28,  19,  29, 112, 212, 113, 213,
19            110, 210, 111, 211, 114, 214, 115, 215]}
20
21# Instantiate an example
22Example((input0, output0))
23