Skip to content

Function: modelGraphFromOnnx()

ts
function modelGraphFromOnnx(graph, opts?): ModelGraph;

Defined in: ml/model.ts:262

Build a ModelGraph from an ONNX graph dict — the framework-neutral path (works for models exported from PyTorch, TensorFlow, JAX, sklearn…). Edges are recovered by matching each node's inputs to the node that produced them; weights (initializers) are folded into the consuming node's params.

Parameters

ParameterType
graphOnnxGraph
optsOnnxAdapterOptions

Returns

ModelGraph

MIT licensed. WebGL2 required.