Export TVMJS runtime to the runtime_dir Parameters ---------- runtime_dir: str The runtime directory
(runtime_dir)
| 395 | |
| 396 | |
| 397 | def 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) |
nothing calls this directly
no test coverage detected
searching dependent graphs…