1# model 2model = Model() 3i1 = Input("op1", "TENSOR_FLOAT32", "{2}") # a vector of 2 float32s 4i2 = Input("op2", "TENSOR_FLOAT32", "{2}") # another vector of 2 float32s 5b0 = Int32Scalar("b0", 0) # an int32_t scalar bias 6tmp = Internal("tmp", "TENSOR_FLOAT32", "{2}") 7tmp2 = Internal("tmp2", "TENSOR_FLOAT32", "{2}") 8o3 = Output("op3", "TENSOR_FLOAT32", "{2}") 9i4 = Input("op4", "TENSOR_FLOAT32", "{2}") # another vector of 2 float32s 10model = model.Operation("ADD", i1, i2, b0).To(tmp) 11model = model.Operation("ADD", tmp, i2, b0).To(tmp2) 12model = model.Operation("ADD", tmp2, i4, b0).To(o3) 13 14# Example 1. Input in operand 0, 15input0 = {i1: # input 0 16 [1.0, 2.0], 17 i2: # input 1 18 [3.0, 4.0], 19 i4: # input 4 20 [5.0, 6.0]} 21 22output0 = {o3: # output 0 23 [9.0, 12.0]} 24 25# Instantiate an example 26Example((input0, output0)) 27 28 29 30