MCPcopy Create free account
hub / github.com/apache/tvm / export_runtime

Function export_runtime

python/tvm/contrib/tvmjs.py:397–422  ·  view source on GitHub ↗

Export TVMJS runtime to the runtime_dir Parameters ---------- runtime_dir: str The runtime directory

(runtime_dir)

Source from the content-addressed store, hash-verified

395
396
397def export_runtime(runtime_dir):
398 """Export TVMJS runtime to the runtime_dir
399
400 Parameters
401 ----------
402 runtime_dir: str
403 The runtime directory
404 """
405 web_hint = (
406 "make sure you setup tvm web runtime correctly."
407 + " obtain a copy of TVM source code, set TVM_HOME env variable:\n"
408 + " cd /path/to/tvm/web; make; npm run bundle"
409 )
410
411 jsbundle = find_wasm_lib("tvmjs.bundle.js", optional=True)
412 if not jsbundle:
413 raise RuntimeError("Cannot find tvmjs.bundle.js, " + web_hint)
414
415 wasi = find_wasm_lib("tvmjs_runtime.wasi.js", optional=True)
416 if not wasi:
417 raise RuntimeError("Cannot find tvmjs_runtime.wasi.js, " + web_hint)
418
419 print(f"Copy {jsbundle[0]} to {runtime_dir}")
420 shutil.copy(jsbundle[0], runtime_dir)
421 print(f"Copy {wasi[0]} to {runtime_dir}")
422 shutil.copy(wasi[0], runtime_dir)

Callers

nothing calls this directly

Calls 3

find_wasm_libFunction · 0.90
printFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…