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

Function _normalize_export_func

python/tvm/testing/runner.py:60–77  ·  view source on GitHub ↗
(export_func, output_format)

Source from the content-addressed store, hash-verified

58
59
60def _normalize_export_func(export_func, output_format) -> tuple[Callable, str]:
61 from tvm.support import ndk, tar
62
63 def export_with(func):
64 return lambda mod, path: mod.export_library(path, fcompile=func)
65
66 if export_func == "tar":
67 export_func = export_with(tar.tar)
68 output_format = "tar"
69 elif export_func == "ndk":
70 export_func = export_with(ndk.create_shared)
71 output_format = "so"
72 elif callable(export_func):
73 if output_format is None:
74 raise ValueError("output_format must be specified if `export_func` is callable")
75 else:
76 raise ValueError(f"Unsupported export_func: {export_func}")
77 return export_func, output_format
78
79
80def local_run( # pylint: disable=too-many-arguments,too-many-locals

Callers 2

local_runFunction · 0.85
rpc_runFunction · 0.85

Calls 1

export_withFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…