UNPKG

onnxruntime-web

Version:

A Javascript library for running ONNX models on browsers

1,169 lines 151 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify /* eslint-disable */ Object.defineProperty(exports, "__esModule", { value: true }); exports.onnxruntime = void 0; const flatbuffers_1 = require("flatbuffers"); /** * @enum {number} */ var onnxruntime; (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { let AttributeType; (function (AttributeType) { AttributeType[AttributeType["UNDEFINED"] = 0] = "UNDEFINED"; AttributeType[AttributeType["FLOAT"] = 1] = "FLOAT"; AttributeType[AttributeType["INT"] = 2] = "INT"; AttributeType[AttributeType["STRING"] = 3] = "STRING"; AttributeType[AttributeType["TENSOR"] = 4] = "TENSOR"; AttributeType[AttributeType["GRAPH"] = 5] = "GRAPH"; AttributeType[AttributeType["FLOATS"] = 6] = "FLOATS"; AttributeType[AttributeType["INTS"] = 7] = "INTS"; AttributeType[AttributeType["STRINGS"] = 8] = "STRINGS"; AttributeType[AttributeType["TENSORS"] = 9] = "TENSORS"; AttributeType[AttributeType["GRAPHS"] = 10] = "GRAPHS"; AttributeType[AttributeType["SPARSE_TENSOR"] = 11] = "SPARSE_TENSOR"; AttributeType[AttributeType["SPARSE_TENSORS"] = 12] = "SPARSE_TENSORS"; })(AttributeType = fbs.AttributeType || (fbs.AttributeType = {})); })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @enum {number} */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { let DimensionValueType; (function (DimensionValueType) { DimensionValueType[DimensionValueType["UNKNOWN"] = 0] = "UNKNOWN"; DimensionValueType[DimensionValueType["VALUE"] = 1] = "VALUE"; DimensionValueType[DimensionValueType["PARAM"] = 2] = "PARAM"; })(DimensionValueType = fbs.DimensionValueType || (fbs.DimensionValueType = {})); })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @enum {number} */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { let TensorDataType; (function (TensorDataType) { TensorDataType[TensorDataType["UNDEFINED"] = 0] = "UNDEFINED"; TensorDataType[TensorDataType["FLOAT"] = 1] = "FLOAT"; TensorDataType[TensorDataType["UINT8"] = 2] = "UINT8"; TensorDataType[TensorDataType["INT8"] = 3] = "INT8"; TensorDataType[TensorDataType["UINT16"] = 4] = "UINT16"; TensorDataType[TensorDataType["INT16"] = 5] = "INT16"; TensorDataType[TensorDataType["INT32"] = 6] = "INT32"; TensorDataType[TensorDataType["INT64"] = 7] = "INT64"; TensorDataType[TensorDataType["STRING"] = 8] = "STRING"; TensorDataType[TensorDataType["BOOL"] = 9] = "BOOL"; TensorDataType[TensorDataType["FLOAT16"] = 10] = "FLOAT16"; TensorDataType[TensorDataType["DOUBLE"] = 11] = "DOUBLE"; TensorDataType[TensorDataType["UINT32"] = 12] = "UINT32"; TensorDataType[TensorDataType["UINT64"] = 13] = "UINT64"; TensorDataType[TensorDataType["COMPLEX64"] = 14] = "COMPLEX64"; TensorDataType[TensorDataType["COMPLEX128"] = 15] = "COMPLEX128"; TensorDataType[TensorDataType["BFLOAT16"] = 16] = "BFLOAT16"; TensorDataType[TensorDataType["FLOAT8E4M3FN"] = 17] = "FLOAT8E4M3FN"; TensorDataType[TensorDataType["FLOAT8E4M3FNUZ"] = 18] = "FLOAT8E4M3FNUZ"; TensorDataType[TensorDataType["FLOAT8E5M2"] = 19] = "FLOAT8E5M2"; TensorDataType[TensorDataType["FLOAT8E5M2FNUZ"] = 20] = "FLOAT8E5M2FNUZ"; })(TensorDataType = fbs.TensorDataType || (fbs.TensorDataType = {})); })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @enum {number} */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { let NodeType; (function (NodeType) { NodeType[NodeType["Primitive"] = 0] = "Primitive"; NodeType[NodeType["Fused"] = 1] = "Fused"; })(NodeType = fbs.NodeType || (fbs.NodeType = {})); })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @enum {number} */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { let TypeInfoValue; (function (TypeInfoValue) { TypeInfoValue[TypeInfoValue["NONE"] = 0] = "NONE"; TypeInfoValue[TypeInfoValue["tensor_type"] = 1] = "tensor_type"; TypeInfoValue[TypeInfoValue["sequence_type"] = 2] = "sequence_type"; TypeInfoValue[TypeInfoValue["map_type"] = 3] = "map_type"; })(TypeInfoValue = fbs.TypeInfoValue || (fbs.TypeInfoValue = {})); })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class Shape { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns Shape */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param Shape= obj * @returns Shape */ static getRootAsShape(bb, obj) { return (obj || new Shape()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param Shape= obj * @returns Shape */ static getSizePrefixedRootAsShape(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new Shape()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param number index * @param onnxruntime.experimental.fbs.Dimension= obj * @returns onnxruntime.experimental.fbs.Dimension */ dim(index, obj) { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new onnxruntime.experimental.fbs.Dimension()) .__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; } /** * @returns number */ dimLength() { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @param flatbuffers.Builder builder */ static startShape(builder) { builder.startObject(1); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset dimOffset */ static addDim(builder, dimOffset) { builder.addFieldOffset(0, dimOffset, 0); } /** * @param flatbuffers.Builder builder * @param Array.<flatbuffers.Offset> data * @returns flatbuffers.Offset */ static createDimVector(builder, data) { builder.startVector(4, data.length, 4); for (let i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); } return builder.endVector(); } /** * @param flatbuffers.Builder builder * @param number numElems */ static startDimVector(builder, numElems) { builder.startVector(4, numElems, 4); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endShape(builder) { let offset = builder.endObject(); return offset; } static createShape(builder, dimOffset) { Shape.startShape(builder); Shape.addDim(builder, dimOffset); return Shape.endShape(builder); } } fbs.Shape = Shape; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class Dimension { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns Dimension */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param Dimension= obj * @returns Dimension */ static getRootAsDimension(bb, obj) { return (obj || new Dimension()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param Dimension= obj * @returns Dimension */ static getSizePrefixedRootAsDimension(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new Dimension()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param onnxruntime.experimental.fbs.DimensionValue= obj * @returns onnxruntime.experimental.fbs.DimensionValue|null */ value(obj) { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new onnxruntime.experimental.fbs.DimensionValue()) .__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } denotation(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } /** * @param flatbuffers.Builder builder */ static startDimension(builder) { builder.startObject(2); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset valueOffset */ static addValue(builder, valueOffset) { builder.addFieldOffset(0, valueOffset, 0); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset denotationOffset */ static addDenotation(builder, denotationOffset) { builder.addFieldOffset(1, denotationOffset, 0); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endDimension(builder) { let offset = builder.endObject(); return offset; } static createDimension(builder, valueOffset, denotationOffset) { Dimension.startDimension(builder); Dimension.addValue(builder, valueOffset); Dimension.addDenotation(builder, denotationOffset); return Dimension.endDimension(builder); } } fbs.Dimension = Dimension; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class DimensionValue { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns DimensionValue */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param DimensionValue= obj * @returns DimensionValue */ static getRootAsDimensionValue(bb, obj) { return (obj || new DimensionValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param DimensionValue= obj * @returns DimensionValue */ static getSizePrefixedRootAsDimensionValue(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new DimensionValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @returns onnxruntime.experimental.fbs.DimensionValueType */ dimType() { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? /** */ (this.bb.readInt8(this.bb_pos + offset)) : onnxruntime.experimental.fbs.DimensionValueType.UNKNOWN; } /** * @returns flatbuffers.Long */ dimValue() { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0); } dimParam(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } /** * @param flatbuffers.Builder builder */ static startDimensionValue(builder) { builder.startObject(3); } /** * @param flatbuffers.Builder builder * @param onnxruntime.experimental.fbs.DimensionValueType dimType */ static addDimType(builder, dimType) { builder.addFieldInt8(0, dimType, onnxruntime.experimental.fbs.DimensionValueType.UNKNOWN); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Long dimValue */ static addDimValue(builder, dimValue) { builder.addFieldInt64(1, dimValue, builder.createLong(0, 0)); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset dimParamOffset */ static addDimParam(builder, dimParamOffset) { builder.addFieldOffset(2, dimParamOffset, 0); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endDimensionValue(builder) { let offset = builder.endObject(); return offset; } static createDimensionValue(builder, dimType, dimValue, dimParamOffset) { DimensionValue.startDimensionValue(builder); DimensionValue.addDimType(builder, dimType); DimensionValue.addDimValue(builder, dimValue); DimensionValue.addDimParam(builder, dimParamOffset); return DimensionValue.endDimensionValue(builder); } } fbs.DimensionValue = DimensionValue; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class TensorTypeAndShape { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns TensorTypeAndShape */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param TensorTypeAndShape= obj * @returns TensorTypeAndShape */ static getRootAsTensorTypeAndShape(bb, obj) { return (obj || new TensorTypeAndShape()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param TensorTypeAndShape= obj * @returns TensorTypeAndShape */ static getSizePrefixedRootAsTensorTypeAndShape(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new TensorTypeAndShape()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @returns onnxruntime.experimental.fbs.TensorDataType */ elemType() { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? /** */ (this.bb.readInt32(this.bb_pos + offset)) : onnxruntime.experimental.fbs.TensorDataType.UNDEFINED; } /** * @param onnxruntime.experimental.fbs.Shape= obj * @returns onnxruntime.experimental.fbs.Shape|null */ shape(obj) { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? (obj || new onnxruntime.experimental.fbs.Shape()) .__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } /** * @param flatbuffers.Builder builder */ static startTensorTypeAndShape(builder) { builder.startObject(2); } /** * @param flatbuffers.Builder builder * @param onnxruntime.experimental.fbs.TensorDataType elemType */ static addElemType(builder, elemType) { builder.addFieldInt32(0, elemType, onnxruntime.experimental.fbs.TensorDataType.UNDEFINED); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset shapeOffset */ static addShape(builder, shapeOffset) { builder.addFieldOffset(1, shapeOffset, 0); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endTensorTypeAndShape(builder) { let offset = builder.endObject(); return offset; } static createTensorTypeAndShape(builder, elemType, shapeOffset) { TensorTypeAndShape.startTensorTypeAndShape(builder); TensorTypeAndShape.addElemType(builder, elemType); TensorTypeAndShape.addShape(builder, shapeOffset); return TensorTypeAndShape.endTensorTypeAndShape(builder); } } fbs.TensorTypeAndShape = TensorTypeAndShape; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class MapType { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns MapType */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param MapType= obj * @returns MapType */ static getRootAsMapType(bb, obj) { return (obj || new MapType()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param MapType= obj * @returns MapType */ static getSizePrefixedRootAsMapType(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new MapType()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @returns onnxruntime.experimental.fbs.TensorDataType */ keyType() { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? /** */ (this.bb.readInt32(this.bb_pos + offset)) : onnxruntime.experimental.fbs.TensorDataType.UNDEFINED; } /** * @param onnxruntime.experimental.fbs.TypeInfo= obj * @returns onnxruntime.experimental.fbs.TypeInfo|null */ valueType(obj) { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? (obj || new onnxruntime.experimental.fbs.TypeInfo()) .__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } /** * @param flatbuffers.Builder builder */ static startMapType(builder) { builder.startObject(2); } /** * @param flatbuffers.Builder builder * @param onnxruntime.experimental.fbs.TensorDataType keyType */ static addKeyType(builder, keyType) { builder.addFieldInt32(0, keyType, onnxruntime.experimental.fbs.TensorDataType.UNDEFINED); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset valueTypeOffset */ static addValueType(builder, valueTypeOffset) { builder.addFieldOffset(1, valueTypeOffset, 0); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endMapType(builder) { let offset = builder.endObject(); return offset; } static createMapType(builder, keyType, valueTypeOffset) { MapType.startMapType(builder); MapType.addKeyType(builder, keyType); MapType.addValueType(builder, valueTypeOffset); return MapType.endMapType(builder); } } fbs.MapType = MapType; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class SequenceType { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns SequenceType */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param SequenceType= obj * @returns SequenceType */ static getRootAsSequenceType(bb, obj) { return (obj || new SequenceType()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param SequenceType= obj * @returns SequenceType */ static getSizePrefixedRootAsSequenceType(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new SequenceType()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param onnxruntime.experimental.fbs.TypeInfo= obj * @returns onnxruntime.experimental.fbs.TypeInfo|null */ elemType(obj) { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new onnxruntime.experimental.fbs.TypeInfo()) .__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } /** * @param flatbuffers.Builder builder */ static startSequenceType(builder) { builder.startObject(1); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset elemTypeOffset */ static addElemType(builder, elemTypeOffset) { builder.addFieldOffset(0, elemTypeOffset, 0); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endSequenceType(builder) { let offset = builder.endObject(); return offset; } static createSequenceType(builder, elemTypeOffset) { SequenceType.startSequenceType(builder); SequenceType.addElemType(builder, elemTypeOffset); return SequenceType.endSequenceType(builder); } } fbs.SequenceType = SequenceType; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class EdgeEnd { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns EdgeEnd */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @returns number */ nodeIndex() { return this.bb.readUint32(this.bb_pos); } /** * @returns number */ srcArgIndex() { return this.bb.readInt32(this.bb_pos + 4); } /** * @returns number */ dstArgIndex() { return this.bb.readInt32(this.bb_pos + 8); } /** * @param flatbuffers.Builder builder * @param number node_index * @param number src_arg_index * @param number dst_arg_index * @returns flatbuffers.Offset */ static createEdgeEnd(builder, node_index, src_arg_index, dst_arg_index) { builder.prep(4, 12); builder.writeInt32(dst_arg_index); builder.writeInt32(src_arg_index); builder.writeInt32(node_index); return builder.offset(); } } fbs.EdgeEnd = EdgeEnd; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class NodeEdge { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns NodeEdge */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param NodeEdge= obj * @returns NodeEdge */ static getRootAsNodeEdge(bb, obj) { return (obj || new NodeEdge()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param NodeEdge= obj * @returns NodeEdge */ static getSizePrefixedRootAsNodeEdge(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new NodeEdge()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @returns number */ nodeIndex() { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } /** * @param number index * @param onnxruntime.experimental.fbs.EdgeEnd= obj * @returns onnxruntime.experimental.fbs.EdgeEnd */ inputEdges(index, obj) { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? (obj || new onnxruntime.experimental.fbs.EdgeEnd()) .__init(this.bb.__vector(this.bb_pos + offset) + index * 12, this.bb) : null; } /** * @returns number */ inputEdgesLength() { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @param number index * @param onnxruntime.experimental.fbs.EdgeEnd= obj * @returns onnxruntime.experimental.fbs.EdgeEnd */ outputEdges(index, obj) { let offset = this.bb.__offset(this.bb_pos, 8); return offset ? (obj || new onnxruntime.experimental.fbs.EdgeEnd()) .__init(this.bb.__vector(this.bb_pos + offset) + index * 12, this.bb) : null; } /** * @returns number */ outputEdgesLength() { let offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @param flatbuffers.Builder builder */ static startNodeEdge(builder) { builder.startObject(3); } /** * @param flatbuffers.Builder builder * @param number nodeIndex */ static addNodeIndex(builder, nodeIndex) { builder.addFieldInt32(0, nodeIndex, 0); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset inputEdgesOffset */ static addInputEdges(builder, inputEdgesOffset) { builder.addFieldOffset(1, inputEdgesOffset, 0); } /** * @param flatbuffers.Builder builder * @param number numElems */ static startInputEdgesVector(builder, numElems) { builder.startVector(12, numElems, 4); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset outputEdgesOffset */ static addOutputEdges(builder, outputEdgesOffset) { builder.addFieldOffset(2, outputEdgesOffset, 0); } /** * @param flatbuffers.Builder builder * @param number numElems */ static startOutputEdgesVector(builder, numElems) { builder.startVector(12, numElems, 4); } /** * @param flatbuffers.Builder builder * @returns flatbuffers.Offset */ static endNodeEdge(builder) { let offset = builder.endObject(); return offset; } static createNodeEdge(builder, nodeIndex, inputEdgesOffset, outputEdgesOffset) { NodeEdge.startNodeEdge(builder); NodeEdge.addNodeIndex(builder, nodeIndex); NodeEdge.addInputEdges(builder, inputEdgesOffset); NodeEdge.addOutputEdges(builder, outputEdgesOffset); return NodeEdge.endNodeEdge(builder); } } fbs.NodeEdge = NodeEdge; })(fbs = experimental.fbs || (experimental.fbs = {})); })(experimental = onnxruntime.experimental || (onnxruntime.experimental = {})); })(onnxruntime || (exports.onnxruntime = onnxruntime = {})); /** * @constructor */ (function (onnxruntime) { var experimental; (function (experimental) { var fbs; (function (fbs) { class Node { constructor() { this.bb = null; this.bb_pos = 0; } /** * @param number i * @param flatbuffers.ByteBuffer bb * @returns Node */ __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * @param flatbuffers.ByteBuffer bb * @param Node= obj * @returns Node */ static getRootAsNode(bb, obj) { return (obj || new Node()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } /** * @param flatbuffers.ByteBuffer bb * @param Node= obj * @returns Node */ static getSizePrefixedRootAsNode(bb, obj) { bb.setPosition(bb.position() + flatbuffers_1.flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new Node()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } name(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } docString(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } domain(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } /** * @returns number */ sinceVersion() { let offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; } /** * @returns number */ index() { let offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } opType(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } /** * @returns onnxruntime.experimental.fbs.NodeType */ type() { let offset = this.bb.__offset(this.bb_pos, 16); return offset ? /** */ (this.bb.readInt32(this.bb_pos + offset)) : onnxruntime.experimental.fbs.NodeType.Primitive; } executionProviderType(optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 18); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } inputs(index, optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; } /** * @returns number */ inputsLength() { let offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } outputs(index, optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; } /** * @returns number */ outputsLength() { let offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @param number index * @param onnxruntime.experimental.fbs.Attribute= obj * @returns onnxruntime.experimental.fbs.Attribute */ attributes(index, obj) { let offset = this.bb.__offset(this.bb_pos, 24); return offset ? (obj || new onnxruntime.experimental.fbs.Attribute()) .__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; } /** * @returns number */ attributesLength() { let offset = this.bb.__offset(this.bb_pos, 24); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @param number index * @returns number */ inputArgCounts(index) { let offset = this.bb.__offset(this.bb_pos, 26); return offset ? this.bb.readInt32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; } /** * @returns number */ inputArgCountsLength() { let offset = this.bb.__offset(this.bb_pos, 26); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @returns Int32Array */ inputArgCountsArray() { let offset = this.bb.__offset(this.bb_pos, 26); return offset ? new Int32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; } implicitInputs(index, optionalEncoding) { let offset = this.bb.__offset(this.bb_pos, 28); return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null; } /** * @returns number */ implicitInputsLength() { let offset = this.bb.__offset(this.bb_pos, 28); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; } /** * @param flatbuffers.Builder builder */ static startNode(builder) { builder.startObject(13); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset nameOffset */ static addName(builder, nameOffset) { builder.addFieldOffset(0, nameOffset, 0); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset docStringOffset */ static addDocString(builder, docStringOffset) { builder.addFieldOffset(1, docStringOffset, 0); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset domainOffset */ static addDomain(builder, domainOffset) { builder.addFieldOffset(2, domainOffset, 0); } /** * @param flatbuffers.Builder builder * @param number sinceVersion */ static addSinceVersion(builder, sinceVersion) { builder.addFieldInt32(3, sinceVersion, 0); } /** * @param flatbuffers.Builder builder * @param number index */ static addIndex(builder, index) { builder.addFieldInt32(4, index, 0); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset opTypeOffset */ static addOpType(builder, opTypeOffset) { builder.addFieldOffset(5, opTypeOffset, 0); } /** * @param flatbuffers.Builder builder * @param onnxruntime.experimental.fbs.NodeType type */ static addType(builder, type) { builder.addFieldInt32(6, type, onnxruntime.experimental.fbs.NodeType.Primitive); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset executionProviderTypeOffset */ static addExecutionProviderType(builder, executionProviderTypeOffset) { builder.addFieldOffset(7, executionProviderTypeOffset, 0); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset inputsOffset */ static addInputs(builder, inputsOffset) { builder.addFieldOffset(8, inputsOffset, 0); } /** * @param flatbuffers.Builder builder * @param Array.<flatbuffers.Offset> data * @returns flatbuffers.Offset */ static createInputsVector(builder, data) { builder.startVector(4, data.length, 4); for (let i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); } return builder.endVector(); } /** * @param flatbuffers.Builder builder * @param number numElems */ static startInputsVector(builder, numElems) { builder.startVector(4, numElems, 4); } /** * @param flatbuffers.Builder builder * @param flatbuffers.Offset outputsOffset */ static addOutputs(builder, outputsOffset) { builder.addFieldOffset(9, outputsOffset, 0); } /** * @param flatbuffers.Builder builder * @param Array.<flatbuffers.Offset> data * @returns flatbuffers.Offset */ static createOutputsVector(builder, data) { builder.startVector(4, data.length, 4); for (let i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); } return builder.endVector()