MCPcopy Index your code
hub / github.com/apache/tvm / save_object

Function save_object

tests/python/runtime/test_runtime_module_load.py:53–70  ·  view source on GitHub ↗
(names)

Source from the content-addressed store, hash-verified

51 temp = utils.tempdir()
52
53 def save_object(names):
54 n = te.size_var("n")
55 Ab = tvm.tirx.decl_buffer((n,), dtype)
56 i = te.var("i")
57 # for i in 0 to n-1:
58 stmt = tvm.tirx.For(
59 i,
60 0,
61 n - 1,
62 tvm.tirx.ForKind.SERIAL,
63 tvm.tirx.BufferStore(Ab, tvm.tirx.BufferLoad(Ab, [i]) + 1, [i + 1]),
64 )
65 mod = tvm.IRModule.from_expr(
66 tvm.tirx.PrimFunc([Ab], stmt).with_attr("global_symbol", "main")
67 )
68 m = tvm.tirx.build(mod, target=target)
69 for name in names:
70 m.write_to_file(name)
71
72 path_obj = temp.relpath("test.o")
73 path_ll = temp.relpath("test.ll")

Callers 1

test_dso_module_loadFunction · 0.85

Calls 3

from_exprMethod · 0.80
with_attrMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…