Title here
Summary here
import { parseOnnx } from '@wetron/onnx';
function parseOnnx(bytes: Uint8Array): ModelGraph;value_infoModelGraph.initializers, plus inline bytes via ModelGraph.weights.source.get(name) when weights.kind === "available"graph.opsets: ReadonlyMap<string, number> (domain -> version; "" = ai.onnx)value_info entries in the graph protoIf, Loop, and Scan subgraphs are inlined with prefixed names (<parent>/<attrName>/...) up to a depth of 4node.domain is set for non-standard domains (e.g. com.microsoft, ai.onnx.ml). It is absent for standard ai.onnx operators.
graph.opsets is only set by the ONNX parser. Pass it to NodePropertyPanel via opsets={graph?.opsets} to show opset versions in the node header.
weights.kind === "available"; the parser indexes them but does not decode until requested. See
Weights for decodeWeight, decodeFirstN, and computeStats.data_location = EXTERNAL set { kind: "external", format: "onnx" }. Load them via loadOnnxExternalWeightsFromUrl(modelBytes, baseUrl) from @wetron/onnx - see
Weights.protobufjs - not a hand-rolled binary reader.