3 i1 = Input("op1", "TENSOR_FLOAT32", "{3,4}") # a matirx of input
4 k = Int32Scalar("k", 2)
5 o1 = Output("op2", "TENSOR_FLOAT32", "{3,2}") # values of output
6 o2 = Output("op3", "TENSOR_INT32", "{3,2}") # indexes of output
7 model = model.Operation("TOPK_V2", i1, k).To([o1, o2])
9 # Example 1. Input in operand 0,
10 input0 = {i1: # input 0
11 [3.123456789123456789, 4.123456789123456789, 5.123456789123456789, 6.123456789123456789,
12 7.123456789123456789, 8.123456789123456789, 9.123456789123456789, 1.123456789123456789,
13 2.123456789123456789, 18.123456789123456789, 19.123456789123456789, 11.123456789123456789]}
15 output0 = {o1: # output 1
16 [6.123456789123456789, 5.123456789123456789,
17 9.123456789123456789, 8.123456789123456789,
18 19.123456789123456789, 18.123456789123456789],
24 # Instantiate an example
25 Example((input0, output0))