1dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung# model 2dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sungmodel = Model() 3cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sungi1 = Input("op1", "TENSOR_FLOAT32", "{2}") # a vector of 2 float32s 4cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sungi2 = Input("op2", "TENSOR_FLOAT32", "{2}") # another vector of 2 float32s 5cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sungb0 = Int32Scalar("b0", 0) # an int32_t scalar bias 6cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sungi3 = Output("op3", "TENSOR_FLOAT32", "{2}") 7dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sungmodel = model.Operation("ADD", i1, i2, b0).To(i3) 8dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung 9dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung# Example 1. Input in operand 0, 10cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sunginput0 = {i1: # input 0 11dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung [1.0, 2.0], 12cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sung i2: # input 1 13dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung [3.0, 4.0]} 14dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung 15cfe77f9ed8a14f97c7f18e4097492a2776a05d2aI-Jui (Ray) Sungoutput0 = {i3: # output 0 16dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung [4.0, 6.0]} 17dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung 18dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung# Instantiate an example 19dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) SungExample((input0, output0)) 20dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung 21dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung 22dcd2fbf1da7ebdc1aa1b57c74db4fffd2911e3b8I-Jui (Ray) Sung 23