import tvm from tvm.ir.module import IRModule from tvm import te import numpy as np
A = te.placeholder((8,), dtype=“float32”, name=“A”) B = te.compute((8,), lambda i:A[i]+1.0, name=“B”)
func = te.create_prim_func([A,B])
ir_module_from_te = IRModule({“main”: func})
mod_from_te = tvm.build(ir_module_from_te, target=“c”)
a = tvm.nd.array(np.arange(8).astype(“float32”)) print(a) b = tvm.nd.array(np.zeros((8,)).astype(“float32”)) mod_from_te(a,b) print(b)