diff --git a/js/web/lib/index.ts b/js/web/lib/index.ts index c5c27a4318049..c3b1c82a8788d 100644 --- a/js/web/lib/index.ts +++ b/js/web/lib/index.ts @@ -7,6 +7,8 @@ // So we import code inside the if-clause to allow bundler remove the code safely. export * from 'onnxruntime-common'; +export * from './onnxjs/model'; +export * as onnxProto from './onnxjs/ort-schema/protobuf/onnx'; import {registerBackend, env} from 'onnxruntime-common'; import {version} from './version'; diff --git a/js/web/lib/onnxjs/graph.ts b/js/web/lib/onnxjs/graph.ts index f16da42815957..3f71e8628da4b 100644 --- a/js/web/lib/onnxjs/graph.ts +++ b/js/web/lib/onnxjs/graph.ts @@ -118,15 +118,19 @@ class Node implements Graph.Node { this.attributes = new Attribute(ProtoUtil.tensorAttributesFromORTFormat(_nodeProto)); } + this.inputNames = []; this.inputs = []; this.outputs = []; + this.outputNames = []; this.executeNode = true; } name: string; opType: string; inputs: number[]; + inputNames: string[]; outputs: number[]; + outputNames: string[]; attributes: Attribute; executeNode: boolean; } @@ -297,6 +301,7 @@ class GraphImpl implements Graph, Graph.Transformer { dataIndices.set(output, dataIndex); } node.outputs.push(dataIndex); + node.outputNames.push(output); if (this._allData[dataIndex]._from !== undefined) { throw new Error(`multiple nodes output to one data value: ${dataIndex}`); @@ -340,6 +345,7 @@ class GraphImpl implements Graph, Graph.Transformer { throw new Error(`unrecognized input '${input}' for node: ${nodeProto.name}`); } node.inputs.push(dataIndex); + node.inputNames.push(input); this._allData[dataIndex]._to.push(i); }