node-executorch
v0.1.0-alpha.3
Published
Node.js binding for ExecuTorch
Downloads
12
Readme
executorch-node
Node.js binding for ExecuTorch
Installation
npm i node-executorch
Usage
import { Module, Tensor } from 'node-executorch';
const model = await Module.load('path/to/model.pte');
const input = new Tensor('int32', [1, 1], Int32Array.from([ 1 ]));
const outputs = await model.forward([input]);
// Manually release
input.dispose();
model.dispose();
Build From Source
Note: For Windows currently only support cross-compile.
- Fetch ExecuTorch Source
- Build ExecuTorch and install to any path
- Build this project
# Install dependency
yarn
# Build
yarn build --CDCMAKE_PREFIX_PATH=/path/to/install/dir \
--CDEXECUTORCH_SRC_ROOT=/path/to/executorch/src_root
License
BSD