diff --git "a/demo/ort-phi3/dist/esm/ort.min.js.map" "b/demo/ort-phi3/dist/esm/ort.min.js.map" new file mode 100644--- /dev/null +++ "b/demo/ort-phi3/dist/esm/ort.min.js.map" @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../common/lib/backend-impl.ts", "../../../common/lib/backend.ts", "../../../common/lib/version.ts", "../../../common/lib/env-impl.ts", "../../../common/lib/env.ts", "../../../common/lib/tensor-conversion-impl.ts", "../../../common/lib/tensor-factory-impl.ts", "../../../common/lib/tensor-impl-type-mapping.ts", "../../../common/lib/tensor-utils-impl.ts", "../../../common/lib/tensor-impl.ts", "../../../common/lib/tensor.ts", "../../../common/lib/trace.ts", "../../../common/lib/inference-session-impl.ts", "../../../common/lib/inference-session.ts", "../../../common/lib/tensor-conversion.ts", "../../../common/lib/tensor-factory.ts", "../../../common/lib/onnx-model.ts", "../../../common/lib/onnx-value.ts", "../../../common/lib/training-session-impl.ts", "../../../common/lib/training-session.ts", "../../../common/lib/index.ts", "../../lib/onnxjs/instrument.ts", "../../lib/onnxjs/opset.ts", "../../node_modules/guid-typescript/dist/guid.js", "../../node_modules/long/index.js", "../../node_modules/flatbuffers/js/flatbuffers.mjs", "../../lib/onnxjs/ort-schema/flatbuffers/ort-generated.ts", "../../node_modules/@protobufjs/aspromise/index.js", "../../node_modules/@protobufjs/base64/index.js", "../../node_modules/@protobufjs/eventemitter/index.js", "../../node_modules/@protobufjs/float/index.js", "../../node_modules/@protobufjs/inquire/index.js", "../../node_modules/@protobufjs/utf8/index.js", "../../node_modules/@protobufjs/pool/index.js", "../../node_modules/protobufjs/src/util/longbits.js", "../../node_modules/protobufjs/src/util/minimal.js", "../../node_modules/protobufjs/src/writer.js", "../../node_modules/protobufjs/src/writer_buffer.js", "../../node_modules/protobufjs/src/reader.js", "../../node_modules/protobufjs/src/reader_buffer.js", "../../node_modules/protobufjs/src/rpc/service.js", "../../node_modules/protobufjs/src/rpc.js", "../../node_modules/protobufjs/src/roots.js", "../../node_modules/protobufjs/src/index-minimal.js", "../../node_modules/protobufjs/minimal.js", "../../lib/onnxjs/ort-schema/protobuf/onnx.js", "../../lib/onnxjs/util.ts", "../../lib/onnxjs/tensor.ts", "../../lib/onnxjs/backends/webgl/glsl-source.ts", "../../lib/onnxjs/backends/webgl/types.ts", "../../lib/onnxjs/backends/webgl/utils.ts", "../../lib/onnxjs/backends/webgl/ops/packing-utils.ts", "../../lib/onnxjs/backends/webgl/ops/pack.ts", "../../lib/onnxjs/backends/webgl/ops/reshape-packed.ts", "../../lib/onnxjs/backends/webgl/ops/uint8-encode.ts", "../../lib/onnxjs/backends/webgl/ops/unpack.ts", "../../lib/onnxjs/backends/webgl/texture-data-encoder.ts", "../../lib/onnxjs/backends/webgl/texture-layout.ts", "../../lib/onnxjs/backends/webgl/inference-handler.ts", "../../lib/onnxjs/attribute-with-cache-key.ts", "../../lib/onnxjs/backends/webgl/ops/batch-normalization.ts", "../../lib/onnxjs/backends/webgl/glsl-definitions.ts", "../../lib/onnxjs/backends/webgl/ops/binary-op.ts", "../../lib/onnxjs/backends/webgl/ops/cast.ts", "../../lib/onnxjs/backends/webgl/ops/concat-packed.ts", "../../lib/onnxjs/backends/webgl/ops/concat.ts", "../../lib/onnxjs/backends/webgl/ops/unary-op.ts", "../../lib/onnxjs/backends/webgl/ops/fuse-utils.ts", "../../lib/onnxjs/backends/webgl/ops/conv-grouped.ts", "../../lib/onnxjs/backends/webgl/ops/im2col-pack.ts", "../../lib/onnxjs/backends/webgl/ops/matmul.ts", "../../lib/onnxjs/backends/webgl/ops/matmul-pack.ts", "../../lib/onnxjs/backends/webgl/ops/conv-pack.ts", "../../lib/onnxjs/backends/webgl/ops/im2col.ts", "../../lib/onnxjs/backends/webgl/ops/dot-product.ts", "../../lib/onnxjs/backends/webgl/ops/conv.ts", "../../lib/onnxjs/backends/webgl/ops/conv-transpose.ts", "../../lib/onnxjs/backends/webgl/ops/transpose.ts", "../../lib/onnxjs/backends/webgl/ops/depth-to-space.ts", "../../lib/onnxjs/backends/webgl/ops/flatten.ts", "../../lib/onnxjs/operators.ts", "../../lib/onnxjs/backends/webgl/ops/gather.ts", "../../lib/onnxjs/backends/webgl/ops/gemm.ts", "../../lib/onnxjs/backends/webgl/ops/image-scaler.ts", "../../lib/onnxjs/backends/webgl/ops/instance-normalization.ts", "../../lib/onnxjs/backends/webgl/ops/lrn.ts", "../../lib/onnxjs/backends/webgl/ops/pad.ts", "../../lib/onnxjs/backends/webgl/ops/pool.ts", "../../lib/onnxjs/backends/webgl/ops/reduce.ts", "../../lib/onnxjs/backends/webgl/ops/reshape.ts", "../../lib/onnxjs/backends/webgl/ops/upsample.ts", "../../lib/onnxjs/backends/webgl/ops/resize-packed.ts", "../../lib/onnxjs/backends/webgl/ops/shape.ts", "../../lib/onnxjs/backends/webgl/ops/slice.ts", "../../lib/onnxjs/backends/webgl/ops/softmax.ts", "../../lib/onnxjs/backends/webgl/ops/split.ts", "../../lib/onnxjs/backends/webgl/ops/squeeze.ts", "../../lib/onnxjs/backends/webgl/ops/sum.ts", "../../lib/onnxjs/backends/webgl/ops/tile.ts", "../../lib/onnxjs/backends/webgl/ops/unsqueeze.ts", "../../lib/onnxjs/backends/webgl/op-resolve-rules.ts", "../../lib/onnxjs/backends/webgl/glsl-function-inliner.ts", "../../lib/onnxjs/backends/webgl/texture-layout-strategy.ts", "../../lib/onnxjs/backends/webgl/glsl-coordinate-lib.ts", "../../lib/onnxjs/backends/webgl/glsl-encoding-lib.ts", "../../lib/onnxjs/backends/webgl/glsl-fragcolor-lib.ts", "../../lib/onnxjs/backends/webgl/glsl-shape-utils-lib.ts", "../../lib/onnxjs/backends/webgl/glsl-vec-lib.ts", "../../lib/onnxjs/backends/webgl/glsl-registered-libs.ts", "../../lib/onnxjs/backends/webgl/glsl-preprocessor.ts", "../../lib/onnxjs/backends/webgl/program-manager.ts", "../../lib/onnxjs/backends/webgl/texture-manager.ts", "../../lib/onnxjs/backends/webgl/session-handler.ts", "../../lib/onnxjs/backends/webgl/webgl-context.ts", "../../lib/onnxjs/backends/webgl/webgl-context-factory.ts", "../../lib/onnxjs/backends/backend-webgl.ts", "../../lib/onnxjs/backend.ts", "../../lib/onnxjs/execution-plan.ts", "../../lib/onnxjs/attribute.ts", "../../lib/onnxjs/graph.ts", "../../lib/onnxjs/model.ts", "../../lib/onnxjs/session.ts", "../../lib/onnxjs/session-handler-inference.ts", "../../lib/backend-onnxjs.ts", "nodejs-ignore:fs", "nodejs-ignore:path", "../../lib/wasm/binding/ort-wasm.js", "nodejs-ignore:worker_threads", "nodejs-ignore:perf_hooks", "nodejs-ignore:os", "../../lib/wasm/binding/ort-wasm-threaded.js", "../../lib/wasm/binding/ort-wasm-threaded.worker.js", "../../lib/wasm/wasm-factory.ts", "../../lib/wasm/wasm-utils.ts", "../../lib/wasm/run-options.ts", "../../lib/wasm/session-options.ts", "../../lib/wasm/wasm-common.ts", "../../lib/wasm/wasm-utils-load-file.ts", "../../lib/wasm/wasm-core-impl.ts", "proxy-worker:./proxy-worker/main", "../../lib/wasm/proxy-wrapper.ts", "../../lib/wasm/session-handler-inference.ts", "../../lib/backend-wasm.ts", "../../lib/backend-wasm-inference.ts", "../../lib/index.ts", "../../lib/version.ts"], + "sourcesContent": ["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Backend} from './backend.js';\nimport {InferenceSession} from './inference-session.js';\n\ninterface BackendInfo {\n backend: Backend;\n priority: number;\n\n initPromise?: Promise;\n initialized?: boolean;\n aborted?: boolean;\n error?: string;\n}\n\nconst backends: Map = new Map();\nconst backendsSortedByPriority: string[] = [];\n\n/**\n * Register a backend.\n *\n * @param name - the name as a key to lookup as an execution provider.\n * @param backend - the backend object.\n * @param priority - an integer indicating the priority of the backend. Higher number means higher priority. if priority\n * < 0, it will be considered as a 'beta' version and will not be used as a fallback backend by default.\n *\n * @ignore\n */\nexport const registerBackend = (name: string, backend: Backend, priority: number): void => {\n if (backend && typeof backend.init === 'function' && typeof backend.createInferenceSessionHandler === 'function') {\n const currentBackend = backends.get(name);\n if (currentBackend === undefined) {\n backends.set(name, {backend, priority});\n } else if (currentBackend.priority > priority) {\n // same name is already registered with a higher priority. skip registeration.\n return;\n } else if (currentBackend.priority === priority) {\n if (currentBackend.backend !== backend) {\n throw new Error(`cannot register backend \"${name}\" using priority ${priority}`);\n }\n }\n\n if (priority >= 0) {\n const i = backendsSortedByPriority.indexOf(name);\n if (i !== -1) {\n backendsSortedByPriority.splice(i, 1);\n }\n\n for (let i = 0; i < backendsSortedByPriority.length; i++) {\n if (backends.get(backendsSortedByPriority[i])!.priority <= priority) {\n backendsSortedByPriority.splice(i, 0, name);\n return;\n }\n }\n backendsSortedByPriority.push(name);\n }\n return;\n }\n\n throw new TypeError('not a valid backend');\n};\n\n/**\n * Try to resolve and initialize a backend.\n *\n * @param backendName - the name of the backend.\n * @returns the backend instance if resolved and initialized successfully, or an error message if failed.\n */\nconst tryResolveAndInitializeBackend = async(backendName: string): Promise => {\n const backendInfo = backends.get(backendName);\n if (!backendInfo) {\n return 'backend not found.';\n }\n\n if (backendInfo.initialized) {\n return backendInfo.backend;\n } else if (backendInfo.aborted) {\n return backendInfo.error!;\n } else {\n const isInitializing = !!backendInfo.initPromise;\n try {\n if (!isInitializing) {\n backendInfo.initPromise = backendInfo.backend.init(backendName);\n }\n await backendInfo.initPromise;\n backendInfo.initialized = true;\n return backendInfo.backend;\n } catch (e) {\n if (!isInitializing) {\n backendInfo.error = `${e}`;\n backendInfo.aborted = true;\n }\n return backendInfo.error!;\n } finally {\n delete backendInfo.initPromise;\n }\n }\n};\n\n/**\n * Resolve execution providers from the specific session options.\n *\n * @param options - the session options object.\n * @returns a promise that resolves to a tuple of an initialized backend instance and a session options object with\n * filtered EP list.\n *\n * @ignore\n */\nexport const resolveBackendAndExecutionProviders = async(options: InferenceSession.SessionOptions):\n Promise<[backend: Backend, options: InferenceSession.SessionOptions]> => {\n // extract backend hints from session options\n const eps = options.executionProviders || [];\n const backendHints = eps.map(i => typeof i === 'string' ? i : i.name);\n const backendNames = backendHints.length === 0 ? backendsSortedByPriority : backendHints;\n\n // try to resolve and initialize all requested backends\n let backend: Backend|undefined;\n const errors = [];\n const availableBackendNames = new Set();\n for (const backendName of backendNames) {\n const resolveResult = await tryResolveAndInitializeBackend(backendName);\n if (typeof resolveResult === 'string') {\n errors.push({name: backendName, err: resolveResult});\n } else {\n if (!backend) {\n backend = resolveResult;\n }\n if (backend === resolveResult) {\n availableBackendNames.add(backendName);\n }\n }\n }\n\n // if no backend is available, throw error.\n if (!backend) {\n throw new Error(`no available backend found. ERR: ${errors.map(e => `[${e.name}] ${e.err}`).join(', ')}`);\n }\n\n // for each explicitly requested backend, if it's not available, output warning message.\n for (const {name, err} of errors) {\n if (backendHints.includes(name)) {\n // eslint-disable-next-line no-console\n console.warn(`removing requested execution provider \"${\n name}\" from session options because it is not available: ${err}`);\n }\n }\n\n const filteredEps = eps.filter(i => availableBackendNames.has(typeof i === 'string' ? i : i.name));\n\n return [\n backend, new Proxy(options, {\n get: (target, prop) => {\n if (prop === 'executionProviders') {\n return filteredEps;\n }\n return Reflect.get(target, prop);\n }\n })\n ];\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession} from './inference-session.js';\nimport {OnnxValue} from './onnx-value.js';\nimport {TrainingSession} from './training-session.js';\n\n/**\n * @ignore\n */\nexport declare namespace SessionHandler {\n type FeedsType = {[name: string]: OnnxValue};\n type FetchesType = {[name: string]: OnnxValue | null};\n type ReturnType = {[name: string]: OnnxValue};\n}\n\n/**\n * Represents shared SessionHandler functionality\n *\n * @ignore\n */\ninterface SessionHandler {\n dispose(): Promise;\n\n readonly inputNames: readonly string[];\n readonly outputNames: readonly string[];\n}\n\n/**\n * Represent a handler instance of an inference session.\n *\n * @ignore\n */\nexport interface InferenceSessionHandler extends SessionHandler {\n startProfiling(): void;\n endProfiling(): void;\n\n run(feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType,\n options: InferenceSession.RunOptions): Promise;\n}\n\n/**\n * Represent a handler instance of a training inference session.\n *\n * @ignore\n */\nexport interface TrainingSessionHandler extends SessionHandler {\n readonly evalInputNames: readonly string[];\n readonly evalOutputNames: readonly string[];\n\n lazyResetGrad(): Promise;\n runTrainStep(\n feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType,\n options: InferenceSession.RunOptions): Promise;\n runOptimizerStep(options: InferenceSession.RunOptions): Promise;\n runEvalStep(\n feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType,\n options: InferenceSession.RunOptions): Promise;\n\n getParametersSize(trainableOnly: boolean): Promise;\n loadParametersBuffer(buffer: Uint8Array, trainableOnly: boolean): Promise;\n getContiguousParameters(trainableOnly: boolean): Promise;\n}\n\n/**\n * Represent a backend that provides implementation of model inferencing.\n *\n * @ignore\n */\nexport interface Backend {\n /**\n * Initialize the backend asynchronously. Should throw when failed.\n */\n init(backendName: string): Promise;\n\n createInferenceSessionHandler(uriOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions):\n Promise;\n\n createTrainingSessionHandler?\n (checkpointStateUriOrBuffer: TrainingSession.UriOrBuffer, trainModelUriOrBuffer: TrainingSession.UriOrBuffer,\n evalModelUriOrBuffer: TrainingSession.UriOrBuffer, optimizerModelUriOrBuffer: TrainingSession.UriOrBuffer,\n options: InferenceSession.SessionOptions): Promise;\n}\n\nexport {registerBackend} from './backend-impl.js';\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// This file is generated by /js/scripts/update-version.ts\n// Do not modify file content manually.\n\nexport const version = '1.18.0';\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Env} from './env.js';\nimport {version} from './version.js';\n\ntype LogLevelType = Env['logLevel'];\n\nlet logLevelValue: Required = 'warning';\n\nexport const env: Env = {\n wasm: {} as Env.WebAssemblyFlags,\n webgl: {} as Env.WebGLFlags,\n webgpu: {} as Env.WebGpuFlags,\n versions: {common: version},\n\n set logLevel(value: LogLevelType) {\n if (value === undefined) {\n return;\n }\n if (typeof value !== 'string' || ['verbose', 'info', 'warning', 'error', 'fatal'].indexOf(value) === -1) {\n throw new Error(`Unsupported logging level: ${value}`);\n }\n logLevelValue = value;\n },\n get logLevel(): Required {\n return logLevelValue;\n },\n};\n\n// set property 'logLevel' so that they can be correctly transferred to worker by `postMessage()`.\nObject.defineProperty(env, 'logLevel', {enumerable: true});\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env as envImpl} from './env-impl.js';\n\nexport declare namespace Env {\n export type WasmPrefixOrFilePaths = string|{\n /* eslint-disable @typescript-eslint/naming-convention */\n 'ort-wasm.wasm'?: string;\n 'ort-wasm-threaded.wasm'?: string;\n 'ort-wasm-simd.wasm'?: string;\n 'ort-training-wasm-simd.wasm'?: string;\n 'ort-wasm-simd-threaded.wasm'?: string;\n /* eslint-enable @typescript-eslint/naming-convention */\n };\n export interface WebAssemblyFlags {\n /**\n * set or get number of thread(s). If omitted or set to 0, number of thread(s) will be determined by system. If set\n * to 1, no worker thread will be spawned.\n *\n * This setting is available only when WebAssembly multithread feature is available in current context.\n *\n * @defaultValue `0`\n */\n numThreads?: number;\n\n /**\n * set or get a boolean value indicating whether to enable SIMD. If set to false, SIMD will be forcely disabled.\n *\n * This setting is available only when WebAssembly SIMD feature is available in current context.\n *\n * @defaultValue `true`\n */\n simd?: boolean;\n\n /**\n * set or get a boolean value indicating whether to enable trace.\n *\n * @deprecated Use `env.trace` instead. If `env.trace` is set, this property will be ignored.\n * @defaultValue `false`\n */\n trace?: boolean;\n\n /**\n * Set or get a number specifying the timeout for initialization of WebAssembly backend, in milliseconds. A zero\n * value indicates no timeout is set.\n *\n * @defaultValue `0`\n */\n initTimeout?: number;\n\n /**\n * Set a custom URL prefix to the .wasm files or a set of overrides for each .wasm file. The override path should be\n * an absolute path.\n */\n wasmPaths?: WasmPrefixOrFilePaths;\n\n /**\n * Set or get a boolean value indicating whether to proxy the execution of main thread to a worker thread.\n *\n * @defaultValue `false`\n */\n proxy?: boolean;\n }\n\n export interface WebGLFlags {\n /**\n * Set or get the WebGL Context ID (webgl or webgl2).\n *\n * @defaultValue `'webgl2'`\n */\n contextId?: 'webgl'|'webgl2';\n /**\n * Get the WebGL rendering context.\n */\n readonly context: WebGLRenderingContext;\n /**\n * Set or get the maximum batch size for matmul. 0 means to disable batching.\n *\n * @deprecated\n */\n matmulMaxBatchSize?: number;\n /**\n * Set or get the texture cache mode.\n *\n * @defaultValue `'full'`\n */\n textureCacheMode?: 'initializerOnly'|'full';\n /**\n * Set or get the packed texture mode\n *\n * @defaultValue `false`\n */\n pack?: boolean;\n /**\n * Set or get whether enable async download.\n *\n * @defaultValue `false`\n */\n async?: boolean;\n }\n\n export interface WebGpuProfilingDataV1TensorMetadata {\n dims: readonly number[];\n dataType: string;\n }\n export interface WebGpuProfilingDataV1 {\n version: 1;\n inputsMetadata: readonly WebGpuProfilingDataV1TensorMetadata[];\n outputsMetadata: readonly WebGpuProfilingDataV1TensorMetadata[];\n kernelId: number;\n kernelType: string;\n kernelName: string;\n programName: string;\n startTime: number;\n endTime: number;\n }\n\n export type WebGpuProfilingData = WebGpuProfilingDataV1;\n\n export interface WebGpuFlags {\n /**\n * Set or get the profiling mode.\n *\n * @deprecated Use `env.webgpu.profiling.mode` instead. If `env.webgpu.profiling.mode` is set, this property will be\n * ignored.\n */\n profilingMode?: 'off'|'default';\n /**\n * Set or get the profiling configuration.\n */\n profiling?: {\n /**\n * Set or get the profiling mode.\n *\n * @defaultValue `'off'`\n */\n mode?: 'off'|'default';\n\n /**\n * Set or get a callback function when a profiling data is received. If not set, the profiling data will be\n * printed to console.\n */\n ondata?: (data: WebGpuProfilingData) => void;\n };\n /**\n * Set or get the power preference.\n *\n * Setting this property only has effect before the first WebGPU inference session is created. The value will be\n * used as options for `navigator.gpu.requestAdapter()`.\n *\n * See {@link https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions} for more details.\n *\n * @defaultValue `undefined`\n */\n powerPreference?: 'low-power'|'high-performance';\n /**\n * Set or get the force fallback adapter flag.\n *\n * Setting this property only has effect before the first WebGPU inference session is created. The value will be\n * used as options for `navigator.gpu.requestAdapter()`.\n *\n * See {@link https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions} for more details.\n *\n * @defaultValue `undefined`\n */\n forceFallbackAdapter?: boolean;\n /**\n * Set or get the adapter for WebGPU.\n *\n * Setting this property only has effect before the first WebGPU inference session is created. The value will be\n * used as the GPU adapter for the underlying WebGPU backend to create GPU device.\n *\n * If this property is not set, it will be available to get after the first WebGPU inference session is created. The\n * value will be the GPU adapter that created by the underlying WebGPU backend.\n *\n * When use with TypeScript, the type of this property is `GPUAdapter` defined in \"@webgpu/types\".\n * Use `const adapter = env.webgpu.adapter as GPUAdapter;` in TypeScript to access this property with correct type.\n *\n * see comments on {@link Tensor.GpuBufferType}\n */\n adapter: unknown;\n /**\n * Get the device for WebGPU.\n *\n * This property is only available after the first WebGPU inference session is created.\n *\n * When use with TypeScript, the type of this property is `GPUDevice` defined in \"@webgpu/types\".\n * Use `const device = env.webgpu.device as GPUDevice;` in TypeScript to access this property with correct type.\n *\n * see comments on {@link Tensor.GpuBufferType} for more details about why not use types defined in \"@webgpu/types\".\n */\n readonly device: unknown;\n /**\n * Set or get whether validate input content.\n *\n * @defaultValue `false`\n */\n validateInputContent?: boolean;\n }\n}\n\nexport interface Env {\n /**\n * set the severity level for logging.\n *\n * @defaultValue `'warning'`\n */\n logLevel?: 'verbose'|'info'|'warning'|'error'|'fatal';\n\n /**\n * Indicate whether run in debug mode.\n *\n * @defaultValue `false`\n */\n debug?: boolean;\n\n /**\n * set or get a boolean value indicating whether to enable trace.\n *\n * @defaultValue `false`\n */\n trace?: boolean;\n\n /**\n * Get version of the current package.\n */\n readonly versions: {\n readonly common: string;\n readonly web?: string;\n readonly node?: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n readonly 'react-native'?: string;\n };\n\n /**\n * Represent a set of flags for WebAssembly\n */\n readonly wasm: Env.WebAssemblyFlags;\n\n /**\n * Represent a set of flags for WebGL\n */\n readonly webgl: Env.WebGLFlags;\n\n /**\n * Represent a set of flags for WebGPU\n */\n readonly webgpu: Env.WebGpuFlags;\n\n [name: string]: unknown;\n}\n\n/**\n * Represent a set of flags as a global singleton.\n */\nexport const env: Env = envImpl;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TensorToDataUrlOptions, TensorToImageDataOptions} from './tensor-conversion.js';\nimport {Tensor} from './tensor.js';\n\n/**\n * implementation of Tensor.toDataURL()\n */\nexport const tensorToDataURL = (tensor: Tensor, options?: TensorToDataUrlOptions): string => {\n const canvas = typeof document !== 'undefined' ? document.createElement('canvas') : (new OffscreenCanvas(1, 1));\n canvas.width = tensor.dims[3];\n canvas.height = tensor.dims[2];\n const pixels2DContext =\n canvas.getContext('2d') as (CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null);\n\n if (pixels2DContext != null) {\n // Default values for height and width & format\n let width: number;\n let height: number;\n if (options?.tensorLayout !== undefined && options.tensorLayout === 'NHWC') {\n width = tensor.dims[2];\n height = tensor.dims[3];\n } else { // Default layout is NCWH\n width = tensor.dims[3];\n height = tensor.dims[2];\n }\n\n const inputformat = options?.format !== undefined ? options.format : 'RGB';\n\n const norm = options?.norm;\n let normMean: [number, number, number, number];\n let normBias: [number, number, number, number];\n if (norm === undefined || norm.mean === undefined) {\n normMean = [255, 255, 255, 255];\n } else {\n if (typeof (norm.mean) === 'number') {\n normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n } else {\n normMean = [norm.mean[0], norm.mean[1], norm.mean[2], 0];\n if (norm.mean[3] !== undefined) {\n normMean[3] = norm.mean[3];\n }\n }\n }\n if (norm === undefined || norm.bias === undefined) {\n normBias = [0, 0, 0, 0];\n } else {\n if (typeof (norm.bias) === 'number') {\n normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n } else {\n normBias = [norm.bias[0], norm.bias[1], norm.bias[2], 0];\n if (norm.bias[3] !== undefined) {\n normBias[3] = norm.bias[3];\n }\n }\n }\n\n const stride = height * width;\n // Default pointer assignments\n let rTensorPointer = 0, gTensorPointer = stride, bTensorPointer = stride * 2, aTensorPointer = -1;\n\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGBA') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n aTensorPointer = stride * 3;\n } else if (inputformat === 'RGB') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n } else if (inputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = stride;\n gTensorPointer = stride * 2;\n }\n\n for (let i = 0; i < height; i++) {\n for (let j = 0; j < width; j++) {\n const R = ((tensor.data[rTensorPointer++] as number) - normBias[0]) * normMean[0]; // R value\n const G = ((tensor.data[gTensorPointer++] as number) - normBias[1]) * normMean[1]; // G value\n const B = ((tensor.data[bTensorPointer++] as number) - normBias[2]) * normMean[2]; // B value\n const A = aTensorPointer === -1 ?\n 255 :\n ((tensor.data[aTensorPointer++] as number) - normBias[3]) * normMean[3]; // A value\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n pixels2DContext.fillStyle = 'rgba(' + R + ',' + G + ',' + B + ',' + A + ')';\n pixels2DContext.fillRect(j, i, 1, 1);\n }\n }\n if ('toDataURL' in canvas) {\n return canvas.toDataURL();\n } else {\n throw new Error('toDataURL is not supported');\n }\n } else {\n throw new Error('Can not access image data');\n }\n};\n\n/**\n * implementation of Tensor.toImageData()\n */\nexport const tensorToImageData = (tensor: Tensor, options?: TensorToImageDataOptions): ImageData => {\n const pixels2DContext = typeof document !== 'undefined' ?\n document.createElement('canvas').getContext('2d') :\n new OffscreenCanvas(1, 1).getContext('2d') as OffscreenCanvasRenderingContext2D;\n let image: ImageData;\n if (pixels2DContext != null) {\n // Default values for height and width & format\n let width: number;\n let height: number;\n let channels: number;\n if (options?.tensorLayout !== undefined && options.tensorLayout === 'NHWC') {\n width = tensor.dims[2];\n height = tensor.dims[1];\n channels = tensor.dims[3];\n } else { // Default layout is NCWH\n width = tensor.dims[3];\n height = tensor.dims[2];\n channels = tensor.dims[1];\n }\n const inputformat = options !== undefined ? (options.format !== undefined ? options.format : 'RGB') : 'RGB';\n\n const norm = options?.norm;\n let normMean: [number, number, number, number];\n let normBias: [number, number, number, number];\n if (norm === undefined || norm.mean === undefined) {\n normMean = [255, 255, 255, 255];\n } else {\n if (typeof (norm.mean) === 'number') {\n normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n } else {\n normMean = [norm.mean[0], norm.mean[1], norm.mean[2], 255];\n if (norm.mean[3] !== undefined) {\n normMean[3] = norm.mean[3];\n }\n }\n }\n if (norm === undefined || norm.bias === undefined) {\n normBias = [0, 0, 0, 0];\n } else {\n if (typeof (norm.bias) === 'number') {\n normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n } else {\n normBias = [norm.bias[0], norm.bias[1], norm.bias[2], 0];\n if (norm.bias[3] !== undefined) {\n normBias[3] = norm.bias[3];\n }\n }\n }\n\n const stride = height * width;\n if (options !== undefined) {\n if (options.format !== undefined && (channels === 4 && options.format !== 'RGBA') ||\n (channels === 3 && (options.format !== 'RGB' && options.format !== 'BGR'))) {\n throw new Error('Tensor format doesn\\'t match input tensor dims');\n }\n }\n\n // Default pointer assignments\n const step = 4;\n let rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = stride, bTensorPointer = stride * 2, aTensorPointer = -1;\n\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGBA') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n aTensorPointer = stride * 3;\n } else if (inputformat === 'RGB') {\n rTensorPointer = 0;\n gTensorPointer = stride;\n bTensorPointer = stride * 2;\n } else if (inputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = stride;\n gTensorPointer = stride * 2;\n }\n\n image = pixels2DContext.createImageData(width, height);\n\n for (let i = 0; i < height * width;\n rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++) {\n image.data[rImagePointer] = ((tensor.data[rTensorPointer++] as number) - normBias[0]) * normMean[0]; // R value\n image.data[gImagePointer] = ((tensor.data[gTensorPointer++] as number) - normBias[1]) * normMean[1]; // G value\n image.data[bImagePointer] = ((tensor.data[bTensorPointer++] as number) - normBias[2]) * normMean[2]; // B value\n image.data[aImagePointer] = aTensorPointer === -1 ?\n 255 :\n ((tensor.data[aTensorPointer++] as number) - normBias[3]) * normMean[3]; // A value\n }\n\n } else {\n throw new Error('Can not access image data');\n }\n return image;\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {OptionsDimensions, OptionsFormat, OptionsNormalizationParameters, OptionsTensorFormat, OptionsTensorLayout, TensorFromGpuBufferOptions, TensorFromImageBitmapOptions, TensorFromImageDataOptions, TensorFromImageElementOptions, TensorFromTextureOptions, TensorFromUrlOptions} from './tensor-factory.js';\nimport {Tensor} from './tensor-impl.js';\nimport {Tensor as TensorInterface} from './tensor.js';\n\ninterface BufferToTensorOptions extends OptionsDimensions, OptionsTensorLayout, OptionsNormalizationParameters,\n OptionsFormat, OptionsTensorFormat {}\n\n/**\n * Create a new tensor object from image object\n *\n * @param buffer - Extracted image buffer data - assuming RGBA format\n * @param imageFormat - input image configuration - required configurations height, width, format\n * @param tensorFormat - output tensor configuration - Default is RGB format\n */\nexport const bufferToTensor = (buffer: Uint8ClampedArray|undefined, options: BufferToTensorOptions): Tensor => {\n if (buffer === undefined) {\n throw new Error('Image buffer must be defined');\n }\n if (options.height === undefined || options.width === undefined) {\n throw new Error('Image height and width must be defined');\n }\n if (options.tensorLayout === 'NHWC') {\n throw new Error('NHWC Tensor layout is not supported yet');\n }\n\n const {height, width} = options;\n\n const norm = options.norm ?? {mean: 255, bias: 0};\n let normMean: [number, number, number, number];\n let normBias: [number, number, number, number];\n\n if (typeof (norm.mean) === 'number') {\n normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n } else {\n normMean = [norm.mean![0], norm.mean![1], norm.mean![2], norm.mean![3] ?? 255];\n }\n\n if (typeof (norm.bias) === 'number') {\n normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n } else {\n normBias = [norm.bias![0], norm.bias![1], norm.bias![2], norm.bias![3] ?? 0];\n }\n\n const inputformat = options.format !== undefined ? options.format : 'RGBA';\n // default value is RGBA since imagedata and HTMLImageElement uses it\n\n const outputformat =\n options.tensorFormat !== undefined ? (options.tensorFormat !== undefined ? options.tensorFormat : 'RGB') : 'RGB';\n const stride = height * width;\n const float32Data = outputformat === 'RGBA' ? new Float32Array(stride * 4) : new Float32Array(stride * 3);\n\n // Default pointer assignments\n let step = 4, rImagePointer = 0, gImagePointer = 1, bImagePointer = 2, aImagePointer = 3;\n let rTensorPointer = 0, gTensorPointer = stride, bTensorPointer = stride * 2, aTensorPointer = -1;\n\n // Updating the pointer assignments based on the input image format\n if (inputformat === 'RGB') {\n step = 3;\n rImagePointer = 0;\n gImagePointer = 1;\n bImagePointer = 2;\n aImagePointer = -1;\n }\n\n // Updating the pointer assignments based on the output tensor format\n if (outputformat === 'RGBA') {\n aTensorPointer = stride * 3;\n } else if (outputformat === 'RBG') {\n rTensorPointer = 0;\n bTensorPointer = stride;\n gTensorPointer = stride * 2;\n } else if (outputformat === 'BGR') {\n bTensorPointer = 0;\n gTensorPointer = stride;\n rTensorPointer = stride * 2;\n }\n\n for (let i = 0; i < stride;\n i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step) {\n float32Data[rTensorPointer++] = (buffer[rImagePointer] + normBias[0]) / normMean[0];\n float32Data[gTensorPointer++] = (buffer[gImagePointer] + normBias[1]) / normMean[1];\n float32Data[bTensorPointer++] = (buffer[bImagePointer] + normBias[2]) / normMean[2];\n if (aTensorPointer !== -1 && aImagePointer !== -1) {\n float32Data[aTensorPointer++] = (buffer[aImagePointer] + normBias[3]) / normMean[3];\n }\n }\n\n // Float32Array -> ort.Tensor\n const outputTensor = outputformat === 'RGBA' ? new Tensor('float32', float32Data, [1, 4, height, width]) :\n new Tensor('float32', float32Data, [1, 3, height, width]);\n return outputTensor;\n};\n\n/**\n * implementation of Tensor.fromImage().\n */\nexport const tensorFromImage = async(\n image: ImageData|HTMLImageElement|ImageBitmap|string,\n options?: TensorFromImageDataOptions|TensorFromImageElementOptions|TensorFromImageBitmapOptions|\n TensorFromUrlOptions): Promise => {\n // checking the type of image object\n const isHTMLImageEle = typeof (HTMLImageElement) !== 'undefined' && image instanceof HTMLImageElement;\n const isImageDataEle = typeof (ImageData) !== 'undefined' && image instanceof ImageData;\n const isImageBitmap = typeof (ImageBitmap) !== 'undefined' && image instanceof ImageBitmap;\n const isString = typeof image === 'string';\n\n let data: Uint8ClampedArray|undefined;\n let bufferToTensorOptions: BufferToTensorOptions = options ?? {};\n\n const createCanvas = () => {\n if (typeof document !== 'undefined') {\n return document.createElement('canvas');\n } else if (typeof OffscreenCanvas !== 'undefined') {\n return new OffscreenCanvas(1, 1);\n } else {\n throw new Error('Canvas is not supported');\n }\n };\n const createCanvasContext = (canvas: HTMLCanvasElement|OffscreenCanvas) => {\n if (canvas instanceof HTMLCanvasElement) {\n return canvas.getContext('2d');\n } else if (canvas instanceof OffscreenCanvas) {\n return canvas.getContext('2d') as OffscreenCanvasRenderingContext2D;\n } else {\n return null;\n }\n };\n // filling and checking image configuration options\n if (isHTMLImageEle) {\n // HTMLImageElement - image object - format is RGBA by default\n const canvas = createCanvas();\n canvas.width = image.width;\n canvas.height = image.height;\n const pixels2DContext = createCanvasContext(canvas);\n\n if (pixels2DContext != null) {\n let height = image.height;\n let width = image.width;\n if (options !== undefined && options.resizedHeight !== undefined && options.resizedWidth !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n }\n\n if (options !== undefined) {\n bufferToTensorOptions = options;\n if (options.tensorFormat !== undefined) {\n throw new Error('Image input config format must be RGBA for HTMLImageElement');\n } else {\n bufferToTensorOptions.tensorFormat = 'RGBA';\n }\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n } else {\n bufferToTensorOptions.tensorFormat = 'RGBA';\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n }\n\n pixels2DContext.drawImage(image, 0, 0);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n } else {\n throw new Error('Can not access image data');\n }\n } else if (isImageDataEle) {\n let height: number;\n let width: number;\n\n if (options !== undefined && options.resizedWidth !== undefined && options.resizedHeight !== undefined) {\n height = options.resizedHeight;\n width = options.resizedWidth;\n } else {\n height = image.height;\n width = image.width;\n }\n\n if (options !== undefined) {\n bufferToTensorOptions = options;\n }\n bufferToTensorOptions.format = 'RGBA';\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n\n if (options !== undefined) {\n const tempCanvas = createCanvas();\n\n tempCanvas.width = width;\n tempCanvas.height = height;\n\n const pixels2DContext = createCanvasContext(tempCanvas);\n\n if (pixels2DContext != null) {\n pixels2DContext.putImageData(image, 0, 0);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n } else {\n throw new Error('Can not access image data');\n }\n } else {\n data = image.data;\n }\n } else if (isImageBitmap) {\n // ImageBitmap - image object - format must be provided by user\n if (options === undefined) {\n throw new Error('Please provide image config with format for Imagebitmap');\n }\n\n const canvas = createCanvas();\n canvas.width = image.width;\n canvas.height = image.height;\n const pixels2DContext = createCanvasContext(canvas);\n\n if (pixels2DContext != null) {\n const height = image.height;\n const width = image.width;\n pixels2DContext.drawImage(image, 0, 0, width, height);\n data = pixels2DContext.getImageData(0, 0, width, height).data;\n bufferToTensorOptions.height = height;\n bufferToTensorOptions.width = width;\n return bufferToTensor(data, bufferToTensorOptions);\n } else {\n throw new Error('Can not access image data');\n }\n } else if (isString) {\n return new Promise((resolve, reject) => {\n const canvas = createCanvas();\n const context = createCanvasContext(canvas);\n if (!image || !context) {\n return reject();\n }\n const newImage = new Image();\n newImage.crossOrigin = 'Anonymous';\n newImage.src = image;\n newImage.onload = () => {\n canvas.width = newImage.width;\n canvas.height = newImage.height;\n context.drawImage(newImage, 0, 0, canvas.width, canvas.height);\n const img = context.getImageData(0, 0, canvas.width, canvas.height);\n\n bufferToTensorOptions.height = canvas.height;\n bufferToTensorOptions.width = canvas.width;\n resolve(bufferToTensor(img.data, bufferToTensorOptions));\n };\n });\n } else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n\n if (data !== undefined) {\n return bufferToTensor(data, bufferToTensorOptions);\n } else {\n throw new Error('Input data provided is not supported - aborted tensor creation');\n }\n};\n\n/**\n * implementation of Tensor.fromTexture().\n */\nexport const tensorFromTexture = (\n texture: TensorInterface.TextureType, options: TensorFromTextureOptions): Tensor => {\n const {width, height, download, dispose} = options;\n // Always assume RGBAF32. TODO: support different texture format\n const dims = [1, height, width, 4];\n return new Tensor({location: 'texture', type: 'float32', texture, dims, download, dispose});\n};\n\n/**\n * implementation of Tensor.fromGpuBuffer().\n */\nexport const tensorFromGpuBuffer = (\n gpuBuffer: TensorInterface.GpuBufferType, options: TensorFromGpuBufferOptions): Tensor => {\n const {dataType, dims, download, dispose} = options;\n return new Tensor({location: 'gpu-buffer', type: dataType ?? 'float32', gpuBuffer, dims, download, dispose});\n};\n\n/**\n * implementation of Tensor.fromPinnedBuffer().\n */\nexport const tensorFromPinnedBuffer = (\n type: T, buffer: TensorInterface.DataTypeMap[T], dims?: readonly number[]): Tensor =>\n new Tensor({location: 'cpu-pinned', type, data: buffer, dims: dims ?? [buffer.length]});\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from './tensor.js';\n\nexport type SupportedTypedArrayConstructors = Float32ArrayConstructor|Uint8ArrayConstructor|Int8ArrayConstructor|\n Uint16ArrayConstructor|Int16ArrayConstructor|Int32ArrayConstructor|BigInt64ArrayConstructor|Uint8ArrayConstructor|\n Float64ArrayConstructor|Uint32ArrayConstructor|BigUint64ArrayConstructor;\nexport type SupportedTypedArray = InstanceType;\n\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nexport const NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP = new Map([\n ['float32', Float32Array],\n ['uint8', Uint8Array],\n ['int8', Int8Array],\n ['uint16', Uint16Array],\n ['int16', Int16Array],\n ['int32', Int32Array],\n ['bool', Uint8Array],\n ['float64', Float64Array],\n ['uint32', Uint32Array],\n]);\n\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nexport const NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP = new Map([\n [Float32Array, 'float32'],\n [Uint8Array, 'uint8'],\n [Int8Array, 'int8'],\n [Uint16Array, 'uint16'],\n [Int16Array, 'int16'],\n [Int32Array, 'int32'],\n [Float64Array, 'float64'],\n [Uint32Array, 'uint32'],\n]);\n\n// a dummy type declaration for Float16Array in case any polyfill is available.\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any\n const Float16Array: any;\n}\n\n// the following code allows delaying execution of BigInt/Float16Array checking. This allows lazy initialization for\n// NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP and NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP, which allows BigInt/Float16Array\n// polyfill if available.\nlet isTypedArrayChecked = false;\nexport const checkTypedArray = () => {\n if (!isTypedArrayChecked) {\n isTypedArrayChecked = true;\n const isBigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined' && BigInt64Array.from;\n const isBigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined' && BigUint64Array.from;\n const isFloat16ArrayAvailable = typeof Float16Array !== 'undefined' && Float16Array.from;\n\n if (isBigInt64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('int64', BigInt64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array, 'int64');\n }\n if (isBigUint64ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('uint64', BigUint64Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array, 'uint64');\n }\n if (isFloat16ArrayAvailable) {\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('float16', Float16Array);\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(Float16Array, 'float16');\n } else {\n // if Float16Array is not available, use 'Uint16Array' to store the data.\n NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('float16', Uint16Array);\n }\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {CpuPinnedConstructorParameters, GpuBufferConstructorParameters, TextureConstructorParameters} from './tensor-factory.js';\nimport {Tensor} from './tensor-impl.js';\n\n/**\n * calculate size from dims.\n *\n * @param dims the dims array. May be an illegal input.\n */\nexport const calculateSize = (dims: readonly unknown[]): number => {\n let size = 1;\n for (let i = 0; i < dims.length; i++) {\n const dim = dims[i];\n if (typeof dim !== 'number' || !Number.isSafeInteger(dim)) {\n throw new TypeError(`dims[${i}] must be an integer, got: ${dim}`);\n }\n if (dim < 0) {\n throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${dim}`);\n }\n size *= dim;\n }\n return size;\n};\n\n/**\n * implementation of Tensor.reshape()\n */\nexport const tensorReshape = (tensor: Tensor, dims: readonly number[]): Tensor => {\n switch (tensor.location) {\n case 'cpu':\n return new Tensor(tensor.type, tensor.data, dims);\n case 'cpu-pinned':\n return new Tensor({\n location: 'cpu-pinned',\n data: tensor.data as CpuPinnedConstructorParameters['data'],\n type: tensor.type as CpuPinnedConstructorParameters['type'],\n dims,\n });\n case 'texture':\n return new Tensor({\n location: 'texture',\n texture: tensor.texture,\n type: tensor.type as TextureConstructorParameters['type'],\n dims,\n });\n case 'gpu-buffer':\n return new Tensor({\n location: 'gpu-buffer',\n gpuBuffer: tensor.gpuBuffer,\n type: tensor.type as GpuBufferConstructorParameters['type'],\n dims,\n });\n default:\n throw new Error(`tensorReshape: tensor location ${tensor.location} is not supported`);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {tensorToDataURL, tensorToImageData} from './tensor-conversion-impl.js';\nimport {TensorToDataUrlOptions, TensorToImageDataOptions} from './tensor-conversion.js';\nimport {tensorFromGpuBuffer, tensorFromImage, tensorFromPinnedBuffer, tensorFromTexture} from './tensor-factory-impl.js';\nimport {CpuPinnedConstructorParameters, GpuBufferConstructorParameters, TensorFromGpuBufferOptions, TensorFromImageBitmapOptions, TensorFromImageDataOptions, TensorFromImageElementOptions, TensorFromTextureOptions, TensorFromUrlOptions, TextureConstructorParameters} from './tensor-factory.js';\nimport {checkTypedArray, NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP, NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP, SupportedTypedArray, SupportedTypedArrayConstructors} from './tensor-impl-type-mapping.js';\nimport {calculateSize, tensorReshape} from './tensor-utils-impl.js';\nimport {Tensor as TensorInterface} from './tensor.js';\n\n// type aliases for those exported from Tensor interface\n\ntype TensorType = TensorInterface.Type;\ntype TensorDataType = TensorInterface.DataType;\ntype TensorDataLocation = TensorInterface.DataLocation;\ntype TensorTextureType = TensorInterface.TextureType;\ntype TensorGpuBufferType = TensorInterface.GpuBufferType;\n\n/**\n * the implementation of Tensor interface.\n *\n * @ignore\n */\nexport class Tensor implements TensorInterface {\n // #region constructors\n\n /**\n * Construct a new CPU tensor object from the given type, data and dims.\n */\n constructor(\n type: TensorType, data: TensorDataType|readonly string[]|readonly number[]|readonly boolean[],\n dims?: readonly number[]);\n /**\n * Construct a new CPU tensor object from the given data and dims. Type is inferred from data.\n */\n constructor(data: TensorDataType|readonly string[]|readonly boolean[], dims?: readonly number[]);\n /**\n * Construct a new tensor object from the pinned CPU data with the given type and dims.\n *\n * Tensor's location will be set to 'cpu-pinned'.\n *\n * @param params - Specify the parameters to construct the tensor.\n */\n constructor(params: CpuPinnedConstructorParameters);\n /**\n * Construct a new tensor object from the WebGL texture with the given type and dims.\n *\n * Tensor's location will be set to 'texture'.\n *\n * @param params - Specify the parameters to construct the tensor.\n */\n constructor(params: TextureConstructorParameters);\n /**\n * Construct a new tensor object from the WebGPU buffer with the given type and dims.\n *\n * Tensor's location will be set to 'gpu-buffer'.\n *\n * @param params - Specify the parameters to construct the tensor.\n */\n constructor(params: GpuBufferConstructorParameters);\n\n /**\n * implementation.\n */\n constructor(\n arg0: TensorType|TensorDataType|readonly string[]|readonly boolean[]|CpuPinnedConstructorParameters|\n TextureConstructorParameters|GpuBufferConstructorParameters,\n arg1?: TensorDataType|readonly number[]|readonly string[]|readonly boolean[], arg2?: readonly number[]) {\n // perform one-time check for BigInt/Float16Array support\n checkTypedArray();\n\n let type: TensorType;\n let dims: readonly number[];\n\n if (typeof arg0 === 'object' && 'location' in arg0) {\n //\n // constructing tensor from specific location\n //\n this.dataLocation = arg0.location;\n type = arg0.type;\n dims = arg0.dims;\n switch (arg0.location) {\n case 'cpu-pinned': {\n const expectedTypedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(type);\n if (!expectedTypedArrayConstructor) {\n throw new TypeError(`unsupported type \"${type}\" to create tensor from pinned buffer`);\n }\n if (!(arg0.data instanceof expectedTypedArrayConstructor)) {\n throw new TypeError(`buffer should be of type ${expectedTypedArrayConstructor.name}`);\n }\n this.cpuData = arg0.data;\n break;\n }\n case 'texture': {\n if (type !== 'float32') {\n throw new TypeError(`unsupported type \"${type}\" to create tensor from texture`);\n }\n this.gpuTextureData = arg0.texture;\n this.downloader = arg0.download;\n this.disposer = arg0.dispose;\n break;\n }\n case 'gpu-buffer': {\n if ((type !== 'float32' && type !== 'float16' && type !== 'int32' && type !== 'int64' && type !== 'uint32' &&\n type !== 'uint8' && type !== 'bool')) {\n throw new TypeError(`unsupported type \"${type}\" to create tensor from gpu buffer`);\n }\n this.gpuBufferData = arg0.gpuBuffer;\n this.downloader = arg0.download;\n this.disposer = arg0.dispose;\n break;\n }\n default:\n throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`);\n }\n } else {\n //\n // constructing tensor of location 'cpu'\n //\n let data: TensorDataType;\n let maybeDims: typeof arg1|typeof arg2;\n // check whether arg0 is type or data\n if (typeof arg0 === 'string') {\n //\n // Override: constructor(type, data, ...)\n //\n type = arg0;\n maybeDims = arg2;\n if (arg0 === 'string') {\n // string tensor\n if (!Array.isArray(arg1)) {\n throw new TypeError('A string tensor\\'s data must be a string array.');\n }\n // we don't check whether every element in the array is string; this is too slow. we assume it's correct and\n // error will be populated at inference\n data = arg1;\n } else {\n // numeric tensor\n const typedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(arg0);\n if (typedArrayConstructor === undefined) {\n throw new TypeError(`Unsupported tensor type: ${arg0}.`);\n }\n if (Array.isArray(arg1)) {\n if (arg0 === 'float16' && typedArrayConstructor === Uint16Array) {\n // When no Float16Array polyfill is used, we cannot create 'float16' tensor from number array.\n //\n // Throw error here because when user try to use number array as data,\n // e.g. new Tensor('float16', [1, 2, 3, 4], dims)), it will actually call\n // Uint16Array.from(arg1) which generates wrong data.\n throw new TypeError(\n 'Creating a float16 tensor from number array is not supported. Please use Uint16Array as data.');\n } else if (arg0 === 'uint64' || arg0 === 'int64') {\n // use 'as any' here because:\n // 1. TypeScript's check on type of 'Array.isArray()' does not work with readonly arrays.\n // see https://github.com/microsoft/TypeScript/issues/17002\n // 2. TypeScript's check on union type of '(BigInt64ArrayConstructor|BigUint64ArrayConstructor).from()'\n // does not accept parameter mapFn.\n // 3. parameters of 'SupportedTypedArrayConstructors.from()' does not match the requirement of the union\n // type.\n\n // assume 'arg1' is of type \"readonly number[]|readonly bigint[]\" here.\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = (typedArrayConstructor as any).from(arg1, BigInt);\n } else {\n // assume 'arg1' is of type \"readonly number[]\" here.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = (typedArrayConstructor as any).from(arg1);\n }\n } else if (arg1 instanceof typedArrayConstructor) {\n data = arg1;\n } else {\n throw new TypeError(`A ${type} tensor's data must be type of ${typedArrayConstructor}`);\n }\n }\n } else {\n //\n // Override: constructor(data, ...)\n //\n maybeDims = arg1;\n if (Array.isArray(arg0)) {\n // only boolean[] and string[] is supported\n if (arg0.length === 0) {\n throw new TypeError('Tensor type cannot be inferred from an empty array.');\n }\n const firstElementType = typeof arg0[0];\n if (firstElementType === 'string') {\n type = 'string';\n data = arg0;\n } else if (firstElementType === 'boolean') {\n type = 'bool';\n // 'arg0' is of type 'boolean[]'. Uint8Array.from(boolean[]) actually works, but typescript thinks this is\n // wrong type. We use 'as any' to make it happy.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = Uint8Array.from(arg0 as any[]);\n } else {\n throw new TypeError(`Invalid element type of data array: ${firstElementType}.`);\n }\n } else {\n // get tensor type from TypedArray\n const mappedType =\n NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(arg0.constructor as SupportedTypedArrayConstructors);\n if (mappedType === undefined) {\n throw new TypeError(`Unsupported type for tensor data: ${arg0.constructor}.`);\n }\n type = mappedType;\n data = arg0 as SupportedTypedArray;\n }\n }\n\n // type and data is processed, now processing dims\n if (maybeDims === undefined) {\n // assume 1-D tensor if dims omitted\n maybeDims = [data.length];\n } else if (!Array.isArray(maybeDims)) {\n throw new TypeError('A tensor\\'s dims must be a number array');\n }\n dims = maybeDims as readonly number[];\n\n this.cpuData = data;\n this.dataLocation = 'cpu';\n }\n\n // perform check on dims\n const size = calculateSize(dims);\n // if data is on CPU, check whether data length matches tensor size\n if (this.cpuData && size !== this.cpuData.length) {\n throw new Error(`Tensor's size(${size}) does not match data length(${this.cpuData.length}).`);\n }\n\n this.type = type;\n this.dims = dims;\n this.size = size;\n }\n // #endregion\n\n // #region factory\n static async fromImage(\n image: ImageData|HTMLImageElement|ImageBitmap|string,\n options?: TensorFromImageDataOptions|TensorFromImageElementOptions|TensorFromImageBitmapOptions|\n TensorFromUrlOptions): Promise {\n return tensorFromImage(image, options);\n }\n\n static fromTexture(\n texture: TensorTextureType, options: TensorFromTextureOptions): TensorInterface {\n return tensorFromTexture(texture, options);\n }\n\n static fromGpuBuffer(\n gpuBuffer: TensorGpuBufferType, options: TensorFromGpuBufferOptions): TensorInterface {\n return tensorFromGpuBuffer(gpuBuffer, options);\n }\n\n static fromPinnedBuffer(\n type: T, buffer: TensorInterface.DataTypeMap[T], dims?: readonly number[]): Tensor {\n return tensorFromPinnedBuffer(type, buffer, dims);\n }\n\n // #endregion\n\n // #region conversions\n toDataURL(options?: TensorToDataUrlOptions): string {\n return tensorToDataURL(this, options);\n }\n\n toImageData(options?: TensorToImageDataOptions): ImageData {\n return tensorToImageData(this, options);\n }\n // #endregion\n\n // #region public fields\n readonly dims: readonly number[];\n readonly type: TensorType;\n readonly size: number;\n // #endregion\n\n // #region private fields\n\n /**\n * stores the location of the data.\n */\n private dataLocation: TensorDataLocation;\n\n /**\n * stores the data on CPU, if location is 'cpu' or 'cpu-pinned'. otherwise empty.\n */\n private cpuData?: TensorDataType;\n\n /**\n * stores the underlying texture when location is 'texture'. otherwise empty.\n */\n private gpuTextureData?: TensorTextureType;\n\n /**\n * stores the underlying GPU buffer when location is 'gpu-buffer'. otherwise empty.\n */\n private gpuBufferData?: TensorGpuBufferType;\n\n /**\n * stores an optional downloader function to download data from GPU to CPU.\n */\n private downloader?(): Promise;\n\n /**\n * a flag indicating whether the data is being downloaded from GPU to CPU.\n */\n private isDownloading?: boolean;\n\n /**\n * stores an optional disposer function to dispose the underlying data.\n */\n private disposer?(): void;\n // #endregion\n\n // #region properties\n get data(): TensorDataType {\n this.ensureValid();\n if (!this.cpuData) {\n throw new Error(\n 'The data is not on CPU. Use `getData()` to download GPU data to CPU, ' +\n 'or use `texture` or `gpuBuffer` property to access the GPU data directly.');\n }\n return this.cpuData;\n }\n\n get location(): TensorDataLocation {\n return this.dataLocation;\n }\n\n get texture(): TensorTextureType {\n this.ensureValid();\n if (!this.gpuTextureData) {\n throw new Error('The data is not stored as a WebGL texture.');\n }\n return this.gpuTextureData;\n }\n\n get gpuBuffer(): TensorGpuBufferType {\n this.ensureValid();\n if (!this.gpuBufferData) {\n throw new Error('The data is not stored as a WebGPU buffer.');\n }\n return this.gpuBufferData;\n }\n // #endregion\n\n // #region methods\n\n async getData(releaseData?: boolean): Promise {\n this.ensureValid();\n switch (this.dataLocation) {\n case 'cpu':\n case 'cpu-pinned':\n return this.data;\n case 'texture':\n case 'gpu-buffer': {\n if (!this.downloader) {\n throw new Error('The current tensor is not created with a specified data downloader.');\n }\n if (this.isDownloading) {\n throw new Error('The current tensor is being downloaded.');\n }\n try {\n this.isDownloading = true;\n const data = await this.downloader();\n this.downloader = undefined;\n this.dataLocation = 'cpu';\n this.cpuData = data;\n\n if (releaseData && this.disposer) {\n this.disposer();\n this.disposer = undefined;\n }\n\n return data;\n\n } finally {\n this.isDownloading = false;\n }\n }\n default:\n throw new Error(`cannot get data from location: ${this.dataLocation}`);\n }\n }\n\n dispose(): void {\n if (this.isDownloading) {\n throw new Error('The current tensor is being downloaded.');\n }\n\n if (this.disposer) {\n this.disposer();\n this.disposer = undefined;\n }\n this.cpuData = undefined;\n this.gpuTextureData = undefined;\n this.gpuBufferData = undefined;\n this.downloader = undefined;\n this.isDownloading = undefined;\n\n this.dataLocation = 'none';\n }\n\n // #endregion\n\n // #region tensor utilities\n private ensureValid(): void {\n if (this.dataLocation === 'none') {\n throw new Error('The tensor is disposed.');\n }\n }\n\n reshape(dims: readonly number[]): TensorInterface {\n this.ensureValid();\n if (this.downloader || this.disposer) {\n throw new Error('Cannot reshape a tensor that owns GPU resource.');\n }\n return tensorReshape(this, dims);\n }\n // #endregion\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TensorFactory} from './tensor-factory.js';\nimport {Tensor as TensorImpl} from './tensor-impl.js';\nimport {TypedTensorUtils} from './tensor-utils.js';\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/**\n * represent a basic tensor with specified dimensions and data type.\n */\ninterface TypedTensorBase {\n /**\n * Get the dimensions of the tensor.\n */\n readonly dims: readonly number[];\n /**\n * Get the data type of the tensor.\n */\n readonly type: T;\n /**\n * Get the buffer data of the tensor.\n *\n * If the data is not on CPU (eg. it's in the form of WebGL texture or WebGPU buffer), throw error.\n */\n readonly data: Tensor.DataTypeMap[T];\n /**\n * Get the location of the data.\n */\n readonly location: Tensor.DataLocation;\n /**\n * Get the WebGL texture that holds the tensor data.\n *\n * If the data is not on GPU as WebGL texture, throw error.\n */\n readonly texture: Tensor.TextureType;\n /**\n * Get the WebGPU buffer that holds the tensor data.\n *\n * If the data is not on GPU as WebGPU buffer, throw error.\n */\n readonly gpuBuffer: Tensor.GpuBufferType;\n\n /**\n * Get the buffer data of the tensor.\n *\n * If the data is on CPU, returns the data immediately.\n * If the data is on GPU, downloads the data and returns the promise.\n *\n * @param releaseData - whether release the data on GPU. Ignore if data is already on CPU.\n */\n getData(releaseData?: boolean): Promise;\n\n /**\n * Dispose the tensor data.\n *\n * If the data is on CPU, remove its internal reference to the underlying data.\n * If the data is on GPU, release the data on GPU.\n *\n * After calling this function, the tensor is considered no longer valid. Its location will be set to 'none'.\n */\n dispose(): void;\n}\n\nexport declare namespace Tensor {\n interface DataTypeMap {\n float32: Float32Array;\n uint8: Uint8Array;\n int8: Int8Array;\n uint16: Uint16Array;\n int16: Int16Array;\n int32: Int32Array;\n int64: BigInt64Array;\n string: string[];\n bool: Uint8Array;\n float16: Uint16Array; // Keep using Uint16Array until we have a concrete solution for float 16.\n float64: Float64Array;\n uint32: Uint32Array;\n uint64: BigUint64Array;\n // complex64: never;\n // complex128: never;\n // bfloat16: never;\n }\n\n interface ElementTypeMap {\n float32: number;\n uint8: number;\n int8: number;\n uint16: number;\n int16: number;\n int32: number;\n int64: bigint;\n string: string;\n bool: boolean;\n float16: number; // Keep using Uint16Array until we have a concrete solution for float 16.\n float64: number;\n uint32: number;\n uint64: bigint;\n // complex64: never;\n // complex128: never;\n // bfloat16: never;\n }\n\n type DataType = DataTypeMap[Type];\n type ElementType = ElementTypeMap[Type];\n\n /**\n * supported data types for constructing a tensor from a pinned CPU buffer\n */\n export type CpuPinnedDataTypes = Exclude;\n\n /**\n * type alias for WebGL texture\n */\n export type TextureType = WebGLTexture;\n\n /**\n * supported data types for constructing a tensor from a WebGL texture\n */\n export type TextureDataTypes = 'float32';\n\n /**\n * type alias for WebGPU buffer\n *\n * The reason why we don't use type \"GPUBuffer\" defined in webgpu.d.ts from @webgpu/types is because \"@webgpu/types\"\n * requires \"@types/dom-webcodecs\" as peer dependency when using TypeScript < v5.1 and its version need to be chosen\n * carefully according to the TypeScript version being used. This means so far there is not a way to keep every\n * TypeScript version happy. It turns out that we will easily broke users on some TypeScript version.\n *\n * for more info see https://github.com/gpuweb/types/issues/127\n */\n export type GpuBufferType = {size: number; mapState: 'unmapped' | 'pending' | 'mapped'};\n\n /**\n * supported data types for constructing a tensor from a WebGPU buffer\n */\n export type GpuBufferDataTypes = 'float32'|'float16'|'int32'|'int64'|'uint32'|'uint8'|'bool';\n\n /**\n * represent where the tensor data is stored\n */\n export type DataLocation = 'none'|'cpu'|'cpu-pinned'|'texture'|'gpu-buffer';\n\n /**\n * represent the data type of a tensor\n */\n export type Type = keyof DataTypeMap;\n}\n\n/**\n * Represent multi-dimensional arrays to feed to or fetch from model inferencing.\n */\nexport interface TypedTensor extends TypedTensorBase, TypedTensorUtils {}\n/**\n * Represent multi-dimensional arrays to feed to or fetch from model inferencing.\n */\nexport interface Tensor extends TypedTensorBase, TypedTensorUtils {}\n\n/**\n * type TensorConstructor defines the constructors of 'Tensor' to create CPU tensor instances.\n */\nexport interface TensorConstructor extends TensorFactory {\n // #region CPU tensor - specify element type\n /**\n * Construct a new string tensor object from the given type, data and dims.\n *\n * @param type - Specify the element type.\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(type: 'string', data: Tensor.DataTypeMap['string']|readonly string[],\n dims?: readonly number[]): TypedTensor<'string'>;\n\n /**\n * Construct a new bool tensor object from the given type, data and dims.\n *\n * @param type - Specify the element type.\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(type: 'bool', data: Tensor.DataTypeMap['bool']|readonly boolean[], dims?: readonly number[]): TypedTensor<'bool'>;\n\n /**\n * Construct a new 64-bit integer typed tensor object from the given type, data and dims.\n *\n * @param type - Specify the element type.\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(\n type: T, data: Tensor.DataTypeMap[T]|readonly bigint[]|readonly number[],\n dims?: readonly number[]): TypedTensor;\n\n /**\n * Construct a new numeric tensor object from the given type, data and dims.\n *\n * @param type - Specify the element type.\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new>(\n type: T, data: Tensor.DataTypeMap[T]|readonly number[], dims?: readonly number[]): TypedTensor;\n // #endregion\n\n // #region CPU tensor - infer element types\n\n /**\n * Construct a new float32 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Float32Array, dims?: readonly number[]): TypedTensor<'float32'>;\n\n /**\n * Construct a new int8 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Int8Array, dims?: readonly number[]): TypedTensor<'int8'>;\n\n /**\n * Construct a new uint8 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Uint8Array, dims?: readonly number[]): TypedTensor<'uint8'>;\n\n /**\n * Construct a new uint16 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Uint16Array, dims?: readonly number[]): TypedTensor<'uint16'>;\n\n /**\n * Construct a new int16 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Int16Array, dims?: readonly number[]): TypedTensor<'int16'>;\n\n /**\n * Construct a new int32 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Int32Array, dims?: readonly number[]): TypedTensor<'int32'>;\n\n /**\n * Construct a new int64 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: BigInt64Array, dims?: readonly number[]): TypedTensor<'int64'>;\n\n /**\n * Construct a new string tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: readonly string[], dims?: readonly number[]): TypedTensor<'string'>;\n\n /**\n * Construct a new bool tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: readonly boolean[], dims?: readonly number[]): TypedTensor<'bool'>;\n\n /**\n * Construct a new float64 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Float64Array, dims?: readonly number[]): TypedTensor<'float64'>;\n\n /**\n * Construct a new uint32 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Uint32Array, dims?: readonly number[]): TypedTensor<'uint32'>;\n\n /**\n * Construct a new uint64 tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: BigUint64Array, dims?: readonly number[]): TypedTensor<'uint64'>;\n\n // #endregion\n\n // #region CPU tensor - fall back to non-generic tensor type declaration\n\n /**\n * Construct a new tensor object from the given type, data and dims.\n *\n * @param type - Specify the element type.\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(type: Tensor.Type, data: Tensor.DataType|readonly number[]|readonly string[]|readonly bigint[]|readonly boolean[],\n dims?: readonly number[]): Tensor;\n\n /**\n * Construct a new tensor object from the given data and dims.\n *\n * @param data - Specify the CPU tensor data.\n * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n */\n new(data: Tensor.DataType, dims?: readonly number[]): Tensor;\n // #endregion\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Tensor = TensorImpl as TensorConstructor;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from './env-impl.js';\n\n/**\n * @ignore\n */\nexport const TRACE = (deviceType: string, label: string) => {\n if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n return;\n }\n // eslint-disable-next-line no-console\n console.timeStamp(`${deviceType}::ORT::${label}`);\n};\n\nconst TRACE_FUNC = (msg: string, extraMsg?: string) => {\n const stack = new Error().stack?.split(/\\r\\n|\\r|\\n/g) || [];\n let hasTraceFunc = false;\n for (let i = 0; i < stack.length; i++) {\n if (hasTraceFunc && !stack[i].includes('TRACE_FUNC')) {\n let label = `FUNC_${msg}::${stack[i].trim().split(' ')[1]}`;\n if (extraMsg) {\n label += `::${extraMsg}`;\n }\n TRACE('CPU', label);\n return;\n }\n if (stack[i].includes('TRACE_FUNC')) {\n hasTraceFunc = true;\n }\n }\n};\n\n/**\n * @ignore\n */\nexport const TRACE_FUNC_BEGIN = (extraMsg?: string) => {\n if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n return;\n }\n TRACE_FUNC('BEGIN', extraMsg);\n};\n\n/**\n * @ignore\n */\nexport const TRACE_FUNC_END = (extraMsg?: string) => {\n if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n return;\n }\n TRACE_FUNC('END', extraMsg);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {resolveBackendAndExecutionProviders} from './backend-impl.js';\nimport {InferenceSessionHandler} from './backend.js';\nimport {InferenceSession as InferenceSessionInterface} from './inference-session.js';\nimport {OnnxValue} from './onnx-value.js';\nimport {Tensor} from './tensor.js';\nimport {TRACE_FUNC_BEGIN, TRACE_FUNC_END} from './trace.js';\n\ntype SessionOptions = InferenceSessionInterface.SessionOptions;\ntype RunOptions = InferenceSessionInterface.RunOptions;\ntype FeedsType = InferenceSessionInterface.FeedsType;\ntype FetchesType = InferenceSessionInterface.FetchesType;\ntype ReturnType = InferenceSessionInterface.ReturnType;\n\nexport class InferenceSession implements InferenceSessionInterface {\n private constructor(handler: InferenceSessionHandler) {\n this.handler = handler;\n }\n run(feeds: FeedsType, options?: RunOptions): Promise;\n run(feeds: FeedsType, fetches: FetchesType, options?: RunOptions): Promise;\n async run(feeds: FeedsType, arg1?: FetchesType|RunOptions, arg2?: RunOptions): Promise {\n TRACE_FUNC_BEGIN();\n const fetches: {[name: string]: OnnxValue|null} = {};\n let options: RunOptions = {};\n // check inputs\n if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n throw new TypeError(\n '\\'feeds\\' must be an object that use input names as keys and OnnxValue as corresponding values.');\n }\n\n let isFetchesEmpty = true;\n // determine which override is being used\n if (typeof arg1 === 'object') {\n if (arg1 === null) {\n throw new TypeError('Unexpected argument[1]: cannot be null.');\n }\n if (arg1 instanceof Tensor) {\n throw new TypeError('\\'fetches\\' cannot be a Tensor');\n }\n\n if (Array.isArray(arg1)) {\n if (arg1.length === 0) {\n throw new TypeError('\\'fetches\\' cannot be an empty array.');\n }\n isFetchesEmpty = false;\n // output names\n for (const name of arg1) {\n if (typeof name !== 'string') {\n throw new TypeError('\\'fetches\\' must be a string array or an object.');\n }\n if (this.outputNames.indexOf(name) === -1) {\n throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n }\n fetches[name] = null;\n }\n\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n } else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else {\n // decide whether arg1 is fetches or options\n // if any output name is present and its value is valid OnnxValue, we consider it fetches\n let isFetches = false;\n const arg1Keys = Object.getOwnPropertyNames(arg1);\n for (const name of this.outputNames) {\n if (arg1Keys.indexOf(name) !== -1) {\n const v = (arg1 as InferenceSessionInterface.NullableOnnxValueMapType)[name];\n if (v === null || v instanceof Tensor) {\n isFetches = true;\n isFetchesEmpty = false;\n fetches[name] = v;\n }\n }\n }\n\n if (isFetches) {\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n } else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else {\n options = arg1 as RunOptions;\n }\n }\n } else if (typeof arg1 !== 'undefined') {\n throw new TypeError('Unexpected argument[1]: must be \\'fetches\\' or \\'options\\'.');\n }\n\n // check if all inputs are in feed\n for (const name of this.inputNames) {\n if (typeof feeds[name] === 'undefined') {\n throw new Error(`input '${name}' is missing in 'feeds'.`);\n }\n }\n\n // if no fetches is specified, we use the full output names list\n if (isFetchesEmpty) {\n for (const name of this.outputNames) {\n fetches[name] = null;\n }\n }\n\n // feeds, fetches and options are prepared\n\n const results = await this.handler.run(feeds, fetches, options);\n const returnValue: {[name: string]: OnnxValue} = {};\n for (const key in results) {\n if (Object.hasOwnProperty.call(results, key)) {\n const result = results[key];\n if (result instanceof Tensor) {\n returnValue[key] = result;\n } else {\n returnValue[key] = new Tensor(result.type, result.data, result.dims);\n }\n }\n }\n TRACE_FUNC_END();\n return returnValue;\n }\n\n async release(): Promise {\n return this.handler.dispose();\n }\n\n static create(path: string, options?: SessionOptions): Promise;\n static create(buffer: ArrayBufferLike, options?: SessionOptions): Promise;\n static create(buffer: ArrayBufferLike, byteOffset: number, byteLength?: number, options?: SessionOptions):\n Promise;\n static create(buffer: Uint8Array, options?: SessionOptions): Promise;\n static async create(\n arg0: string|ArrayBufferLike|Uint8Array, arg1?: SessionOptions|number, arg2?: number,\n arg3?: SessionOptions): Promise {\n TRACE_FUNC_BEGIN();\n // either load from a file or buffer\n let filePathOrUint8Array: string|Uint8Array;\n let options: SessionOptions = {};\n\n if (typeof arg0 === 'string') {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n } else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else if (arg0 instanceof Uint8Array) {\n filePathOrUint8Array = arg0;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n } else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else if (\n arg0 instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && arg0 instanceof SharedArrayBuffer)) {\n const buffer = arg0;\n let byteOffset = 0;\n let byteLength = arg0.byteLength;\n if (typeof arg1 === 'object' && arg1 !== null) {\n options = arg1;\n } else if (typeof arg1 === 'number') {\n byteOffset = arg1;\n if (!Number.isSafeInteger(byteOffset)) {\n throw new RangeError('\\'byteOffset\\' must be an integer.');\n }\n if (byteOffset < 0 || byteOffset >= buffer.byteLength) {\n throw new RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`);\n }\n byteLength = arg0.byteLength - byteOffset;\n if (typeof arg2 === 'number') {\n byteLength = arg2;\n if (!Number.isSafeInteger(byteLength)) {\n throw new RangeError('\\'byteLength\\' must be an integer.');\n }\n if (byteLength <= 0 || byteOffset + byteLength > buffer.byteLength) {\n throw new RangeError(`'byteLength' is out of range (0, ${buffer.byteLength - byteOffset}].`);\n }\n if (typeof arg3 === 'object' && arg3 !== null) {\n options = arg3;\n } else if (typeof arg3 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'byteLength\\' must be a number.');\n }\n } else if (typeof arg1 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n filePathOrUint8Array = new Uint8Array(buffer, byteOffset, byteLength);\n } else {\n throw new TypeError('Unexpected argument[0]: must be \\'path\\' or \\'buffer\\'.');\n }\n\n // resolve backend, update session options with validated EPs, and create session handler\n const [backend, optionsWithValidatedEPs] = await resolveBackendAndExecutionProviders(options);\n const handler = await backend.createInferenceSessionHandler(filePathOrUint8Array, optionsWithValidatedEPs);\n TRACE_FUNC_END();\n return new InferenceSession(handler);\n }\n\n startProfiling(): void {\n this.handler.startProfiling();\n }\n endProfiling(): void {\n this.handler.endProfiling();\n }\n\n get inputNames(): readonly string[] {\n return this.handler.inputNames;\n }\n get outputNames(): readonly string[] {\n return this.handler.outputNames;\n }\n\n private handler: InferenceSessionHandler;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession as InferenceSessionImpl} from './inference-session-impl.js';\nimport {OnnxModelOptions} from './onnx-model.js';\nimport {OnnxValue, OnnxValueDataLocation} from './onnx-value.js';\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nexport declare namespace InferenceSession {\n // #region input/output types\n\n type OnnxValueMapType = {readonly [name: string]: OnnxValue};\n type NullableOnnxValueMapType = {readonly [name: string]: OnnxValue | null};\n\n /**\n * A feeds (model inputs) is an object that uses input names as keys and OnnxValue as corresponding values.\n */\n type FeedsType = OnnxValueMapType;\n\n /**\n * A fetches (model outputs) could be one of the following:\n *\n * - Omitted. Use model's output names definition.\n * - An array of string indicating the output names.\n * - An object that use output names as keys and OnnxValue or null as corresponding values.\n *\n * @remark\n * different from input argument, in output, OnnxValue is optional. If an OnnxValue is present it will be\n * used as a pre-allocated value by the inference engine; if omitted, inference engine will allocate buffer\n * internally.\n */\n type FetchesType = readonly string[]|NullableOnnxValueMapType;\n\n /**\n * A inferencing return type is an object that uses output names as keys and OnnxValue as corresponding values.\n */\n type ReturnType = OnnxValueMapType;\n\n // #endregion\n\n // #region session options\n\n /**\n * A set of configurations for session behavior.\n */\n export interface SessionOptions extends OnnxModelOptions {\n /**\n * An array of execution provider options.\n *\n * An execution provider option can be a string indicating the name of the execution provider,\n * or an object of corresponding type.\n */\n executionProviders?: readonly ExecutionProviderConfig[];\n\n /**\n * The intra OP threads number.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native).\n */\n intraOpNumThreads?: number;\n\n /**\n * The inter OP threads number.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native).\n */\n interOpNumThreads?: number;\n\n /**\n * The free dimension override.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n freeDimensionOverrides?: {readonly [dimensionName: string]: number};\n\n /**\n * The optimization level.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n graphOptimizationLevel?: 'disabled'|'basic'|'extended'|'all';\n\n /**\n * Whether enable CPU memory arena.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n enableCpuMemArena?: boolean;\n\n /**\n * Whether enable memory pattern.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n enableMemPattern?: boolean;\n\n /**\n * Execution mode.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n executionMode?: 'sequential'|'parallel';\n\n /**\n * Optimized model file path.\n *\n * If this setting is specified, the optimized model will be dumped. In browser, a blob will be created\n * with a pop-up window.\n */\n optimizedModelFilePath?: string;\n\n /**\n * Whether enable profiling.\n *\n * This setting is a placeholder for a future use.\n */\n enableProfiling?: boolean;\n\n /**\n * File prefix for profiling.\n *\n * This setting is a placeholder for a future use.\n */\n profileFilePrefix?: string;\n\n /**\n * Log ID.\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n logId?: string;\n\n /**\n * Log severity level. See\n * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n logSeverityLevel?: 0|1|2|3|4;\n\n /**\n * Log verbosity level.\n *\n * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n */\n logVerbosityLevel?: number;\n\n /**\n * Specify string as a preferred data location for all outputs, or an object that use output names as keys and a\n * preferred data location as corresponding values.\n *\n * This setting is available only in ONNXRuntime Web for WebGL and WebGPU EP.\n */\n preferredOutputLocation?: OnnxValueDataLocation|{readonly [outputName: string]: OnnxValueDataLocation};\n\n /**\n * Whether enable graph capture.\n * This setting is available only in ONNXRuntime Web for WebGPU EP.\n */\n enableGraphCapture?: boolean;\n\n /**\n * Store configurations for a session. See\n * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/\n * onnxruntime_session_options_config_keys.h\n *\n * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n *\n * @example\n * ```js\n * extra: {\n * session: {\n * set_denormal_as_zero: \"1\",\n * disable_prepacking: \"1\"\n * },\n * optimization: {\n * enable_gelu_approximation: \"1\"\n * }\n * }\n * ```\n */\n extra?: Record;\n }\n\n // #region execution providers\n\n // Currently, we have the following backends to support execution providers:\n // Backend Node.js binding: supports 'cpu', 'dml' (win32), 'coreml' (macOS) and 'cuda' (linux).\n // Backend WebAssembly: supports 'cpu', 'wasm', 'webgpu' and 'webnn'.\n // Backend ONNX.js: supports 'webgl'.\n // Backend React Native: supports 'cpu', 'xnnpack', 'coreml' (iOS), 'nnapi' (Android).\n interface ExecutionProviderOptionMap {\n coreml: CoreMLExecutionProviderOption;\n cpu: CpuExecutionProviderOption;\n cuda: CudaExecutionProviderOption;\n dml: DmlExecutionProviderOption;\n nnapi: NnapiExecutionProviderOption;\n tensorrt: TensorRtExecutionProviderOption;\n wasm: WebAssemblyExecutionProviderOption;\n webgl: WebGLExecutionProviderOption;\n webgpu: WebGpuExecutionProviderOption;\n webnn: WebNNExecutionProviderOption;\n xnnpack: XnnpackExecutionProviderOption;\n }\n\n type ExecutionProviderName = keyof ExecutionProviderOptionMap;\n type ExecutionProviderConfig =\n ExecutionProviderOptionMap[ExecutionProviderName]|ExecutionProviderOption|ExecutionProviderName|string;\n\n export interface ExecutionProviderOption {\n readonly name: string;\n }\n export interface CpuExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'cpu';\n useArena?: boolean;\n }\n export interface CudaExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'cuda';\n deviceId?: number;\n }\n export interface DmlExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'dml';\n deviceId?: number;\n }\n export interface TensorRtExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'tensorrt';\n deviceId?: number;\n }\n export interface WebAssemblyExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'wasm';\n }\n export interface WebGLExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'webgl';\n // TODO: add flags\n }\n export interface XnnpackExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'xnnpack';\n }\n export interface WebGpuExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'webgpu';\n preferredLayout?: 'NCHW'|'NHWC';\n }\n export interface WebNNExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'webnn';\n deviceType?: 'cpu'|'gpu'|'npu';\n numThreads?: number;\n powerPreference?: 'default'|'low-power'|'high-performance';\n }\n export interface CoreMLExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'coreml';\n /**\n * The bit flags for CoreML execution provider.\n *\n * ```\n * COREML_FLAG_USE_CPU_ONLY = 0x001\n * COREML_FLAG_ENABLE_ON_SUBGRAPH = 0x002\n * COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE = 0x004\n * COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES = 0x008\n * COREML_FLAG_CREATE_MLPROGRAM = 0x010\n * ```\n *\n * See include/onnxruntime/core/providers/coreml/coreml_provider_factory.h for more details.\n *\n * This flag is available only in ONNXRuntime (Node.js binding).\n */\n coreMlFlags?: number;\n /**\n * Specify whether to use CPU only in CoreML EP.\n *\n * This setting is available only in ONNXRuntime (react-native).\n */\n useCPUOnly?: boolean;\n /**\n * Specify whether to enable CoreML EP on subgraph.\n *\n * This setting is available only in ONNXRuntime (react-native).\n */\n enableOnSubgraph?: boolean;\n /**\n * Specify whether to only enable CoreML EP for Apple devices with ANE (Apple Neural Engine).\n *\n * This setting is available only in ONNXRuntime (react-native).\n */\n onlyEnableDeviceWithANE?: boolean;\n }\n export interface NnapiExecutionProviderOption extends ExecutionProviderOption {\n readonly name: 'nnapi';\n useFP16?: boolean;\n useNCHW?: boolean;\n cpuDisabled?: boolean;\n cpuOnly?: boolean;\n }\n // #endregion\n\n // #endregion\n\n // #region run options\n\n /**\n * A set of configurations for inference run behavior\n */\n export interface RunOptions {\n /**\n * Log severity level. See\n * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n logSeverityLevel?: 0|1|2|3|4;\n\n /**\n * Log verbosity level.\n *\n * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n */\n logVerbosityLevel?: number;\n\n /**\n * Terminate all incomplete OrtRun calls as soon as possible if true\n *\n * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n */\n terminate?: boolean;\n\n /**\n * A tag for the Run() calls using this\n *\n * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n */\n tag?: string;\n\n /**\n * Set a single run configuration entry. See\n * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/\n * onnxruntime_run_options_config_keys.h\n *\n * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n *\n * @example\n *\n * ```js\n * extra: {\n * memory: {\n * enable_memory_arena_shrinkage: \"1\",\n * }\n * }\n * ```\n */\n extra?: Record;\n }\n\n // #endregion\n\n // #region value metadata\n\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n interface ValueMetadata {\n // TBD\n }\n\n // #endregion\n}\n\n/**\n * Represent a runtime instance of an ONNX model.\n */\nexport interface InferenceSession {\n // #region run()\n\n /**\n * Execute the model asynchronously with the given feeds and options.\n *\n * @param feeds - Representation of the model input. See type description of `InferenceSession.InputType` for detail.\n * @param options - Optional. A set of options that controls the behavior of model inference.\n * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.\n */\n run(feeds: InferenceSession.FeedsType, options?: InferenceSession.RunOptions): Promise;\n\n /**\n * Execute the model asynchronously with the given feeds, fetches and options.\n *\n * @param feeds - Representation of the model input. See type description of `InferenceSession.InputType` for detail.\n * @param fetches - Representation of the model output. See type description of `InferenceSession.OutputType` for\n * detail.\n * @param options - Optional. A set of options that controls the behavior of model inference.\n * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.\n */\n run(feeds: InferenceSession.FeedsType, fetches: InferenceSession.FetchesType,\n options?: InferenceSession.RunOptions): Promise;\n\n // #endregion\n\n // #region release()\n\n /**\n * Release the inference session and the underlying resources.\n */\n release(): Promise;\n\n // #endregion\n\n // #region profiling\n\n /**\n * Start profiling.\n */\n startProfiling(): void;\n\n /**\n * End profiling.\n */\n endProfiling(): void;\n\n // #endregion\n\n // #region metadata\n\n /**\n * Get input names of the loaded model.\n */\n readonly inputNames: readonly string[];\n\n /**\n * Get output names of the loaded model.\n */\n readonly outputNames: readonly string[];\n\n // /**\n // * Get input metadata of the loaded model.\n // */\n // readonly inputMetadata: ReadonlyArray>;\n\n // /**\n // * Get output metadata of the loaded model.\n // */\n // readonly outputMetadata: ReadonlyArray>;\n\n // #endregion\n}\n\nexport interface InferenceSessionFactory {\n // #region create()\n\n /**\n * Create a new inference session and load model asynchronously from an ONNX model file.\n *\n * @param uri - The URI or file path of the model to load.\n * @param options - specify configuration for creating a new inference session.\n * @returns A promise that resolves to an InferenceSession object.\n */\n create(uri: string, options?: InferenceSession.SessionOptions): Promise;\n\n /**\n * Create a new inference session and load model asynchronously from an array bufer.\n *\n * @param buffer - An ArrayBuffer representation of an ONNX model.\n * @param options - specify configuration for creating a new inference session.\n * @returns A promise that resolves to an InferenceSession object.\n */\n create(buffer: ArrayBufferLike, options?: InferenceSession.SessionOptions): Promise;\n\n /**\n * Create a new inference session and load model asynchronously from segment of an array bufer.\n *\n * @param buffer - An ArrayBuffer representation of an ONNX model.\n * @param byteOffset - The beginning of the specified portion of the array buffer.\n * @param byteLength - The length in bytes of the array buffer.\n * @param options - specify configuration for creating a new inference session.\n * @returns A promise that resolves to an InferenceSession object.\n */\n create(buffer: ArrayBufferLike, byteOffset: number, byteLength?: number, options?: InferenceSession.SessionOptions):\n Promise;\n\n /**\n * Create a new inference session and load model asynchronously from a Uint8Array.\n *\n * @param buffer - A Uint8Array representation of an ONNX model.\n * @param options - specify configuration for creating a new inference session.\n * @returns A promise that resolves to an InferenceSession object.\n */\n create(buffer: Uint8Array, options?: InferenceSession.SessionOptions): Promise;\n\n // #endregion\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const InferenceSession: InferenceSessionFactory = InferenceSessionImpl;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {OptionsFormat, OptionsNormalizationParameters, OptionsTensorLayout} from './tensor-factory.js';\n\nexport interface TensorToDataUrlOptions extends OptionsTensorLayout, OptionsFormat, OptionsNormalizationParameters {}\n\nexport interface TensorToImageDataOptions extends OptionsTensorLayout, OptionsFormat, OptionsNormalizationParameters {}\n\nexport interface ConversionUtils {\n /**\n * creates a DataURL instance from tensor\n *\n * @param options - An optional object representing options for creating a DataURL instance from the tensor.\n *\n * The following default settings will be applied:\n * - `format`: `'RGB'`\n * - `tensorLayout`: `'NCHW'`\n * @returns a DataURL string representing the image converted from tensor data\n */\n toDataURL(options?: TensorToDataUrlOptions): string;\n\n /**\n * creates an ImageData instance from tensor\n *\n * @param options - An optional object representing options for creating an ImageData instance from the tensor.\n *\n * The following default settings will be applied:\n * - `format`: `'RGB'`\n * - `tensorLayout`: `'NCHW'`\n * @returns an ImageData instance representing the image converted from tensor data\n */\n toImageData(options?: TensorToImageDataOptions): ImageData;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor, TypedTensor} from './tensor.js';\n\nexport type ImageFormat = 'RGB'|'RGBA'|'BGR'|'RBG';\nexport type ImageTensorLayout = 'NHWC'|'NCHW';\n\n// the following region contains type definitions for constructing tensor from a specific location.\n\n// #region types for constructing a tensor from a specific location\n\n/**\n * represent common properties of the parameter for constructing a tensor from a specific location.\n */\ninterface CommonConstructorParameters extends Pick {\n /**\n * Specify the data type of the tensor.\n */\n readonly type: T;\n}\n\n/**\n * represent the parameter for constructing a tensor from a GPU resource.\n */\ninterface GpuResourceConstructorParameters {\n /**\n * an optional callback function to download data from GPU to CPU.\n *\n * If not provided, the tensor treat the GPU data as external resource.\n */\n download?(): Promise;\n\n /**\n * an optional callback function that will be called when the tensor is disposed.\n *\n * If not provided, the tensor treat the GPU data as external resource.\n */\n dispose?(): void;\n}\n\n/**\n * represent the parameter for constructing a tensor from a pinned CPU buffer\n */\nexport interface CpuPinnedConstructorParameters extends\n CommonConstructorParameters {\n /**\n * Specify the location of the data to be 'cpu-pinned'.\n */\n readonly location: 'cpu-pinned';\n /**\n * Specify the CPU pinned buffer that holds the tensor data.\n */\n readonly data: Tensor.DataTypeMap[T];\n}\n\n/**\n * represent the parameter for constructing a tensor from a WebGL texture\n */\nexport interface TextureConstructorParameters extends\n CommonConstructorParameters, GpuResourceConstructorParameters {\n /**\n * Specify the location of the data to be 'texture'.\n */\n readonly location: 'texture';\n /**\n * Specify the WebGL texture that holds the tensor data.\n */\n readonly texture: Tensor.TextureType;\n}\n\n/**\n * represent the parameter for constructing a tensor from a WebGPU buffer\n */\nexport interface GpuBufferConstructorParameters extends\n CommonConstructorParameters, GpuResourceConstructorParameters {\n /**\n * Specify the location of the data to be 'gpu-buffer'.\n */\n readonly location: 'gpu-buffer';\n /**\n * Specify the WebGPU buffer that holds the tensor data.\n */\n readonly gpuBuffer: Tensor.GpuBufferType;\n}\n\n// #endregion\n\n// the following region contains type definitions of each individual options.\n// the tensor factory functions use a composition of those options as the parameter type.\n\n// #region Options fields\n\nexport interface OptionsFormat {\n /**\n * Describes the image format represented in RGBA color space.\n */\n format?: ImageFormat;\n}\n\nexport interface OptionsTensorFormat {\n /**\n * Describes the image format of the tensor.\n *\n * NOTE: this is different from option 'format'. While option 'format' represents the original image, 'tensorFormat'\n * represents the target format of the tensor. A transpose will be performed if they are different.\n */\n tensorFormat?: ImageFormat;\n}\n\nexport interface OptionsTensorDataType {\n /**\n * Describes the data type of the tensor.\n */\n dataType?: 'float32'|'uint8';\n}\n\nexport interface OptionsTensorLayout {\n /**\n * Describes the tensor layout when representing data of one or more image(s).\n */\n tensorLayout?: ImageTensorLayout;\n}\n\nexport interface OptionsDimensions {\n /**\n * Describes the image height in pixel\n */\n height?: number;\n /**\n * Describes the image width in pixel\n */\n width?: number;\n}\n\nexport interface OptionResizedDimensions {\n /**\n * Describes the resized height. If omitted, original height will be used.\n */\n resizedHeight?: number;\n /**\n * Describes resized width - can be accessed via tensor dimensions as well\n */\n resizedWidth?: number;\n}\n\nexport interface OptionsNormalizationParameters {\n /**\n * Describes normalization parameters when preprocessing the image as model input.\n *\n * Data element are ranged from 0 to 255.\n */\n norm?: {\n /**\n * The 'bias' value for image normalization.\n * - If omitted, use default value 0.\n * - If it's a single number, apply to each channel\n * - If it's an array of 3 or 4 numbers, apply element-wise. Number of elements need to match the number of channels\n * for the corresponding image format\n */\n bias?: number|[number, number, number]|[number, number, number, number];\n /**\n * The 'mean' value for image normalization.\n * - If omitted, use default value 255.\n * - If it's a single number, apply to each channel\n * - If it's an array of 3 or 4 numbers, apply element-wise. Number of elements need to match the number of channels\n * for the corresponding image format\n */\n mean?: number | [number, number, number] | [number, number, number, number];\n };\n}\n\n// #endregion\n\n// #region Options composition\n\nexport interface TensorFromImageDataOptions extends OptionResizedDimensions, OptionsTensorFormat, OptionsTensorLayout,\n OptionsTensorDataType, OptionsNormalizationParameters {}\n\nexport interface TensorFromImageElementOptions extends OptionResizedDimensions, OptionsTensorFormat,\n OptionsTensorLayout, OptionsTensorDataType,\n OptionsNormalizationParameters {}\n\nexport interface TensorFromUrlOptions extends OptionsDimensions, OptionResizedDimensions, OptionsTensorFormat,\n OptionsTensorLayout, OptionsTensorDataType,\n OptionsNormalizationParameters {}\n\nexport interface TensorFromImageBitmapOptions extends OptionResizedDimensions, OptionsTensorFormat, OptionsTensorLayout,\n OptionsTensorDataType, OptionsNormalizationParameters {}\n\nexport interface TensorFromTextureOptions extends\n Required, OptionsFormat, GpuResourceConstructorParameters/* TODO: add more */ {}\n\nexport interface TensorFromGpuBufferOptions extends\n Pick, GpuResourceConstructorParameters {\n /**\n * Describes the data type of the tensor.\n */\n dataType?: T;\n}\n\n// #endregion\n\n/**\n * type TensorFactory defines the factory functions of 'Tensor' to create tensor instances from existing data or\n * resources.\n */\nexport interface TensorFactory {\n /**\n * create a tensor from an ImageData object\n *\n * @param imageData - the ImageData object to create tensor from\n * @param options - An optional object representing options for creating tensor from ImageData.\n *\n * The following default settings will be applied:\n * - `tensorFormat`: `'RGB'`\n * - `tensorLayout`: `'NCHW'`\n * - `dataType`: `'float32'`\n * @returns A promise that resolves to a tensor object\n */\n fromImage(imageData: ImageData, options?: TensorFromImageDataOptions):\n Promise|TypedTensor<'uint8'>>;\n\n /**\n * create a tensor from a HTMLImageElement object\n *\n * @param imageElement - the HTMLImageElement object to create tensor from\n * @param options - An optional object representing options for creating tensor from HTMLImageElement.\n *\n * The following default settings will be applied:\n * - `tensorFormat`: `'RGB'`\n * - `tensorLayout`: `'NCHW'`\n * - `dataType`: `'float32'`\n * @returns A promise that resolves to a tensor object\n */\n fromImage(imageElement: HTMLImageElement, options?: TensorFromImageElementOptions):\n Promise|TypedTensor<'uint8'>>;\n\n /**\n * create a tensor from URL\n *\n * @param urlSource - a string as a URL to the image or a data URL containing the image data.\n * @param options - An optional object representing options for creating tensor from URL.\n *\n * The following default settings will be applied:\n * - `tensorFormat`: `'RGB'`\n * - `tensorLayout`: `'NCHW'`\n * - `dataType`: `'float32'`\n * @returns A promise that resolves to a tensor object\n */\n fromImage(urlSource: string, options?: TensorFromUrlOptions): Promise|TypedTensor<'uint8'>>;\n\n /**\n * create a tensor from an ImageBitmap object\n *\n * @param bitmap - the ImageBitmap object to create tensor from\n * @param options - An optional object representing options for creating tensor from URL.\n *\n * The following default settings will be applied:\n * - `tensorFormat`: `'RGB'`\n * - `tensorLayout`: `'NCHW'`\n * - `dataType`: `'float32'`\n * @returns A promise that resolves to a tensor object\n */\n fromImage(bitmap: ImageBitmap, options: TensorFromImageBitmapOptions):\n Promise|TypedTensor<'uint8'>>;\n\n /**\n * create a tensor from a WebGL texture\n *\n * @param texture - the WebGLTexture object to create tensor from\n * @param options - An optional object representing options for creating tensor from WebGL texture.\n *\n * The options include following properties:\n * - `width`: the width of the texture. Required.\n * - `height`: the height of the texture. Required.\n * - `format`: the format of the texture. If omitted, assume 'RGBA'.\n * - `download`: an optional function to download the tensor data from GPU to CPU. If omitted, the GPU data\n * will not be able to download. Usually, this is provided by a GPU backend for the inference outputs. Users don't\n * need to provide this function.\n * - `dispose`: an optional function to dispose the tensor data on GPU. If omitted, the GPU data will not be disposed.\n * Usually, this is provided by a GPU backend for the inference outputs. Users don't need to provide this function.\n *\n * @returns a tensor object\n */\n fromTexture(\n texture: Tensor.TextureType, options: TensorFromTextureOptions): TypedTensor<'float32'>;\n\n /**\n * create a tensor from a WebGPU buffer\n *\n * @param buffer - the GPUBuffer object to create tensor from\n * @param options - An optional object representing options for creating tensor from WebGPU buffer.\n *\n * The options include following properties:\n * - `dataType`: the data type of the tensor. If omitted, assume 'float32'.\n * - `dims`: the dimension of the tensor. Required.\n * - `download`: an optional function to download the tensor data from GPU to CPU. If omitted, the GPU data\n * will not be able to download. Usually, this is provided by a GPU backend for the inference outputs. Users don't\n * need to provide this function.\n * - `dispose`: an optional function to dispose the tensor data on GPU. If omitted, the GPU data will not be disposed.\n * Usually, this is provided by a GPU backend for the inference outputs. Users don't need to provide this function.\n *\n * @returns a tensor object\n */\n fromGpuBuffer(\n buffer: Tensor.GpuBufferType, options: TensorFromGpuBufferOptions): TypedTensor;\n\n /**\n * create a tensor from a pre-allocated buffer. The buffer will be used as a pinned buffer.\n *\n * @param type - the tensor element type.\n * @param buffer - a TypedArray corresponding to the type.\n * @param dims - specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n *\n * @returns a tensor object\n */\n fromPinnedBuffer>(\n type: T, buffer: Tensor.DataTypeMap[T], dims?: readonly number[]): TypedTensor;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * A string that represents a file's URL or path.\n *\n * Path is vailable only in onnxruntime-node or onnxruntime-web running in Node.js.\n */\nexport type FileUrlOrPath = string;\n\n/**\n * A Blob object that represents a file.\n */\nexport type FileBlob = Blob;\n\n/**\n * A Uint8Array, ArrayBuffer or SharedArrayBuffer object that represents a file content.\n *\n * When it is an ArrayBuffer or SharedArrayBuffer, the whole buffer is assumed to be the file content.\n */\nexport type FileData = Uint8Array|ArrayBufferLike;\n\n/**\n * Represents a file that can be loaded by the ONNX Runtime JavaScript API.\n */\nexport type FileType = FileUrlOrPath|FileBlob|FileData;\n\n/**\n * Represents an external data file.\n */\nexport interface ExternalDataFileDescription {\n /**\n * Specify the external data file.\n */\n data: FileType;\n /**\n * Specify the file path.\n */\n path: string;\n}\n\n/**\n * Represents an external data file.\n *\n * When using a string, it should be a file URL or path that in the same directory as the model file.\n */\nexport type ExternalDataFileType = ExternalDataFileDescription|FileUrlOrPath;\n\n/**\n * Options for model loading.\n */\nexport interface OnnxModelOptions {\n /**\n * Specifying a list of files that represents the external data.\n */\n externalData?: readonly ExternalDataFileType[];\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from './tensor.js';\n\nexport type NonTensorType = never;\n\n/**\n * Type OnnxValue Represents both tensors and non-tensors value for model's inputs/outputs.\n *\n * NOTE: currently not support non-tensor\n */\nexport type OnnxValue = Tensor|NonTensorType;\n\n/**\n * Type OnnxValueDataLocation represents the location of the data of an OnnxValue.\n */\nexport type OnnxValueDataLocation = Tensor.DataLocation;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {resolveBackendAndExecutionProviders} from './backend-impl.js';\nimport {SessionHandler, TrainingSessionHandler} from './backend.js';\nimport {InferenceSession as InferenceSession} from './inference-session.js';\nimport {OnnxValue} from './onnx-value.js';\nimport {Tensor} from './tensor.js';\nimport {TrainingSession as TrainingSessionInterface, TrainingSessionCreateOptions} from './training-session.js';\n\ntype SessionOptions = InferenceSession.SessionOptions;\ntype FeedsType = InferenceSession.FeedsType;\ntype FetchesType = InferenceSession.FetchesType;\ntype ReturnType = InferenceSession.ReturnType;\ntype RunOptions = InferenceSession.RunOptions;\n\nconst noBackendErrMsg: string = 'Training backend could not be resolved. ' +\n 'Make sure you\\'re using the correct configuration & WebAssembly files.';\n\nexport class TrainingSession implements TrainingSessionInterface {\n private constructor(handler: TrainingSessionHandler, hasOptimizerModel: boolean, hasEvalModel: boolean) {\n this.handler = handler;\n this.hasOptimizerModel = hasOptimizerModel;\n this.hasEvalModel = hasEvalModel;\n }\n private handler: TrainingSessionHandler;\n private hasOptimizerModel: boolean;\n private hasEvalModel: boolean;\n\n get trainingInputNames(): readonly string[] {\n return this.handler.inputNames;\n }\n get trainingOutputNames(): readonly string[] {\n return this.handler.outputNames;\n }\n\n get evalInputNames(): readonly string[] {\n if (this.hasEvalModel) {\n return this.handler.evalInputNames;\n } else {\n throw new Error('This training session has no evalModel loaded.');\n }\n }\n get evalOutputNames(): readonly string[] {\n if (this.hasEvalModel) {\n return this.handler.evalOutputNames;\n } else {\n throw new Error('This training session has no evalModel loaded.');\n }\n }\n\n static async create(trainingOptions: TrainingSessionCreateOptions, sessionOptions?: SessionOptions):\n Promise {\n const evalModel: string|Uint8Array = trainingOptions.evalModel || '';\n const optimizerModel: string|Uint8Array = trainingOptions.optimizerModel || '';\n const options: SessionOptions = sessionOptions || {};\n\n // resolve backend, update session options with validated EPs, and create session handler\n const [backend, optionsWithValidatedEPs] = await resolveBackendAndExecutionProviders(options);\n if (backend.createTrainingSessionHandler) {\n const handler = await backend.createTrainingSessionHandler(\n trainingOptions.checkpointState, trainingOptions.trainModel, evalModel, optimizerModel,\n optionsWithValidatedEPs);\n return new TrainingSession(handler, !!trainingOptions.optimizerModel, !!trainingOptions.evalModel);\n } else {\n throw new Error(noBackendErrMsg);\n }\n }\n\n /**\n * Helper function for runTrainStep and future runStep methods that handles the type-narrowing conversion from\n * the given parameters to SessionHandler.FetchesType and RunOptions.\n *\n * @param inputNames the feeds object is checked that they contain all input names in the provided list of input\n * names.\n * @param outputNames the fetches object is checked that their keys match up with valid names in the list of output\n * names.\n * @param feeds the required input\n * @param arg1 narrowed & converted into the SessionHandler.FetchesType or RunOptions object\n * @param arg2 optional RunOptions object.\n * @returns\n */\n typeNarrowingForRunStep(\n inputNames: readonly string[], outputNames: readonly string[], feeds: FeedsType, arg1?: FetchesType|RunOptions,\n arg2?: RunOptions): [SessionHandler.FetchesType, RunOptions] {\n const fetches: {[name: string]: OnnxValue|null} = {};\n let options: RunOptions = {};\n // check inputs\n if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n throw new TypeError(\n '\\'feeds\\' must be an object that use input names as keys and OnnxValue as corresponding values.');\n }\n\n let isFetchesEmpty = true;\n // determine which override is being used\n if (typeof arg1 === 'object') {\n if (arg1 === null) {\n throw new TypeError('Unexpected argument[1]: cannot be null.');\n }\n if (arg1 instanceof Tensor) {\n throw new TypeError('\\'fetches\\' cannot be a Tensor');\n }\n\n if (Array.isArray(arg1)) {\n if (arg1.length === 0) {\n throw new TypeError('\\'fetches\\' cannot be an empty array.');\n }\n isFetchesEmpty = false;\n // output names\n for (const name of arg1) {\n if (typeof name !== 'string') {\n throw new TypeError('\\'fetches\\' must be a string array or an object.');\n }\n if (outputNames.indexOf(name) === -1) {\n throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n }\n fetches[name] = null;\n }\n\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n } else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else {\n // decide whether arg1 is fetches or options\n // if any output name is present and its value is valid OnnxValue, we consider it fetches\n let isFetches = false;\n const arg1Keys = Object.getOwnPropertyNames(arg1);\n for (const name of outputNames) {\n if (arg1Keys.indexOf(name) !== -1) {\n const v = (arg1 as InferenceSession.NullableOnnxValueMapType)[name];\n if (v === null || v instanceof Tensor) {\n isFetches = true;\n isFetchesEmpty = false;\n fetches[name] = v;\n }\n }\n }\n\n if (isFetches) {\n if (typeof arg2 === 'object' && arg2 !== null) {\n options = arg2;\n } else if (typeof arg2 !== 'undefined') {\n throw new TypeError('\\'options\\' must be an object.');\n }\n } else {\n options = arg1 as RunOptions;\n }\n }\n } else if (typeof arg1 !== 'undefined') {\n throw new TypeError('Unexpected argument[1]: must be \\'fetches\\' or \\'options\\'.');\n }\n\n // check if all inputs are in feed\n for (const name of inputNames) {\n if (typeof feeds[name] === 'undefined') {\n throw new Error(`input '${name}' is missing in 'feeds'.`);\n }\n }\n\n // if no fetches is specified, we use the full output names list\n if (isFetchesEmpty) {\n for (const name of outputNames) {\n fetches[name] = null;\n }\n }\n\n return [fetches, options];\n }\n\n /**\n * Helper method for runTrainStep and any other runStep methods. Takes the ReturnType result from the SessionHandler\n * and changes it into a map of Tensors.\n *\n * @param results\n * @returns\n */\n convertHandlerReturnTypeToMapOfTensors(results: SessionHandler.ReturnType): ReturnType {\n const returnValue: {[name: string]: OnnxValue} = {};\n for (const key in results) {\n if (Object.hasOwnProperty.call(results, key)) {\n const result = results[key];\n if (result instanceof Tensor) {\n returnValue[key] = result;\n } else {\n returnValue[key] = new Tensor(result.type, result.data, result.dims);\n }\n }\n }\n return returnValue;\n }\n\n async lazyResetGrad(): Promise {\n await this.handler.lazyResetGrad();\n }\n\n runTrainStep(feeds: FeedsType, options?: RunOptions): Promise;\n runTrainStep(feeds: FeedsType, fetches: FetchesType, options?: RunOptions): Promise;\n async runTrainStep(feeds: FeedsType, arg1?: FetchesType|RunOptions, arg2?: RunOptions): Promise {\n const [fetches, options] =\n this.typeNarrowingForRunStep(this.trainingInputNames, this.trainingOutputNames, feeds, arg1, arg2);\n const results = await this.handler.runTrainStep(feeds, fetches, options);\n return this.convertHandlerReturnTypeToMapOfTensors(results);\n }\n\n async runOptimizerStep(options?: InferenceSession.RunOptions|undefined): Promise {\n if (this.hasOptimizerModel) {\n await this.handler.runOptimizerStep(options || {});\n } else {\n throw new Error('This TrainingSession has no OptimizerModel loaded.');\n }\n }\n\n runEvalStep(feeds: FeedsType, options?: RunOptions|undefined): Promise;\n runEvalStep(feeds: FeedsType, fetches: FetchesType, options?: RunOptions|undefined): Promise;\n async runEvalStep(feeds: FeedsType, arg1?: FetchesType|RunOptions, arg2?: RunOptions): Promise {\n if (this.hasEvalModel) {\n const [fetches, options] =\n this.typeNarrowingForRunStep(this.evalInputNames, this.evalOutputNames, feeds, arg1, arg2);\n const results = await this.handler.runEvalStep(feeds, fetches, options);\n return this.convertHandlerReturnTypeToMapOfTensors(results);\n } else {\n throw new Error('This TrainingSession has no EvalModel loaded.');\n }\n }\n\n async getParametersSize(trainableOnly = true): Promise {\n return this.handler.getParametersSize(trainableOnly);\n }\n\n async loadParametersBuffer(array: Uint8Array, trainableOnly = true): Promise {\n const paramsSize = await this.getParametersSize(trainableOnly);\n // checking that the size of the Uint8Array is equivalent to the byte length of a Float32Array of the number\n // of parameters\n if (array.length !== 4 * paramsSize) {\n throw new Error(\n 'Size of the buffer passed into loadParametersBuffer must match the number of parameters in ' +\n 'the model. Please use getParametersSize method to check.');\n }\n return this.handler.loadParametersBuffer(array, trainableOnly);\n }\n\n async getContiguousParameters(trainableOnly = true): Promise {\n return this.handler.getContiguousParameters(trainableOnly);\n }\n\n async release(): Promise {\n return this.handler.dispose();\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession} from './inference-session.js';\nimport {OnnxValue} from './onnx-value.js';\nimport {TrainingSession as TrainingSessionImpl} from './training-session-impl.js';\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nexport declare namespace TrainingSession {\n /**\n * Either URI file path (string) or Uint8Array containing model or checkpoint information.\n */\n type UriOrBuffer = string|Uint8Array;\n}\n\n/**\n * Represent a runtime instance of an ONNX training session,\n * which contains a model that can be trained, and, optionally,\n * an eval and optimizer model.\n */\nexport interface TrainingSession {\n // #region run()\n\n /**\n * Lazily resets the gradients of all trainable parameters to zero. Should happen after the invocation of\n * runOptimizerStep.\n */\n lazyResetGrad(): Promise;\n\n /**\n * Run TrainStep asynchronously with the given feeds and options.\n *\n * @param feeds - Representation of the model input. See type description of `InferenceSession.InputType` for\n detail.\n * @param options - Optional. A set of options that controls the behavior of model training.\n * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.\n */\n runTrainStep(feeds: InferenceSession.FeedsType, options?: InferenceSession.RunOptions):\n Promise;\n\n /**\n * Run a single train step with the given inputs and options.\n *\n * @param feeds - Representation of the model input.\n * @param fetches - Representation of the model output.\n * detail.\n * @param options - Optional. A set of options that controls the behavior of model training.\n * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding\n values.\n */\n runTrainStep(\n feeds: InferenceSession.FeedsType, fetches: InferenceSession.FetchesType,\n options?: InferenceSession.RunOptions): Promise;\n\n /**\n * Runs a single optimizer step, which performs weight updates for the trainable parameters using the optimizer model.\n *\n * @param options - Optional. A set of options that controls the behavior of model optimizing.\n */\n runOptimizerStep(options?: InferenceSession.RunOptions): Promise;\n\n /**\n * Run a single eval step with the given inputs and options using the eval model.\n *\n * @param feeds - Representation of the model input.\n * @param options - Optional. A set of options that controls the behavior of model eval step.\n * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding\n values.\n */\n runEvalStep(feeds: InferenceSession.FeedsType, options?: InferenceSession.RunOptions):\n Promise;\n\n /**\n * Run a single eval step with the given inputs and options using the eval model.\n *\n * @param feeds - Representation of the model input.\n * @param fetches - Representation of the model output.\n * detail.\n * @param options - Optional. A set of options that controls the behavior of model eval step.\n * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding\n values.\n */\n runEvalStep(\n feeds: InferenceSession.FeedsType, fetches: InferenceSession.FetchesType,\n options?: InferenceSession.RunOptions): Promise;\n\n // #endregion\n\n // #region copy parameters\n\n /**\n * Retrieves the size of all parameters for the training state. Calculates the total number of primitive (datatype of\n * the parameters) elements of all the parameters in the training state.\n *\n * @param trainableOnly - When set to true, the size is calculated for trainable params only. Default value is true.\n */\n getParametersSize(trainableOnly: boolean): Promise;\n\n /**\n * Copies parameter values from the given buffer to the training state. Currently, only supporting models with\n * parameters of type Float32.\n *\n * @param buffer - A Uint8Array representation of Float32 parameters.\n * @param trainableOnly - True if trainable parameters only to be modified, false otherwise. Default value is true.\n */\n loadParametersBuffer(buffer: Uint8Array, trainableOnly: boolean): Promise;\n\n /**\n * Copies the model parameters to a contiguous buffer. Usually used in the context of Federated Learning.\n * Currently, only supporting models with parameters of type Float32.\n *\n * @param trainableOnly - When set to true, only trainable parameters are copied. Trainable parameters are parameters\n * for which requires_grad is set to true. Default value is true.\n * @returns A promise that resolves to a Float32 OnnxValue of the requested parameters.\n */\n getContiguousParameters(trainableOnly: boolean): Promise;\n // #endregion\n\n // #region release()\n\n /**\n * Release the inference session and the underlying resources.\n */\n release(): Promise;\n // #endregion\n\n // #region metadata\n\n /**\n * Get input names of the loaded training model.\n */\n readonly trainingInputNames: readonly string[];\n\n /**\n * Get output names of the loaded training model.\n */\n readonly trainingOutputNames: readonly string[];\n\n /**\n * Get input names of the loaded eval model. Is an empty array if no eval model is loaded.\n */\n readonly evalInputNames: readonly string[];\n\n /**\n * Get output names of the loaded eval model. Is an empty array if no eval model is loaded.\n */\n readonly evalOutputNames: readonly string[];\n\n // #endregion\n}\n\n/**\n * Represents the optional parameters that can be passed into the TrainingSessionFactory.\n */\nexport interface TrainingSessionCreateOptions {\n /**\n * URI or buffer for a .ckpt file that contains the checkpoint for the training model.\n */\n checkpointState: TrainingSession.UriOrBuffer;\n /**\n * URI or buffer for the .onnx training file.\n */\n trainModel: TrainingSession.UriOrBuffer;\n /**\n * Optional. URI or buffer for the .onnx optimizer model file.\n */\n optimizerModel?: TrainingSession.UriOrBuffer;\n /**\n * Optional. URI or buffer for the .onnx eval model file.\n */\n evalModel?: TrainingSession.UriOrBuffer;\n}\n\n/**\n * Defines method overload possibilities for creating a TrainingSession.\n */\nexport interface TrainingSessionFactory {\n // #region create()\n\n /**\n * Creates a new TrainingSession and asynchronously loads any models passed in through trainingOptions\n *\n * @param trainingOptions specify models and checkpoints to load into the Training Session\n * @param sessionOptions specify configuration for training session behavior\n *\n * @returns Promise that resolves to a TrainingSession object\n */\n create(trainingOptions: TrainingSessionCreateOptions, sessionOptions?: InferenceSession.SessionOptions):\n Promise;\n\n // #endregion\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const TrainingSession: TrainingSessionFactory = TrainingSessionImpl;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * # ONNX Runtime JavaScript API\n *\n * ONNX Runtime JavaScript API is a unified API for all JavaScript usages, including the following NPM packages:\n *\n * - [onnxruntime-node](https://www.npmjs.com/package/onnxruntime-node)\n * - [onnxruntime-web](https://www.npmjs.com/package/onnxruntime-web)\n * - [onnxruntime-react-native](https://www.npmjs.com/package/onnxruntime-react-native)\n *\n * See also:\n * - [Get Started](https://onnxruntime.ai/docs/get-started/with-javascript/)\n * - [Inference examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js)\n *\n * @packageDocumentation\n */\n\nexport * from './backend.js';\nexport * from './env.js';\nexport * from './inference-session.js';\nexport * from './tensor.js';\nexport * from './tensor-conversion.js';\nexport * from './tensor-factory.js';\nexport * from './trace.js';\nexport * from './onnx-model.js';\nexport * from './onnx-value.js';\nexport * from './training-session.js';\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Env} from 'onnxruntime-common';\n\nimport {WebGLContext} from './backends/webgl/webgl-context';\n\nexport declare namespace Logger {\n export interface SeverityTypeMap {\n verbose: 'v';\n info: 'i';\n warning: 'w';\n error: 'e';\n fatal: 'f';\n }\n\n export type Severity = keyof SeverityTypeMap;\n\n export type Provider = 'none'|'console';\n\n /**\n * Logging config that used to control the behavior of logger\n */\n export interface Config {\n /**\n * Specify the logging provider. 'console' by default\n */\n provider?: Provider;\n /**\n * Specify the minimal logger serverity. 'warning' by default\n */\n minimalSeverity?: Logger.Severity;\n /**\n * Whether to output date time in log. true by default\n */\n logDateTime?: boolean;\n /**\n * Whether to output source information (Not yet supported). false by default\n */\n logSourceLocation?: boolean;\n }\n\n export interface CategorizedLogger {\n verbose(content: string): void;\n info(content: string): void;\n warning(content: string): void;\n error(content: string): void;\n fatal(content: string): void;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport interface Logger {\n (category: string): Logger.CategorizedLogger;\n\n verbose(content: string): void;\n verbose(category: string, content: string): void;\n info(content: string): void;\n info(category: string, content: string): void;\n warning(content: string): void;\n warning(category: string, content: string): void;\n error(content: string): void;\n error(category: string, content: string): void;\n fatal(content: string): void;\n fatal(category: string, content: string): void;\n\n /**\n * Reset the logger configuration.\n * @param config specify an optional default config\n */\n reset(config?: Logger.Config): void;\n /**\n * Set the logger's behavior on the given category\n * @param category specify a category string. If '*' is specified, all previous configuration will be overwritten. If\n * '' is specified, the default behavior will be updated.\n * @param config the config object to indicate the logger's behavior\n */\n set(category: string, config: Logger.Config): void;\n\n /**\n * Set the logger's behavior from ort-common env\n * @param env the env used to set logger. Currently only setting loglevel is supported through Env.\n */\n setWithEnv(env: Env): void;\n}\n\ninterface LoggerProvider {\n log(severity: Logger.Severity, content: string, category?: string): void;\n}\nclass NoOpLoggerProvider implements LoggerProvider {\n log(_severity: Logger.Severity, _content: string, _category?: string) {\n // do nothing\n }\n}\nclass ConsoleLoggerProvider implements LoggerProvider {\n log(severity: Logger.Severity, content: string, category?: string) {\n // eslint-disable-next-line no-console\n console.log(`${this.color(severity)} ${category ? '\\x1b[35m' + category + '\\x1b[0m ' : ''}${content}`);\n }\n\n private color(severity: Logger.Severity) {\n switch (severity) {\n case 'verbose':\n return '\\x1b[34;40mv\\x1b[0m';\n case 'info':\n return '\\x1b[32mi\\x1b[0m';\n case 'warning':\n return '\\x1b[30;43mw\\x1b[0m';\n case 'error':\n return '\\x1b[31;40me\\x1b[0m';\n case 'fatal':\n return '\\x1b[101mf\\x1b[0m';\n default:\n throw new Error(`unsupported severity: ${severity}`);\n }\n }\n}\n\nconst SEVERITY_VALUE = {\n verbose: 1000,\n info: 2000,\n warning: 4000,\n error: 5000,\n fatal: 6000\n};\n\nconst LOGGER_PROVIDER_MAP: {readonly [provider: string]: Readonly} = {\n ['none']: new NoOpLoggerProvider(),\n ['console']: new ConsoleLoggerProvider()\n};\nconst LOGGER_DEFAULT_CONFIG = {\n provider: 'console',\n minimalSeverity: 'warning',\n logDateTime: true,\n logSourceLocation: false\n};\nlet LOGGER_CONFIG_MAP:\n {[category: string]: Readonly>} = {['']: LOGGER_DEFAULT_CONFIG as Required};\n\nfunction log(category: string): Logger.CategorizedLogger;\nfunction log(severity: Logger.Severity, content: string): void;\nfunction log(severity: Logger.Severity, category: string, content: string): void;\nfunction log(severity: Logger.Severity, arg1: string, arg2?: string): void;\nfunction log(\n arg0: string|Logger.Severity, arg1?: string, arg2?: string|number, arg3?: number): Logger.CategorizedLogger|void {\n if (arg1 === undefined) {\n // log(category: string): Logger.CategorizedLogger;\n return createCategorizedLogger(arg0);\n } else if (arg2 === undefined) {\n // log(severity, content);\n logInternal(arg0 as Logger.Severity, arg1, 1);\n } else if (typeof arg2 === 'number' && arg3 === undefined) {\n // log(severity, content, stack)\n logInternal(arg0 as Logger.Severity, arg1, arg2);\n } else if (typeof arg2 === 'string' && arg3 === undefined) {\n // log(severity, category, content)\n logInternal(arg0 as Logger.Severity, arg2, 1, arg1);\n } else if (typeof arg2 === 'string' && typeof arg3 === 'number') {\n // log(severity, category, content, stack)\n logInternal(arg0 as Logger.Severity, arg2, arg3, arg1);\n } else {\n throw new TypeError('input is valid');\n }\n}\n\nfunction createCategorizedLogger(category: string): Logger.CategorizedLogger {\n return {\n verbose: log.verbose.bind(null, category),\n info: log.info.bind(null, category),\n warning: log.warning.bind(null, category),\n error: log.error.bind(null, category),\n fatal: log.fatal.bind(null, category)\n };\n}\n\n// NOTE: argument 'category' is put the last parameter beacause typescript\n// doesn't allow optional argument put in front of required argument. This\n// order is different from a usual logging API.\nfunction logInternal(severity: Logger.Severity, content: string, _stack: number, category?: string) {\n const config = LOGGER_CONFIG_MAP[category || ''] || LOGGER_CONFIG_MAP[''];\n if (SEVERITY_VALUE[severity] < SEVERITY_VALUE[config.minimalSeverity]) {\n return;\n }\n\n if (config.logDateTime) {\n content = `${new Date().toISOString()}|${content}`;\n }\n\n if (config.logSourceLocation) {\n // TODO: calculate source location from 'stack'\n }\n\n LOGGER_PROVIDER_MAP[config.provider].log(severity, content, category);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nnamespace log {\n export function verbose(content: string): void;\n export function verbose(category: string, content: string): void;\n export function verbose(arg0: string, arg1?: string) {\n log('verbose', arg0, arg1);\n }\n export function info(content: string): void;\n export function info(category: string, content: string): void;\n export function info(arg0: string, arg1?: string) {\n log('info', arg0, arg1);\n }\n export function warning(content: string): void;\n export function warning(category: string, content: string): void;\n export function warning(arg0: string, arg1?: string) {\n log('warning', arg0, arg1);\n }\n export function error(content: string): void;\n export function error(category: string, content: string): void;\n export function error(arg0: string, arg1?: string) {\n log('error', arg0, arg1);\n }\n export function fatal(content: string): void;\n export function fatal(category: string, content: string): void;\n export function fatal(arg0: string, arg1?: string) {\n log('fatal', arg0, arg1);\n }\n\n export function reset(config?: Logger.Config): void {\n LOGGER_CONFIG_MAP = {};\n set('', config || {});\n }\n export function set(category: string, config: Logger.Config): void {\n if (category === '*') {\n reset(config);\n } else {\n const previousConfig = LOGGER_CONFIG_MAP[category] || LOGGER_DEFAULT_CONFIG;\n LOGGER_CONFIG_MAP[category] = {\n provider: config.provider || previousConfig.provider,\n minimalSeverity: config.minimalSeverity || previousConfig.minimalSeverity,\n logDateTime: (config.logDateTime === undefined) ? previousConfig.logDateTime : config.logDateTime,\n logSourceLocation: (config.logSourceLocation === undefined) ? previousConfig.logSourceLocation :\n config.logSourceLocation\n };\n }\n\n // TODO: we want to support wildcard or regex?\n }\n\n export function setWithEnv(env: Env): void {\n const config: Logger.Config = {};\n if (env.logLevel) {\n config.minimalSeverity = env.logLevel as Logger.Severity;\n }\n set('', config);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare, @typescript-eslint/naming-convention\nexport const Logger: Logger = log;\n\nexport declare namespace Profiler {\n export interface Config {\n maxNumberEvents?: number;\n flushBatchSize?: number;\n flushIntervalInMilliseconds?: number;\n }\n\n export type EventCategory = 'session'|'node'|'op'|'backend';\n\n export interface Event {\n end(): void|Promise;\n }\n}\n// TODO\n// class WebGLEvent implements Profiler.Event {}\n\nclass Event implements Profiler.Event {\n constructor(\n public category: Profiler.EventCategory, public name: string, public startTime: number,\n private endCallback: (e: Event) => void|Promise, public timer?: WebGLQuery, public ctx?: WebGLContext) {}\n\n async end() {\n return this.endCallback(this);\n }\n\n async checkTimer(): Promise {\n if (this.ctx === undefined || this.timer === undefined) {\n throw new Error('No webgl timer found');\n } else {\n this.ctx.endTimer();\n return this.ctx.waitForQueryAndGetTime(this.timer);\n }\n }\n}\n\nclass EventRecord {\n constructor(\n public category: Profiler.EventCategory, public name: string, public startTime: number, public endTime: number) {}\n}\n\nexport class Profiler {\n static create(config?: Profiler.Config): Profiler {\n if (config === undefined) {\n return new this();\n }\n return new this(config.maxNumberEvents, config.flushBatchSize, config.flushIntervalInMilliseconds);\n }\n\n private constructor(maxNumberEvents?: number, flushBatchSize?: number, flushIntervalInMilliseconds?: number) {\n this._started = false;\n this._maxNumberEvents = maxNumberEvents === undefined ? 10000 : maxNumberEvents;\n this._flushBatchSize = flushBatchSize === undefined ? 10 : flushBatchSize;\n this._flushIntervalInMilliseconds = flushIntervalInMilliseconds === undefined ? 5000 : flushIntervalInMilliseconds;\n }\n\n // start profiling\n start() {\n this._started = true;\n this._timingEvents = [];\n this._flushTime = now();\n this._flushPointer = 0;\n }\n\n // stop profiling\n stop() {\n this._started = false;\n for (; this._flushPointer < this._timingEvents.length; this._flushPointer++) {\n this.logOneEvent(this._timingEvents[this._flushPointer]);\n }\n }\n\n // create an event scope for the specific function\n event(category: Profiler.EventCategory, name: string, func: () => T, ctx?: WebGLContext): T;\n event(category: Profiler.EventCategory, name: string, func: () => Promise, ctx?: WebGLContext): Promise;\n\n event(category: Profiler.EventCategory, name: string, func: () => T | Promise, ctx?: WebGLContext): T\n |Promise {\n const event = this._started ? this.begin(category, name, ctx) : undefined;\n let isPromise = false;\n\n const res = func();\n\n // we consider a then-able object is a promise\n if (res && typeof (res as Promise).then === 'function') {\n isPromise = true;\n return new Promise((resolve, reject) => {\n (res as Promise)\n .then(\n async value => { // fulfilled\n if (event) {\n await event.end();\n }\n resolve(value);\n },\n async reason => { // rejected\n if (event) {\n await event.end();\n }\n reject(reason);\n });\n });\n }\n if (!isPromise && event) {\n const eventRes = event.end();\n if (eventRes && typeof eventRes.then === 'function') {\n return new Promise((resolve, reject) => {\n (eventRes).then(\n () => { // fulfilled\n resolve(res);\n },\n (reason) => { // rejected\n reject(reason);\n });\n });\n }\n }\n return res;\n }\n\n // begin an event\n begin(category: Profiler.EventCategory, name: string, ctx?: WebGLContext): Event {\n if (!this._started) {\n throw new Error('profiler is not started yet');\n }\n if (ctx === undefined) {\n const startTime = now();\n this.flush(startTime);\n return new Event(category, name, startTime, e => this.endSync(e));\n } else {\n const timer: WebGLQuery = ctx.beginTimer();\n return new Event(category, name, 0, async e => this.end(e), timer, ctx);\n }\n }\n\n // end the specific event\n private async end(event: Event): Promise {\n const endTime: number = await event.checkTimer();\n if (this._timingEvents.length < this._maxNumberEvents) {\n this._timingEvents.push(new EventRecord(event.category, event.name, event.startTime, endTime));\n this.flush(endTime);\n }\n }\n\n private endSync(event: Event): void {\n const endTime: number = now();\n if (this._timingEvents.length < this._maxNumberEvents) {\n this._timingEvents.push(new EventRecord(event.category, event.name, event.startTime, endTime));\n this.flush(endTime);\n }\n }\n\n private logOneEvent(event: EventRecord) {\n Logger.verbose(\n `Profiler.${event.category}`,\n `${(event.endTime - event.startTime).toFixed(2)}ms on event '${event.name}' at ${event.endTime.toFixed(2)}`);\n }\n\n private flush(currentTime: number) {\n if (this._timingEvents.length - this._flushPointer >= this._flushBatchSize ||\n currentTime - this._flushTime >= this._flushIntervalInMilliseconds) {\n // should flush when either batch size accumlated or interval elepsed\n\n for (const previousPointer = this._flushPointer; this._flushPointer < previousPointer + this._flushBatchSize &&\n this._flushPointer < this._timingEvents.length;\n this._flushPointer++) {\n this.logOneEvent(this._timingEvents[this._flushPointer]);\n }\n\n this._flushTime = now();\n }\n }\n\n get started() {\n return this._started;\n }\n private _started = false;\n private _timingEvents: EventRecord[];\n\n private readonly _maxNumberEvents: number;\n\n private readonly _flushBatchSize: number;\n private readonly _flushIntervalInMilliseconds: number;\n\n private _flushTime: number;\n private _flushPointer = 0;\n}\n\n/**\n * returns a number to represent the current timestamp in a resolution as high as possible.\n */\nexport const now = (typeof performance !== 'undefined' && performance.now) ? () => performance.now() : Date.now;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from './graph';\nimport {OperatorImplementation, OperatorInitialization} from './operators';\n\nexport interface OpSet {\n domain: string;\n version: number;\n}\nexport declare namespace OpSet {\n /**\n * Domain of an opset, it can be an empty string(default value, represent for ai.onnx), or 'ai.onnx.ml'\n */\n type Domain = ''|'ai.onnx.ml'|'com.microsoft';\n /**\n * A resolve rule consists of 4 or 5 items: opType, opSetDomain, versionSelector, operatorImplementation and\n * operatorInitialization (optional)\n */\n type ResolveRule = [\n string, Domain, string, OperatorImplementation\n ]|[string, Domain, string, OperatorImplementation, OperatorInitialization];\n}\n\nexport function resolveOperator(node: Graph.Node, opsets: readonly OpSet[], rules: readonly OpSet.ResolveRule[]) {\n for (const rule of rules) {\n const opType = rule[0];\n const domain = rule[1];\n const versionSelector = rule[2];\n const opImpl = rule[3];\n const opInit = rule[4];\n\n if (node.opType === opType) { // operator type matches\n for (const opset of opsets) {\n // opset '' and 'ai.onnx' are considered the same.\n if (opset.domain === domain || (opset.domain === 'ai.onnx' && domain === '')) { // opset domain found\n if (matchSelector(opset.version, versionSelector)) {\n return {opImpl, opInit};\n }\n }\n }\n }\n }\n\n throw new TypeError(`cannot resolve operator '${node.opType}' with opsets: ${\n opsets.map(set => `${set.domain || 'ai.onnx'} v${set.version}`).join(', ')}`);\n}\n\nfunction matchSelector(version: number, selector: string): boolean {\n if (selector.endsWith('+')) {\n // minimum version match ('7+' expects version>=7)\n const rangeStart = Number.parseInt(selector.substring(0, selector.length - 1), 10);\n return !isNaN(rangeStart) && rangeStart <= version;\n } else if (selector.split('-').length === 2) {\n // range match ('6-8' expects 6<=version<=8)\n const pair = selector.split('-');\n const rangeStart = Number.parseInt(pair[0], 10);\n const rangeEnd = Number.parseInt(pair[1], 10);\n return !isNaN(rangeStart) && !isNaN(rangeEnd) && rangeStart <= version && version <= rangeEnd;\n } else {\n // exact match ('7' expects version===7)\n return Number.parseInt(selector, 10) === version;\n }\n}\n", "\"use strict\";\r\nexports.__esModule = true;\r\nvar Guid = /** @class */ (function () {\r\n function Guid(guid) {\r\n if (!guid) {\r\n throw new TypeError(\"Invalid argument; `value` has no value.\");\r\n }\r\n this.value = Guid.EMPTY;\r\n if (guid && Guid.isGuid(guid)) {\r\n this.value = guid;\r\n }\r\n }\r\n Guid.isGuid = function (guid) {\r\n var value = guid.toString();\r\n return guid && (guid instanceof Guid || Guid.validator.test(value));\r\n };\r\n Guid.create = function () {\r\n return new Guid([Guid.gen(2), Guid.gen(1), Guid.gen(1), Guid.gen(1), Guid.gen(3)].join(\"-\"));\r\n };\r\n Guid.createEmpty = function () {\r\n return new Guid(\"emptyguid\");\r\n };\r\n Guid.parse = function (guid) {\r\n return new Guid(guid);\r\n };\r\n Guid.raw = function () {\r\n return [Guid.gen(2), Guid.gen(1), Guid.gen(1), Guid.gen(1), Guid.gen(3)].join(\"-\");\r\n };\r\n Guid.gen = function (count) {\r\n var out = \"\";\r\n for (var i = 0; i < count; i++) {\r\n // tslint:disable-next-line:no-bitwise\r\n out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n }\r\n return out;\r\n };\r\n Guid.prototype.equals = function (other) {\r\n // Comparing string `value` against provided `guid` will auto-call\r\n // toString on `guid` for comparison\r\n return Guid.isGuid(other) && this.value === other.toString();\r\n };\r\n Guid.prototype.isEmpty = function () {\r\n return this.value === Guid.EMPTY;\r\n };\r\n Guid.prototype.toString = function () {\r\n return this.value;\r\n };\r\n Guid.prototype.toJSON = function () {\r\n return {\r\n value: this.value\r\n };\r\n };\r\n Guid.validator = new RegExp(\"^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$\", \"i\");\r\n Guid.EMPTY = \"00000000-0000-0000-0000-000000000000\";\r\n return Guid;\r\n}());\r\nexports.Guid = Guid;\r\n", "/**\n * @license\n * Copyright 2009 The Closure Library Authors\n * Copyright 2020 Daniel Wirtz / The long.js Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// WebAssembly optimizations to do native i64 multiplication and divide\nvar wasm = null;\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n} catch (e) {\n // no wasm support :(\n}\n\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nfunction Long(low, high, unsigned) {\n\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\n\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\n\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nfunction isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n\n/**\n * @function\n * @param {*} value number\n * @returns {number}\n * @inner\n */\nfunction ctz32(value) {\n var c = Math.clz32(value & -value);\n return value ? 31 - c : c;\n}\n\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\nLong.isLong = isLong;\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromInt = fromInt;\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return fromNumber(-value, unsigned).neg();\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromNumber = fromNumber;\n\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromBits = fromBits;\n\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nfunction fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned;\n unsigned = false;\n } else {\n unsigned = !!unsigned;\n }\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return unsigned ? UZERO : ZERO;\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n\n var p;\n if ((p = str.indexOf('-')) > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\nLong.fromString = fromString;\n\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\nLong.fromValue = fromValue;\n\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ZERO = fromInt(0);\n\n/**\n * Signed zero.\n * @type {!Long}\n */\nLong.ZERO = ZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UZERO = fromInt(0, true);\n\n/**\n * Unsigned zero.\n * @type {!Long}\n */\nLong.UZERO = UZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ONE = fromInt(1);\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UONE = fromInt(1, true);\n\n/**\n * Unsigned one.\n * @type {!Long}\n */\nLong.UONE = UONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar NEG_ONE = fromInt(-1);\n\n/**\n * Signed negative one.\n * @type {!Long}\n */\nLong.NEG_ONE = NEG_ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n\n/**\n * Maximum signed value.\n * @type {!Long}\n */\nLong.MAX_VALUE = MAX_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n\n/**\n * Minimum signed value.\n * @type {!Long}\n */\nLong.MIN_VALUE = MIN_VALUE;\n\n/**\n * @alias Long.prototype\n * @inner\n */\nvar LongPrototype = Long.prototype;\n\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n};\n\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toNumber = function toNumber() {\n if (this.unsigned)\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nLongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (this.isZero())\n return '0';\n if (this.isNegative()) { // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else\n return '-' + this.neg().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero())\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n};\n\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nLongPrototype.getHighBits = function getHighBits() {\n return this.high;\n};\n\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n};\n\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nLongPrototype.getLowBits = function getLowBits() {\n return this.low;\n};\n\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n};\n\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative()) // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return this.high != 0 ? bit + 33 : bit + 1;\n};\n\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n};\n\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\nLongPrototype.eqz = LongPrototype.isZero;\n\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n};\n\n/**\n * Tests if this Long's value is positive or zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n};\n\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n};\n\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n};\n\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.equals = function equals(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return this.high === other.high && this.low === other.low;\n};\n\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.eq = LongPrototype.equals;\n\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.notEquals = function notEquals(other) {\n return !this.eq(/* validates */ other);\n};\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.neq = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ne = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThan = function lessThan(other) {\n return this.comp(/* validates */ other) < 0;\n};\n\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lt = LongPrototype.lessThan;\n\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(/* validates */ other) <= 0;\n};\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(/* validates */ other) > 0;\n};\n\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gt = LongPrototype.greaterThan;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(/* validates */ other) >= 0;\n};\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.compare = function compare(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.eq(other))\n return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!this.unsigned)\n return this.sub(other).isNegative() ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\n};\n\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.comp = LongPrototype.compare;\n\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nLongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE))\n return MIN_VALUE;\n return this.not().add(ONE);\n};\n\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\nLongPrototype.neg = LongPrototype.negate;\n\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nLongPrototype.add = function add(addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n};\n\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.sub = LongPrototype.subtract;\n\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero())\n return this;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n\n // use wasm support if present\n if (wasm) {\n var low = wasm[\"mul\"](this.low,\n this.high,\n multiplier.low,\n multiplier.high);\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (multiplier.isZero())\n return this.unsigned ? UZERO : ZERO;\n if (this.eq(MIN_VALUE))\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE))\n return this.isOdd() ? MIN_VALUE : ZERO;\n\n if (this.isNegative()) {\n if (multiplier.isNegative())\n return this.neg().mul(multiplier.neg());\n else\n return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative())\n return this.mul(multiplier.neg()).neg();\n\n // If both longs are small, use float multiplication\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.mul = LongPrototype.multiply;\n\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (divisor.isZero())\n throw Error('division by zero');\n\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!this.unsigned &&\n this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return this;\n }\n var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (this.isZero())\n return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE))\n return this.unsigned ? UZERO : ZERO;\n if (this.isNegative()) {\n if (divisor.isNegative())\n return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative())\n return this.div(divisor.neg()).neg();\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = divisor.toUnsigned();\n if (divisor.gt(this))\n return UZERO;\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = this;\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero())\n approxRes = ONE;\n\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n return res;\n};\n\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.div = LongPrototype.divide;\n\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n\n // use wasm support if present\n if (wasm) {\n var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n return this.sub(this.div(divisor).mul(divisor));\n};\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.mod = LongPrototype.modulo;\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.rem = LongPrototype.modulo;\n\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nLongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n};\n\n/**\n * Returns count leading zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countLeadingZeros = function countLeadingZeros() {\n return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;\n};\n\n/**\n * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.clz = LongPrototype.countLeadingZeros;\n\n/**\n * Returns count trailing zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countTrailingZeros = function countTrailingZeros() {\n return this.low ? ctz32(this.low) : ctz32(this.high) + 32;\n};\n\n/**\n * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.ctz = LongPrototype.countTrailingZeros;\n\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.and = function and(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.or = function or(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.xor = function xor(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\n else\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shl = LongPrototype.shiftLeft;\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\n else\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\n};\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr = LongPrototype.shiftRight;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned);\n if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n};\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotl = LongPrototype.rotateLeft;\n\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotr = LongPrototype.rotateRight;\n\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nLongPrototype.toSigned = function toSigned() {\n if (!this.unsigned)\n return this;\n return fromBits(this.low, this.high, false);\n};\n\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nLongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned)\n return this;\n return fromBits(this.low, this.high, true);\n};\n\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nLongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n};\n\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nLongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n};\n\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nLongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [\n hi >>> 24,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n};\n\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(\n bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24,\n bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24,\n unsigned\n );\n};\n\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(\n bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7],\n bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3],\n unsigned\n );\n};\n\nexport default Long;\n", "/// @file\n/// @addtogroup flatbuffers_javascript_api\n/// @{\n/// @cond FLATBUFFERS_INTERNAL\n\n/**\n * @fileoverview\n *\n * Need to suppress 'global this' error so the Node.js export line doesn't cause\n * closure compile to error out.\n * @suppress {globalThis}\n */\n\n/**\n * @const\n * @namespace\n */\nvar flatbuffers = {};\n\n/**\n * @typedef {number}\n */\nflatbuffers.Offset;\n\n/**\n * @typedef {{\n * bb: flatbuffers.ByteBuffer,\n * bb_pos: number\n * }}\n */\nflatbuffers.Table;\n\n/**\n * @type {number}\n * @const\n */\nflatbuffers.SIZEOF_SHORT = 2;\n\n/**\n * @type {number}\n * @const\n */\nflatbuffers.SIZEOF_INT = 4;\n\n/**\n * @type {number}\n * @const\n */\nflatbuffers.FILE_IDENTIFIER_LENGTH = 4;\n\n/**\n * @type {number}\n * @const\n */\nflatbuffers.SIZE_PREFIX_LENGTH = 4;\n\n/**\n * @enum {number}\n */\nflatbuffers.Encoding = {\n UTF8_BYTES: 1,\n UTF16_STRING: 2\n};\n\n/**\n * @type {Int32Array}\n * @const\n */\nflatbuffers.int32 = new Int32Array(2);\n\n/**\n * @type {Float32Array}\n * @const\n */\nflatbuffers.float32 = new Float32Array(flatbuffers.int32.buffer);\n\n/**\n * @type {Float64Array}\n * @const\n */\nflatbuffers.float64 = new Float64Array(flatbuffers.int32.buffer);\n\n/**\n * @type {boolean}\n * @const\n */\nflatbuffers.isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * @constructor\n * @param {number} low\n * @param {number} high\n */\nflatbuffers.Long = function(low, high) {\n /**\n * @type {number}\n * @const\n */\n this.low = low | 0;\n\n /**\n * @type {number}\n * @const\n */\n this.high = high | 0;\n};\n\n/**\n * @param {number} low\n * @param {number} high\n * @returns {!flatbuffers.Long}\n */\nflatbuffers.Long.create = function(low, high) {\n // Special-case zero to avoid GC overhead for default values\n return low == 0 && high == 0 ? flatbuffers.Long.ZERO : new flatbuffers.Long(low, high);\n};\n\n/**\n * @returns {number}\n */\nflatbuffers.Long.prototype.toFloat64 = function() {\n return (this.low >>> 0) + this.high * 0x100000000;\n};\n\n/**\n * @param {flatbuffers.Long} other\n * @returns {boolean}\n */\nflatbuffers.Long.prototype.equals = function(other) {\n return this.low == other.low && this.high == other.high;\n};\n\n/**\n * @type {!flatbuffers.Long}\n * @const\n */\nflatbuffers.Long.ZERO = new flatbuffers.Long(0, 0);\n\n/// @endcond\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Create a FlatBufferBuilder.\n *\n * @constructor\n * @param {number=} opt_initial_size\n */\nflatbuffers.Builder = function(opt_initial_size) {\n if (!opt_initial_size) {\n var initial_size = 1024;\n } else {\n var initial_size = opt_initial_size;\n }\n\n /**\n * @type {flatbuffers.ByteBuffer}\n * @private\n */\n this.bb = flatbuffers.ByteBuffer.allocate(initial_size);\n\n /**\n * Remaining space in the ByteBuffer.\n *\n * @type {number}\n * @private\n */\n this.space = initial_size;\n\n /**\n * Minimum alignment encountered so far.\n *\n * @type {number}\n * @private\n */\n this.minalign = 1;\n\n /**\n * The vtable for the current table.\n *\n * @type {Array.}\n * @private\n */\n this.vtable = null;\n\n /**\n * The amount of fields we're actually using.\n *\n * @type {number}\n * @private\n */\n this.vtable_in_use = 0;\n\n /**\n * Whether we are currently serializing a table.\n *\n * @type {boolean}\n * @private\n */\n this.isNested = false;\n\n /**\n * Starting offset of the current struct/table.\n *\n * @type {number}\n * @private\n */\n this.object_start = 0;\n\n /**\n * List of offsets of all vtables.\n *\n * @type {Array.}\n * @private\n */\n this.vtables = [];\n\n /**\n * For the current vector being built.\n *\n * @type {number}\n * @private\n */\n this.vector_num_elems = 0;\n\n /**\n * False omits default values from the serialized data\n *\n * @type {boolean}\n * @private\n */\n this.force_defaults = false;\n};\n\nflatbuffers.Builder.prototype.clear = function() {\n this.bb.clear();\n this.space = this.bb.capacity();\n this.minalign = 1;\n this.vtable = null;\n this.vtable_in_use = 0;\n this.isNested = false;\n this.object_start = 0;\n this.vtables = [];\n this.vector_num_elems = 0;\n this.force_defaults = false;\n};\n\n/**\n * In order to save space, fields that are set to their default value\n * don't get serialized into the buffer. Forcing defaults provides a\n * way to manually disable this optimization.\n *\n * @param {boolean} forceDefaults true always serializes default values\n */\nflatbuffers.Builder.prototype.forceDefaults = function(forceDefaults) {\n this.force_defaults = forceDefaults;\n};\n\n/**\n * Get the ByteBuffer representing the FlatBuffer. Only call this after you've\n * called finish(). The actual data starts at the ByteBuffer's current position,\n * not necessarily at 0.\n *\n * @returns {flatbuffers.ByteBuffer}\n */\nflatbuffers.Builder.prototype.dataBuffer = function() {\n return this.bb;\n};\n\n/**\n * Get the bytes representing the FlatBuffer. Only call this after you've\n * called finish().\n *\n * @returns {!Uint8Array}\n */\nflatbuffers.Builder.prototype.asUint8Array = function() {\n return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());\n};\n\n/// @cond FLATBUFFERS_INTERNAL\n/**\n * Prepare to write an element of `size` after `additional_bytes` have been\n * written, e.g. if you write a string, you need to align such the int length\n * field is aligned to 4 bytes, and the string data follows it directly. If all\n * you need to do is alignment, `additional_bytes` will be 0.\n *\n * @param {number} size This is the of the new element to write\n * @param {number} additional_bytes The padding size\n */\nflatbuffers.Builder.prototype.prep = function(size, additional_bytes) {\n // Track the biggest thing we've ever aligned to.\n if (size > this.minalign) {\n this.minalign = size;\n }\n\n // Find the amount of alignment needed such that `size` is properly\n // aligned after `additional_bytes`\n var align_size = ((~(this.bb.capacity() - this.space + additional_bytes)) + 1) & (size - 1);\n\n // Reallocate the buffer if needed.\n while (this.space < align_size + size + additional_bytes) {\n var old_buf_size = this.bb.capacity();\n this.bb = flatbuffers.Builder.growByteBuffer(this.bb);\n this.space += this.bb.capacity() - old_buf_size;\n }\n\n this.pad(align_size);\n};\n\n/**\n * @param {number} byte_size\n */\nflatbuffers.Builder.prototype.pad = function(byte_size) {\n for (var i = 0; i < byte_size; i++) {\n this.bb.writeInt8(--this.space, 0);\n }\n};\n\n/**\n * @param {number} value\n */\nflatbuffers.Builder.prototype.writeInt8 = function(value) {\n this.bb.writeInt8(this.space -= 1, value);\n};\n\n/**\n * @param {number} value\n */\nflatbuffers.Builder.prototype.writeInt16 = function(value) {\n this.bb.writeInt16(this.space -= 2, value);\n};\n\n/**\n * @param {number} value\n */\nflatbuffers.Builder.prototype.writeInt32 = function(value) {\n this.bb.writeInt32(this.space -= 4, value);\n};\n\n/**\n * @param {flatbuffers.Long} value\n */\nflatbuffers.Builder.prototype.writeInt64 = function(value) {\n this.bb.writeInt64(this.space -= 8, value);\n};\n\n/**\n * @param {number} value\n */\nflatbuffers.Builder.prototype.writeFloat32 = function(value) {\n this.bb.writeFloat32(this.space -= 4, value);\n};\n\n/**\n * @param {number} value\n */\nflatbuffers.Builder.prototype.writeFloat64 = function(value) {\n this.bb.writeFloat64(this.space -= 8, value);\n};\n/// @endcond\n\n/**\n * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param {number} value The `int8` to add the the buffer.\n */\nflatbuffers.Builder.prototype.addInt8 = function(value) {\n this.prep(1, 0);\n this.writeInt8(value);\n};\n\n/**\n * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param {number} value The `int16` to add the the buffer.\n */\nflatbuffers.Builder.prototype.addInt16 = function(value) {\n this.prep(2, 0);\n this.writeInt16(value);\n};\n\n/**\n * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param {number} value The `int32` to add the the buffer.\n */\nflatbuffers.Builder.prototype.addInt32 = function(value) {\n this.prep(4, 0);\n this.writeInt32(value);\n};\n\n/**\n * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param {flatbuffers.Long} value The `int64` to add the the buffer.\n */\nflatbuffers.Builder.prototype.addInt64 = function(value) {\n this.prep(8, 0);\n this.writeInt64(value);\n};\n\n/**\n * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param {number} value The `float32` to add the the buffer.\n */\nflatbuffers.Builder.prototype.addFloat32 = function(value) {\n this.prep(4, 0);\n this.writeFloat32(value);\n};\n\n/**\n * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param {number} value The `float64` to add the the buffer.\n */\nflatbuffers.Builder.prototype.addFloat64 = function(value) {\n this.prep(8, 0);\n this.writeFloat64(value);\n};\n\n/// @cond FLATBUFFERS_INTERNAL\n/**\n * @param {number} voffset\n * @param {number} value\n * @param {number} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldInt8 = function(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt8(value);\n this.slot(voffset);\n }\n};\n\n/**\n * @param {number} voffset\n * @param {number} value\n * @param {number} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldInt16 = function(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt16(value);\n this.slot(voffset);\n }\n};\n\n/**\n * @param {number} voffset\n * @param {number} value\n * @param {number} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldInt32 = function(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt32(value);\n this.slot(voffset);\n }\n};\n\n/**\n * @param {number} voffset\n * @param {flatbuffers.Long} value\n * @param {flatbuffers.Long} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldInt64 = function(voffset, value, defaultValue) {\n if (this.force_defaults || !value.equals(defaultValue)) {\n this.addInt64(value);\n this.slot(voffset);\n }\n};\n\n/**\n * @param {number} voffset\n * @param {number} value\n * @param {number} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldFloat32 = function(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addFloat32(value);\n this.slot(voffset);\n }\n};\n\n/**\n * @param {number} voffset\n * @param {number} value\n * @param {number} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldFloat64 = function(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addFloat64(value);\n this.slot(voffset);\n }\n};\n\n/**\n * @param {number} voffset\n * @param {flatbuffers.Offset} value\n * @param {flatbuffers.Offset} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldOffset = function(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addOffset(value);\n this.slot(voffset);\n }\n};\n\n/**\n * Structs are stored inline, so nothing additional is being added. `d` is always 0.\n *\n * @param {number} voffset\n * @param {flatbuffers.Offset} value\n * @param {flatbuffers.Offset} defaultValue\n */\nflatbuffers.Builder.prototype.addFieldStruct = function(voffset, value, defaultValue) {\n if (value != defaultValue) {\n this.nested(value);\n this.slot(voffset);\n }\n};\n\n/**\n * Structures are always stored inline, they need to be created right\n * where they're used. You'll get this assertion failure if you\n * created it elsewhere.\n *\n * @param {flatbuffers.Offset} obj The offset of the created object\n */\nflatbuffers.Builder.prototype.nested = function(obj) {\n if (obj != this.offset()) {\n throw new Error('FlatBuffers: struct must be serialized inline.');\n }\n};\n\n/**\n * Should not be creating any other object, string or vector\n * while an object is being constructed\n */\nflatbuffers.Builder.prototype.notNested = function() {\n if (this.isNested) {\n throw new Error('FlatBuffers: object serialization must not be nested.');\n }\n};\n\n/**\n * Set the current vtable at `voffset` to the current location in the buffer.\n *\n * @param {number} voffset\n */\nflatbuffers.Builder.prototype.slot = function(voffset) {\n this.vtable[voffset] = this.offset();\n};\n\n/**\n * @returns {flatbuffers.Offset} Offset relative to the end of the buffer.\n */\nflatbuffers.Builder.prototype.offset = function() {\n return this.bb.capacity() - this.space;\n};\n\n/**\n * Doubles the size of the backing ByteBuffer and copies the old data towards\n * the end of the new buffer (since we build the buffer backwards).\n *\n * @param {flatbuffers.ByteBuffer} bb The current buffer with the existing data\n * @returns {!flatbuffers.ByteBuffer} A new byte buffer with the old data copied\n * to it. The data is located at the end of the buffer.\n *\n * uint8Array.set() formally takes {Array|ArrayBufferView}, so to pass\n * it a uint8Array we need to suppress the type check:\n * @suppress {checkTypes}\n */\nflatbuffers.Builder.growByteBuffer = function(bb) {\n var old_buf_size = bb.capacity();\n\n // Ensure we don't grow beyond what fits in an int.\n if (old_buf_size & 0xC0000000) {\n throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');\n }\n\n var new_buf_size = old_buf_size << 1;\n var nbb = flatbuffers.ByteBuffer.allocate(new_buf_size);\n nbb.setPosition(new_buf_size - old_buf_size);\n nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);\n return nbb;\n};\n/// @endcond\n\n/**\n * Adds on offset, relative to where it will be written.\n *\n * @param {flatbuffers.Offset} offset The offset to add.\n */\nflatbuffers.Builder.prototype.addOffset = function(offset) {\n this.prep(flatbuffers.SIZEOF_INT, 0); // Ensure alignment is already done.\n this.writeInt32(this.offset() - offset + flatbuffers.SIZEOF_INT);\n};\n\n/// @cond FLATBUFFERS_INTERNAL\n/**\n * Start encoding a new object in the buffer. Users will not usually need to\n * call this directly. The FlatBuffers compiler will generate helper methods\n * that call this method internally.\n *\n * @param {number} numfields\n */\nflatbuffers.Builder.prototype.startObject = function(numfields) {\n this.notNested();\n if (this.vtable == null) {\n this.vtable = [];\n }\n this.vtable_in_use = numfields;\n for (var i = 0; i < numfields; i++) {\n this.vtable[i] = 0; // This will push additional elements as needed\n }\n this.isNested = true;\n this.object_start = this.offset();\n};\n\n/**\n * Finish off writing the object that is under construction.\n *\n * @returns {flatbuffers.Offset} The offset to the object inside `dataBuffer`\n */\nflatbuffers.Builder.prototype.endObject = function() {\n if (this.vtable == null || !this.isNested) {\n throw new Error('FlatBuffers: endObject called without startObject');\n }\n\n this.addInt32(0);\n var vtableloc = this.offset();\n\n // Trim trailing zeroes.\n var i = this.vtable_in_use - 1;\n for (; i >= 0 && this.vtable[i] == 0; i--) {}\n var trimmed_size = i + 1;\n\n // Write out the current vtable.\n for (; i >= 0; i--) {\n // Offset relative to the start of the table.\n this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);\n }\n\n var standard_fields = 2; // The fields below:\n this.addInt16(vtableloc - this.object_start);\n var len = (trimmed_size + standard_fields) * flatbuffers.SIZEOF_SHORT;\n this.addInt16(len);\n\n // Search for an existing vtable that matches the current one.\n var existing_vtable = 0;\n var vt1 = this.space;\nouter_loop:\n for (i = 0; i < this.vtables.length; i++) {\n var vt2 = this.bb.capacity() - this.vtables[i];\n if (len == this.bb.readInt16(vt2)) {\n for (var j = flatbuffers.SIZEOF_SHORT; j < len; j += flatbuffers.SIZEOF_SHORT) {\n if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {\n continue outer_loop;\n }\n }\n existing_vtable = this.vtables[i];\n break;\n }\n }\n\n if (existing_vtable) {\n // Found a match:\n // Remove the current vtable.\n this.space = this.bb.capacity() - vtableloc;\n\n // Point table to existing vtable.\n this.bb.writeInt32(this.space, existing_vtable - vtableloc);\n } else {\n // No match:\n // Add the location of the current vtable to the list of vtables.\n this.vtables.push(this.offset());\n\n // Point table to current vtable.\n this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);\n }\n\n this.isNested = false;\n return vtableloc;\n};\n/// @endcond\n\n/**\n * Finalize a buffer, poiting to the given `root_table`.\n *\n * @param {flatbuffers.Offset} root_table\n * @param {string=} opt_file_identifier\n * @param {boolean=} opt_size_prefix\n */\nflatbuffers.Builder.prototype.finish = function(root_table, opt_file_identifier, opt_size_prefix) {\n var size_prefix = opt_size_prefix ? flatbuffers.SIZE_PREFIX_LENGTH : 0;\n if (opt_file_identifier) {\n var file_identifier = opt_file_identifier;\n this.prep(this.minalign, flatbuffers.SIZEOF_INT +\n flatbuffers.FILE_IDENTIFIER_LENGTH + size_prefix);\n if (file_identifier.length != flatbuffers.FILE_IDENTIFIER_LENGTH) {\n throw new Error('FlatBuffers: file identifier must be length ' +\n flatbuffers.FILE_IDENTIFIER_LENGTH);\n }\n for (var i = flatbuffers.FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {\n this.writeInt8(file_identifier.charCodeAt(i));\n }\n }\n this.prep(this.minalign, flatbuffers.SIZEOF_INT + size_prefix);\n this.addOffset(root_table);\n if (size_prefix) {\n this.addInt32(this.bb.capacity() - this.space);\n }\n this.bb.setPosition(this.space);\n};\n\n/**\n * Finalize a size prefixed buffer, pointing to the given `root_table`.\n *\n * @param {flatbuffers.Offset} root_table\n * @param {string=} opt_file_identifier\n */\nflatbuffers.Builder.prototype.finishSizePrefixed = function (root_table, opt_file_identifier) {\n this.finish(root_table, opt_file_identifier, true);\n};\n\n/// @cond FLATBUFFERS_INTERNAL\n/**\n * This checks a required field has been set in a given table that has\n * just been constructed.\n *\n * @param {flatbuffers.Offset} table\n * @param {number} field\n */\nflatbuffers.Builder.prototype.requiredField = function(table, field) {\n var table_start = this.bb.capacity() - table;\n var vtable_start = table_start - this.bb.readInt32(table_start);\n var ok = this.bb.readInt16(vtable_start + field) != 0;\n\n // If this fails, the caller will show what field needs to be set.\n if (!ok) {\n throw new Error('FlatBuffers: field ' + field + ' must be set');\n }\n};\n\n/**\n * Start a new array/vector of objects. Users usually will not call\n * this directly. The FlatBuffers compiler will create a start/end\n * method for vector types in generated code.\n *\n * @param {number} elem_size The size of each element in the array\n * @param {number} num_elems The number of elements in the array\n * @param {number} alignment The alignment of the array\n */\nflatbuffers.Builder.prototype.startVector = function(elem_size, num_elems, alignment) {\n this.notNested();\n this.vector_num_elems = num_elems;\n this.prep(flatbuffers.SIZEOF_INT, elem_size * num_elems);\n this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.\n};\n\n/**\n * Finish off the creation of an array and all its elements. The array must be\n * created with `startVector`.\n *\n * @returns {flatbuffers.Offset} The offset at which the newly created array\n * starts.\n */\nflatbuffers.Builder.prototype.endVector = function() {\n this.writeInt32(this.vector_num_elems);\n return this.offset();\n};\n/// @endcond\n\n/**\n * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed\n * instead of a string, it is assumed to contain valid UTF-8 encoded data.\n *\n * @param {string|Uint8Array} s The string to encode\n * @return {flatbuffers.Offset} The offset in the buffer where the encoded string starts\n */\nflatbuffers.Builder.prototype.createString = function(s) {\n if (s instanceof Uint8Array) {\n var utf8 = s;\n } else {\n var utf8 = [];\n var i = 0;\n\n while (i < s.length) {\n var codePoint;\n\n // Decode UTF-16\n var a = s.charCodeAt(i++);\n if (a < 0xD800 || a >= 0xDC00) {\n codePoint = a;\n } else {\n var b = s.charCodeAt(i++);\n codePoint = (a << 10) + b + (0x10000 - (0xD800 << 10) - 0xDC00);\n }\n\n // Encode UTF-8\n if (codePoint < 0x80) {\n utf8.push(codePoint);\n } else {\n if (codePoint < 0x800) {\n utf8.push(((codePoint >> 6) & 0x1F) | 0xC0);\n } else {\n if (codePoint < 0x10000) {\n utf8.push(((codePoint >> 12) & 0x0F) | 0xE0);\n } else {\n utf8.push(\n ((codePoint >> 18) & 0x07) | 0xF0,\n ((codePoint >> 12) & 0x3F) | 0x80);\n }\n utf8.push(((codePoint >> 6) & 0x3F) | 0x80);\n }\n utf8.push((codePoint & 0x3F) | 0x80);\n }\n }\n }\n\n this.addInt8(0);\n this.startVector(1, utf8.length, 1);\n this.bb.setPosition(this.space -= utf8.length);\n for (var i = 0, offset = this.space, bytes = this.bb.bytes(); i < utf8.length; i++) {\n bytes[offset++] = utf8[i];\n }\n return this.endVector();\n};\n\n/**\n * A helper function to avoid generated code depending on this file directly.\n *\n * @param {number} low\n * @param {number} high\n * @returns {!flatbuffers.Long}\n */\nflatbuffers.Builder.prototype.createLong = function(low, high) {\n return flatbuffers.Long.create(low, high);\n};\n////////////////////////////////////////////////////////////////////////////////\n/// @cond FLATBUFFERS_INTERNAL\n/**\n * Create a new ByteBuffer with a given array of bytes (`Uint8Array`).\n *\n * @constructor\n * @param {Uint8Array} bytes\n */\nflatbuffers.ByteBuffer = function(bytes) {\n /**\n * @type {Uint8Array}\n * @private\n */\n this.bytes_ = bytes;\n\n /**\n * @type {number}\n * @private\n */\n this.position_ = 0;\n};\n\n/**\n * Create and allocate a new ByteBuffer with a given size.\n *\n * @param {number} byte_size\n * @returns {!flatbuffers.ByteBuffer}\n */\nflatbuffers.ByteBuffer.allocate = function(byte_size) {\n return new flatbuffers.ByteBuffer(new Uint8Array(byte_size));\n};\n\nflatbuffers.ByteBuffer.prototype.clear = function() {\n this.position_ = 0;\n};\n\n/**\n * Get the underlying `Uint8Array`.\n *\n * @returns {Uint8Array}\n */\nflatbuffers.ByteBuffer.prototype.bytes = function() {\n return this.bytes_;\n};\n\n/**\n * Get the buffer's position.\n *\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.position = function() {\n return this.position_;\n};\n\n/**\n * Set the buffer's position.\n *\n * @param {number} position\n */\nflatbuffers.ByteBuffer.prototype.setPosition = function(position) {\n this.position_ = position;\n};\n\n/**\n * Get the buffer's capacity.\n *\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.capacity = function() {\n return this.bytes_.length;\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readInt8 = function(offset) {\n return this.readUint8(offset) << 24 >> 24;\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readUint8 = function(offset) {\n return this.bytes_[offset];\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readInt16 = function(offset) {\n return this.readUint16(offset) << 16 >> 16;\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readUint16 = function(offset) {\n return this.bytes_[offset] | this.bytes_[offset + 1] << 8;\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readInt32 = function(offset) {\n return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readUint32 = function(offset) {\n return this.readInt32(offset) >>> 0;\n};\n\n/**\n * @param {number} offset\n * @returns {!flatbuffers.Long}\n */\nflatbuffers.ByteBuffer.prototype.readInt64 = function(offset) {\n return new flatbuffers.Long(this.readInt32(offset), this.readInt32(offset + 4));\n};\n\n/**\n * @param {number} offset\n * @returns {!flatbuffers.Long}\n */\nflatbuffers.ByteBuffer.prototype.readUint64 = function(offset) {\n return new flatbuffers.Long(this.readUint32(offset), this.readUint32(offset + 4));\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readFloat32 = function(offset) {\n flatbuffers.int32[0] = this.readInt32(offset);\n return flatbuffers.float32[0];\n};\n\n/**\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.readFloat64 = function(offset) {\n flatbuffers.int32[flatbuffers.isLittleEndian ? 0 : 1] = this.readInt32(offset);\n flatbuffers.int32[flatbuffers.isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);\n return flatbuffers.float64[0];\n};\n\n/**\n * @param {number} offset\n * @param {number|boolean} value\n */\nflatbuffers.ByteBuffer.prototype.writeInt8 = function(offset, value) {\n this.bytes_[offset] = /** @type {number} */(value);\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeUint8 = function(offset, value) {\n this.bytes_[offset] = value;\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeInt16 = function(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeUint16 = function(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeInt32 = function(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n this.bytes_[offset + 2] = value >> 16;\n this.bytes_[offset + 3] = value >> 24;\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeUint32 = function(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n this.bytes_[offset + 2] = value >> 16;\n this.bytes_[offset + 3] = value >> 24;\n};\n\n/**\n * @param {number} offset\n * @param {flatbuffers.Long} value\n */\nflatbuffers.ByteBuffer.prototype.writeInt64 = function(offset, value) {\n this.writeInt32(offset, value.low);\n this.writeInt32(offset + 4, value.high);\n};\n\n/**\n * @param {number} offset\n * @param {flatbuffers.Long} value\n */\nflatbuffers.ByteBuffer.prototype.writeUint64 = function(offset, value) {\n this.writeUint32(offset, value.low);\n this.writeUint32(offset + 4, value.high);\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeFloat32 = function(offset, value) {\n flatbuffers.float32[0] = value;\n this.writeInt32(offset, flatbuffers.int32[0]);\n};\n\n/**\n * @param {number} offset\n * @param {number} value\n */\nflatbuffers.ByteBuffer.prototype.writeFloat64 = function(offset, value) {\n flatbuffers.float64[0] = value;\n this.writeInt32(offset, flatbuffers.int32[flatbuffers.isLittleEndian ? 0 : 1]);\n this.writeInt32(offset + 4, flatbuffers.int32[flatbuffers.isLittleEndian ? 1 : 0]);\n};\n\n/**\n * Return the file identifier. Behavior is undefined for FlatBuffers whose\n * schema does not include a file_identifier (likely points at padding or the\n * start of a the root vtable).\n * @returns {string}\n */\nflatbuffers.ByteBuffer.prototype.getBufferIdentifier = function() {\n if (this.bytes_.length < this.position_ + flatbuffers.SIZEOF_INT +\n flatbuffers.FILE_IDENTIFIER_LENGTH) {\n throw new Error(\n 'FlatBuffers: ByteBuffer is too short to contain an identifier.');\n }\n var result = \"\";\n for (var i = 0; i < flatbuffers.FILE_IDENTIFIER_LENGTH; i++) {\n result += String.fromCharCode(\n this.readInt8(this.position_ + flatbuffers.SIZEOF_INT + i));\n }\n return result;\n};\n\n/**\n * Look up a field in the vtable, return an offset into the object, or 0 if the\n * field is not present.\n *\n * @param {number} bb_pos\n * @param {number} vtable_offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.__offset = function(bb_pos, vtable_offset) {\n var vtable = bb_pos - this.readInt32(bb_pos);\n return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;\n};\n\n/**\n * Initialize any Table-derived type to point to the union at the given offset.\n *\n * @param {flatbuffers.Table} t\n * @param {number} offset\n * @returns {flatbuffers.Table}\n */\nflatbuffers.ByteBuffer.prototype.__union = function(t, offset) {\n t.bb_pos = offset + this.readInt32(offset);\n t.bb = this;\n return t;\n};\n\n/**\n * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.\n * This allocates a new string and converts to wide chars upon each access.\n *\n * To avoid the conversion to UTF-16, pass flatbuffers.Encoding.UTF8_BYTES as\n * the \"optionalEncoding\" argument. This is useful for avoiding conversion to\n * and from UTF-16 when the data will just be packaged back up in another\n * FlatBuffer later on.\n *\n * @param {number} offset\n * @param {flatbuffers.Encoding=} opt_encoding Defaults to UTF16_STRING\n * @returns {string|!Uint8Array}\n */\nflatbuffers.ByteBuffer.prototype.__string = function(offset, opt_encoding) {\n offset += this.readInt32(offset);\n\n var length = this.readInt32(offset);\n var result = '';\n var i = 0;\n\n offset += flatbuffers.SIZEOF_INT;\n\n if (opt_encoding === flatbuffers.Encoding.UTF8_BYTES) {\n return this.bytes_.subarray(offset, offset + length);\n }\n\n while (i < length) {\n var codePoint;\n\n // Decode UTF-8\n var a = this.readUint8(offset + i++);\n if (a < 0xC0) {\n codePoint = a;\n } else {\n var b = this.readUint8(offset + i++);\n if (a < 0xE0) {\n codePoint =\n ((a & 0x1F) << 6) |\n (b & 0x3F);\n } else {\n var c = this.readUint8(offset + i++);\n if (a < 0xF0) {\n codePoint =\n ((a & 0x0F) << 12) |\n ((b & 0x3F) << 6) |\n (c & 0x3F);\n } else {\n var d = this.readUint8(offset + i++);\n codePoint =\n ((a & 0x07) << 18) |\n ((b & 0x3F) << 12) |\n ((c & 0x3F) << 6) |\n (d & 0x3F);\n }\n }\n }\n\n // Encode UTF-16\n if (codePoint < 0x10000) {\n result += String.fromCharCode(codePoint);\n } else {\n codePoint -= 0x10000;\n result += String.fromCharCode(\n (codePoint >> 10) + 0xD800,\n (codePoint & ((1 << 10) - 1)) + 0xDC00);\n }\n }\n\n return result;\n};\n\n/**\n * Retrieve the relative offset stored at \"offset\"\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.__indirect = function(offset) {\n return offset + this.readInt32(offset);\n};\n\n/**\n * Get the start of data of a vector whose offset is stored at \"offset\" in this object.\n *\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.__vector = function(offset) {\n return offset + this.readInt32(offset) + flatbuffers.SIZEOF_INT; // data starts after the length\n};\n\n/**\n * Get the length of a vector whose offset is stored at \"offset\" in this object.\n *\n * @param {number} offset\n * @returns {number}\n */\nflatbuffers.ByteBuffer.prototype.__vector_len = function(offset) {\n return this.readInt32(offset + this.readInt32(offset));\n};\n\n/**\n * @param {string} ident\n * @returns {boolean}\n */\nflatbuffers.ByteBuffer.prototype.__has_identifier = function(ident) {\n if (ident.length != flatbuffers.FILE_IDENTIFIER_LENGTH) {\n throw new Error('FlatBuffers: file identifier must be length ' +\n flatbuffers.FILE_IDENTIFIER_LENGTH);\n }\n for (var i = 0; i < flatbuffers.FILE_IDENTIFIER_LENGTH; i++) {\n if (ident.charCodeAt(i) != this.readInt8(this.position_ + flatbuffers.SIZEOF_INT + i)) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * A helper function to avoid generated code depending on this file directly.\n *\n * @param {number} low\n * @param {number} high\n * @returns {!flatbuffers.Long}\n */\nflatbuffers.ByteBuffer.prototype.createLong = function(low, high) {\n return flatbuffers.Long.create(low, high);\n};\n\n// Exports for Node.js and RequireJS\nexport { flatbuffers };\n\n/// @endcond\n/// @}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n/* eslint-disable */\n\nimport {flatbuffers} from 'flatbuffers';\n\n/**\n * @enum {number}\n */\nexport namespace onnxruntime.experimental.fbs {\n export enum AttributeType {\n UNDEFINED = 0,\n FLOAT = 1,\n INT = 2,\n STRING = 3,\n TENSOR = 4,\n GRAPH = 5,\n FLOATS = 6,\n INTS = 7,\n STRINGS = 8,\n TENSORS = 9,\n GRAPHS = 10,\n SPARSE_TENSOR = 11,\n SPARSE_TENSORS = 12\n }\n}\n\n/**\n * @enum {number}\n */\nexport namespace onnxruntime.experimental.fbs {\n export enum DimensionValueType {UNKNOWN = 0, VALUE = 1, PARAM = 2}\n}\n\n/**\n * @enum {number}\n */\nexport namespace onnxruntime.experimental.fbs {\n export enum TensorDataType {\n UNDEFINED = 0,\n FLOAT = 1,\n UINT8 = 2,\n INT8 = 3,\n UINT16 = 4,\n INT16 = 5,\n INT32 = 6,\n INT64 = 7,\n STRING = 8,\n BOOL = 9,\n FLOAT16 = 10,\n DOUBLE = 11,\n UINT32 = 12,\n UINT64 = 13,\n COMPLEX64 = 14,\n COMPLEX128 = 15,\n BFLOAT16 = 16,\n FLOAT8E4M3FN = 17,\n FLOAT8E4M3FNUZ = 18,\n FLOAT8E5M2 = 19,\n FLOAT8E5M2FNUZ = 20,\n }\n}\n\n/**\n * @enum {number}\n */\nexport namespace onnxruntime.experimental.fbs {\n export enum NodeType {Primitive = 0, Fused = 1}\n}\n\n/**\n * @enum {number}\n */\nexport namespace onnxruntime.experimental.fbs {\n export enum TypeInfoValue {NONE = 0, tensor_type = 1, sequence_type = 2, map_type = 3}\n}\n\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Shape {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Shape\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Shape {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Shape= obj\n * @returns Shape\n */\n static getRootAsShape(bb: flatbuffers.ByteBuffer, obj?: Shape): Shape {\n return (obj || new Shape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Shape= obj\n * @returns Shape\n */\n static getSizePrefixedRootAsShape(bb: flatbuffers.ByteBuffer, obj?: Shape): Shape {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Shape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.Dimension= obj\n * @returns onnxruntime.experimental.fbs.Dimension\n */\n dim(index: number, obj?: onnxruntime.experimental.fbs.Dimension): onnxruntime.experimental.fbs.Dimension|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? (obj || new onnxruntime.experimental.fbs.Dimension())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n dimLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startShape(builder: flatbuffers.Builder) {\n builder.startObject(1);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset dimOffset\n */\n static addDim(builder: flatbuffers.Builder, dimOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, dimOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createDimVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startDimVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endShape(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createShape(builder: flatbuffers.Builder, dimOffset: flatbuffers.Offset): flatbuffers.Offset {\n Shape.startShape(builder);\n Shape.addDim(builder, dimOffset);\n return Shape.endShape(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Dimension {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Dimension\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Dimension {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Dimension= obj\n * @returns Dimension\n */\n static getRootAsDimension(bb: flatbuffers.ByteBuffer, obj?: Dimension): Dimension {\n return (obj || new Dimension()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Dimension= obj\n * @returns Dimension\n */\n static getSizePrefixedRootAsDimension(bb: flatbuffers.ByteBuffer, obj?: Dimension): Dimension {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Dimension()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param onnxruntime.experimental.fbs.DimensionValue= obj\n * @returns onnxruntime.experimental.fbs.DimensionValue|null\n */\n value(obj?: onnxruntime.experimental.fbs.DimensionValue): onnxruntime.experimental.fbs.DimensionValue|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? (obj || new onnxruntime.experimental.fbs.DimensionValue())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n denotation(): string|null;\n denotation(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n denotation(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startDimension(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset valueOffset\n */\n static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, valueOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset denotationOffset\n */\n static addDenotation(builder: flatbuffers.Builder, denotationOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, denotationOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endDimension(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createDimension(\n builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset,\n denotationOffset: flatbuffers.Offset): flatbuffers.Offset {\n Dimension.startDimension(builder);\n Dimension.addValue(builder, valueOffset);\n Dimension.addDenotation(builder, denotationOffset);\n return Dimension.endDimension(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class DimensionValue {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns DimensionValue\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): DimensionValue {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param DimensionValue= obj\n * @returns DimensionValue\n */\n static getRootAsDimensionValue(bb: flatbuffers.ByteBuffer, obj?: DimensionValue): DimensionValue {\n return (obj || new DimensionValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param DimensionValue= obj\n * @returns DimensionValue\n */\n static getSizePrefixedRootAsDimensionValue(bb: flatbuffers.ByteBuffer, obj?: DimensionValue): DimensionValue {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new DimensionValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.DimensionValueType\n */\n dimType(): onnxruntime.experimental.fbs.DimensionValueType {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? /** */ (this.bb!.readInt8(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.DimensionValueType.UNKNOWN;\n }\n\n /**\n * @returns flatbuffers.Long\n */\n dimValue(): flatbuffers.Long {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n dimParam(): string|null;\n dimParam(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n dimParam(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startDimensionValue(builder: flatbuffers.Builder) {\n builder.startObject(3);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.DimensionValueType dimType\n */\n static addDimType(builder: flatbuffers.Builder, dimType: onnxruntime.experimental.fbs.DimensionValueType) {\n builder.addFieldInt8(0, dimType, onnxruntime.experimental.fbs.DimensionValueType.UNKNOWN);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Long dimValue\n */\n static addDimValue(builder: flatbuffers.Builder, dimValue: flatbuffers.Long) {\n builder.addFieldInt64(1, dimValue, builder.createLong(0, 0));\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset dimParamOffset\n */\n static addDimParam(builder: flatbuffers.Builder, dimParamOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, dimParamOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endDimensionValue(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createDimensionValue(\n builder: flatbuffers.Builder, dimType: onnxruntime.experimental.fbs.DimensionValueType,\n dimValue: flatbuffers.Long, dimParamOffset: flatbuffers.Offset): flatbuffers.Offset {\n DimensionValue.startDimensionValue(builder);\n DimensionValue.addDimType(builder, dimType);\n DimensionValue.addDimValue(builder, dimValue);\n DimensionValue.addDimParam(builder, dimParamOffset);\n return DimensionValue.endDimensionValue(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class TensorTypeAndShape {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns TensorTypeAndShape\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): TensorTypeAndShape {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param TensorTypeAndShape= obj\n * @returns TensorTypeAndShape\n */\n static getRootAsTensorTypeAndShape(bb: flatbuffers.ByteBuffer, obj?: TensorTypeAndShape): TensorTypeAndShape {\n return (obj || new TensorTypeAndShape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param TensorTypeAndShape= obj\n * @returns TensorTypeAndShape\n */\n static getSizePrefixedRootAsTensorTypeAndShape(bb: flatbuffers.ByteBuffer, obj?: TensorTypeAndShape):\n TensorTypeAndShape {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new TensorTypeAndShape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.TensorDataType\n */\n elemType(): onnxruntime.experimental.fbs.TensorDataType {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? /** */ (this.bb!.readInt32(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.TensorDataType.UNDEFINED;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Shape= obj\n * @returns onnxruntime.experimental.fbs.Shape|null\n */\n shape(obj?: onnxruntime.experimental.fbs.Shape): onnxruntime.experimental.fbs.Shape|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.Shape())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startTensorTypeAndShape(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.TensorDataType elemType\n */\n static addElemType(builder: flatbuffers.Builder, elemType: onnxruntime.experimental.fbs.TensorDataType) {\n builder.addFieldInt32(0, elemType, onnxruntime.experimental.fbs.TensorDataType.UNDEFINED);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset shapeOffset\n */\n static addShape(builder: flatbuffers.Builder, shapeOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, shapeOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endTensorTypeAndShape(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createTensorTypeAndShape(\n builder: flatbuffers.Builder, elemType: onnxruntime.experimental.fbs.TensorDataType,\n shapeOffset: flatbuffers.Offset): flatbuffers.Offset {\n TensorTypeAndShape.startTensorTypeAndShape(builder);\n TensorTypeAndShape.addElemType(builder, elemType);\n TensorTypeAndShape.addShape(builder, shapeOffset);\n return TensorTypeAndShape.endTensorTypeAndShape(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class MapType {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns MapType\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): MapType {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param MapType= obj\n * @returns MapType\n */\n static getRootAsMapType(bb: flatbuffers.ByteBuffer, obj?: MapType): MapType {\n return (obj || new MapType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param MapType= obj\n * @returns MapType\n */\n static getSizePrefixedRootAsMapType(bb: flatbuffers.ByteBuffer, obj?: MapType): MapType {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new MapType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.TensorDataType\n */\n keyType(): onnxruntime.experimental.fbs.TensorDataType {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? /** */ (this.bb!.readInt32(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.TensorDataType.UNDEFINED;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.TypeInfo= obj\n * @returns onnxruntime.experimental.fbs.TypeInfo|null\n */\n valueType(obj?: onnxruntime.experimental.fbs.TypeInfo): onnxruntime.experimental.fbs.TypeInfo|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.TypeInfo())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startMapType(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.TensorDataType keyType\n */\n static addKeyType(builder: flatbuffers.Builder, keyType: onnxruntime.experimental.fbs.TensorDataType) {\n builder.addFieldInt32(0, keyType, onnxruntime.experimental.fbs.TensorDataType.UNDEFINED);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset valueTypeOffset\n */\n static addValueType(builder: flatbuffers.Builder, valueTypeOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, valueTypeOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endMapType(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createMapType(\n builder: flatbuffers.Builder, keyType: onnxruntime.experimental.fbs.TensorDataType,\n valueTypeOffset: flatbuffers.Offset): flatbuffers.Offset {\n MapType.startMapType(builder);\n MapType.addKeyType(builder, keyType);\n MapType.addValueType(builder, valueTypeOffset);\n return MapType.endMapType(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class SequenceType {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns SequenceType\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): SequenceType {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SequenceType= obj\n * @returns SequenceType\n */\n static getRootAsSequenceType(bb: flatbuffers.ByteBuffer, obj?: SequenceType): SequenceType {\n return (obj || new SequenceType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SequenceType= obj\n * @returns SequenceType\n */\n static getSizePrefixedRootAsSequenceType(bb: flatbuffers.ByteBuffer, obj?: SequenceType): SequenceType {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new SequenceType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param onnxruntime.experimental.fbs.TypeInfo= obj\n * @returns onnxruntime.experimental.fbs.TypeInfo|null\n */\n elemType(obj?: onnxruntime.experimental.fbs.TypeInfo): onnxruntime.experimental.fbs.TypeInfo|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? (obj || new onnxruntime.experimental.fbs.TypeInfo())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startSequenceType(builder: flatbuffers.Builder) {\n builder.startObject(1);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset elemTypeOffset\n */\n static addElemType(builder: flatbuffers.Builder, elemTypeOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, elemTypeOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endSequenceType(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createSequenceType(builder: flatbuffers.Builder, elemTypeOffset: flatbuffers.Offset): flatbuffers.Offset {\n SequenceType.startSequenceType(builder);\n SequenceType.addElemType(builder, elemTypeOffset);\n return SequenceType.endSequenceType(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class EdgeEnd {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns EdgeEnd\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): EdgeEnd {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @returns number\n */\n nodeIndex(): number {\n return this.bb!.readUint32(this.bb_pos);\n }\n\n /**\n * @returns number\n */\n srcArgIndex(): number {\n return this.bb!.readInt32(this.bb_pos + 4);\n }\n\n /**\n * @returns number\n */\n dstArgIndex(): number {\n return this.bb!.readInt32(this.bb_pos + 8);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number node_index\n * @param number src_arg_index\n * @param number dst_arg_index\n * @returns flatbuffers.Offset\n */\n static createEdgeEnd(\n builder: flatbuffers.Builder, node_index: number, src_arg_index: number,\n dst_arg_index: number): flatbuffers.Offset {\n builder.prep(4, 12);\n builder.writeInt32(dst_arg_index);\n builder.writeInt32(src_arg_index);\n builder.writeInt32(node_index);\n return builder.offset();\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class NodeEdge {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns NodeEdge\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): NodeEdge {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param NodeEdge= obj\n * @returns NodeEdge\n */\n static getRootAsNodeEdge(bb: flatbuffers.ByteBuffer, obj?: NodeEdge): NodeEdge {\n return (obj || new NodeEdge()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param NodeEdge= obj\n * @returns NodeEdge\n */\n static getSizePrefixedRootAsNodeEdge(bb: flatbuffers.ByteBuffer, obj?: NodeEdge): NodeEdge {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new NodeEdge()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @returns number\n */\n nodeIndex(): number {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.EdgeEnd= obj\n * @returns onnxruntime.experimental.fbs.EdgeEnd\n */\n inputEdges(index: number, obj?: onnxruntime.experimental.fbs.EdgeEnd): onnxruntime.experimental.fbs.EdgeEnd|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.EdgeEnd())\n .__init(this.bb!.__vector(this.bb_pos + offset) + index * 12, this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n inputEdgesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.EdgeEnd= obj\n * @returns onnxruntime.experimental.fbs.EdgeEnd\n */\n outputEdges(index: number, obj?: onnxruntime.experimental.fbs.EdgeEnd): onnxruntime.experimental.fbs.EdgeEnd|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? (obj || new onnxruntime.experimental.fbs.EdgeEnd())\n .__init(this.bb!.__vector(this.bb_pos + offset) + index * 12, this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n outputEdgesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startNodeEdge(builder: flatbuffers.Builder) {\n builder.startObject(3);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number nodeIndex\n */\n static addNodeIndex(builder: flatbuffers.Builder, nodeIndex: number) {\n builder.addFieldInt32(0, nodeIndex, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset inputEdgesOffset\n */\n static addInputEdges(builder: flatbuffers.Builder, inputEdgesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, inputEdgesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startInputEdgesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(12, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset outputEdgesOffset\n */\n static addOutputEdges(builder: flatbuffers.Builder, outputEdgesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, outputEdgesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startOutputEdgesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(12, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endNodeEdge(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createNodeEdge(\n builder: flatbuffers.Builder, nodeIndex: number, inputEdgesOffset: flatbuffers.Offset,\n outputEdgesOffset: flatbuffers.Offset): flatbuffers.Offset {\n NodeEdge.startNodeEdge(builder);\n NodeEdge.addNodeIndex(builder, nodeIndex);\n NodeEdge.addInputEdges(builder, inputEdgesOffset);\n NodeEdge.addOutputEdges(builder, outputEdgesOffset);\n return NodeEdge.endNodeEdge(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Node {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Node\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Node {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Node= obj\n * @returns Node\n */\n static getRootAsNode(bb: flatbuffers.ByteBuffer, obj?: Node): Node {\n return (obj || new Node()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Node= obj\n * @returns Node\n */\n static getSizePrefixedRootAsNode(bb: flatbuffers.ByteBuffer, obj?: Node): Node {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Node()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n name(): string|null;\n name(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n name(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n docString(): string|null;\n docString(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n docString(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n domain(): string|null;\n domain(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n domain(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n sinceVersion(): number {\n let offset = this.bb!.__offset(this.bb_pos, 10);\n return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns number\n */\n index(): number {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n opType(): string|null;\n opType(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n opType(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.NodeType\n */\n type(): onnxruntime.experimental.fbs.NodeType {\n let offset = this.bb!.__offset(this.bb_pos, 16);\n return offset ? /** */ (this.bb!.readInt32(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.NodeType.Primitive;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n executionProviderType(): string|null;\n executionProviderType(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n executionProviderType(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 18);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n inputs(index: number): string;\n inputs(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n inputs(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 20);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n inputsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 20);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n outputs(index: number): string;\n outputs(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n outputs(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 22);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n outputsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 22);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.Attribute= obj\n * @returns onnxruntime.experimental.fbs.Attribute\n */\n attributes(index: number, obj?: onnxruntime.experimental.fbs.Attribute): onnxruntime.experimental.fbs.Attribute\n |null {\n let offset = this.bb!.__offset(this.bb_pos, 24);\n return offset ? (obj || new onnxruntime.experimental.fbs.Attribute())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n attributesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 24);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @returns number\n */\n inputArgCounts(index: number): number|null {\n let offset = this.bb!.__offset(this.bb_pos, 26);\n return offset ? this.bb!.readInt32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n }\n\n /**\n * @returns number\n */\n inputArgCountsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 26);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns Int32Array\n */\n inputArgCountsArray(): Int32Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 26);\n return offset ?\n new Int32Array(\n this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n this.bb!.__vector_len(this.bb_pos + offset)) :\n null;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n implicitInputs(index: number): string;\n implicitInputs(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n implicitInputs(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 28);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n implicitInputsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 28);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startNode(builder: flatbuffers.Builder) {\n builder.startObject(13);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nameOffset\n */\n static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, nameOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset docStringOffset\n */\n static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, docStringOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset domainOffset\n */\n static addDomain(builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, domainOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number sinceVersion\n */\n static addSinceVersion(builder: flatbuffers.Builder, sinceVersion: number) {\n builder.addFieldInt32(3, sinceVersion, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number index\n */\n static addIndex(builder: flatbuffers.Builder, index: number) {\n builder.addFieldInt32(4, index, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset opTypeOffset\n */\n static addOpType(builder: flatbuffers.Builder, opTypeOffset: flatbuffers.Offset) {\n builder.addFieldOffset(5, opTypeOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.NodeType type\n */\n static addType(builder: flatbuffers.Builder, type: onnxruntime.experimental.fbs.NodeType) {\n builder.addFieldInt32(6, type, onnxruntime.experimental.fbs.NodeType.Primitive);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset executionProviderTypeOffset\n */\n static addExecutionProviderType(builder: flatbuffers.Builder, executionProviderTypeOffset: flatbuffers.Offset) {\n builder.addFieldOffset(7, executionProviderTypeOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset inputsOffset\n */\n static addInputs(builder: flatbuffers.Builder, inputsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(8, inputsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createInputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startInputsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset outputsOffset\n */\n static addOutputs(builder: flatbuffers.Builder, outputsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(9, outputsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createOutputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startOutputsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset attributesOffset\n */\n static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(10, attributesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startAttributesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset inputArgCountsOffset\n */\n static addInputArgCounts(builder: flatbuffers.Builder, inputArgCountsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(11, inputArgCountsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createInputArgCountsVector(builder: flatbuffers.Builder, data: number[]|Uint8Array): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt32(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startInputArgCountsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset implicitInputsOffset\n */\n static addImplicitInputs(builder: flatbuffers.Builder, implicitInputsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(12, implicitInputsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createImplicitInputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startImplicitInputsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endNode(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createNode(\n builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, docStringOffset: flatbuffers.Offset,\n domainOffset: flatbuffers.Offset, sinceVersion: number, index: number, opTypeOffset: flatbuffers.Offset,\n type: onnxruntime.experimental.fbs.NodeType, executionProviderTypeOffset: flatbuffers.Offset,\n inputsOffset: flatbuffers.Offset, outputsOffset: flatbuffers.Offset, attributesOffset: flatbuffers.Offset,\n inputArgCountsOffset: flatbuffers.Offset, implicitInputsOffset: flatbuffers.Offset): flatbuffers.Offset {\n Node.startNode(builder);\n Node.addName(builder, nameOffset);\n Node.addDocString(builder, docStringOffset);\n Node.addDomain(builder, domainOffset);\n Node.addSinceVersion(builder, sinceVersion);\n Node.addIndex(builder, index);\n Node.addOpType(builder, opTypeOffset);\n Node.addType(builder, type);\n Node.addExecutionProviderType(builder, executionProviderTypeOffset);\n Node.addInputs(builder, inputsOffset);\n Node.addOutputs(builder, outputsOffset);\n Node.addAttributes(builder, attributesOffset);\n Node.addInputArgCounts(builder, inputArgCountsOffset);\n Node.addImplicitInputs(builder, implicitInputsOffset);\n return Node.endNode(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class ValueInfo {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns ValueInfo\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): ValueInfo {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param ValueInfo= obj\n * @returns ValueInfo\n */\n static getRootAsValueInfo(bb: flatbuffers.ByteBuffer, obj?: ValueInfo): ValueInfo {\n return (obj || new ValueInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param ValueInfo= obj\n * @returns ValueInfo\n */\n static getSizePrefixedRootAsValueInfo(bb: flatbuffers.ByteBuffer, obj?: ValueInfo): ValueInfo {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new ValueInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n name(): string|null;\n name(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n name(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n docString(): string|null;\n docString(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n docString(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.TypeInfo= obj\n * @returns onnxruntime.experimental.fbs.TypeInfo|null\n */\n type(obj?: onnxruntime.experimental.fbs.TypeInfo): onnxruntime.experimental.fbs.TypeInfo|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? (obj || new onnxruntime.experimental.fbs.TypeInfo())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startValueInfo(builder: flatbuffers.Builder) {\n builder.startObject(3);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nameOffset\n */\n static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, nameOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset docStringOffset\n */\n static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, docStringOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset typeOffset\n */\n static addType(builder: flatbuffers.Builder, typeOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, typeOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endValueInfo(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createValueInfo(\n builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, docStringOffset: flatbuffers.Offset,\n typeOffset: flatbuffers.Offset): flatbuffers.Offset {\n ValueInfo.startValueInfo(builder);\n ValueInfo.addName(builder, nameOffset);\n ValueInfo.addDocString(builder, docStringOffset);\n ValueInfo.addType(builder, typeOffset);\n return ValueInfo.endValueInfo(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class TypeInfo {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns TypeInfo\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): TypeInfo {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param TypeInfo= obj\n * @returns TypeInfo\n */\n static getRootAsTypeInfo(bb: flatbuffers.ByteBuffer, obj?: TypeInfo): TypeInfo {\n return (obj || new TypeInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param TypeInfo= obj\n * @returns TypeInfo\n */\n static getSizePrefixedRootAsTypeInfo(bb: flatbuffers.ByteBuffer, obj?: TypeInfo): TypeInfo {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new TypeInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n denotation(): string|null;\n denotation(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n denotation(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.TypeInfoValue\n */\n valueType(): onnxruntime.experimental.fbs.TypeInfoValue {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? /** */ (this.bb!.readUint8(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.TypeInfoValue.NONE;\n }\n\n /**\n * @param flatbuffers.Table obj\n * @returns ?flatbuffers.Table\n */\n value(obj: T): T|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startTypeInfo(builder: flatbuffers.Builder) {\n builder.startObject(3);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset denotationOffset\n */\n static addDenotation(builder: flatbuffers.Builder, denotationOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, denotationOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.TypeInfoValue valueType\n */\n static addValueType(builder: flatbuffers.Builder, valueType: onnxruntime.experimental.fbs.TypeInfoValue) {\n builder.addFieldInt8(1, valueType, onnxruntime.experimental.fbs.TypeInfoValue.NONE);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset valueOffset\n */\n static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, valueOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endTypeInfo(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createTypeInfo(\n builder: flatbuffers.Builder, denotationOffset: flatbuffers.Offset,\n valueType: onnxruntime.experimental.fbs.TypeInfoValue, valueOffset: flatbuffers.Offset): flatbuffers.Offset {\n TypeInfo.startTypeInfo(builder);\n TypeInfo.addDenotation(builder, denotationOffset);\n TypeInfo.addValueType(builder, valueType);\n TypeInfo.addValue(builder, valueOffset);\n return TypeInfo.endTypeInfo(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class OperatorSetId {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns OperatorSetId\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): OperatorSetId {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param OperatorSetId= obj\n * @returns OperatorSetId\n */\n static getRootAsOperatorSetId(bb: flatbuffers.ByteBuffer, obj?: OperatorSetId): OperatorSetId {\n return (obj || new OperatorSetId()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param OperatorSetId= obj\n * @returns OperatorSetId\n */\n static getSizePrefixedRootAsOperatorSetId(bb: flatbuffers.ByteBuffer, obj?: OperatorSetId): OperatorSetId {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new OperatorSetId()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n domain(): string|null;\n domain(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n domain(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @returns flatbuffers.Long\n */\n version(): flatbuffers.Long {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startOperatorSetId(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset domainOffset\n */\n static addDomain(builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, domainOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Long version\n */\n static addVersion(builder: flatbuffers.Builder, version: flatbuffers.Long) {\n builder.addFieldInt64(1, version, builder.createLong(0, 0));\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endOperatorSetId(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createOperatorSetId(\n builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset, version: flatbuffers.Long): flatbuffers.Offset {\n OperatorSetId.startOperatorSetId(builder);\n OperatorSetId.addDomain(builder, domainOffset);\n OperatorSetId.addVersion(builder, version);\n return OperatorSetId.endOperatorSetId(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Tensor {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Tensor\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Tensor {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Tensor= obj\n * @returns Tensor\n */\n static getRootAsTensor(bb: flatbuffers.ByteBuffer, obj?: Tensor): Tensor {\n return (obj || new Tensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Tensor= obj\n * @returns Tensor\n */\n static getSizePrefixedRootAsTensor(bb: flatbuffers.ByteBuffer, obj?: Tensor): Tensor {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Tensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n name(): string|null;\n name(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n name(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n docString(): string|null;\n docString(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n docString(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param number index\n * @returns flatbuffers.Long\n */\n dims(index: number): flatbuffers.Long|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) :\n this.bb!.createLong(0, 0);\n }\n\n /**\n * @returns number\n */\n dimsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.TensorDataType\n */\n dataType(): onnxruntime.experimental.fbs.TensorDataType {\n let offset = this.bb!.__offset(this.bb_pos, 10);\n return offset ? /** */ (this.bb!.readInt32(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.TensorDataType.UNDEFINED;\n }\n\n /**\n * @param number index\n * @returns number\n */\n rawData(index: number): number|null {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;\n }\n\n /**\n * @returns number\n */\n rawDataLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns Uint8Array\n */\n rawDataArray(): Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ?\n new Uint8Array(\n this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n this.bb!.__vector_len(this.bb_pos + offset)) :\n null;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n stringData(index: number): string;\n stringData(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n stringData(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n stringDataLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startTensor(builder: flatbuffers.Builder) {\n builder.startObject(6);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nameOffset\n */\n static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, nameOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset docStringOffset\n */\n static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, docStringOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset dimsOffset\n */\n static addDims(builder: flatbuffers.Builder, dimsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, dimsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createDimsVector(builder: flatbuffers.Builder, data: flatbuffers.Long[]): flatbuffers.Offset {\n builder.startVector(8, data.length, 8);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt64(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startDimsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(8, numElems, 8);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.TensorDataType dataType\n */\n static addDataType(builder: flatbuffers.Builder, dataType: onnxruntime.experimental.fbs.TensorDataType) {\n builder.addFieldInt32(3, dataType, onnxruntime.experimental.fbs.TensorDataType.UNDEFINED);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset rawDataOffset\n */\n static addRawData(builder: flatbuffers.Builder, rawDataOffset: flatbuffers.Offset) {\n builder.addFieldOffset(4, rawDataOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createRawDataVector(builder: flatbuffers.Builder, data: number[]|Uint8Array): flatbuffers.Offset {\n builder.startVector(1, data.length, 1);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt8(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startRawDataVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(1, numElems, 1);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset stringDataOffset\n */\n static addStringData(builder: flatbuffers.Builder, stringDataOffset: flatbuffers.Offset) {\n builder.addFieldOffset(5, stringDataOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createStringDataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startStringDataVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endTensor(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createTensor(\n builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, docStringOffset: flatbuffers.Offset,\n dimsOffset: flatbuffers.Offset, dataType: onnxruntime.experimental.fbs.TensorDataType,\n rawDataOffset: flatbuffers.Offset, stringDataOffset: flatbuffers.Offset): flatbuffers.Offset {\n Tensor.startTensor(builder);\n Tensor.addName(builder, nameOffset);\n Tensor.addDocString(builder, docStringOffset);\n Tensor.addDims(builder, dimsOffset);\n Tensor.addDataType(builder, dataType);\n Tensor.addRawData(builder, rawDataOffset);\n Tensor.addStringData(builder, stringDataOffset);\n return Tensor.endTensor(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class SparseTensor {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns SparseTensor\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): SparseTensor {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SparseTensor= obj\n * @returns SparseTensor\n */\n static getRootAsSparseTensor(bb: flatbuffers.ByteBuffer, obj?: SparseTensor): SparseTensor {\n return (obj || new SparseTensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SparseTensor= obj\n * @returns SparseTensor\n */\n static getSizePrefixedRootAsSparseTensor(bb: flatbuffers.ByteBuffer, obj?: SparseTensor): SparseTensor {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new SparseTensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Tensor= obj\n * @returns onnxruntime.experimental.fbs.Tensor|null\n */\n values(obj?: onnxruntime.experimental.fbs.Tensor): onnxruntime.experimental.fbs.Tensor|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? (obj || new onnxruntime.experimental.fbs.Tensor())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Tensor= obj\n * @returns onnxruntime.experimental.fbs.Tensor|null\n */\n indices(obj?: onnxruntime.experimental.fbs.Tensor): onnxruntime.experimental.fbs.Tensor|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.Tensor())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param number index\n * @returns flatbuffers.Long\n */\n dims(index: number): flatbuffers.Long|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) :\n this.bb!.createLong(0, 0);\n }\n\n /**\n * @returns number\n */\n dimsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startSparseTensor(builder: flatbuffers.Builder) {\n builder.startObject(3);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset valuesOffset\n */\n static addValues(builder: flatbuffers.Builder, valuesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, valuesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset indicesOffset\n */\n static addIndices(builder: flatbuffers.Builder, indicesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, indicesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset dimsOffset\n */\n static addDims(builder: flatbuffers.Builder, dimsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, dimsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createDimsVector(builder: flatbuffers.Builder, data: flatbuffers.Long[]): flatbuffers.Offset {\n builder.startVector(8, data.length, 8);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt64(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startDimsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(8, numElems, 8);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endSparseTensor(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createSparseTensor(\n builder: flatbuffers.Builder, valuesOffset: flatbuffers.Offset, indicesOffset: flatbuffers.Offset,\n dimsOffset: flatbuffers.Offset): flatbuffers.Offset {\n SparseTensor.startSparseTensor(builder);\n SparseTensor.addValues(builder, valuesOffset);\n SparseTensor.addIndices(builder, indicesOffset);\n SparseTensor.addDims(builder, dimsOffset);\n return SparseTensor.endSparseTensor(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Attribute {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Attribute\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Attribute {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Attribute= obj\n * @returns Attribute\n */\n static getRootAsAttribute(bb: flatbuffers.ByteBuffer, obj?: Attribute): Attribute {\n return (obj || new Attribute()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Attribute= obj\n * @returns Attribute\n */\n static getSizePrefixedRootAsAttribute(bb: flatbuffers.ByteBuffer, obj?: Attribute): Attribute {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Attribute()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n name(): string|null;\n name(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n name(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n docString(): string|null;\n docString(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n docString(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @returns onnxruntime.experimental.fbs.AttributeType\n */\n type(): onnxruntime.experimental.fbs.AttributeType {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? /** */ (this.bb!.readInt32(this.bb_pos + offset)) :\n onnxruntime.experimental.fbs.AttributeType.UNDEFINED;\n }\n\n /**\n * @returns number\n */\n f(): number {\n let offset = this.bb!.__offset(this.bb_pos, 10);\n return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;\n }\n\n /**\n * @returns flatbuffers.Long\n */\n i(): flatbuffers.Long {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n s(): string|null;\n s(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n s(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Tensor= obj\n * @returns onnxruntime.experimental.fbs.Tensor|null\n */\n t(obj?: onnxruntime.experimental.fbs.Tensor): onnxruntime.experimental.fbs.Tensor|null {\n let offset = this.bb!.__offset(this.bb_pos, 16);\n return offset ? (obj || new onnxruntime.experimental.fbs.Tensor())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Graph= obj\n * @returns onnxruntime.experimental.fbs.Graph|null\n */\n g(obj?: onnxruntime.experimental.fbs.Graph): onnxruntime.experimental.fbs.Graph|null {\n let offset = this.bb!.__offset(this.bb_pos, 18);\n return offset ? (obj || new onnxruntime.experimental.fbs.Graph())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param number index\n * @returns number\n */\n floats(index: number): number|null {\n let offset = this.bb!.__offset(this.bb_pos, 20);\n return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n }\n\n /**\n * @returns number\n */\n floatsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 20);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns Float32Array\n */\n floatsArray(): Float32Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 20);\n return offset ?\n new Float32Array(\n this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n this.bb!.__vector_len(this.bb_pos + offset)) :\n null;\n }\n\n /**\n * @param number index\n * @returns flatbuffers.Long\n */\n ints(index: number): flatbuffers.Long|null {\n let offset = this.bb!.__offset(this.bb_pos, 22);\n return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) :\n this.bb!.createLong(0, 0);\n }\n\n /**\n * @returns number\n */\n intsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 22);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n strings(index: number): string;\n strings(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n strings(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 24);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n stringsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 24);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.Tensor= obj\n * @returns onnxruntime.experimental.fbs.Tensor\n */\n tensors(index: number, obj?: onnxruntime.experimental.fbs.Tensor): onnxruntime.experimental.fbs.Tensor|null {\n let offset = this.bb!.__offset(this.bb_pos, 26);\n return offset ? (obj || new onnxruntime.experimental.fbs.Tensor())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n tensorsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 26);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.Graph= obj\n * @returns onnxruntime.experimental.fbs.Graph\n */\n graphs(index: number, obj?: onnxruntime.experimental.fbs.Graph): onnxruntime.experimental.fbs.Graph|null {\n let offset = this.bb!.__offset(this.bb_pos, 28);\n return offset ? (obj || new onnxruntime.experimental.fbs.Graph())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n graphsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 28);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startAttribute(builder: flatbuffers.Builder) {\n builder.startObject(13);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nameOffset\n */\n static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, nameOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset docStringOffset\n */\n static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, docStringOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param onnxruntime.experimental.fbs.AttributeType type\n */\n static addType(builder: flatbuffers.Builder, type: onnxruntime.experimental.fbs.AttributeType) {\n builder.addFieldInt32(2, type, onnxruntime.experimental.fbs.AttributeType.UNDEFINED);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number f\n */\n static addF(builder: flatbuffers.Builder, f: number) {\n builder.addFieldFloat32(3, f, 0.0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Long i\n */\n static addI(builder: flatbuffers.Builder, i: flatbuffers.Long) {\n builder.addFieldInt64(4, i, builder.createLong(0, 0));\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset sOffset\n */\n static addS(builder: flatbuffers.Builder, sOffset: flatbuffers.Offset) {\n builder.addFieldOffset(5, sOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset tOffset\n */\n static addT(builder: flatbuffers.Builder, tOffset: flatbuffers.Offset) {\n builder.addFieldOffset(6, tOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset gOffset\n */\n static addG(builder: flatbuffers.Builder, gOffset: flatbuffers.Offset) {\n builder.addFieldOffset(7, gOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset floatsOffset\n */\n static addFloats(builder: flatbuffers.Builder, floatsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(8, floatsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createFloatsVector(builder: flatbuffers.Builder, data: number[]|Uint8Array): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addFloat32(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startFloatsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset intsOffset\n */\n static addInts(builder: flatbuffers.Builder, intsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(9, intsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createIntsVector(builder: flatbuffers.Builder, data: flatbuffers.Long[]): flatbuffers.Offset {\n builder.startVector(8, data.length, 8);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt64(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startIntsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(8, numElems, 8);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset stringsOffset\n */\n static addStrings(builder: flatbuffers.Builder, stringsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(10, stringsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createStringsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startStringsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset tensorsOffset\n */\n static addTensors(builder: flatbuffers.Builder, tensorsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(11, tensorsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createTensorsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startTensorsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset graphsOffset\n */\n static addGraphs(builder: flatbuffers.Builder, graphsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(12, graphsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createGraphsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startGraphsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endAttribute(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createAttribute(\n builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, docStringOffset: flatbuffers.Offset,\n type: onnxruntime.experimental.fbs.AttributeType, f: number, i: flatbuffers.Long, sOffset: flatbuffers.Offset,\n tOffset: flatbuffers.Offset, gOffset: flatbuffers.Offset, floatsOffset: flatbuffers.Offset,\n intsOffset: flatbuffers.Offset, stringsOffset: flatbuffers.Offset, tensorsOffset: flatbuffers.Offset,\n graphsOffset: flatbuffers.Offset): flatbuffers.Offset {\n Attribute.startAttribute(builder);\n Attribute.addName(builder, nameOffset);\n Attribute.addDocString(builder, docStringOffset);\n Attribute.addType(builder, type);\n Attribute.addF(builder, f);\n Attribute.addI(builder, i);\n Attribute.addS(builder, sOffset);\n Attribute.addT(builder, tOffset);\n Attribute.addG(builder, gOffset);\n Attribute.addFloats(builder, floatsOffset);\n Attribute.addInts(builder, intsOffset);\n Attribute.addStrings(builder, stringsOffset);\n Attribute.addTensors(builder, tensorsOffset);\n Attribute.addGraphs(builder, graphsOffset);\n return Attribute.endAttribute(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Graph {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Graph\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Graph {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Graph= obj\n * @returns Graph\n */\n static getRootAsGraph(bb: flatbuffers.ByteBuffer, obj?: Graph): Graph {\n return (obj || new Graph()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Graph= obj\n * @returns Graph\n */\n static getSizePrefixedRootAsGraph(bb: flatbuffers.ByteBuffer, obj?: Graph): Graph {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Graph()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.Tensor= obj\n * @returns onnxruntime.experimental.fbs.Tensor\n */\n initializers(index: number, obj?: onnxruntime.experimental.fbs.Tensor): onnxruntime.experimental.fbs.Tensor|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? (obj || new onnxruntime.experimental.fbs.Tensor())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n initializersLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.ValueInfo= obj\n * @returns onnxruntime.experimental.fbs.ValueInfo\n */\n nodeArgs(index: number, obj?: onnxruntime.experimental.fbs.ValueInfo): onnxruntime.experimental.fbs.ValueInfo|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.ValueInfo())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n nodeArgsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.Node= obj\n * @returns onnxruntime.experimental.fbs.Node\n */\n nodes(index: number, obj?: onnxruntime.experimental.fbs.Node): onnxruntime.experimental.fbs.Node|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? (obj || new onnxruntime.experimental.fbs.Node())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n nodesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns number\n */\n maxNodeIndex(): number {\n let offset = this.bb!.__offset(this.bb_pos, 10);\n return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.NodeEdge= obj\n * @returns onnxruntime.experimental.fbs.NodeEdge\n */\n nodeEdges(index: number, obj?: onnxruntime.experimental.fbs.NodeEdge): onnxruntime.experimental.fbs.NodeEdge|null {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? (obj || new onnxruntime.experimental.fbs.NodeEdge())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n nodeEdgesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n inputs(index: number): string;\n inputs(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n inputs(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n inputsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array\n */\n outputs(index: number): string;\n outputs(index: number, optionalEncoding: flatbuffers.Encoding): string|Uint8Array;\n outputs(index: number, optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 16);\n return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n }\n\n /**\n * @returns number\n */\n outputsLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 16);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.SparseTensor= obj\n * @returns onnxruntime.experimental.fbs.SparseTensor\n */\n sparseInitializers(index: number, obj?: onnxruntime.experimental.fbs.SparseTensor):\n onnxruntime.experimental.fbs.SparseTensor|null {\n let offset = this.bb!.__offset(this.bb_pos, 18);\n return offset ? (obj || new onnxruntime.experimental.fbs.SparseTensor())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n sparseInitializersLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 18);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startGraph(builder: flatbuffers.Builder) {\n builder.startObject(8);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset initializersOffset\n */\n static addInitializers(builder: flatbuffers.Builder, initializersOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, initializersOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createInitializersVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startInitializersVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nodeArgsOffset\n */\n static addNodeArgs(builder: flatbuffers.Builder, nodeArgsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, nodeArgsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createNodeArgsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startNodeArgsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nodesOffset\n */\n static addNodes(builder: flatbuffers.Builder, nodesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, nodesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createNodesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startNodesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number maxNodeIndex\n */\n static addMaxNodeIndex(builder: flatbuffers.Builder, maxNodeIndex: number) {\n builder.addFieldInt32(3, maxNodeIndex, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nodeEdgesOffset\n */\n static addNodeEdges(builder: flatbuffers.Builder, nodeEdgesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(4, nodeEdgesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createNodeEdgesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startNodeEdgesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset inputsOffset\n */\n static addInputs(builder: flatbuffers.Builder, inputsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(5, inputsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createInputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startInputsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset outputsOffset\n */\n static addOutputs(builder: flatbuffers.Builder, outputsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(6, outputsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createOutputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startOutputsVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset sparseInitializersOffset\n */\n static addSparseInitializers(builder: flatbuffers.Builder, sparseInitializersOffset: flatbuffers.Offset) {\n builder.addFieldOffset(7, sparseInitializersOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createSparseInitializersVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]):\n flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startSparseInitializersVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endGraph(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createGraph(\n builder: flatbuffers.Builder, initializersOffset: flatbuffers.Offset, nodeArgsOffset: flatbuffers.Offset,\n nodesOffset: flatbuffers.Offset, maxNodeIndex: number, nodeEdgesOffset: flatbuffers.Offset,\n inputsOffset: flatbuffers.Offset, outputsOffset: flatbuffers.Offset,\n sparseInitializersOffset: flatbuffers.Offset): flatbuffers.Offset {\n Graph.startGraph(builder);\n Graph.addInitializers(builder, initializersOffset);\n Graph.addNodeArgs(builder, nodeArgsOffset);\n Graph.addNodes(builder, nodesOffset);\n Graph.addMaxNodeIndex(builder, maxNodeIndex);\n Graph.addNodeEdges(builder, nodeEdgesOffset);\n Graph.addInputs(builder, inputsOffset);\n Graph.addOutputs(builder, outputsOffset);\n Graph.addSparseInitializers(builder, sparseInitializersOffset);\n return Graph.endGraph(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class Model {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns Model\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): Model {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Model= obj\n * @returns Model\n */\n static getRootAsModel(bb: flatbuffers.ByteBuffer, obj?: Model): Model {\n return (obj || new Model()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param Model= obj\n * @returns Model\n */\n static getSizePrefixedRootAsModel(bb: flatbuffers.ByteBuffer, obj?: Model): Model {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new Model()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @returns flatbuffers.Long\n */\n irVersion(): flatbuffers.Long {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.OperatorSetId= obj\n * @returns onnxruntime.experimental.fbs.OperatorSetId\n */\n opsetImport(index: number, obj?: onnxruntime.experimental.fbs.OperatorSetId):\n onnxruntime.experimental.fbs.OperatorSetId|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.OperatorSetId())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n opsetImportLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n producerName(): string|null;\n producerName(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n producerName(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n producerVersion(): string|null;\n producerVersion(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n producerVersion(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 10);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n domain(): string|null;\n domain(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n domain(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 12);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @returns flatbuffers.Long\n */\n modelVersion(): flatbuffers.Long {\n let offset = this.bb!.__offset(this.bb_pos, 14);\n return offset ? this.bb!.readInt64(this.bb_pos + offset) : this.bb!.createLong(0, 0);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n docString(): string|null;\n docString(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n docString(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 16);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Graph= obj\n * @returns onnxruntime.experimental.fbs.Graph|null\n */\n graph(obj?: onnxruntime.experimental.fbs.Graph): onnxruntime.experimental.fbs.Graph|null {\n let offset = this.bb!.__offset(this.bb_pos, 18);\n return offset ? (obj || new onnxruntime.experimental.fbs.Graph())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n graphDocString(): string|null;\n graphDocString(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n graphDocString(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 20);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startModel(builder: flatbuffers.Builder) {\n builder.startObject(9);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Long irVersion\n */\n static addIrVersion(builder: flatbuffers.Builder, irVersion: flatbuffers.Long) {\n builder.addFieldInt64(0, irVersion, builder.createLong(0, 0));\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset opsetImportOffset\n */\n static addOpsetImport(builder: flatbuffers.Builder, opsetImportOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, opsetImportOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createOpsetImportVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startOpsetImportVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset producerNameOffset\n */\n static addProducerName(builder: flatbuffers.Builder, producerNameOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, producerNameOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset producerVersionOffset\n */\n static addProducerVersion(builder: flatbuffers.Builder, producerVersionOffset: flatbuffers.Offset) {\n builder.addFieldOffset(3, producerVersionOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset domainOffset\n */\n static addDomain(builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset) {\n builder.addFieldOffset(4, domainOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Long modelVersion\n */\n static addModelVersion(builder: flatbuffers.Builder, modelVersion: flatbuffers.Long) {\n builder.addFieldInt64(5, modelVersion, builder.createLong(0, 0));\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset docStringOffset\n */\n static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n builder.addFieldOffset(6, docStringOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset graphOffset\n */\n static addGraph(builder: flatbuffers.Builder, graphOffset: flatbuffers.Offset) {\n builder.addFieldOffset(7, graphOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset graphDocStringOffset\n */\n static addGraphDocString(builder: flatbuffers.Builder, graphDocStringOffset: flatbuffers.Offset) {\n builder.addFieldOffset(8, graphDocStringOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endModel(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createModel(\n builder: flatbuffers.Builder, irVersion: flatbuffers.Long, opsetImportOffset: flatbuffers.Offset,\n producerNameOffset: flatbuffers.Offset, producerVersionOffset: flatbuffers.Offset,\n domainOffset: flatbuffers.Offset, modelVersion: flatbuffers.Long, docStringOffset: flatbuffers.Offset,\n graphOffset: flatbuffers.Offset, graphDocStringOffset: flatbuffers.Offset): flatbuffers.Offset {\n Model.startModel(builder);\n Model.addIrVersion(builder, irVersion);\n Model.addOpsetImport(builder, opsetImportOffset);\n Model.addProducerName(builder, producerNameOffset);\n Model.addProducerVersion(builder, producerVersionOffset);\n Model.addDomain(builder, domainOffset);\n Model.addModelVersion(builder, modelVersion);\n Model.addDocString(builder, docStringOffset);\n Model.addGraph(builder, graphOffset);\n Model.addGraphDocString(builder, graphDocStringOffset);\n return Model.endModel(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class KernelCreateInfos {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns KernelCreateInfos\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): KernelCreateInfos {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param KernelCreateInfos= obj\n * @returns KernelCreateInfos\n */\n static getRootAsKernelCreateInfos(bb: flatbuffers.ByteBuffer, obj?: KernelCreateInfos): KernelCreateInfos {\n return (obj || new KernelCreateInfos()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param KernelCreateInfos= obj\n * @returns KernelCreateInfos\n */\n static getSizePrefixedRootAsKernelCreateInfos(bb: flatbuffers.ByteBuffer, obj?: KernelCreateInfos):\n KernelCreateInfos {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new KernelCreateInfos()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param number index\n * @returns number\n */\n nodeIndices(index: number): number|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.readUint32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n }\n\n /**\n * @returns number\n */\n nodeIndicesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @returns Uint32Array\n */\n nodeIndicesArray(): Uint32Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ?\n new Uint32Array(\n this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n this.bb!.__vector_len(this.bb_pos + offset)) :\n null;\n }\n\n /**\n * @param number index\n * @returns flatbuffers.Long\n */\n kernelDefHashes(index: number): flatbuffers.Long|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) :\n this.bb!.createLong(0, 0);\n }\n\n /**\n * @returns number\n */\n kernelDefHashesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startKernelCreateInfos(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset nodeIndicesOffset\n */\n static addNodeIndices(builder: flatbuffers.Builder, nodeIndicesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, nodeIndicesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createNodeIndicesVector(builder: flatbuffers.Builder, data: number[]|Uint8Array): flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt32(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startNodeIndicesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset kernelDefHashesOffset\n */\n static addKernelDefHashes(builder: flatbuffers.Builder, kernelDefHashesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, kernelDefHashesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createKernelDefHashesVector(builder: flatbuffers.Builder, data: flatbuffers.Long[]): flatbuffers.Offset {\n builder.startVector(8, data.length, 8);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addInt64(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startKernelDefHashesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(8, numElems, 8);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endKernelCreateInfos(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createKernelCreateInfos(\n builder: flatbuffers.Builder, nodeIndicesOffset: flatbuffers.Offset,\n kernelDefHashesOffset: flatbuffers.Offset): flatbuffers.Offset {\n KernelCreateInfos.startKernelCreateInfos(builder);\n KernelCreateInfos.addNodeIndices(builder, nodeIndicesOffset);\n KernelCreateInfos.addKernelDefHashes(builder, kernelDefHashesOffset);\n return KernelCreateInfos.endKernelCreateInfos(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class SubGraphSessionState {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns SubGraphSessionState\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): SubGraphSessionState {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SubGraphSessionState= obj\n * @returns SubGraphSessionState\n */\n static getRootAsSubGraphSessionState(bb: flatbuffers.ByteBuffer, obj?: SubGraphSessionState): SubGraphSessionState {\n return (obj || new SubGraphSessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SubGraphSessionState= obj\n * @returns SubGraphSessionState\n */\n static getSizePrefixedRootAsSubGraphSessionState(bb: flatbuffers.ByteBuffer, obj?: SubGraphSessionState):\n SubGraphSessionState {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new SubGraphSessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n graphId(): string|null;\n graphId(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n graphId(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.SessionState= obj\n * @returns onnxruntime.experimental.fbs.SessionState|null\n */\n sessionState(obj?: onnxruntime.experimental.fbs.SessionState): onnxruntime.experimental.fbs.SessionState|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.SessionState())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startSubGraphSessionState(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset graphIdOffset\n */\n static addGraphId(builder: flatbuffers.Builder, graphIdOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, graphIdOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset sessionStateOffset\n */\n static addSessionState(builder: flatbuffers.Builder, sessionStateOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, sessionStateOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endSubGraphSessionState(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n builder.requiredField(offset, 4); // graph_id\n return offset;\n }\n\n static createSubGraphSessionState(\n builder: flatbuffers.Builder, graphIdOffset: flatbuffers.Offset,\n sessionStateOffset: flatbuffers.Offset): flatbuffers.Offset {\n SubGraphSessionState.startSubGraphSessionState(builder);\n SubGraphSessionState.addGraphId(builder, graphIdOffset);\n SubGraphSessionState.addSessionState(builder, sessionStateOffset);\n return SubGraphSessionState.endSubGraphSessionState(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class SessionState {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns SessionState\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): SessionState {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SessionState= obj\n * @returns SessionState\n */\n static getRootAsSessionState(bb: flatbuffers.ByteBuffer, obj?: SessionState): SessionState {\n return (obj || new SessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param SessionState= obj\n * @returns SessionState\n */\n static getSizePrefixedRootAsSessionState(bb: flatbuffers.ByteBuffer, obj?: SessionState): SessionState {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new SessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param onnxruntime.experimental.fbs.KernelCreateInfos= obj\n * @returns onnxruntime.experimental.fbs.KernelCreateInfos|null\n */\n kernels(obj?: onnxruntime.experimental.fbs.KernelCreateInfos): onnxruntime.experimental.fbs.KernelCreateInfos|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? (obj || new onnxruntime.experimental.fbs.KernelCreateInfos())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param number index\n * @param onnxruntime.experimental.fbs.SubGraphSessionState= obj\n * @returns onnxruntime.experimental.fbs.SubGraphSessionState\n */\n subGraphSessionStates(index: number, obj?: onnxruntime.experimental.fbs.SubGraphSessionState):\n onnxruntime.experimental.fbs.SubGraphSessionState|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.SubGraphSessionState())\n .__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) :\n null;\n }\n\n /**\n * @returns number\n */\n subGraphSessionStatesLength(): number {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startSessionState(builder: flatbuffers.Builder) {\n builder.startObject(2);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset kernelsOffset\n */\n static addKernels(builder: flatbuffers.Builder, kernelsOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, kernelsOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset subGraphSessionStatesOffset\n */\n static addSubGraphSessionStates(builder: flatbuffers.Builder, subGraphSessionStatesOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, subGraphSessionStatesOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param Array. data\n * @returns flatbuffers.Offset\n */\n static createSubGraphSessionStatesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]):\n flatbuffers.Offset {\n builder.startVector(4, data.length, 4);\n for (let i = data.length - 1; i >= 0; i--) {\n builder.addOffset(data[i]);\n }\n return builder.endVector();\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param number numElems\n */\n static startSubGraphSessionStatesVector(builder: flatbuffers.Builder, numElems: number) {\n builder.startVector(4, numElems, 4);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endSessionState(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n static createSessionState(\n builder: flatbuffers.Builder, kernelsOffset: flatbuffers.Offset,\n subGraphSessionStatesOffset: flatbuffers.Offset): flatbuffers.Offset {\n SessionState.startSessionState(builder);\n SessionState.addKernels(builder, kernelsOffset);\n SessionState.addSubGraphSessionStates(builder, subGraphSessionStatesOffset);\n return SessionState.endSessionState(builder);\n }\n }\n}\n/**\n * @constructor\n */\nexport namespace onnxruntime.experimental.fbs {\n export class InferenceSession {\n bb: flatbuffers.ByteBuffer|null = null;\n\n bb_pos = 0;\n /**\n * @param number i\n * @param flatbuffers.ByteBuffer bb\n * @returns InferenceSession\n */\n __init(i: number, bb: flatbuffers.ByteBuffer): InferenceSession {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param InferenceSession= obj\n * @returns InferenceSession\n */\n static getRootAsInferenceSession(bb: flatbuffers.ByteBuffer, obj?: InferenceSession): InferenceSession {\n return (obj || new InferenceSession()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @param InferenceSession= obj\n * @returns InferenceSession\n */\n static getSizePrefixedRootAsInferenceSession(bb: flatbuffers.ByteBuffer, obj?: InferenceSession): InferenceSession {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new InferenceSession()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n\n /**\n * @param flatbuffers.ByteBuffer bb\n * @returns boolean\n */\n static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean {\n return bb.__has_identifier('ORTM');\n }\n\n /**\n * @param flatbuffers.Encoding= optionalEncoding\n * @returns string|Uint8Array|null\n */\n ortVersion(): string|null;\n ortVersion(optionalEncoding: flatbuffers.Encoding): string|Uint8Array|null;\n ortVersion(optionalEncoding?: any): string|Uint8Array|null {\n let offset = this.bb!.__offset(this.bb_pos, 4);\n return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.Model= obj\n * @returns onnxruntime.experimental.fbs.Model|null\n */\n model(obj?: onnxruntime.experimental.fbs.Model): onnxruntime.experimental.fbs.Model|null {\n let offset = this.bb!.__offset(this.bb_pos, 6);\n return offset ? (obj || new onnxruntime.experimental.fbs.Model())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param onnxruntime.experimental.fbs.SessionState= obj\n * @returns onnxruntime.experimental.fbs.SessionState|null\n */\n sessionState(obj?: onnxruntime.experimental.fbs.SessionState): onnxruntime.experimental.fbs.SessionState|null {\n let offset = this.bb!.__offset(this.bb_pos, 8);\n return offset ? (obj || new onnxruntime.experimental.fbs.SessionState())\n .__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) :\n null;\n }\n\n /**\n * @param flatbuffers.Builder builder\n */\n static startInferenceSession(builder: flatbuffers.Builder) {\n builder.startObject(3);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset ortVersionOffset\n */\n static addOrtVersion(builder: flatbuffers.Builder, ortVersionOffset: flatbuffers.Offset) {\n builder.addFieldOffset(0, ortVersionOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset modelOffset\n */\n static addModel(builder: flatbuffers.Builder, modelOffset: flatbuffers.Offset) {\n builder.addFieldOffset(1, modelOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset sessionStateOffset\n */\n static addSessionState(builder: flatbuffers.Builder, sessionStateOffset: flatbuffers.Offset) {\n builder.addFieldOffset(2, sessionStateOffset, 0);\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @returns flatbuffers.Offset\n */\n static endInferenceSession(builder: flatbuffers.Builder): flatbuffers.Offset {\n let offset = builder.endObject();\n return offset;\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset offset\n */\n static finishInferenceSessionBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset) {\n builder.finish(offset, 'ORTM');\n }\n\n /**\n * @param flatbuffers.Builder builder\n * @param flatbuffers.Offset offset\n */\n static finishSizePrefixedInferenceSessionBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset) {\n builder.finish(offset, 'ORTM', true);\n }\n\n static createInferenceSession(\n builder: flatbuffers.Builder, ortVersionOffset: flatbuffers.Offset, modelOffset: flatbuffers.Offset,\n sessionStateOffset: flatbuffers.Offset): flatbuffers.Offset {\n InferenceSession.startInferenceSession(builder);\n InferenceSession.addOrtVersion(builder, ortVersionOffset);\n InferenceSession.addModel(builder, modelOffset);\n InferenceSession.addSessionState(builder, sessionStateOffset);\n return InferenceSession.endInferenceSession(builder);\n }\n }\n}\n", "\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n", "\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n", "\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n", "\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n", "\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n", "\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n", "\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n", "\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n", "\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n", "\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n\n if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n var nativeBuffer = util.Buffer;\n return nativeBuffer\n ? nativeBuffer.alloc(0)\n : new this.buf.constructor(0);\n }\n return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n", "\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n", "\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n", "\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n", "\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n", "\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util = require(\"./util/minimal\");\nprotobuf.rpc = require(\"./rpc\");\nprotobuf.roots = require(\"./roots\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n", "// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n", "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\n\n$root.onnx = (function() {\n\n /**\n * Namespace onnx.\n * @exports onnx\n * @namespace\n */\n var onnx = {};\n\n /**\n * Version enum.\n * @name onnx.Version\n * @enum {number}\n * @property {number} _START_VERSION=0 _START_VERSION value\n * @property {number} IR_VERSION_2017_10_10=1 IR_VERSION_2017_10_10 value\n * @property {number} IR_VERSION_2017_10_30=2 IR_VERSION_2017_10_30 value\n * @property {number} IR_VERSION_2017_11_3=3 IR_VERSION_2017_11_3 value\n * @property {number} IR_VERSION_2019_1_22=4 IR_VERSION_2019_1_22 value\n * @property {number} IR_VERSION_2019_3_18=5 IR_VERSION_2019_3_18 value\n * @property {number} IR_VERSION_2019_9_19=6 IR_VERSION_2019_9_19 value\n * @property {number} IR_VERSION_2020_5_8=7 IR_VERSION_2020_5_8 value\n * @property {number} IR_VERSION_2021_7_30=8 IR_VERSION_2021_7_30 value\n * @property {number} IR_VERSION=9 IR_VERSION value\n */\n onnx.Version = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"_START_VERSION\"] = 0;\n values[valuesById[1] = \"IR_VERSION_2017_10_10\"] = 1;\n values[valuesById[2] = \"IR_VERSION_2017_10_30\"] = 2;\n values[valuesById[3] = \"IR_VERSION_2017_11_3\"] = 3;\n values[valuesById[4] = \"IR_VERSION_2019_1_22\"] = 4;\n values[valuesById[5] = \"IR_VERSION_2019_3_18\"] = 5;\n values[valuesById[6] = \"IR_VERSION_2019_9_19\"] = 6;\n values[valuesById[7] = \"IR_VERSION_2020_5_8\"] = 7;\n values[valuesById[8] = \"IR_VERSION_2021_7_30\"] = 8;\n values[valuesById[9] = \"IR_VERSION\"] = 9;\n return values;\n })();\n\n onnx.AttributeProto = (function() {\n\n /**\n * Properties of an AttributeProto.\n * @memberof onnx\n * @interface IAttributeProto\n * @property {string|null} [name] AttributeProto name\n * @property {string|null} [refAttrName] AttributeProto refAttrName\n * @property {string|null} [docString] AttributeProto docString\n * @property {onnx.AttributeProto.AttributeType|null} [type] AttributeProto type\n * @property {number|null} [f] AttributeProto f\n * @property {number|Long|null} [i] AttributeProto i\n * @property {Uint8Array|null} [s] AttributeProto s\n * @property {onnx.ITensorProto|null} [t] AttributeProto t\n * @property {onnx.IGraphProto|null} [g] AttributeProto g\n * @property {onnx.ISparseTensorProto|null} [sparseTensor] AttributeProto sparseTensor\n * @property {onnx.ITypeProto|null} [tp] AttributeProto tp\n * @property {Array.|null} [floats] AttributeProto floats\n * @property {Array.|null} [ints] AttributeProto ints\n * @property {Array.|null} [strings] AttributeProto strings\n * @property {Array.|null} [tensors] AttributeProto tensors\n * @property {Array.|null} [graphs] AttributeProto graphs\n * @property {Array.|null} [sparseTensors] AttributeProto sparseTensors\n * @property {Array.|null} [typeProtos] AttributeProto typeProtos\n */\n\n /**\n * Constructs a new AttributeProto.\n * @memberof onnx\n * @classdesc Represents an AttributeProto.\n * @implements IAttributeProto\n * @constructor\n * @param {onnx.IAttributeProto=} [properties] Properties to set\n */\n function AttributeProto(properties) {\n this.floats = [];\n this.ints = [];\n this.strings = [];\n this.tensors = [];\n this.graphs = [];\n this.sparseTensors = [];\n this.typeProtos = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * AttributeProto name.\n * @member {string} name\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.name = \"\";\n\n /**\n * AttributeProto refAttrName.\n * @member {string} refAttrName\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.refAttrName = \"\";\n\n /**\n * AttributeProto docString.\n * @member {string} docString\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.docString = \"\";\n\n /**\n * AttributeProto type.\n * @member {onnx.AttributeProto.AttributeType} type\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.type = 0;\n\n /**\n * AttributeProto f.\n * @member {number} f\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.f = 0;\n\n /**\n * AttributeProto i.\n * @member {number|Long} i\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.i = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n /**\n * AttributeProto s.\n * @member {Uint8Array} s\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.s = $util.newBuffer([]);\n\n /**\n * AttributeProto t.\n * @member {onnx.ITensorProto|null|undefined} t\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.t = null;\n\n /**\n * AttributeProto g.\n * @member {onnx.IGraphProto|null|undefined} g\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.g = null;\n\n /**\n * AttributeProto sparseTensor.\n * @member {onnx.ISparseTensorProto|null|undefined} sparseTensor\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.sparseTensor = null;\n\n /**\n * AttributeProto tp.\n * @member {onnx.ITypeProto|null|undefined} tp\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.tp = null;\n\n /**\n * AttributeProto floats.\n * @member {Array.} floats\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.floats = $util.emptyArray;\n\n /**\n * AttributeProto ints.\n * @member {Array.} ints\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.ints = $util.emptyArray;\n\n /**\n * AttributeProto strings.\n * @member {Array.} strings\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.strings = $util.emptyArray;\n\n /**\n * AttributeProto tensors.\n * @member {Array.} tensors\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.tensors = $util.emptyArray;\n\n /**\n * AttributeProto graphs.\n * @member {Array.} graphs\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.graphs = $util.emptyArray;\n\n /**\n * AttributeProto sparseTensors.\n * @member {Array.} sparseTensors\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.sparseTensors = $util.emptyArray;\n\n /**\n * AttributeProto typeProtos.\n * @member {Array.} typeProtos\n * @memberof onnx.AttributeProto\n * @instance\n */\n AttributeProto.prototype.typeProtos = $util.emptyArray;\n\n /**\n * Creates a new AttributeProto instance using the specified properties.\n * @function create\n * @memberof onnx.AttributeProto\n * @static\n * @param {onnx.IAttributeProto=} [properties] Properties to set\n * @returns {onnx.AttributeProto} AttributeProto instance\n */\n AttributeProto.create = function create(properties) {\n return new AttributeProto(properties);\n };\n\n /**\n * Encodes the specified AttributeProto message. Does not implicitly {@link onnx.AttributeProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.AttributeProto\n * @static\n * @param {onnx.IAttributeProto} message AttributeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AttributeProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.f != null && Object.hasOwnProperty.call(message, \"f\"))\n writer.uint32(/* id 2, wireType 5 =*/21).float(message.f);\n if (message.i != null && Object.hasOwnProperty.call(message, \"i\"))\n writer.uint32(/* id 3, wireType 0 =*/24).int64(message.i);\n if (message.s != null && Object.hasOwnProperty.call(message, \"s\"))\n writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.s);\n if (message.t != null && Object.hasOwnProperty.call(message, \"t\"))\n $root.onnx.TensorProto.encode(message.t, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.g != null && Object.hasOwnProperty.call(message, \"g\"))\n $root.onnx.GraphProto.encode(message.g, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n if (message.floats != null && message.floats.length) {\n writer.uint32(/* id 7, wireType 2 =*/58).fork();\n for (var i = 0; i < message.floats.length; ++i)\n writer.float(message.floats[i]);\n writer.ldelim();\n }\n if (message.ints != null && message.ints.length) {\n writer.uint32(/* id 8, wireType 2 =*/66).fork();\n for (var i = 0; i < message.ints.length; ++i)\n writer.int64(message.ints[i]);\n writer.ldelim();\n }\n if (message.strings != null && message.strings.length)\n for (var i = 0; i < message.strings.length; ++i)\n writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.strings[i]);\n if (message.tensors != null && message.tensors.length)\n for (var i = 0; i < message.tensors.length; ++i)\n $root.onnx.TensorProto.encode(message.tensors[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();\n if (message.graphs != null && message.graphs.length)\n for (var i = 0; i < message.graphs.length; ++i)\n $root.onnx.GraphProto.encode(message.graphs[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 13, wireType 2 =*/106).string(message.docString);\n if (message.tp != null && Object.hasOwnProperty.call(message, \"tp\"))\n $root.onnx.TypeProto.encode(message.tp, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();\n if (message.typeProtos != null && message.typeProtos.length)\n for (var i = 0; i < message.typeProtos.length; ++i)\n $root.onnx.TypeProto.encode(message.typeProtos[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n writer.uint32(/* id 20, wireType 0 =*/160).int32(message.type);\n if (message.refAttrName != null && Object.hasOwnProperty.call(message, \"refAttrName\"))\n writer.uint32(/* id 21, wireType 2 =*/170).string(message.refAttrName);\n if (message.sparseTensor != null && Object.hasOwnProperty.call(message, \"sparseTensor\"))\n $root.onnx.SparseTensorProto.encode(message.sparseTensor, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();\n if (message.sparseTensors != null && message.sparseTensors.length)\n for (var i = 0; i < message.sparseTensors.length; ++i)\n $root.onnx.SparseTensorProto.encode(message.sparseTensors[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified AttributeProto message, length delimited. Does not implicitly {@link onnx.AttributeProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.AttributeProto\n * @static\n * @param {onnx.IAttributeProto} message AttributeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n AttributeProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an AttributeProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.AttributeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.AttributeProto} AttributeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AttributeProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.AttributeProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 21: {\n message.refAttrName = reader.string();\n break;\n }\n case 13: {\n message.docString = reader.string();\n break;\n }\n case 20: {\n message.type = reader.int32();\n break;\n }\n case 2: {\n message.f = reader.float();\n break;\n }\n case 3: {\n message.i = reader.int64();\n break;\n }\n case 4: {\n message.s = reader.bytes();\n break;\n }\n case 5: {\n message.t = $root.onnx.TensorProto.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.g = $root.onnx.GraphProto.decode(reader, reader.uint32());\n break;\n }\n case 22: {\n message.sparseTensor = $root.onnx.SparseTensorProto.decode(reader, reader.uint32());\n break;\n }\n case 14: {\n message.tp = $root.onnx.TypeProto.decode(reader, reader.uint32());\n break;\n }\n case 7: {\n if (!(message.floats && message.floats.length))\n message.floats = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.floats.push(reader.float());\n } else\n message.floats.push(reader.float());\n break;\n }\n case 8: {\n if (!(message.ints && message.ints.length))\n message.ints = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.ints.push(reader.int64());\n } else\n message.ints.push(reader.int64());\n break;\n }\n case 9: {\n if (!(message.strings && message.strings.length))\n message.strings = [];\n message.strings.push(reader.bytes());\n break;\n }\n case 10: {\n if (!(message.tensors && message.tensors.length))\n message.tensors = [];\n message.tensors.push($root.onnx.TensorProto.decode(reader, reader.uint32()));\n break;\n }\n case 11: {\n if (!(message.graphs && message.graphs.length))\n message.graphs = [];\n message.graphs.push($root.onnx.GraphProto.decode(reader, reader.uint32()));\n break;\n }\n case 23: {\n if (!(message.sparseTensors && message.sparseTensors.length))\n message.sparseTensors = [];\n message.sparseTensors.push($root.onnx.SparseTensorProto.decode(reader, reader.uint32()));\n break;\n }\n case 15: {\n if (!(message.typeProtos && message.typeProtos.length))\n message.typeProtos = [];\n message.typeProtos.push($root.onnx.TypeProto.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an AttributeProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.AttributeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.AttributeProto} AttributeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n AttributeProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an AttributeProto message.\n * @function verify\n * @memberof onnx.AttributeProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n AttributeProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.refAttrName != null && message.hasOwnProperty(\"refAttrName\"))\n if (!$util.isString(message.refAttrName))\n return \"refAttrName: string expected\";\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n if (message.type != null && message.hasOwnProperty(\"type\"))\n switch (message.type) {\n default:\n return \"type: enum value expected\";\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 11:\n case 13:\n case 6:\n case 7:\n case 8:\n case 9:\n case 10:\n case 12:\n case 14:\n break;\n }\n if (message.f != null && message.hasOwnProperty(\"f\"))\n if (typeof message.f !== \"number\")\n return \"f: number expected\";\n if (message.i != null && message.hasOwnProperty(\"i\"))\n if (!$util.isInteger(message.i) && !(message.i && $util.isInteger(message.i.low) && $util.isInteger(message.i.high)))\n return \"i: integer|Long expected\";\n if (message.s != null && message.hasOwnProperty(\"s\"))\n if (!(message.s && typeof message.s.length === \"number\" || $util.isString(message.s)))\n return \"s: buffer expected\";\n if (message.t != null && message.hasOwnProperty(\"t\")) {\n var error = $root.onnx.TensorProto.verify(message.t);\n if (error)\n return \"t.\" + error;\n }\n if (message.g != null && message.hasOwnProperty(\"g\")) {\n var error = $root.onnx.GraphProto.verify(message.g);\n if (error)\n return \"g.\" + error;\n }\n if (message.sparseTensor != null && message.hasOwnProperty(\"sparseTensor\")) {\n var error = $root.onnx.SparseTensorProto.verify(message.sparseTensor);\n if (error)\n return \"sparseTensor.\" + error;\n }\n if (message.tp != null && message.hasOwnProperty(\"tp\")) {\n var error = $root.onnx.TypeProto.verify(message.tp);\n if (error)\n return \"tp.\" + error;\n }\n if (message.floats != null && message.hasOwnProperty(\"floats\")) {\n if (!Array.isArray(message.floats))\n return \"floats: array expected\";\n for (var i = 0; i < message.floats.length; ++i)\n if (typeof message.floats[i] !== \"number\")\n return \"floats: number[] expected\";\n }\n if (message.ints != null && message.hasOwnProperty(\"ints\")) {\n if (!Array.isArray(message.ints))\n return \"ints: array expected\";\n for (var i = 0; i < message.ints.length; ++i)\n if (!$util.isInteger(message.ints[i]) && !(message.ints[i] && $util.isInteger(message.ints[i].low) && $util.isInteger(message.ints[i].high)))\n return \"ints: integer|Long[] expected\";\n }\n if (message.strings != null && message.hasOwnProperty(\"strings\")) {\n if (!Array.isArray(message.strings))\n return \"strings: array expected\";\n for (var i = 0; i < message.strings.length; ++i)\n if (!(message.strings[i] && typeof message.strings[i].length === \"number\" || $util.isString(message.strings[i])))\n return \"strings: buffer[] expected\";\n }\n if (message.tensors != null && message.hasOwnProperty(\"tensors\")) {\n if (!Array.isArray(message.tensors))\n return \"tensors: array expected\";\n for (var i = 0; i < message.tensors.length; ++i) {\n var error = $root.onnx.TensorProto.verify(message.tensors[i]);\n if (error)\n return \"tensors.\" + error;\n }\n }\n if (message.graphs != null && message.hasOwnProperty(\"graphs\")) {\n if (!Array.isArray(message.graphs))\n return \"graphs: array expected\";\n for (var i = 0; i < message.graphs.length; ++i) {\n var error = $root.onnx.GraphProto.verify(message.graphs[i]);\n if (error)\n return \"graphs.\" + error;\n }\n }\n if (message.sparseTensors != null && message.hasOwnProperty(\"sparseTensors\")) {\n if (!Array.isArray(message.sparseTensors))\n return \"sparseTensors: array expected\";\n for (var i = 0; i < message.sparseTensors.length; ++i) {\n var error = $root.onnx.SparseTensorProto.verify(message.sparseTensors[i]);\n if (error)\n return \"sparseTensors.\" + error;\n }\n }\n if (message.typeProtos != null && message.hasOwnProperty(\"typeProtos\")) {\n if (!Array.isArray(message.typeProtos))\n return \"typeProtos: array expected\";\n for (var i = 0; i < message.typeProtos.length; ++i) {\n var error = $root.onnx.TypeProto.verify(message.typeProtos[i]);\n if (error)\n return \"typeProtos.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates an AttributeProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.AttributeProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.AttributeProto} AttributeProto\n */\n AttributeProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.AttributeProto)\n return object;\n var message = new $root.onnx.AttributeProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.refAttrName != null)\n message.refAttrName = String(object.refAttrName);\n if (object.docString != null)\n message.docString = String(object.docString);\n switch (object.type) {\n default:\n if (typeof object.type === \"number\") {\n message.type = object.type;\n break;\n }\n break;\n case \"UNDEFINED\":\n case 0:\n message.type = 0;\n break;\n case \"FLOAT\":\n case 1:\n message.type = 1;\n break;\n case \"INT\":\n case 2:\n message.type = 2;\n break;\n case \"STRING\":\n case 3:\n message.type = 3;\n break;\n case \"TENSOR\":\n case 4:\n message.type = 4;\n break;\n case \"GRAPH\":\n case 5:\n message.type = 5;\n break;\n case \"SPARSE_TENSOR\":\n case 11:\n message.type = 11;\n break;\n case \"TYPE_PROTO\":\n case 13:\n message.type = 13;\n break;\n case \"FLOATS\":\n case 6:\n message.type = 6;\n break;\n case \"INTS\":\n case 7:\n message.type = 7;\n break;\n case \"STRINGS\":\n case 8:\n message.type = 8;\n break;\n case \"TENSORS\":\n case 9:\n message.type = 9;\n break;\n case \"GRAPHS\":\n case 10:\n message.type = 10;\n break;\n case \"SPARSE_TENSORS\":\n case 12:\n message.type = 12;\n break;\n case \"TYPE_PROTOS\":\n case 14:\n message.type = 14;\n break;\n }\n if (object.f != null)\n message.f = Number(object.f);\n if (object.i != null)\n if ($util.Long)\n (message.i = $util.Long.fromValue(object.i)).unsigned = false;\n else if (typeof object.i === \"string\")\n message.i = parseInt(object.i, 10);\n else if (typeof object.i === \"number\")\n message.i = object.i;\n else if (typeof object.i === \"object\")\n message.i = new $util.LongBits(object.i.low >>> 0, object.i.high >>> 0).toNumber();\n if (object.s != null)\n if (typeof object.s === \"string\")\n $util.base64.decode(object.s, message.s = $util.newBuffer($util.base64.length(object.s)), 0);\n else if (object.s.length >= 0)\n message.s = object.s;\n if (object.t != null) {\n if (typeof object.t !== \"object\")\n throw TypeError(\".onnx.AttributeProto.t: object expected\");\n message.t = $root.onnx.TensorProto.fromObject(object.t);\n }\n if (object.g != null) {\n if (typeof object.g !== \"object\")\n throw TypeError(\".onnx.AttributeProto.g: object expected\");\n message.g = $root.onnx.GraphProto.fromObject(object.g);\n }\n if (object.sparseTensor != null) {\n if (typeof object.sparseTensor !== \"object\")\n throw TypeError(\".onnx.AttributeProto.sparseTensor: object expected\");\n message.sparseTensor = $root.onnx.SparseTensorProto.fromObject(object.sparseTensor);\n }\n if (object.tp != null) {\n if (typeof object.tp !== \"object\")\n throw TypeError(\".onnx.AttributeProto.tp: object expected\");\n message.tp = $root.onnx.TypeProto.fromObject(object.tp);\n }\n if (object.floats) {\n if (!Array.isArray(object.floats))\n throw TypeError(\".onnx.AttributeProto.floats: array expected\");\n message.floats = [];\n for (var i = 0; i < object.floats.length; ++i)\n message.floats[i] = Number(object.floats[i]);\n }\n if (object.ints) {\n if (!Array.isArray(object.ints))\n throw TypeError(\".onnx.AttributeProto.ints: array expected\");\n message.ints = [];\n for (var i = 0; i < object.ints.length; ++i)\n if ($util.Long)\n (message.ints[i] = $util.Long.fromValue(object.ints[i])).unsigned = false;\n else if (typeof object.ints[i] === \"string\")\n message.ints[i] = parseInt(object.ints[i], 10);\n else if (typeof object.ints[i] === \"number\")\n message.ints[i] = object.ints[i];\n else if (typeof object.ints[i] === \"object\")\n message.ints[i] = new $util.LongBits(object.ints[i].low >>> 0, object.ints[i].high >>> 0).toNumber();\n }\n if (object.strings) {\n if (!Array.isArray(object.strings))\n throw TypeError(\".onnx.AttributeProto.strings: array expected\");\n message.strings = [];\n for (var i = 0; i < object.strings.length; ++i)\n if (typeof object.strings[i] === \"string\")\n $util.base64.decode(object.strings[i], message.strings[i] = $util.newBuffer($util.base64.length(object.strings[i])), 0);\n else if (object.strings[i].length >= 0)\n message.strings[i] = object.strings[i];\n }\n if (object.tensors) {\n if (!Array.isArray(object.tensors))\n throw TypeError(\".onnx.AttributeProto.tensors: array expected\");\n message.tensors = [];\n for (var i = 0; i < object.tensors.length; ++i) {\n if (typeof object.tensors[i] !== \"object\")\n throw TypeError(\".onnx.AttributeProto.tensors: object expected\");\n message.tensors[i] = $root.onnx.TensorProto.fromObject(object.tensors[i]);\n }\n }\n if (object.graphs) {\n if (!Array.isArray(object.graphs))\n throw TypeError(\".onnx.AttributeProto.graphs: array expected\");\n message.graphs = [];\n for (var i = 0; i < object.graphs.length; ++i) {\n if (typeof object.graphs[i] !== \"object\")\n throw TypeError(\".onnx.AttributeProto.graphs: object expected\");\n message.graphs[i] = $root.onnx.GraphProto.fromObject(object.graphs[i]);\n }\n }\n if (object.sparseTensors) {\n if (!Array.isArray(object.sparseTensors))\n throw TypeError(\".onnx.AttributeProto.sparseTensors: array expected\");\n message.sparseTensors = [];\n for (var i = 0; i < object.sparseTensors.length; ++i) {\n if (typeof object.sparseTensors[i] !== \"object\")\n throw TypeError(\".onnx.AttributeProto.sparseTensors: object expected\");\n message.sparseTensors[i] = $root.onnx.SparseTensorProto.fromObject(object.sparseTensors[i]);\n }\n }\n if (object.typeProtos) {\n if (!Array.isArray(object.typeProtos))\n throw TypeError(\".onnx.AttributeProto.typeProtos: array expected\");\n message.typeProtos = [];\n for (var i = 0; i < object.typeProtos.length; ++i) {\n if (typeof object.typeProtos[i] !== \"object\")\n throw TypeError(\".onnx.AttributeProto.typeProtos: object expected\");\n message.typeProtos[i] = $root.onnx.TypeProto.fromObject(object.typeProtos[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from an AttributeProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.AttributeProto\n * @static\n * @param {onnx.AttributeProto} message AttributeProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n AttributeProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.floats = [];\n object.ints = [];\n object.strings = [];\n object.tensors = [];\n object.graphs = [];\n object.typeProtos = [];\n object.sparseTensors = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object.f = 0;\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.i = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.i = options.longs === String ? \"0\" : 0;\n if (options.bytes === String)\n object.s = \"\";\n else {\n object.s = [];\n if (options.bytes !== Array)\n object.s = $util.newBuffer(object.s);\n }\n object.t = null;\n object.g = null;\n object.docString = \"\";\n object.tp = null;\n object.type = options.enums === String ? \"UNDEFINED\" : 0;\n object.refAttrName = \"\";\n object.sparseTensor = null;\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.f != null && message.hasOwnProperty(\"f\"))\n object.f = options.json && !isFinite(message.f) ? String(message.f) : message.f;\n if (message.i != null && message.hasOwnProperty(\"i\"))\n if (typeof message.i === \"number\")\n object.i = options.longs === String ? String(message.i) : message.i;\n else\n object.i = options.longs === String ? $util.Long.prototype.toString.call(message.i) : options.longs === Number ? new $util.LongBits(message.i.low >>> 0, message.i.high >>> 0).toNumber() : message.i;\n if (message.s != null && message.hasOwnProperty(\"s\"))\n object.s = options.bytes === String ? $util.base64.encode(message.s, 0, message.s.length) : options.bytes === Array ? Array.prototype.slice.call(message.s) : message.s;\n if (message.t != null && message.hasOwnProperty(\"t\"))\n object.t = $root.onnx.TensorProto.toObject(message.t, options);\n if (message.g != null && message.hasOwnProperty(\"g\"))\n object.g = $root.onnx.GraphProto.toObject(message.g, options);\n if (message.floats && message.floats.length) {\n object.floats = [];\n for (var j = 0; j < message.floats.length; ++j)\n object.floats[j] = options.json && !isFinite(message.floats[j]) ? String(message.floats[j]) : message.floats[j];\n }\n if (message.ints && message.ints.length) {\n object.ints = [];\n for (var j = 0; j < message.ints.length; ++j)\n if (typeof message.ints[j] === \"number\")\n object.ints[j] = options.longs === String ? String(message.ints[j]) : message.ints[j];\n else\n object.ints[j] = options.longs === String ? $util.Long.prototype.toString.call(message.ints[j]) : options.longs === Number ? new $util.LongBits(message.ints[j].low >>> 0, message.ints[j].high >>> 0).toNumber() : message.ints[j];\n }\n if (message.strings && message.strings.length) {\n object.strings = [];\n for (var j = 0; j < message.strings.length; ++j)\n object.strings[j] = options.bytes === String ? $util.base64.encode(message.strings[j], 0, message.strings[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.strings[j]) : message.strings[j];\n }\n if (message.tensors && message.tensors.length) {\n object.tensors = [];\n for (var j = 0; j < message.tensors.length; ++j)\n object.tensors[j] = $root.onnx.TensorProto.toObject(message.tensors[j], options);\n }\n if (message.graphs && message.graphs.length) {\n object.graphs = [];\n for (var j = 0; j < message.graphs.length; ++j)\n object.graphs[j] = $root.onnx.GraphProto.toObject(message.graphs[j], options);\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n if (message.tp != null && message.hasOwnProperty(\"tp\"))\n object.tp = $root.onnx.TypeProto.toObject(message.tp, options);\n if (message.typeProtos && message.typeProtos.length) {\n object.typeProtos = [];\n for (var j = 0; j < message.typeProtos.length; ++j)\n object.typeProtos[j] = $root.onnx.TypeProto.toObject(message.typeProtos[j], options);\n }\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = options.enums === String ? $root.onnx.AttributeProto.AttributeType[message.type] === undefined ? message.type : $root.onnx.AttributeProto.AttributeType[message.type] : message.type;\n if (message.refAttrName != null && message.hasOwnProperty(\"refAttrName\"))\n object.refAttrName = message.refAttrName;\n if (message.sparseTensor != null && message.hasOwnProperty(\"sparseTensor\"))\n object.sparseTensor = $root.onnx.SparseTensorProto.toObject(message.sparseTensor, options);\n if (message.sparseTensors && message.sparseTensors.length) {\n object.sparseTensors = [];\n for (var j = 0; j < message.sparseTensors.length; ++j)\n object.sparseTensors[j] = $root.onnx.SparseTensorProto.toObject(message.sparseTensors[j], options);\n }\n return object;\n };\n\n /**\n * Converts this AttributeProto to JSON.\n * @function toJSON\n * @memberof onnx.AttributeProto\n * @instance\n * @returns {Object.} JSON object\n */\n AttributeProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for AttributeProto\n * @function getTypeUrl\n * @memberof onnx.AttributeProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n AttributeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.AttributeProto\";\n };\n\n /**\n * AttributeType enum.\n * @name onnx.AttributeProto.AttributeType\n * @enum {number}\n * @property {number} UNDEFINED=0 UNDEFINED value\n * @property {number} FLOAT=1 FLOAT value\n * @property {number} INT=2 INT value\n * @property {number} STRING=3 STRING value\n * @property {number} TENSOR=4 TENSOR value\n * @property {number} GRAPH=5 GRAPH value\n * @property {number} SPARSE_TENSOR=11 SPARSE_TENSOR value\n * @property {number} TYPE_PROTO=13 TYPE_PROTO value\n * @property {number} FLOATS=6 FLOATS value\n * @property {number} INTS=7 INTS value\n * @property {number} STRINGS=8 STRINGS value\n * @property {number} TENSORS=9 TENSORS value\n * @property {number} GRAPHS=10 GRAPHS value\n * @property {number} SPARSE_TENSORS=12 SPARSE_TENSORS value\n * @property {number} TYPE_PROTOS=14 TYPE_PROTOS value\n */\n AttributeProto.AttributeType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"UNDEFINED\"] = 0;\n values[valuesById[1] = \"FLOAT\"] = 1;\n values[valuesById[2] = \"INT\"] = 2;\n values[valuesById[3] = \"STRING\"] = 3;\n values[valuesById[4] = \"TENSOR\"] = 4;\n values[valuesById[5] = \"GRAPH\"] = 5;\n values[valuesById[11] = \"SPARSE_TENSOR\"] = 11;\n values[valuesById[13] = \"TYPE_PROTO\"] = 13;\n values[valuesById[6] = \"FLOATS\"] = 6;\n values[valuesById[7] = \"INTS\"] = 7;\n values[valuesById[8] = \"STRINGS\"] = 8;\n values[valuesById[9] = \"TENSORS\"] = 9;\n values[valuesById[10] = \"GRAPHS\"] = 10;\n values[valuesById[12] = \"SPARSE_TENSORS\"] = 12;\n values[valuesById[14] = \"TYPE_PROTOS\"] = 14;\n return values;\n })();\n\n return AttributeProto;\n })();\n\n onnx.ValueInfoProto = (function() {\n\n /**\n * Properties of a ValueInfoProto.\n * @memberof onnx\n * @interface IValueInfoProto\n * @property {string|null} [name] ValueInfoProto name\n * @property {onnx.ITypeProto|null} [type] ValueInfoProto type\n * @property {string|null} [docString] ValueInfoProto docString\n */\n\n /**\n * Constructs a new ValueInfoProto.\n * @memberof onnx\n * @classdesc Represents a ValueInfoProto.\n * @implements IValueInfoProto\n * @constructor\n * @param {onnx.IValueInfoProto=} [properties] Properties to set\n */\n function ValueInfoProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ValueInfoProto name.\n * @member {string} name\n * @memberof onnx.ValueInfoProto\n * @instance\n */\n ValueInfoProto.prototype.name = \"\";\n\n /**\n * ValueInfoProto type.\n * @member {onnx.ITypeProto|null|undefined} type\n * @memberof onnx.ValueInfoProto\n * @instance\n */\n ValueInfoProto.prototype.type = null;\n\n /**\n * ValueInfoProto docString.\n * @member {string} docString\n * @memberof onnx.ValueInfoProto\n * @instance\n */\n ValueInfoProto.prototype.docString = \"\";\n\n /**\n * Creates a new ValueInfoProto instance using the specified properties.\n * @function create\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {onnx.IValueInfoProto=} [properties] Properties to set\n * @returns {onnx.ValueInfoProto} ValueInfoProto instance\n */\n ValueInfoProto.create = function create(properties) {\n return new ValueInfoProto(properties);\n };\n\n /**\n * Encodes the specified ValueInfoProto message. Does not implicitly {@link onnx.ValueInfoProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {onnx.IValueInfoProto} message ValueInfoProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ValueInfoProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n $root.onnx.TypeProto.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.docString);\n return writer;\n };\n\n /**\n * Encodes the specified ValueInfoProto message, length delimited. Does not implicitly {@link onnx.ValueInfoProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {onnx.IValueInfoProto} message ValueInfoProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ValueInfoProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a ValueInfoProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.ValueInfoProto} ValueInfoProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ValueInfoProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.ValueInfoProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 2: {\n message.type = $root.onnx.TypeProto.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n message.docString = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a ValueInfoProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.ValueInfoProto} ValueInfoProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ValueInfoProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a ValueInfoProto message.\n * @function verify\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ValueInfoProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.type != null && message.hasOwnProperty(\"type\")) {\n var error = $root.onnx.TypeProto.verify(message.type);\n if (error)\n return \"type.\" + error;\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n return null;\n };\n\n /**\n * Creates a ValueInfoProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.ValueInfoProto} ValueInfoProto\n */\n ValueInfoProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.ValueInfoProto)\n return object;\n var message = new $root.onnx.ValueInfoProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.type != null) {\n if (typeof object.type !== \"object\")\n throw TypeError(\".onnx.ValueInfoProto.type: object expected\");\n message.type = $root.onnx.TypeProto.fromObject(object.type);\n }\n if (object.docString != null)\n message.docString = String(object.docString);\n return message;\n };\n\n /**\n * Creates a plain object from a ValueInfoProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {onnx.ValueInfoProto} message ValueInfoProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ValueInfoProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.name = \"\";\n object.type = null;\n object.docString = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.type != null && message.hasOwnProperty(\"type\"))\n object.type = $root.onnx.TypeProto.toObject(message.type, options);\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n return object;\n };\n\n /**\n * Converts this ValueInfoProto to JSON.\n * @function toJSON\n * @memberof onnx.ValueInfoProto\n * @instance\n * @returns {Object.} JSON object\n */\n ValueInfoProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for ValueInfoProto\n * @function getTypeUrl\n * @memberof onnx.ValueInfoProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ValueInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.ValueInfoProto\";\n };\n\n return ValueInfoProto;\n })();\n\n onnx.NodeProto = (function() {\n\n /**\n * Properties of a NodeProto.\n * @memberof onnx\n * @interface INodeProto\n * @property {Array.|null} [input] NodeProto input\n * @property {Array.|null} [output] NodeProto output\n * @property {string|null} [name] NodeProto name\n * @property {string|null} [opType] NodeProto opType\n * @property {string|null} [domain] NodeProto domain\n * @property {Array.|null} [attribute] NodeProto attribute\n * @property {string|null} [docString] NodeProto docString\n */\n\n /**\n * Constructs a new NodeProto.\n * @memberof onnx\n * @classdesc Represents a NodeProto.\n * @implements INodeProto\n * @constructor\n * @param {onnx.INodeProto=} [properties] Properties to set\n */\n function NodeProto(properties) {\n this.input = [];\n this.output = [];\n this.attribute = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * NodeProto input.\n * @member {Array.} input\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.input = $util.emptyArray;\n\n /**\n * NodeProto output.\n * @member {Array.} output\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.output = $util.emptyArray;\n\n /**\n * NodeProto name.\n * @member {string} name\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.name = \"\";\n\n /**\n * NodeProto opType.\n * @member {string} opType\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.opType = \"\";\n\n /**\n * NodeProto domain.\n * @member {string} domain\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.domain = \"\";\n\n /**\n * NodeProto attribute.\n * @member {Array.} attribute\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.attribute = $util.emptyArray;\n\n /**\n * NodeProto docString.\n * @member {string} docString\n * @memberof onnx.NodeProto\n * @instance\n */\n NodeProto.prototype.docString = \"\";\n\n /**\n * Creates a new NodeProto instance using the specified properties.\n * @function create\n * @memberof onnx.NodeProto\n * @static\n * @param {onnx.INodeProto=} [properties] Properties to set\n * @returns {onnx.NodeProto} NodeProto instance\n */\n NodeProto.create = function create(properties) {\n return new NodeProto(properties);\n };\n\n /**\n * Encodes the specified NodeProto message. Does not implicitly {@link onnx.NodeProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.NodeProto\n * @static\n * @param {onnx.INodeProto} message NodeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NodeProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.input != null && message.input.length)\n for (var i = 0; i < message.input.length; ++i)\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.input[i]);\n if (message.output != null && message.output.length)\n for (var i = 0; i < message.output.length; ++i)\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.output[i]);\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.name);\n if (message.opType != null && Object.hasOwnProperty.call(message, \"opType\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.opType);\n if (message.attribute != null && message.attribute.length)\n for (var i = 0; i < message.attribute.length; ++i)\n $root.onnx.AttributeProto.encode(message.attribute[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.docString);\n if (message.domain != null && Object.hasOwnProperty.call(message, \"domain\"))\n writer.uint32(/* id 7, wireType 2 =*/58).string(message.domain);\n return writer;\n };\n\n /**\n * Encodes the specified NodeProto message, length delimited. Does not implicitly {@link onnx.NodeProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.NodeProto\n * @static\n * @param {onnx.INodeProto} message NodeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n NodeProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a NodeProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.NodeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.NodeProto} NodeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NodeProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.NodeProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.input && message.input.length))\n message.input = [];\n message.input.push(reader.string());\n break;\n }\n case 2: {\n if (!(message.output && message.output.length))\n message.output = [];\n message.output.push(reader.string());\n break;\n }\n case 3: {\n message.name = reader.string();\n break;\n }\n case 4: {\n message.opType = reader.string();\n break;\n }\n case 7: {\n message.domain = reader.string();\n break;\n }\n case 5: {\n if (!(message.attribute && message.attribute.length))\n message.attribute = [];\n message.attribute.push($root.onnx.AttributeProto.decode(reader, reader.uint32()));\n break;\n }\n case 6: {\n message.docString = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a NodeProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.NodeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.NodeProto} NodeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n NodeProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a NodeProto message.\n * @function verify\n * @memberof onnx.NodeProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n NodeProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.input != null && message.hasOwnProperty(\"input\")) {\n if (!Array.isArray(message.input))\n return \"input: array expected\";\n for (var i = 0; i < message.input.length; ++i)\n if (!$util.isString(message.input[i]))\n return \"input: string[] expected\";\n }\n if (message.output != null && message.hasOwnProperty(\"output\")) {\n if (!Array.isArray(message.output))\n return \"output: array expected\";\n for (var i = 0; i < message.output.length; ++i)\n if (!$util.isString(message.output[i]))\n return \"output: string[] expected\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.opType != null && message.hasOwnProperty(\"opType\"))\n if (!$util.isString(message.opType))\n return \"opType: string expected\";\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n if (!$util.isString(message.domain))\n return \"domain: string expected\";\n if (message.attribute != null && message.hasOwnProperty(\"attribute\")) {\n if (!Array.isArray(message.attribute))\n return \"attribute: array expected\";\n for (var i = 0; i < message.attribute.length; ++i) {\n var error = $root.onnx.AttributeProto.verify(message.attribute[i]);\n if (error)\n return \"attribute.\" + error;\n }\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n return null;\n };\n\n /**\n * Creates a NodeProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.NodeProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.NodeProto} NodeProto\n */\n NodeProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.NodeProto)\n return object;\n var message = new $root.onnx.NodeProto();\n if (object.input) {\n if (!Array.isArray(object.input))\n throw TypeError(\".onnx.NodeProto.input: array expected\");\n message.input = [];\n for (var i = 0; i < object.input.length; ++i)\n message.input[i] = String(object.input[i]);\n }\n if (object.output) {\n if (!Array.isArray(object.output))\n throw TypeError(\".onnx.NodeProto.output: array expected\");\n message.output = [];\n for (var i = 0; i < object.output.length; ++i)\n message.output[i] = String(object.output[i]);\n }\n if (object.name != null)\n message.name = String(object.name);\n if (object.opType != null)\n message.opType = String(object.opType);\n if (object.domain != null)\n message.domain = String(object.domain);\n if (object.attribute) {\n if (!Array.isArray(object.attribute))\n throw TypeError(\".onnx.NodeProto.attribute: array expected\");\n message.attribute = [];\n for (var i = 0; i < object.attribute.length; ++i) {\n if (typeof object.attribute[i] !== \"object\")\n throw TypeError(\".onnx.NodeProto.attribute: object expected\");\n message.attribute[i] = $root.onnx.AttributeProto.fromObject(object.attribute[i]);\n }\n }\n if (object.docString != null)\n message.docString = String(object.docString);\n return message;\n };\n\n /**\n * Creates a plain object from a NodeProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.NodeProto\n * @static\n * @param {onnx.NodeProto} message NodeProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n NodeProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.input = [];\n object.output = [];\n object.attribute = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object.opType = \"\";\n object.docString = \"\";\n object.domain = \"\";\n }\n if (message.input && message.input.length) {\n object.input = [];\n for (var j = 0; j < message.input.length; ++j)\n object.input[j] = message.input[j];\n }\n if (message.output && message.output.length) {\n object.output = [];\n for (var j = 0; j < message.output.length; ++j)\n object.output[j] = message.output[j];\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.opType != null && message.hasOwnProperty(\"opType\"))\n object.opType = message.opType;\n if (message.attribute && message.attribute.length) {\n object.attribute = [];\n for (var j = 0; j < message.attribute.length; ++j)\n object.attribute[j] = $root.onnx.AttributeProto.toObject(message.attribute[j], options);\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n object.domain = message.domain;\n return object;\n };\n\n /**\n * Converts this NodeProto to JSON.\n * @function toJSON\n * @memberof onnx.NodeProto\n * @instance\n * @returns {Object.} JSON object\n */\n NodeProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for NodeProto\n * @function getTypeUrl\n * @memberof onnx.NodeProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n NodeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.NodeProto\";\n };\n\n return NodeProto;\n })();\n\n onnx.TrainingInfoProto = (function() {\n\n /**\n * Properties of a TrainingInfoProto.\n * @memberof onnx\n * @interface ITrainingInfoProto\n * @property {onnx.IGraphProto|null} [initialization] TrainingInfoProto initialization\n * @property {onnx.IGraphProto|null} [algorithm] TrainingInfoProto algorithm\n * @property {Array.|null} [initializationBinding] TrainingInfoProto initializationBinding\n * @property {Array.|null} [updateBinding] TrainingInfoProto updateBinding\n */\n\n /**\n * Constructs a new TrainingInfoProto.\n * @memberof onnx\n * @classdesc Represents a TrainingInfoProto.\n * @implements ITrainingInfoProto\n * @constructor\n * @param {onnx.ITrainingInfoProto=} [properties] Properties to set\n */\n function TrainingInfoProto(properties) {\n this.initializationBinding = [];\n this.updateBinding = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * TrainingInfoProto initialization.\n * @member {onnx.IGraphProto|null|undefined} initialization\n * @memberof onnx.TrainingInfoProto\n * @instance\n */\n TrainingInfoProto.prototype.initialization = null;\n\n /**\n * TrainingInfoProto algorithm.\n * @member {onnx.IGraphProto|null|undefined} algorithm\n * @memberof onnx.TrainingInfoProto\n * @instance\n */\n TrainingInfoProto.prototype.algorithm = null;\n\n /**\n * TrainingInfoProto initializationBinding.\n * @member {Array.} initializationBinding\n * @memberof onnx.TrainingInfoProto\n * @instance\n */\n TrainingInfoProto.prototype.initializationBinding = $util.emptyArray;\n\n /**\n * TrainingInfoProto updateBinding.\n * @member {Array.} updateBinding\n * @memberof onnx.TrainingInfoProto\n * @instance\n */\n TrainingInfoProto.prototype.updateBinding = $util.emptyArray;\n\n /**\n * Creates a new TrainingInfoProto instance using the specified properties.\n * @function create\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {onnx.ITrainingInfoProto=} [properties] Properties to set\n * @returns {onnx.TrainingInfoProto} TrainingInfoProto instance\n */\n TrainingInfoProto.create = function create(properties) {\n return new TrainingInfoProto(properties);\n };\n\n /**\n * Encodes the specified TrainingInfoProto message. Does not implicitly {@link onnx.TrainingInfoProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {onnx.ITrainingInfoProto} message TrainingInfoProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TrainingInfoProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.initialization != null && Object.hasOwnProperty.call(message, \"initialization\"))\n $root.onnx.GraphProto.encode(message.initialization, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.algorithm != null && Object.hasOwnProperty.call(message, \"algorithm\"))\n $root.onnx.GraphProto.encode(message.algorithm, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.initializationBinding != null && message.initializationBinding.length)\n for (var i = 0; i < message.initializationBinding.length; ++i)\n $root.onnx.StringStringEntryProto.encode(message.initializationBinding[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.updateBinding != null && message.updateBinding.length)\n for (var i = 0; i < message.updateBinding.length; ++i)\n $root.onnx.StringStringEntryProto.encode(message.updateBinding[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified TrainingInfoProto message, length delimited. Does not implicitly {@link onnx.TrainingInfoProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {onnx.ITrainingInfoProto} message TrainingInfoProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TrainingInfoProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a TrainingInfoProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TrainingInfoProto} TrainingInfoProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TrainingInfoProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TrainingInfoProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.initialization = $root.onnx.GraphProto.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.algorithm = $root.onnx.GraphProto.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n if (!(message.initializationBinding && message.initializationBinding.length))\n message.initializationBinding = [];\n message.initializationBinding.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n break;\n }\n case 4: {\n if (!(message.updateBinding && message.updateBinding.length))\n message.updateBinding = [];\n message.updateBinding.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a TrainingInfoProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TrainingInfoProto} TrainingInfoProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TrainingInfoProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a TrainingInfoProto message.\n * @function verify\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TrainingInfoProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.initialization != null && message.hasOwnProperty(\"initialization\")) {\n var error = $root.onnx.GraphProto.verify(message.initialization);\n if (error)\n return \"initialization.\" + error;\n }\n if (message.algorithm != null && message.hasOwnProperty(\"algorithm\")) {\n var error = $root.onnx.GraphProto.verify(message.algorithm);\n if (error)\n return \"algorithm.\" + error;\n }\n if (message.initializationBinding != null && message.hasOwnProperty(\"initializationBinding\")) {\n if (!Array.isArray(message.initializationBinding))\n return \"initializationBinding: array expected\";\n for (var i = 0; i < message.initializationBinding.length; ++i) {\n var error = $root.onnx.StringStringEntryProto.verify(message.initializationBinding[i]);\n if (error)\n return \"initializationBinding.\" + error;\n }\n }\n if (message.updateBinding != null && message.hasOwnProperty(\"updateBinding\")) {\n if (!Array.isArray(message.updateBinding))\n return \"updateBinding: array expected\";\n for (var i = 0; i < message.updateBinding.length; ++i) {\n var error = $root.onnx.StringStringEntryProto.verify(message.updateBinding[i]);\n if (error)\n return \"updateBinding.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates a TrainingInfoProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TrainingInfoProto} TrainingInfoProto\n */\n TrainingInfoProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TrainingInfoProto)\n return object;\n var message = new $root.onnx.TrainingInfoProto();\n if (object.initialization != null) {\n if (typeof object.initialization !== \"object\")\n throw TypeError(\".onnx.TrainingInfoProto.initialization: object expected\");\n message.initialization = $root.onnx.GraphProto.fromObject(object.initialization);\n }\n if (object.algorithm != null) {\n if (typeof object.algorithm !== \"object\")\n throw TypeError(\".onnx.TrainingInfoProto.algorithm: object expected\");\n message.algorithm = $root.onnx.GraphProto.fromObject(object.algorithm);\n }\n if (object.initializationBinding) {\n if (!Array.isArray(object.initializationBinding))\n throw TypeError(\".onnx.TrainingInfoProto.initializationBinding: array expected\");\n message.initializationBinding = [];\n for (var i = 0; i < object.initializationBinding.length; ++i) {\n if (typeof object.initializationBinding[i] !== \"object\")\n throw TypeError(\".onnx.TrainingInfoProto.initializationBinding: object expected\");\n message.initializationBinding[i] = $root.onnx.StringStringEntryProto.fromObject(object.initializationBinding[i]);\n }\n }\n if (object.updateBinding) {\n if (!Array.isArray(object.updateBinding))\n throw TypeError(\".onnx.TrainingInfoProto.updateBinding: array expected\");\n message.updateBinding = [];\n for (var i = 0; i < object.updateBinding.length; ++i) {\n if (typeof object.updateBinding[i] !== \"object\")\n throw TypeError(\".onnx.TrainingInfoProto.updateBinding: object expected\");\n message.updateBinding[i] = $root.onnx.StringStringEntryProto.fromObject(object.updateBinding[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from a TrainingInfoProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {onnx.TrainingInfoProto} message TrainingInfoProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TrainingInfoProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.initializationBinding = [];\n object.updateBinding = [];\n }\n if (options.defaults) {\n object.initialization = null;\n object.algorithm = null;\n }\n if (message.initialization != null && message.hasOwnProperty(\"initialization\"))\n object.initialization = $root.onnx.GraphProto.toObject(message.initialization, options);\n if (message.algorithm != null && message.hasOwnProperty(\"algorithm\"))\n object.algorithm = $root.onnx.GraphProto.toObject(message.algorithm, options);\n if (message.initializationBinding && message.initializationBinding.length) {\n object.initializationBinding = [];\n for (var j = 0; j < message.initializationBinding.length; ++j)\n object.initializationBinding[j] = $root.onnx.StringStringEntryProto.toObject(message.initializationBinding[j], options);\n }\n if (message.updateBinding && message.updateBinding.length) {\n object.updateBinding = [];\n for (var j = 0; j < message.updateBinding.length; ++j)\n object.updateBinding[j] = $root.onnx.StringStringEntryProto.toObject(message.updateBinding[j], options);\n }\n return object;\n };\n\n /**\n * Converts this TrainingInfoProto to JSON.\n * @function toJSON\n * @memberof onnx.TrainingInfoProto\n * @instance\n * @returns {Object.} JSON object\n */\n TrainingInfoProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for TrainingInfoProto\n * @function getTypeUrl\n * @memberof onnx.TrainingInfoProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TrainingInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TrainingInfoProto\";\n };\n\n return TrainingInfoProto;\n })();\n\n onnx.ModelProto = (function() {\n\n /**\n * Properties of a ModelProto.\n * @memberof onnx\n * @interface IModelProto\n * @property {number|Long|null} [irVersion] ModelProto irVersion\n * @property {Array.|null} [opsetImport] ModelProto opsetImport\n * @property {string|null} [producerName] ModelProto producerName\n * @property {string|null} [producerVersion] ModelProto producerVersion\n * @property {string|null} [domain] ModelProto domain\n * @property {number|Long|null} [modelVersion] ModelProto modelVersion\n * @property {string|null} [docString] ModelProto docString\n * @property {onnx.IGraphProto|null} [graph] ModelProto graph\n * @property {Array.|null} [metadataProps] ModelProto metadataProps\n * @property {Array.|null} [trainingInfo] ModelProto trainingInfo\n * @property {Array.|null} [functions] ModelProto functions\n */\n\n /**\n * Constructs a new ModelProto.\n * @memberof onnx\n * @classdesc Represents a ModelProto.\n * @implements IModelProto\n * @constructor\n * @param {onnx.IModelProto=} [properties] Properties to set\n */\n function ModelProto(properties) {\n this.opsetImport = [];\n this.metadataProps = [];\n this.trainingInfo = [];\n this.functions = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * ModelProto irVersion.\n * @member {number|Long} irVersion\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.irVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n /**\n * ModelProto opsetImport.\n * @member {Array.} opsetImport\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.opsetImport = $util.emptyArray;\n\n /**\n * ModelProto producerName.\n * @member {string} producerName\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.producerName = \"\";\n\n /**\n * ModelProto producerVersion.\n * @member {string} producerVersion\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.producerVersion = \"\";\n\n /**\n * ModelProto domain.\n * @member {string} domain\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.domain = \"\";\n\n /**\n * ModelProto modelVersion.\n * @member {number|Long} modelVersion\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.modelVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n /**\n * ModelProto docString.\n * @member {string} docString\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.docString = \"\";\n\n /**\n * ModelProto graph.\n * @member {onnx.IGraphProto|null|undefined} graph\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.graph = null;\n\n /**\n * ModelProto metadataProps.\n * @member {Array.} metadataProps\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.metadataProps = $util.emptyArray;\n\n /**\n * ModelProto trainingInfo.\n * @member {Array.} trainingInfo\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.trainingInfo = $util.emptyArray;\n\n /**\n * ModelProto functions.\n * @member {Array.} functions\n * @memberof onnx.ModelProto\n * @instance\n */\n ModelProto.prototype.functions = $util.emptyArray;\n\n /**\n * Creates a new ModelProto instance using the specified properties.\n * @function create\n * @memberof onnx.ModelProto\n * @static\n * @param {onnx.IModelProto=} [properties] Properties to set\n * @returns {onnx.ModelProto} ModelProto instance\n */\n ModelProto.create = function create(properties) {\n return new ModelProto(properties);\n };\n\n /**\n * Encodes the specified ModelProto message. Does not implicitly {@link onnx.ModelProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.ModelProto\n * @static\n * @param {onnx.IModelProto} message ModelProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ModelProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.irVersion != null && Object.hasOwnProperty.call(message, \"irVersion\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int64(message.irVersion);\n if (message.producerName != null && Object.hasOwnProperty.call(message, \"producerName\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.producerName);\n if (message.producerVersion != null && Object.hasOwnProperty.call(message, \"producerVersion\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.producerVersion);\n if (message.domain != null && Object.hasOwnProperty.call(message, \"domain\"))\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.domain);\n if (message.modelVersion != null && Object.hasOwnProperty.call(message, \"modelVersion\"))\n writer.uint32(/* id 5, wireType 0 =*/40).int64(message.modelVersion);\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.docString);\n if (message.graph != null && Object.hasOwnProperty.call(message, \"graph\"))\n $root.onnx.GraphProto.encode(message.graph, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.opsetImport != null && message.opsetImport.length)\n for (var i = 0; i < message.opsetImport.length; ++i)\n $root.onnx.OperatorSetIdProto.encode(message.opsetImport[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.metadataProps != null && message.metadataProps.length)\n for (var i = 0; i < message.metadataProps.length; ++i)\n $root.onnx.StringStringEntryProto.encode(message.metadataProps[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();\n if (message.trainingInfo != null && message.trainingInfo.length)\n for (var i = 0; i < message.trainingInfo.length; ++i)\n $root.onnx.TrainingInfoProto.encode(message.trainingInfo[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();\n if (message.functions != null && message.functions.length)\n for (var i = 0; i < message.functions.length; ++i)\n $root.onnx.FunctionProto.encode(message.functions[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified ModelProto message, length delimited. Does not implicitly {@link onnx.ModelProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.ModelProto\n * @static\n * @param {onnx.IModelProto} message ModelProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ModelProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a ModelProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.ModelProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.ModelProto} ModelProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ModelProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.ModelProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.irVersion = reader.int64();\n break;\n }\n case 8: {\n if (!(message.opsetImport && message.opsetImport.length))\n message.opsetImport = [];\n message.opsetImport.push($root.onnx.OperatorSetIdProto.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.producerName = reader.string();\n break;\n }\n case 3: {\n message.producerVersion = reader.string();\n break;\n }\n case 4: {\n message.domain = reader.string();\n break;\n }\n case 5: {\n message.modelVersion = reader.int64();\n break;\n }\n case 6: {\n message.docString = reader.string();\n break;\n }\n case 7: {\n message.graph = $root.onnx.GraphProto.decode(reader, reader.uint32());\n break;\n }\n case 14: {\n if (!(message.metadataProps && message.metadataProps.length))\n message.metadataProps = [];\n message.metadataProps.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n break;\n }\n case 20: {\n if (!(message.trainingInfo && message.trainingInfo.length))\n message.trainingInfo = [];\n message.trainingInfo.push($root.onnx.TrainingInfoProto.decode(reader, reader.uint32()));\n break;\n }\n case 25: {\n if (!(message.functions && message.functions.length))\n message.functions = [];\n message.functions.push($root.onnx.FunctionProto.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a ModelProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.ModelProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.ModelProto} ModelProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ModelProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a ModelProto message.\n * @function verify\n * @memberof onnx.ModelProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n ModelProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.irVersion != null && message.hasOwnProperty(\"irVersion\"))\n if (!$util.isInteger(message.irVersion) && !(message.irVersion && $util.isInteger(message.irVersion.low) && $util.isInteger(message.irVersion.high)))\n return \"irVersion: integer|Long expected\";\n if (message.opsetImport != null && message.hasOwnProperty(\"opsetImport\")) {\n if (!Array.isArray(message.opsetImport))\n return \"opsetImport: array expected\";\n for (var i = 0; i < message.opsetImport.length; ++i) {\n var error = $root.onnx.OperatorSetIdProto.verify(message.opsetImport[i]);\n if (error)\n return \"opsetImport.\" + error;\n }\n }\n if (message.producerName != null && message.hasOwnProperty(\"producerName\"))\n if (!$util.isString(message.producerName))\n return \"producerName: string expected\";\n if (message.producerVersion != null && message.hasOwnProperty(\"producerVersion\"))\n if (!$util.isString(message.producerVersion))\n return \"producerVersion: string expected\";\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n if (!$util.isString(message.domain))\n return \"domain: string expected\";\n if (message.modelVersion != null && message.hasOwnProperty(\"modelVersion\"))\n if (!$util.isInteger(message.modelVersion) && !(message.modelVersion && $util.isInteger(message.modelVersion.low) && $util.isInteger(message.modelVersion.high)))\n return \"modelVersion: integer|Long expected\";\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n if (message.graph != null && message.hasOwnProperty(\"graph\")) {\n var error = $root.onnx.GraphProto.verify(message.graph);\n if (error)\n return \"graph.\" + error;\n }\n if (message.metadataProps != null && message.hasOwnProperty(\"metadataProps\")) {\n if (!Array.isArray(message.metadataProps))\n return \"metadataProps: array expected\";\n for (var i = 0; i < message.metadataProps.length; ++i) {\n var error = $root.onnx.StringStringEntryProto.verify(message.metadataProps[i]);\n if (error)\n return \"metadataProps.\" + error;\n }\n }\n if (message.trainingInfo != null && message.hasOwnProperty(\"trainingInfo\")) {\n if (!Array.isArray(message.trainingInfo))\n return \"trainingInfo: array expected\";\n for (var i = 0; i < message.trainingInfo.length; ++i) {\n var error = $root.onnx.TrainingInfoProto.verify(message.trainingInfo[i]);\n if (error)\n return \"trainingInfo.\" + error;\n }\n }\n if (message.functions != null && message.hasOwnProperty(\"functions\")) {\n if (!Array.isArray(message.functions))\n return \"functions: array expected\";\n for (var i = 0; i < message.functions.length; ++i) {\n var error = $root.onnx.FunctionProto.verify(message.functions[i]);\n if (error)\n return \"functions.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates a ModelProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.ModelProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.ModelProto} ModelProto\n */\n ModelProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.ModelProto)\n return object;\n var message = new $root.onnx.ModelProto();\n if (object.irVersion != null)\n if ($util.Long)\n (message.irVersion = $util.Long.fromValue(object.irVersion)).unsigned = false;\n else if (typeof object.irVersion === \"string\")\n message.irVersion = parseInt(object.irVersion, 10);\n else if (typeof object.irVersion === \"number\")\n message.irVersion = object.irVersion;\n else if (typeof object.irVersion === \"object\")\n message.irVersion = new $util.LongBits(object.irVersion.low >>> 0, object.irVersion.high >>> 0).toNumber();\n if (object.opsetImport) {\n if (!Array.isArray(object.opsetImport))\n throw TypeError(\".onnx.ModelProto.opsetImport: array expected\");\n message.opsetImport = [];\n for (var i = 0; i < object.opsetImport.length; ++i) {\n if (typeof object.opsetImport[i] !== \"object\")\n throw TypeError(\".onnx.ModelProto.opsetImport: object expected\");\n message.opsetImport[i] = $root.onnx.OperatorSetIdProto.fromObject(object.opsetImport[i]);\n }\n }\n if (object.producerName != null)\n message.producerName = String(object.producerName);\n if (object.producerVersion != null)\n message.producerVersion = String(object.producerVersion);\n if (object.domain != null)\n message.domain = String(object.domain);\n if (object.modelVersion != null)\n if ($util.Long)\n (message.modelVersion = $util.Long.fromValue(object.modelVersion)).unsigned = false;\n else if (typeof object.modelVersion === \"string\")\n message.modelVersion = parseInt(object.modelVersion, 10);\n else if (typeof object.modelVersion === \"number\")\n message.modelVersion = object.modelVersion;\n else if (typeof object.modelVersion === \"object\")\n message.modelVersion = new $util.LongBits(object.modelVersion.low >>> 0, object.modelVersion.high >>> 0).toNumber();\n if (object.docString != null)\n message.docString = String(object.docString);\n if (object.graph != null) {\n if (typeof object.graph !== \"object\")\n throw TypeError(\".onnx.ModelProto.graph: object expected\");\n message.graph = $root.onnx.GraphProto.fromObject(object.graph);\n }\n if (object.metadataProps) {\n if (!Array.isArray(object.metadataProps))\n throw TypeError(\".onnx.ModelProto.metadataProps: array expected\");\n message.metadataProps = [];\n for (var i = 0; i < object.metadataProps.length; ++i) {\n if (typeof object.metadataProps[i] !== \"object\")\n throw TypeError(\".onnx.ModelProto.metadataProps: object expected\");\n message.metadataProps[i] = $root.onnx.StringStringEntryProto.fromObject(object.metadataProps[i]);\n }\n }\n if (object.trainingInfo) {\n if (!Array.isArray(object.trainingInfo))\n throw TypeError(\".onnx.ModelProto.trainingInfo: array expected\");\n message.trainingInfo = [];\n for (var i = 0; i < object.trainingInfo.length; ++i) {\n if (typeof object.trainingInfo[i] !== \"object\")\n throw TypeError(\".onnx.ModelProto.trainingInfo: object expected\");\n message.trainingInfo[i] = $root.onnx.TrainingInfoProto.fromObject(object.trainingInfo[i]);\n }\n }\n if (object.functions) {\n if (!Array.isArray(object.functions))\n throw TypeError(\".onnx.ModelProto.functions: array expected\");\n message.functions = [];\n for (var i = 0; i < object.functions.length; ++i) {\n if (typeof object.functions[i] !== \"object\")\n throw TypeError(\".onnx.ModelProto.functions: object expected\");\n message.functions[i] = $root.onnx.FunctionProto.fromObject(object.functions[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from a ModelProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.ModelProto\n * @static\n * @param {onnx.ModelProto} message ModelProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n ModelProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.opsetImport = [];\n object.metadataProps = [];\n object.trainingInfo = [];\n object.functions = [];\n }\n if (options.defaults) {\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.irVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.irVersion = options.longs === String ? \"0\" : 0;\n object.producerName = \"\";\n object.producerVersion = \"\";\n object.domain = \"\";\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.modelVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.modelVersion = options.longs === String ? \"0\" : 0;\n object.docString = \"\";\n object.graph = null;\n }\n if (message.irVersion != null && message.hasOwnProperty(\"irVersion\"))\n if (typeof message.irVersion === \"number\")\n object.irVersion = options.longs === String ? String(message.irVersion) : message.irVersion;\n else\n object.irVersion = options.longs === String ? $util.Long.prototype.toString.call(message.irVersion) : options.longs === Number ? new $util.LongBits(message.irVersion.low >>> 0, message.irVersion.high >>> 0).toNumber() : message.irVersion;\n if (message.producerName != null && message.hasOwnProperty(\"producerName\"))\n object.producerName = message.producerName;\n if (message.producerVersion != null && message.hasOwnProperty(\"producerVersion\"))\n object.producerVersion = message.producerVersion;\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n object.domain = message.domain;\n if (message.modelVersion != null && message.hasOwnProperty(\"modelVersion\"))\n if (typeof message.modelVersion === \"number\")\n object.modelVersion = options.longs === String ? String(message.modelVersion) : message.modelVersion;\n else\n object.modelVersion = options.longs === String ? $util.Long.prototype.toString.call(message.modelVersion) : options.longs === Number ? new $util.LongBits(message.modelVersion.low >>> 0, message.modelVersion.high >>> 0).toNumber() : message.modelVersion;\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n if (message.graph != null && message.hasOwnProperty(\"graph\"))\n object.graph = $root.onnx.GraphProto.toObject(message.graph, options);\n if (message.opsetImport && message.opsetImport.length) {\n object.opsetImport = [];\n for (var j = 0; j < message.opsetImport.length; ++j)\n object.opsetImport[j] = $root.onnx.OperatorSetIdProto.toObject(message.opsetImport[j], options);\n }\n if (message.metadataProps && message.metadataProps.length) {\n object.metadataProps = [];\n for (var j = 0; j < message.metadataProps.length; ++j)\n object.metadataProps[j] = $root.onnx.StringStringEntryProto.toObject(message.metadataProps[j], options);\n }\n if (message.trainingInfo && message.trainingInfo.length) {\n object.trainingInfo = [];\n for (var j = 0; j < message.trainingInfo.length; ++j)\n object.trainingInfo[j] = $root.onnx.TrainingInfoProto.toObject(message.trainingInfo[j], options);\n }\n if (message.functions && message.functions.length) {\n object.functions = [];\n for (var j = 0; j < message.functions.length; ++j)\n object.functions[j] = $root.onnx.FunctionProto.toObject(message.functions[j], options);\n }\n return object;\n };\n\n /**\n * Converts this ModelProto to JSON.\n * @function toJSON\n * @memberof onnx.ModelProto\n * @instance\n * @returns {Object.} JSON object\n */\n ModelProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for ModelProto\n * @function getTypeUrl\n * @memberof onnx.ModelProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n ModelProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.ModelProto\";\n };\n\n return ModelProto;\n })();\n\n onnx.StringStringEntryProto = (function() {\n\n /**\n * Properties of a StringStringEntryProto.\n * @memberof onnx\n * @interface IStringStringEntryProto\n * @property {string|null} [key] StringStringEntryProto key\n * @property {string|null} [value] StringStringEntryProto value\n */\n\n /**\n * Constructs a new StringStringEntryProto.\n * @memberof onnx\n * @classdesc Represents a StringStringEntryProto.\n * @implements IStringStringEntryProto\n * @constructor\n * @param {onnx.IStringStringEntryProto=} [properties] Properties to set\n */\n function StringStringEntryProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * StringStringEntryProto key.\n * @member {string} key\n * @memberof onnx.StringStringEntryProto\n * @instance\n */\n StringStringEntryProto.prototype.key = \"\";\n\n /**\n * StringStringEntryProto value.\n * @member {string} value\n * @memberof onnx.StringStringEntryProto\n * @instance\n */\n StringStringEntryProto.prototype.value = \"\";\n\n /**\n * Creates a new StringStringEntryProto instance using the specified properties.\n * @function create\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {onnx.IStringStringEntryProto=} [properties] Properties to set\n * @returns {onnx.StringStringEntryProto} StringStringEntryProto instance\n */\n StringStringEntryProto.create = function create(properties) {\n return new StringStringEntryProto(properties);\n };\n\n /**\n * Encodes the specified StringStringEntryProto message. Does not implicitly {@link onnx.StringStringEntryProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {onnx.IStringStringEntryProto} message StringStringEntryProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n StringStringEntryProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.key != null && Object.hasOwnProperty.call(message, \"key\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.key);\n if (message.value != null && Object.hasOwnProperty.call(message, \"value\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.value);\n return writer;\n };\n\n /**\n * Encodes the specified StringStringEntryProto message, length delimited. Does not implicitly {@link onnx.StringStringEntryProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {onnx.IStringStringEntryProto} message StringStringEntryProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n StringStringEntryProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a StringStringEntryProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.StringStringEntryProto} StringStringEntryProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n StringStringEntryProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.StringStringEntryProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.key = reader.string();\n break;\n }\n case 2: {\n message.value = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a StringStringEntryProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.StringStringEntryProto} StringStringEntryProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n StringStringEntryProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a StringStringEntryProto message.\n * @function verify\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n StringStringEntryProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.key != null && message.hasOwnProperty(\"key\"))\n if (!$util.isString(message.key))\n return \"key: string expected\";\n if (message.value != null && message.hasOwnProperty(\"value\"))\n if (!$util.isString(message.value))\n return \"value: string expected\";\n return null;\n };\n\n /**\n * Creates a StringStringEntryProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.StringStringEntryProto} StringStringEntryProto\n */\n StringStringEntryProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.StringStringEntryProto)\n return object;\n var message = new $root.onnx.StringStringEntryProto();\n if (object.key != null)\n message.key = String(object.key);\n if (object.value != null)\n message.value = String(object.value);\n return message;\n };\n\n /**\n * Creates a plain object from a StringStringEntryProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {onnx.StringStringEntryProto} message StringStringEntryProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n StringStringEntryProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.key = \"\";\n object.value = \"\";\n }\n if (message.key != null && message.hasOwnProperty(\"key\"))\n object.key = message.key;\n if (message.value != null && message.hasOwnProperty(\"value\"))\n object.value = message.value;\n return object;\n };\n\n /**\n * Converts this StringStringEntryProto to JSON.\n * @function toJSON\n * @memberof onnx.StringStringEntryProto\n * @instance\n * @returns {Object.} JSON object\n */\n StringStringEntryProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for StringStringEntryProto\n * @function getTypeUrl\n * @memberof onnx.StringStringEntryProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n StringStringEntryProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.StringStringEntryProto\";\n };\n\n return StringStringEntryProto;\n })();\n\n onnx.TensorAnnotation = (function() {\n\n /**\n * Properties of a TensorAnnotation.\n * @memberof onnx\n * @interface ITensorAnnotation\n * @property {string|null} [tensorName] TensorAnnotation tensorName\n * @property {Array.|null} [quantParameterTensorNames] TensorAnnotation quantParameterTensorNames\n */\n\n /**\n * Constructs a new TensorAnnotation.\n * @memberof onnx\n * @classdesc Represents a TensorAnnotation.\n * @implements ITensorAnnotation\n * @constructor\n * @param {onnx.ITensorAnnotation=} [properties] Properties to set\n */\n function TensorAnnotation(properties) {\n this.quantParameterTensorNames = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * TensorAnnotation tensorName.\n * @member {string} tensorName\n * @memberof onnx.TensorAnnotation\n * @instance\n */\n TensorAnnotation.prototype.tensorName = \"\";\n\n /**\n * TensorAnnotation quantParameterTensorNames.\n * @member {Array.} quantParameterTensorNames\n * @memberof onnx.TensorAnnotation\n * @instance\n */\n TensorAnnotation.prototype.quantParameterTensorNames = $util.emptyArray;\n\n /**\n * Creates a new TensorAnnotation instance using the specified properties.\n * @function create\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {onnx.ITensorAnnotation=} [properties] Properties to set\n * @returns {onnx.TensorAnnotation} TensorAnnotation instance\n */\n TensorAnnotation.create = function create(properties) {\n return new TensorAnnotation(properties);\n };\n\n /**\n * Encodes the specified TensorAnnotation message. Does not implicitly {@link onnx.TensorAnnotation.verify|verify} messages.\n * @function encode\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {onnx.ITensorAnnotation} message TensorAnnotation message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TensorAnnotation.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tensorName != null && Object.hasOwnProperty.call(message, \"tensorName\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorName);\n if (message.quantParameterTensorNames != null && message.quantParameterTensorNames.length)\n for (var i = 0; i < message.quantParameterTensorNames.length; ++i)\n $root.onnx.StringStringEntryProto.encode(message.quantParameterTensorNames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified TensorAnnotation message, length delimited. Does not implicitly {@link onnx.TensorAnnotation.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {onnx.ITensorAnnotation} message TensorAnnotation message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TensorAnnotation.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a TensorAnnotation message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TensorAnnotation} TensorAnnotation\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TensorAnnotation.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TensorAnnotation();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.tensorName = reader.string();\n break;\n }\n case 2: {\n if (!(message.quantParameterTensorNames && message.quantParameterTensorNames.length))\n message.quantParameterTensorNames = [];\n message.quantParameterTensorNames.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a TensorAnnotation message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TensorAnnotation} TensorAnnotation\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TensorAnnotation.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a TensorAnnotation message.\n * @function verify\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TensorAnnotation.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.tensorName != null && message.hasOwnProperty(\"tensorName\"))\n if (!$util.isString(message.tensorName))\n return \"tensorName: string expected\";\n if (message.quantParameterTensorNames != null && message.hasOwnProperty(\"quantParameterTensorNames\")) {\n if (!Array.isArray(message.quantParameterTensorNames))\n return \"quantParameterTensorNames: array expected\";\n for (var i = 0; i < message.quantParameterTensorNames.length; ++i) {\n var error = $root.onnx.StringStringEntryProto.verify(message.quantParameterTensorNames[i]);\n if (error)\n return \"quantParameterTensorNames.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates a TensorAnnotation message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TensorAnnotation} TensorAnnotation\n */\n TensorAnnotation.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TensorAnnotation)\n return object;\n var message = new $root.onnx.TensorAnnotation();\n if (object.tensorName != null)\n message.tensorName = String(object.tensorName);\n if (object.quantParameterTensorNames) {\n if (!Array.isArray(object.quantParameterTensorNames))\n throw TypeError(\".onnx.TensorAnnotation.quantParameterTensorNames: array expected\");\n message.quantParameterTensorNames = [];\n for (var i = 0; i < object.quantParameterTensorNames.length; ++i) {\n if (typeof object.quantParameterTensorNames[i] !== \"object\")\n throw TypeError(\".onnx.TensorAnnotation.quantParameterTensorNames: object expected\");\n message.quantParameterTensorNames[i] = $root.onnx.StringStringEntryProto.fromObject(object.quantParameterTensorNames[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from a TensorAnnotation message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {onnx.TensorAnnotation} message TensorAnnotation\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TensorAnnotation.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.quantParameterTensorNames = [];\n if (options.defaults)\n object.tensorName = \"\";\n if (message.tensorName != null && message.hasOwnProperty(\"tensorName\"))\n object.tensorName = message.tensorName;\n if (message.quantParameterTensorNames && message.quantParameterTensorNames.length) {\n object.quantParameterTensorNames = [];\n for (var j = 0; j < message.quantParameterTensorNames.length; ++j)\n object.quantParameterTensorNames[j] = $root.onnx.StringStringEntryProto.toObject(message.quantParameterTensorNames[j], options);\n }\n return object;\n };\n\n /**\n * Converts this TensorAnnotation to JSON.\n * @function toJSON\n * @memberof onnx.TensorAnnotation\n * @instance\n * @returns {Object.} JSON object\n */\n TensorAnnotation.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for TensorAnnotation\n * @function getTypeUrl\n * @memberof onnx.TensorAnnotation\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TensorAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TensorAnnotation\";\n };\n\n return TensorAnnotation;\n })();\n\n onnx.GraphProto = (function() {\n\n /**\n * Properties of a GraphProto.\n * @memberof onnx\n * @interface IGraphProto\n * @property {Array.|null} [node] GraphProto node\n * @property {string|null} [name] GraphProto name\n * @property {Array.|null} [initializer] GraphProto initializer\n * @property {Array.|null} [sparseInitializer] GraphProto sparseInitializer\n * @property {string|null} [docString] GraphProto docString\n * @property {Array.|null} [input] GraphProto input\n * @property {Array.|null} [output] GraphProto output\n * @property {Array.|null} [valueInfo] GraphProto valueInfo\n * @property {Array.|null} [quantizationAnnotation] GraphProto quantizationAnnotation\n */\n\n /**\n * Constructs a new GraphProto.\n * @memberof onnx\n * @classdesc Represents a GraphProto.\n * @implements IGraphProto\n * @constructor\n * @param {onnx.IGraphProto=} [properties] Properties to set\n */\n function GraphProto(properties) {\n this.node = [];\n this.initializer = [];\n this.sparseInitializer = [];\n this.input = [];\n this.output = [];\n this.valueInfo = [];\n this.quantizationAnnotation = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * GraphProto node.\n * @member {Array.} node\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.node = $util.emptyArray;\n\n /**\n * GraphProto name.\n * @member {string} name\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.name = \"\";\n\n /**\n * GraphProto initializer.\n * @member {Array.} initializer\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.initializer = $util.emptyArray;\n\n /**\n * GraphProto sparseInitializer.\n * @member {Array.} sparseInitializer\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.sparseInitializer = $util.emptyArray;\n\n /**\n * GraphProto docString.\n * @member {string} docString\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.docString = \"\";\n\n /**\n * GraphProto input.\n * @member {Array.} input\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.input = $util.emptyArray;\n\n /**\n * GraphProto output.\n * @member {Array.} output\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.output = $util.emptyArray;\n\n /**\n * GraphProto valueInfo.\n * @member {Array.} valueInfo\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.valueInfo = $util.emptyArray;\n\n /**\n * GraphProto quantizationAnnotation.\n * @member {Array.} quantizationAnnotation\n * @memberof onnx.GraphProto\n * @instance\n */\n GraphProto.prototype.quantizationAnnotation = $util.emptyArray;\n\n /**\n * Creates a new GraphProto instance using the specified properties.\n * @function create\n * @memberof onnx.GraphProto\n * @static\n * @param {onnx.IGraphProto=} [properties] Properties to set\n * @returns {onnx.GraphProto} GraphProto instance\n */\n GraphProto.create = function create(properties) {\n return new GraphProto(properties);\n };\n\n /**\n * Encodes the specified GraphProto message. Does not implicitly {@link onnx.GraphProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.GraphProto\n * @static\n * @param {onnx.IGraphProto} message GraphProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GraphProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.node != null && message.node.length)\n for (var i = 0; i < message.node.length; ++i)\n $root.onnx.NodeProto.encode(message.node[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);\n if (message.initializer != null && message.initializer.length)\n for (var i = 0; i < message.initializer.length; ++i)\n $root.onnx.TensorProto.encode(message.initializer[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 10, wireType 2 =*/82).string(message.docString);\n if (message.input != null && message.input.length)\n for (var i = 0; i < message.input.length; ++i)\n $root.onnx.ValueInfoProto.encode(message.input[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();\n if (message.output != null && message.output.length)\n for (var i = 0; i < message.output.length; ++i)\n $root.onnx.ValueInfoProto.encode(message.output[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();\n if (message.valueInfo != null && message.valueInfo.length)\n for (var i = 0; i < message.valueInfo.length; ++i)\n $root.onnx.ValueInfoProto.encode(message.valueInfo[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();\n if (message.quantizationAnnotation != null && message.quantizationAnnotation.length)\n for (var i = 0; i < message.quantizationAnnotation.length; ++i)\n $root.onnx.TensorAnnotation.encode(message.quantizationAnnotation[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();\n if (message.sparseInitializer != null && message.sparseInitializer.length)\n for (var i = 0; i < message.sparseInitializer.length; ++i)\n $root.onnx.SparseTensorProto.encode(message.sparseInitializer[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified GraphProto message, length delimited. Does not implicitly {@link onnx.GraphProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.GraphProto\n * @static\n * @param {onnx.IGraphProto} message GraphProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n GraphProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a GraphProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.GraphProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.GraphProto} GraphProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GraphProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.GraphProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.node && message.node.length))\n message.node = [];\n message.node.push($root.onnx.NodeProto.decode(reader, reader.uint32()));\n break;\n }\n case 2: {\n message.name = reader.string();\n break;\n }\n case 5: {\n if (!(message.initializer && message.initializer.length))\n message.initializer = [];\n message.initializer.push($root.onnx.TensorProto.decode(reader, reader.uint32()));\n break;\n }\n case 15: {\n if (!(message.sparseInitializer && message.sparseInitializer.length))\n message.sparseInitializer = [];\n message.sparseInitializer.push($root.onnx.SparseTensorProto.decode(reader, reader.uint32()));\n break;\n }\n case 10: {\n message.docString = reader.string();\n break;\n }\n case 11: {\n if (!(message.input && message.input.length))\n message.input = [];\n message.input.push($root.onnx.ValueInfoProto.decode(reader, reader.uint32()));\n break;\n }\n case 12: {\n if (!(message.output && message.output.length))\n message.output = [];\n message.output.push($root.onnx.ValueInfoProto.decode(reader, reader.uint32()));\n break;\n }\n case 13: {\n if (!(message.valueInfo && message.valueInfo.length))\n message.valueInfo = [];\n message.valueInfo.push($root.onnx.ValueInfoProto.decode(reader, reader.uint32()));\n break;\n }\n case 14: {\n if (!(message.quantizationAnnotation && message.quantizationAnnotation.length))\n message.quantizationAnnotation = [];\n message.quantizationAnnotation.push($root.onnx.TensorAnnotation.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a GraphProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.GraphProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.GraphProto} GraphProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n GraphProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a GraphProto message.\n * @function verify\n * @memberof onnx.GraphProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n GraphProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.node != null && message.hasOwnProperty(\"node\")) {\n if (!Array.isArray(message.node))\n return \"node: array expected\";\n for (var i = 0; i < message.node.length; ++i) {\n var error = $root.onnx.NodeProto.verify(message.node[i]);\n if (error)\n return \"node.\" + error;\n }\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.initializer != null && message.hasOwnProperty(\"initializer\")) {\n if (!Array.isArray(message.initializer))\n return \"initializer: array expected\";\n for (var i = 0; i < message.initializer.length; ++i) {\n var error = $root.onnx.TensorProto.verify(message.initializer[i]);\n if (error)\n return \"initializer.\" + error;\n }\n }\n if (message.sparseInitializer != null && message.hasOwnProperty(\"sparseInitializer\")) {\n if (!Array.isArray(message.sparseInitializer))\n return \"sparseInitializer: array expected\";\n for (var i = 0; i < message.sparseInitializer.length; ++i) {\n var error = $root.onnx.SparseTensorProto.verify(message.sparseInitializer[i]);\n if (error)\n return \"sparseInitializer.\" + error;\n }\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n if (message.input != null && message.hasOwnProperty(\"input\")) {\n if (!Array.isArray(message.input))\n return \"input: array expected\";\n for (var i = 0; i < message.input.length; ++i) {\n var error = $root.onnx.ValueInfoProto.verify(message.input[i]);\n if (error)\n return \"input.\" + error;\n }\n }\n if (message.output != null && message.hasOwnProperty(\"output\")) {\n if (!Array.isArray(message.output))\n return \"output: array expected\";\n for (var i = 0; i < message.output.length; ++i) {\n var error = $root.onnx.ValueInfoProto.verify(message.output[i]);\n if (error)\n return \"output.\" + error;\n }\n }\n if (message.valueInfo != null && message.hasOwnProperty(\"valueInfo\")) {\n if (!Array.isArray(message.valueInfo))\n return \"valueInfo: array expected\";\n for (var i = 0; i < message.valueInfo.length; ++i) {\n var error = $root.onnx.ValueInfoProto.verify(message.valueInfo[i]);\n if (error)\n return \"valueInfo.\" + error;\n }\n }\n if (message.quantizationAnnotation != null && message.hasOwnProperty(\"quantizationAnnotation\")) {\n if (!Array.isArray(message.quantizationAnnotation))\n return \"quantizationAnnotation: array expected\";\n for (var i = 0; i < message.quantizationAnnotation.length; ++i) {\n var error = $root.onnx.TensorAnnotation.verify(message.quantizationAnnotation[i]);\n if (error)\n return \"quantizationAnnotation.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates a GraphProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.GraphProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.GraphProto} GraphProto\n */\n GraphProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.GraphProto)\n return object;\n var message = new $root.onnx.GraphProto();\n if (object.node) {\n if (!Array.isArray(object.node))\n throw TypeError(\".onnx.GraphProto.node: array expected\");\n message.node = [];\n for (var i = 0; i < object.node.length; ++i) {\n if (typeof object.node[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.node: object expected\");\n message.node[i] = $root.onnx.NodeProto.fromObject(object.node[i]);\n }\n }\n if (object.name != null)\n message.name = String(object.name);\n if (object.initializer) {\n if (!Array.isArray(object.initializer))\n throw TypeError(\".onnx.GraphProto.initializer: array expected\");\n message.initializer = [];\n for (var i = 0; i < object.initializer.length; ++i) {\n if (typeof object.initializer[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.initializer: object expected\");\n message.initializer[i] = $root.onnx.TensorProto.fromObject(object.initializer[i]);\n }\n }\n if (object.sparseInitializer) {\n if (!Array.isArray(object.sparseInitializer))\n throw TypeError(\".onnx.GraphProto.sparseInitializer: array expected\");\n message.sparseInitializer = [];\n for (var i = 0; i < object.sparseInitializer.length; ++i) {\n if (typeof object.sparseInitializer[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.sparseInitializer: object expected\");\n message.sparseInitializer[i] = $root.onnx.SparseTensorProto.fromObject(object.sparseInitializer[i]);\n }\n }\n if (object.docString != null)\n message.docString = String(object.docString);\n if (object.input) {\n if (!Array.isArray(object.input))\n throw TypeError(\".onnx.GraphProto.input: array expected\");\n message.input = [];\n for (var i = 0; i < object.input.length; ++i) {\n if (typeof object.input[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.input: object expected\");\n message.input[i] = $root.onnx.ValueInfoProto.fromObject(object.input[i]);\n }\n }\n if (object.output) {\n if (!Array.isArray(object.output))\n throw TypeError(\".onnx.GraphProto.output: array expected\");\n message.output = [];\n for (var i = 0; i < object.output.length; ++i) {\n if (typeof object.output[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.output: object expected\");\n message.output[i] = $root.onnx.ValueInfoProto.fromObject(object.output[i]);\n }\n }\n if (object.valueInfo) {\n if (!Array.isArray(object.valueInfo))\n throw TypeError(\".onnx.GraphProto.valueInfo: array expected\");\n message.valueInfo = [];\n for (var i = 0; i < object.valueInfo.length; ++i) {\n if (typeof object.valueInfo[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.valueInfo: object expected\");\n message.valueInfo[i] = $root.onnx.ValueInfoProto.fromObject(object.valueInfo[i]);\n }\n }\n if (object.quantizationAnnotation) {\n if (!Array.isArray(object.quantizationAnnotation))\n throw TypeError(\".onnx.GraphProto.quantizationAnnotation: array expected\");\n message.quantizationAnnotation = [];\n for (var i = 0; i < object.quantizationAnnotation.length; ++i) {\n if (typeof object.quantizationAnnotation[i] !== \"object\")\n throw TypeError(\".onnx.GraphProto.quantizationAnnotation: object expected\");\n message.quantizationAnnotation[i] = $root.onnx.TensorAnnotation.fromObject(object.quantizationAnnotation[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from a GraphProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.GraphProto\n * @static\n * @param {onnx.GraphProto} message GraphProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n GraphProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.node = [];\n object.initializer = [];\n object.input = [];\n object.output = [];\n object.valueInfo = [];\n object.quantizationAnnotation = [];\n object.sparseInitializer = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object.docString = \"\";\n }\n if (message.node && message.node.length) {\n object.node = [];\n for (var j = 0; j < message.node.length; ++j)\n object.node[j] = $root.onnx.NodeProto.toObject(message.node[j], options);\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.initializer && message.initializer.length) {\n object.initializer = [];\n for (var j = 0; j < message.initializer.length; ++j)\n object.initializer[j] = $root.onnx.TensorProto.toObject(message.initializer[j], options);\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n if (message.input && message.input.length) {\n object.input = [];\n for (var j = 0; j < message.input.length; ++j)\n object.input[j] = $root.onnx.ValueInfoProto.toObject(message.input[j], options);\n }\n if (message.output && message.output.length) {\n object.output = [];\n for (var j = 0; j < message.output.length; ++j)\n object.output[j] = $root.onnx.ValueInfoProto.toObject(message.output[j], options);\n }\n if (message.valueInfo && message.valueInfo.length) {\n object.valueInfo = [];\n for (var j = 0; j < message.valueInfo.length; ++j)\n object.valueInfo[j] = $root.onnx.ValueInfoProto.toObject(message.valueInfo[j], options);\n }\n if (message.quantizationAnnotation && message.quantizationAnnotation.length) {\n object.quantizationAnnotation = [];\n for (var j = 0; j < message.quantizationAnnotation.length; ++j)\n object.quantizationAnnotation[j] = $root.onnx.TensorAnnotation.toObject(message.quantizationAnnotation[j], options);\n }\n if (message.sparseInitializer && message.sparseInitializer.length) {\n object.sparseInitializer = [];\n for (var j = 0; j < message.sparseInitializer.length; ++j)\n object.sparseInitializer[j] = $root.onnx.SparseTensorProto.toObject(message.sparseInitializer[j], options);\n }\n return object;\n };\n\n /**\n * Converts this GraphProto to JSON.\n * @function toJSON\n * @memberof onnx.GraphProto\n * @instance\n * @returns {Object.} JSON object\n */\n GraphProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for GraphProto\n * @function getTypeUrl\n * @memberof onnx.GraphProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n GraphProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.GraphProto\";\n };\n\n return GraphProto;\n })();\n\n onnx.TensorProto = (function() {\n\n /**\n * Properties of a TensorProto.\n * @memberof onnx\n * @interface ITensorProto\n * @property {Array.|null} [dims] TensorProto dims\n * @property {number|null} [dataType] TensorProto dataType\n * @property {onnx.TensorProto.ISegment|null} [segment] TensorProto segment\n * @property {Array.|null} [floatData] TensorProto floatData\n * @property {Array.|null} [int32Data] TensorProto int32Data\n * @property {Array.|null} [stringData] TensorProto stringData\n * @property {Array.|null} [int64Data] TensorProto int64Data\n * @property {string|null} [name] TensorProto name\n * @property {string|null} [docString] TensorProto docString\n * @property {Uint8Array|null} [rawData] TensorProto rawData\n * @property {Array.|null} [externalData] TensorProto externalData\n * @property {onnx.TensorProto.DataLocation|null} [dataLocation] TensorProto dataLocation\n * @property {Array.|null} [doubleData] TensorProto doubleData\n * @property {Array.|null} [uint64Data] TensorProto uint64Data\n */\n\n /**\n * Constructs a new TensorProto.\n * @memberof onnx\n * @classdesc Represents a TensorProto.\n * @implements ITensorProto\n * @constructor\n * @param {onnx.ITensorProto=} [properties] Properties to set\n */\n function TensorProto(properties) {\n this.dims = [];\n this.floatData = [];\n this.int32Data = [];\n this.stringData = [];\n this.int64Data = [];\n this.externalData = [];\n this.doubleData = [];\n this.uint64Data = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * TensorProto dims.\n * @member {Array.} dims\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.dims = $util.emptyArray;\n\n /**\n * TensorProto dataType.\n * @member {number} dataType\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.dataType = 0;\n\n /**\n * TensorProto segment.\n * @member {onnx.TensorProto.ISegment|null|undefined} segment\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.segment = null;\n\n /**\n * TensorProto floatData.\n * @member {Array.} floatData\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.floatData = $util.emptyArray;\n\n /**\n * TensorProto int32Data.\n * @member {Array.} int32Data\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.int32Data = $util.emptyArray;\n\n /**\n * TensorProto stringData.\n * @member {Array.} stringData\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.stringData = $util.emptyArray;\n\n /**\n * TensorProto int64Data.\n * @member {Array.} int64Data\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.int64Data = $util.emptyArray;\n\n /**\n * TensorProto name.\n * @member {string} name\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.name = \"\";\n\n /**\n * TensorProto docString.\n * @member {string} docString\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.docString = \"\";\n\n /**\n * TensorProto rawData.\n * @member {Uint8Array} rawData\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.rawData = $util.newBuffer([]);\n\n /**\n * TensorProto externalData.\n * @member {Array.} externalData\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.externalData = $util.emptyArray;\n\n /**\n * TensorProto dataLocation.\n * @member {onnx.TensorProto.DataLocation} dataLocation\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.dataLocation = 0;\n\n /**\n * TensorProto doubleData.\n * @member {Array.} doubleData\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.doubleData = $util.emptyArray;\n\n /**\n * TensorProto uint64Data.\n * @member {Array.} uint64Data\n * @memberof onnx.TensorProto\n * @instance\n */\n TensorProto.prototype.uint64Data = $util.emptyArray;\n\n /**\n * Creates a new TensorProto instance using the specified properties.\n * @function create\n * @memberof onnx.TensorProto\n * @static\n * @param {onnx.ITensorProto=} [properties] Properties to set\n * @returns {onnx.TensorProto} TensorProto instance\n */\n TensorProto.create = function create(properties) {\n return new TensorProto(properties);\n };\n\n /**\n * Encodes the specified TensorProto message. Does not implicitly {@link onnx.TensorProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.TensorProto\n * @static\n * @param {onnx.ITensorProto} message TensorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TensorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.dims != null && message.dims.length) {\n writer.uint32(/* id 1, wireType 2 =*/10).fork();\n for (var i = 0; i < message.dims.length; ++i)\n writer.int64(message.dims[i]);\n writer.ldelim();\n }\n if (message.dataType != null && Object.hasOwnProperty.call(message, \"dataType\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dataType);\n if (message.segment != null && Object.hasOwnProperty.call(message, \"segment\"))\n $root.onnx.TensorProto.Segment.encode(message.segment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n if (message.floatData != null && message.floatData.length) {\n writer.uint32(/* id 4, wireType 2 =*/34).fork();\n for (var i = 0; i < message.floatData.length; ++i)\n writer.float(message.floatData[i]);\n writer.ldelim();\n }\n if (message.int32Data != null && message.int32Data.length) {\n writer.uint32(/* id 5, wireType 2 =*/42).fork();\n for (var i = 0; i < message.int32Data.length; ++i)\n writer.int32(message.int32Data[i]);\n writer.ldelim();\n }\n if (message.stringData != null && message.stringData.length)\n for (var i = 0; i < message.stringData.length; ++i)\n writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.stringData[i]);\n if (message.int64Data != null && message.int64Data.length) {\n writer.uint32(/* id 7, wireType 2 =*/58).fork();\n for (var i = 0; i < message.int64Data.length; ++i)\n writer.int64(message.int64Data[i]);\n writer.ldelim();\n }\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.name);\n if (message.rawData != null && Object.hasOwnProperty.call(message, \"rawData\"))\n writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.rawData);\n if (message.doubleData != null && message.doubleData.length) {\n writer.uint32(/* id 10, wireType 2 =*/82).fork();\n for (var i = 0; i < message.doubleData.length; ++i)\n writer.double(message.doubleData[i]);\n writer.ldelim();\n }\n if (message.uint64Data != null && message.uint64Data.length) {\n writer.uint32(/* id 11, wireType 2 =*/90).fork();\n for (var i = 0; i < message.uint64Data.length; ++i)\n writer.uint64(message.uint64Data[i]);\n writer.ldelim();\n }\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 12, wireType 2 =*/98).string(message.docString);\n if (message.externalData != null && message.externalData.length)\n for (var i = 0; i < message.externalData.length; ++i)\n $root.onnx.StringStringEntryProto.encode(message.externalData[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();\n if (message.dataLocation != null && Object.hasOwnProperty.call(message, \"dataLocation\"))\n writer.uint32(/* id 14, wireType 0 =*/112).int32(message.dataLocation);\n return writer;\n };\n\n /**\n * Encodes the specified TensorProto message, length delimited. Does not implicitly {@link onnx.TensorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TensorProto\n * @static\n * @param {onnx.ITensorProto} message TensorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TensorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a TensorProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TensorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TensorProto} TensorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TensorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TensorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.dims && message.dims.length))\n message.dims = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.dims.push(reader.int64());\n } else\n message.dims.push(reader.int64());\n break;\n }\n case 2: {\n message.dataType = reader.int32();\n break;\n }\n case 3: {\n message.segment = $root.onnx.TensorProto.Segment.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n if (!(message.floatData && message.floatData.length))\n message.floatData = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.floatData.push(reader.float());\n } else\n message.floatData.push(reader.float());\n break;\n }\n case 5: {\n if (!(message.int32Data && message.int32Data.length))\n message.int32Data = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.int32Data.push(reader.int32());\n } else\n message.int32Data.push(reader.int32());\n break;\n }\n case 6: {\n if (!(message.stringData && message.stringData.length))\n message.stringData = [];\n message.stringData.push(reader.bytes());\n break;\n }\n case 7: {\n if (!(message.int64Data && message.int64Data.length))\n message.int64Data = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.int64Data.push(reader.int64());\n } else\n message.int64Data.push(reader.int64());\n break;\n }\n case 8: {\n message.name = reader.string();\n break;\n }\n case 12: {\n message.docString = reader.string();\n break;\n }\n case 9: {\n message.rawData = reader.bytes();\n break;\n }\n case 13: {\n if (!(message.externalData && message.externalData.length))\n message.externalData = [];\n message.externalData.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n break;\n }\n case 14: {\n message.dataLocation = reader.int32();\n break;\n }\n case 10: {\n if (!(message.doubleData && message.doubleData.length))\n message.doubleData = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.doubleData.push(reader.double());\n } else\n message.doubleData.push(reader.double());\n break;\n }\n case 11: {\n if (!(message.uint64Data && message.uint64Data.length))\n message.uint64Data = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.uint64Data.push(reader.uint64());\n } else\n message.uint64Data.push(reader.uint64());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a TensorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TensorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TensorProto} TensorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TensorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a TensorProto message.\n * @function verify\n * @memberof onnx.TensorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TensorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.dims != null && message.hasOwnProperty(\"dims\")) {\n if (!Array.isArray(message.dims))\n return \"dims: array expected\";\n for (var i = 0; i < message.dims.length; ++i)\n if (!$util.isInteger(message.dims[i]) && !(message.dims[i] && $util.isInteger(message.dims[i].low) && $util.isInteger(message.dims[i].high)))\n return \"dims: integer|Long[] expected\";\n }\n if (message.dataType != null && message.hasOwnProperty(\"dataType\"))\n if (!$util.isInteger(message.dataType))\n return \"dataType: integer expected\";\n if (message.segment != null && message.hasOwnProperty(\"segment\")) {\n var error = $root.onnx.TensorProto.Segment.verify(message.segment);\n if (error)\n return \"segment.\" + error;\n }\n if (message.floatData != null && message.hasOwnProperty(\"floatData\")) {\n if (!Array.isArray(message.floatData))\n return \"floatData: array expected\";\n for (var i = 0; i < message.floatData.length; ++i)\n if (typeof message.floatData[i] !== \"number\")\n return \"floatData: number[] expected\";\n }\n if (message.int32Data != null && message.hasOwnProperty(\"int32Data\")) {\n if (!Array.isArray(message.int32Data))\n return \"int32Data: array expected\";\n for (var i = 0; i < message.int32Data.length; ++i)\n if (!$util.isInteger(message.int32Data[i]))\n return \"int32Data: integer[] expected\";\n }\n if (message.stringData != null && message.hasOwnProperty(\"stringData\")) {\n if (!Array.isArray(message.stringData))\n return \"stringData: array expected\";\n for (var i = 0; i < message.stringData.length; ++i)\n if (!(message.stringData[i] && typeof message.stringData[i].length === \"number\" || $util.isString(message.stringData[i])))\n return \"stringData: buffer[] expected\";\n }\n if (message.int64Data != null && message.hasOwnProperty(\"int64Data\")) {\n if (!Array.isArray(message.int64Data))\n return \"int64Data: array expected\";\n for (var i = 0; i < message.int64Data.length; ++i)\n if (!$util.isInteger(message.int64Data[i]) && !(message.int64Data[i] && $util.isInteger(message.int64Data[i].low) && $util.isInteger(message.int64Data[i].high)))\n return \"int64Data: integer|Long[] expected\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n if (message.rawData != null && message.hasOwnProperty(\"rawData\"))\n if (!(message.rawData && typeof message.rawData.length === \"number\" || $util.isString(message.rawData)))\n return \"rawData: buffer expected\";\n if (message.externalData != null && message.hasOwnProperty(\"externalData\")) {\n if (!Array.isArray(message.externalData))\n return \"externalData: array expected\";\n for (var i = 0; i < message.externalData.length; ++i) {\n var error = $root.onnx.StringStringEntryProto.verify(message.externalData[i]);\n if (error)\n return \"externalData.\" + error;\n }\n }\n if (message.dataLocation != null && message.hasOwnProperty(\"dataLocation\"))\n switch (message.dataLocation) {\n default:\n return \"dataLocation: enum value expected\";\n case 0:\n case 1:\n break;\n }\n if (message.doubleData != null && message.hasOwnProperty(\"doubleData\")) {\n if (!Array.isArray(message.doubleData))\n return \"doubleData: array expected\";\n for (var i = 0; i < message.doubleData.length; ++i)\n if (typeof message.doubleData[i] !== \"number\")\n return \"doubleData: number[] expected\";\n }\n if (message.uint64Data != null && message.hasOwnProperty(\"uint64Data\")) {\n if (!Array.isArray(message.uint64Data))\n return \"uint64Data: array expected\";\n for (var i = 0; i < message.uint64Data.length; ++i)\n if (!$util.isInteger(message.uint64Data[i]) && !(message.uint64Data[i] && $util.isInteger(message.uint64Data[i].low) && $util.isInteger(message.uint64Data[i].high)))\n return \"uint64Data: integer|Long[] expected\";\n }\n return null;\n };\n\n /**\n * Creates a TensorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TensorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TensorProto} TensorProto\n */\n TensorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TensorProto)\n return object;\n var message = new $root.onnx.TensorProto();\n if (object.dims) {\n if (!Array.isArray(object.dims))\n throw TypeError(\".onnx.TensorProto.dims: array expected\");\n message.dims = [];\n for (var i = 0; i < object.dims.length; ++i)\n if ($util.Long)\n (message.dims[i] = $util.Long.fromValue(object.dims[i])).unsigned = false;\n else if (typeof object.dims[i] === \"string\")\n message.dims[i] = parseInt(object.dims[i], 10);\n else if (typeof object.dims[i] === \"number\")\n message.dims[i] = object.dims[i];\n else if (typeof object.dims[i] === \"object\")\n message.dims[i] = new $util.LongBits(object.dims[i].low >>> 0, object.dims[i].high >>> 0).toNumber();\n }\n if (object.dataType != null)\n message.dataType = object.dataType | 0;\n if (object.segment != null) {\n if (typeof object.segment !== \"object\")\n throw TypeError(\".onnx.TensorProto.segment: object expected\");\n message.segment = $root.onnx.TensorProto.Segment.fromObject(object.segment);\n }\n if (object.floatData) {\n if (!Array.isArray(object.floatData))\n throw TypeError(\".onnx.TensorProto.floatData: array expected\");\n message.floatData = [];\n for (var i = 0; i < object.floatData.length; ++i)\n message.floatData[i] = Number(object.floatData[i]);\n }\n if (object.int32Data) {\n if (!Array.isArray(object.int32Data))\n throw TypeError(\".onnx.TensorProto.int32Data: array expected\");\n message.int32Data = [];\n for (var i = 0; i < object.int32Data.length; ++i)\n message.int32Data[i] = object.int32Data[i] | 0;\n }\n if (object.stringData) {\n if (!Array.isArray(object.stringData))\n throw TypeError(\".onnx.TensorProto.stringData: array expected\");\n message.stringData = [];\n for (var i = 0; i < object.stringData.length; ++i)\n if (typeof object.stringData[i] === \"string\")\n $util.base64.decode(object.stringData[i], message.stringData[i] = $util.newBuffer($util.base64.length(object.stringData[i])), 0);\n else if (object.stringData[i].length >= 0)\n message.stringData[i] = object.stringData[i];\n }\n if (object.int64Data) {\n if (!Array.isArray(object.int64Data))\n throw TypeError(\".onnx.TensorProto.int64Data: array expected\");\n message.int64Data = [];\n for (var i = 0; i < object.int64Data.length; ++i)\n if ($util.Long)\n (message.int64Data[i] = $util.Long.fromValue(object.int64Data[i])).unsigned = false;\n else if (typeof object.int64Data[i] === \"string\")\n message.int64Data[i] = parseInt(object.int64Data[i], 10);\n else if (typeof object.int64Data[i] === \"number\")\n message.int64Data[i] = object.int64Data[i];\n else if (typeof object.int64Data[i] === \"object\")\n message.int64Data[i] = new $util.LongBits(object.int64Data[i].low >>> 0, object.int64Data[i].high >>> 0).toNumber();\n }\n if (object.name != null)\n message.name = String(object.name);\n if (object.docString != null)\n message.docString = String(object.docString);\n if (object.rawData != null)\n if (typeof object.rawData === \"string\")\n $util.base64.decode(object.rawData, message.rawData = $util.newBuffer($util.base64.length(object.rawData)), 0);\n else if (object.rawData.length >= 0)\n message.rawData = object.rawData;\n if (object.externalData) {\n if (!Array.isArray(object.externalData))\n throw TypeError(\".onnx.TensorProto.externalData: array expected\");\n message.externalData = [];\n for (var i = 0; i < object.externalData.length; ++i) {\n if (typeof object.externalData[i] !== \"object\")\n throw TypeError(\".onnx.TensorProto.externalData: object expected\");\n message.externalData[i] = $root.onnx.StringStringEntryProto.fromObject(object.externalData[i]);\n }\n }\n switch (object.dataLocation) {\n default:\n if (typeof object.dataLocation === \"number\") {\n message.dataLocation = object.dataLocation;\n break;\n }\n break;\n case \"DEFAULT\":\n case 0:\n message.dataLocation = 0;\n break;\n case \"EXTERNAL\":\n case 1:\n message.dataLocation = 1;\n break;\n }\n if (object.doubleData) {\n if (!Array.isArray(object.doubleData))\n throw TypeError(\".onnx.TensorProto.doubleData: array expected\");\n message.doubleData = [];\n for (var i = 0; i < object.doubleData.length; ++i)\n message.doubleData[i] = Number(object.doubleData[i]);\n }\n if (object.uint64Data) {\n if (!Array.isArray(object.uint64Data))\n throw TypeError(\".onnx.TensorProto.uint64Data: array expected\");\n message.uint64Data = [];\n for (var i = 0; i < object.uint64Data.length; ++i)\n if ($util.Long)\n (message.uint64Data[i] = $util.Long.fromValue(object.uint64Data[i])).unsigned = true;\n else if (typeof object.uint64Data[i] === \"string\")\n message.uint64Data[i] = parseInt(object.uint64Data[i], 10);\n else if (typeof object.uint64Data[i] === \"number\")\n message.uint64Data[i] = object.uint64Data[i];\n else if (typeof object.uint64Data[i] === \"object\")\n message.uint64Data[i] = new $util.LongBits(object.uint64Data[i].low >>> 0, object.uint64Data[i].high >>> 0).toNumber(true);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a TensorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TensorProto\n * @static\n * @param {onnx.TensorProto} message TensorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TensorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.dims = [];\n object.floatData = [];\n object.int32Data = [];\n object.stringData = [];\n object.int64Data = [];\n object.doubleData = [];\n object.uint64Data = [];\n object.externalData = [];\n }\n if (options.defaults) {\n object.dataType = 0;\n object.segment = null;\n object.name = \"\";\n if (options.bytes === String)\n object.rawData = \"\";\n else {\n object.rawData = [];\n if (options.bytes !== Array)\n object.rawData = $util.newBuffer(object.rawData);\n }\n object.docString = \"\";\n object.dataLocation = options.enums === String ? \"DEFAULT\" : 0;\n }\n if (message.dims && message.dims.length) {\n object.dims = [];\n for (var j = 0; j < message.dims.length; ++j)\n if (typeof message.dims[j] === \"number\")\n object.dims[j] = options.longs === String ? String(message.dims[j]) : message.dims[j];\n else\n object.dims[j] = options.longs === String ? $util.Long.prototype.toString.call(message.dims[j]) : options.longs === Number ? new $util.LongBits(message.dims[j].low >>> 0, message.dims[j].high >>> 0).toNumber() : message.dims[j];\n }\n if (message.dataType != null && message.hasOwnProperty(\"dataType\"))\n object.dataType = message.dataType;\n if (message.segment != null && message.hasOwnProperty(\"segment\"))\n object.segment = $root.onnx.TensorProto.Segment.toObject(message.segment, options);\n if (message.floatData && message.floatData.length) {\n object.floatData = [];\n for (var j = 0; j < message.floatData.length; ++j)\n object.floatData[j] = options.json && !isFinite(message.floatData[j]) ? String(message.floatData[j]) : message.floatData[j];\n }\n if (message.int32Data && message.int32Data.length) {\n object.int32Data = [];\n for (var j = 0; j < message.int32Data.length; ++j)\n object.int32Data[j] = message.int32Data[j];\n }\n if (message.stringData && message.stringData.length) {\n object.stringData = [];\n for (var j = 0; j < message.stringData.length; ++j)\n object.stringData[j] = options.bytes === String ? $util.base64.encode(message.stringData[j], 0, message.stringData[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.stringData[j]) : message.stringData[j];\n }\n if (message.int64Data && message.int64Data.length) {\n object.int64Data = [];\n for (var j = 0; j < message.int64Data.length; ++j)\n if (typeof message.int64Data[j] === \"number\")\n object.int64Data[j] = options.longs === String ? String(message.int64Data[j]) : message.int64Data[j];\n else\n object.int64Data[j] = options.longs === String ? $util.Long.prototype.toString.call(message.int64Data[j]) : options.longs === Number ? new $util.LongBits(message.int64Data[j].low >>> 0, message.int64Data[j].high >>> 0).toNumber() : message.int64Data[j];\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.rawData != null && message.hasOwnProperty(\"rawData\"))\n object.rawData = options.bytes === String ? $util.base64.encode(message.rawData, 0, message.rawData.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawData) : message.rawData;\n if (message.doubleData && message.doubleData.length) {\n object.doubleData = [];\n for (var j = 0; j < message.doubleData.length; ++j)\n object.doubleData[j] = options.json && !isFinite(message.doubleData[j]) ? String(message.doubleData[j]) : message.doubleData[j];\n }\n if (message.uint64Data && message.uint64Data.length) {\n object.uint64Data = [];\n for (var j = 0; j < message.uint64Data.length; ++j)\n if (typeof message.uint64Data[j] === \"number\")\n object.uint64Data[j] = options.longs === String ? String(message.uint64Data[j]) : message.uint64Data[j];\n else\n object.uint64Data[j] = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Data[j]) : options.longs === Number ? new $util.LongBits(message.uint64Data[j].low >>> 0, message.uint64Data[j].high >>> 0).toNumber(true) : message.uint64Data[j];\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n if (message.externalData && message.externalData.length) {\n object.externalData = [];\n for (var j = 0; j < message.externalData.length; ++j)\n object.externalData[j] = $root.onnx.StringStringEntryProto.toObject(message.externalData[j], options);\n }\n if (message.dataLocation != null && message.hasOwnProperty(\"dataLocation\"))\n object.dataLocation = options.enums === String ? $root.onnx.TensorProto.DataLocation[message.dataLocation] === undefined ? message.dataLocation : $root.onnx.TensorProto.DataLocation[message.dataLocation] : message.dataLocation;\n return object;\n };\n\n /**\n * Converts this TensorProto to JSON.\n * @function toJSON\n * @memberof onnx.TensorProto\n * @instance\n * @returns {Object.} JSON object\n */\n TensorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for TensorProto\n * @function getTypeUrl\n * @memberof onnx.TensorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TensorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TensorProto\";\n };\n\n /**\n * DataType enum.\n * @name onnx.TensorProto.DataType\n * @enum {number}\n * @property {number} UNDEFINED=0 UNDEFINED value\n * @property {number} FLOAT=1 FLOAT value\n * @property {number} UINT8=2 UINT8 value\n * @property {number} INT8=3 INT8 value\n * @property {number} UINT16=4 UINT16 value\n * @property {number} INT16=5 INT16 value\n * @property {number} INT32=6 INT32 value\n * @property {number} INT64=7 INT64 value\n * @property {number} STRING=8 STRING value\n * @property {number} BOOL=9 BOOL value\n * @property {number} FLOAT16=10 FLOAT16 value\n * @property {number} DOUBLE=11 DOUBLE value\n * @property {number} UINT32=12 UINT32 value\n * @property {number} UINT64=13 UINT64 value\n * @property {number} COMPLEX64=14 COMPLEX64 value\n * @property {number} COMPLEX128=15 COMPLEX128 value\n * @property {number} BFLOAT16=16 BFLOAT16 value\n * @property {number} FLOAT8E4M3FN=17 FLOAT8E4M3FN value\n * @property {number} FLOAT8E4M3FNUZ=18 FLOAT8E4M3FNUZ value\n * @property {number} FLOAT8E5M2=19 FLOAT8E5M2 value\n * @property {number} FLOAT8E5M2FNUZ=20 FLOAT8E5M2FNUZ value\n */\n TensorProto.DataType = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"UNDEFINED\"] = 0;\n values[valuesById[1] = \"FLOAT\"] = 1;\n values[valuesById[2] = \"UINT8\"] = 2;\n values[valuesById[3] = \"INT8\"] = 3;\n values[valuesById[4] = \"UINT16\"] = 4;\n values[valuesById[5] = \"INT16\"] = 5;\n values[valuesById[6] = \"INT32\"] = 6;\n values[valuesById[7] = \"INT64\"] = 7;\n values[valuesById[8] = \"STRING\"] = 8;\n values[valuesById[9] = \"BOOL\"] = 9;\n values[valuesById[10] = \"FLOAT16\"] = 10;\n values[valuesById[11] = \"DOUBLE\"] = 11;\n values[valuesById[12] = \"UINT32\"] = 12;\n values[valuesById[13] = \"UINT64\"] = 13;\n values[valuesById[14] = \"COMPLEX64\"] = 14;\n values[valuesById[15] = \"COMPLEX128\"] = 15;\n values[valuesById[16] = \"BFLOAT16\"] = 16;\n values[valuesById[17] = \"FLOAT8E4M3FN\"] = 17;\n values[valuesById[18] = \"FLOAT8E4M3FNUZ\"] = 18;\n values[valuesById[19] = \"FLOAT8E5M2\"] = 19;\n values[valuesById[20] = \"FLOAT8E5M2FNUZ\"] = 20;\n return values;\n })();\n\n TensorProto.Segment = (function() {\n\n /**\n * Properties of a Segment.\n * @memberof onnx.TensorProto\n * @interface ISegment\n * @property {number|Long|null} [begin] Segment begin\n * @property {number|Long|null} [end] Segment end\n */\n\n /**\n * Constructs a new Segment.\n * @memberof onnx.TensorProto\n * @classdesc Represents a Segment.\n * @implements ISegment\n * @constructor\n * @param {onnx.TensorProto.ISegment=} [properties] Properties to set\n */\n function Segment(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * Segment begin.\n * @member {number|Long} begin\n * @memberof onnx.TensorProto.Segment\n * @instance\n */\n Segment.prototype.begin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n /**\n * Segment end.\n * @member {number|Long} end\n * @memberof onnx.TensorProto.Segment\n * @instance\n */\n Segment.prototype.end = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n /**\n * Creates a new Segment instance using the specified properties.\n * @function create\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {onnx.TensorProto.ISegment=} [properties] Properties to set\n * @returns {onnx.TensorProto.Segment} Segment instance\n */\n Segment.create = function create(properties) {\n return new Segment(properties);\n };\n\n /**\n * Encodes the specified Segment message. Does not implicitly {@link onnx.TensorProto.Segment.verify|verify} messages.\n * @function encode\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {onnx.TensorProto.ISegment} message Segment message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Segment.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.begin != null && Object.hasOwnProperty.call(message, \"begin\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int64(message.begin);\n if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int64(message.end);\n return writer;\n };\n\n /**\n * Encodes the specified Segment message, length delimited. Does not implicitly {@link onnx.TensorProto.Segment.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {onnx.TensorProto.ISegment} message Segment message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Segment.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a Segment message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TensorProto.Segment} Segment\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Segment.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TensorProto.Segment();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.begin = reader.int64();\n break;\n }\n case 2: {\n message.end = reader.int64();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a Segment message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TensorProto.Segment} Segment\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Segment.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a Segment message.\n * @function verify\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Segment.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.begin != null && message.hasOwnProperty(\"begin\"))\n if (!$util.isInteger(message.begin) && !(message.begin && $util.isInteger(message.begin.low) && $util.isInteger(message.begin.high)))\n return \"begin: integer|Long expected\";\n if (message.end != null && message.hasOwnProperty(\"end\"))\n if (!$util.isInteger(message.end) && !(message.end && $util.isInteger(message.end.low) && $util.isInteger(message.end.high)))\n return \"end: integer|Long expected\";\n return null;\n };\n\n /**\n * Creates a Segment message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TensorProto.Segment} Segment\n */\n Segment.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TensorProto.Segment)\n return object;\n var message = new $root.onnx.TensorProto.Segment();\n if (object.begin != null)\n if ($util.Long)\n (message.begin = $util.Long.fromValue(object.begin)).unsigned = false;\n else if (typeof object.begin === \"string\")\n message.begin = parseInt(object.begin, 10);\n else if (typeof object.begin === \"number\")\n message.begin = object.begin;\n else if (typeof object.begin === \"object\")\n message.begin = new $util.LongBits(object.begin.low >>> 0, object.begin.high >>> 0).toNumber();\n if (object.end != null)\n if ($util.Long)\n (message.end = $util.Long.fromValue(object.end)).unsigned = false;\n else if (typeof object.end === \"string\")\n message.end = parseInt(object.end, 10);\n else if (typeof object.end === \"number\")\n message.end = object.end;\n else if (typeof object.end === \"object\")\n message.end = new $util.LongBits(object.end.low >>> 0, object.end.high >>> 0).toNumber();\n return message;\n };\n\n /**\n * Creates a plain object from a Segment message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {onnx.TensorProto.Segment} message Segment\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Segment.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.begin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.begin = options.longs === String ? \"0\" : 0;\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.end = options.longs === String ? \"0\" : 0;\n }\n if (message.begin != null && message.hasOwnProperty(\"begin\"))\n if (typeof message.begin === \"number\")\n object.begin = options.longs === String ? String(message.begin) : message.begin;\n else\n object.begin = options.longs === String ? $util.Long.prototype.toString.call(message.begin) : options.longs === Number ? new $util.LongBits(message.begin.low >>> 0, message.begin.high >>> 0).toNumber() : message.begin;\n if (message.end != null && message.hasOwnProperty(\"end\"))\n if (typeof message.end === \"number\")\n object.end = options.longs === String ? String(message.end) : message.end;\n else\n object.end = options.longs === String ? $util.Long.prototype.toString.call(message.end) : options.longs === Number ? new $util.LongBits(message.end.low >>> 0, message.end.high >>> 0).toNumber() : message.end;\n return object;\n };\n\n /**\n * Converts this Segment to JSON.\n * @function toJSON\n * @memberof onnx.TensorProto.Segment\n * @instance\n * @returns {Object.} JSON object\n */\n Segment.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for Segment\n * @function getTypeUrl\n * @memberof onnx.TensorProto.Segment\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TensorProto.Segment\";\n };\n\n return Segment;\n })();\n\n /**\n * DataLocation enum.\n * @name onnx.TensorProto.DataLocation\n * @enum {number}\n * @property {number} DEFAULT=0 DEFAULT value\n * @property {number} EXTERNAL=1 EXTERNAL value\n */\n TensorProto.DataLocation = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"DEFAULT\"] = 0;\n values[valuesById[1] = \"EXTERNAL\"] = 1;\n return values;\n })();\n\n return TensorProto;\n })();\n\n onnx.SparseTensorProto = (function() {\n\n /**\n * Properties of a SparseTensorProto.\n * @memberof onnx\n * @interface ISparseTensorProto\n * @property {onnx.ITensorProto|null} [values] SparseTensorProto values\n * @property {onnx.ITensorProto|null} [indices] SparseTensorProto indices\n * @property {Array.|null} [dims] SparseTensorProto dims\n */\n\n /**\n * Constructs a new SparseTensorProto.\n * @memberof onnx\n * @classdesc Represents a SparseTensorProto.\n * @implements ISparseTensorProto\n * @constructor\n * @param {onnx.ISparseTensorProto=} [properties] Properties to set\n */\n function SparseTensorProto(properties) {\n this.dims = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * SparseTensorProto values.\n * @member {onnx.ITensorProto|null|undefined} values\n * @memberof onnx.SparseTensorProto\n * @instance\n */\n SparseTensorProto.prototype.values = null;\n\n /**\n * SparseTensorProto indices.\n * @member {onnx.ITensorProto|null|undefined} indices\n * @memberof onnx.SparseTensorProto\n * @instance\n */\n SparseTensorProto.prototype.indices = null;\n\n /**\n * SparseTensorProto dims.\n * @member {Array.} dims\n * @memberof onnx.SparseTensorProto\n * @instance\n */\n SparseTensorProto.prototype.dims = $util.emptyArray;\n\n /**\n * Creates a new SparseTensorProto instance using the specified properties.\n * @function create\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {onnx.ISparseTensorProto=} [properties] Properties to set\n * @returns {onnx.SparseTensorProto} SparseTensorProto instance\n */\n SparseTensorProto.create = function create(properties) {\n return new SparseTensorProto(properties);\n };\n\n /**\n * Encodes the specified SparseTensorProto message. Does not implicitly {@link onnx.SparseTensorProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {onnx.ISparseTensorProto} message SparseTensorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SparseTensorProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.values != null && Object.hasOwnProperty.call(message, \"values\"))\n $root.onnx.TensorProto.encode(message.values, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.indices != null && Object.hasOwnProperty.call(message, \"indices\"))\n $root.onnx.TensorProto.encode(message.indices, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n if (message.dims != null && message.dims.length) {\n writer.uint32(/* id 3, wireType 2 =*/26).fork();\n for (var i = 0; i < message.dims.length; ++i)\n writer.int64(message.dims[i]);\n writer.ldelim();\n }\n return writer;\n };\n\n /**\n * Encodes the specified SparseTensorProto message, length delimited. Does not implicitly {@link onnx.SparseTensorProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {onnx.ISparseTensorProto} message SparseTensorProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SparseTensorProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a SparseTensorProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.SparseTensorProto} SparseTensorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SparseTensorProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.SparseTensorProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.values = $root.onnx.TensorProto.decode(reader, reader.uint32());\n break;\n }\n case 2: {\n message.indices = $root.onnx.TensorProto.decode(reader, reader.uint32());\n break;\n }\n case 3: {\n if (!(message.dims && message.dims.length))\n message.dims = [];\n if ((tag & 7) === 2) {\n var end2 = reader.uint32() + reader.pos;\n while (reader.pos < end2)\n message.dims.push(reader.int64());\n } else\n message.dims.push(reader.int64());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a SparseTensorProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.SparseTensorProto} SparseTensorProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SparseTensorProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a SparseTensorProto message.\n * @function verify\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n SparseTensorProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.values != null && message.hasOwnProperty(\"values\")) {\n var error = $root.onnx.TensorProto.verify(message.values);\n if (error)\n return \"values.\" + error;\n }\n if (message.indices != null && message.hasOwnProperty(\"indices\")) {\n var error = $root.onnx.TensorProto.verify(message.indices);\n if (error)\n return \"indices.\" + error;\n }\n if (message.dims != null && message.hasOwnProperty(\"dims\")) {\n if (!Array.isArray(message.dims))\n return \"dims: array expected\";\n for (var i = 0; i < message.dims.length; ++i)\n if (!$util.isInteger(message.dims[i]) && !(message.dims[i] && $util.isInteger(message.dims[i].low) && $util.isInteger(message.dims[i].high)))\n return \"dims: integer|Long[] expected\";\n }\n return null;\n };\n\n /**\n * Creates a SparseTensorProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.SparseTensorProto} SparseTensorProto\n */\n SparseTensorProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.SparseTensorProto)\n return object;\n var message = new $root.onnx.SparseTensorProto();\n if (object.values != null) {\n if (typeof object.values !== \"object\")\n throw TypeError(\".onnx.SparseTensorProto.values: object expected\");\n message.values = $root.onnx.TensorProto.fromObject(object.values);\n }\n if (object.indices != null) {\n if (typeof object.indices !== \"object\")\n throw TypeError(\".onnx.SparseTensorProto.indices: object expected\");\n message.indices = $root.onnx.TensorProto.fromObject(object.indices);\n }\n if (object.dims) {\n if (!Array.isArray(object.dims))\n throw TypeError(\".onnx.SparseTensorProto.dims: array expected\");\n message.dims = [];\n for (var i = 0; i < object.dims.length; ++i)\n if ($util.Long)\n (message.dims[i] = $util.Long.fromValue(object.dims[i])).unsigned = false;\n else if (typeof object.dims[i] === \"string\")\n message.dims[i] = parseInt(object.dims[i], 10);\n else if (typeof object.dims[i] === \"number\")\n message.dims[i] = object.dims[i];\n else if (typeof object.dims[i] === \"object\")\n message.dims[i] = new $util.LongBits(object.dims[i].low >>> 0, object.dims[i].high >>> 0).toNumber();\n }\n return message;\n };\n\n /**\n * Creates a plain object from a SparseTensorProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {onnx.SparseTensorProto} message SparseTensorProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n SparseTensorProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.dims = [];\n if (options.defaults) {\n object.values = null;\n object.indices = null;\n }\n if (message.values != null && message.hasOwnProperty(\"values\"))\n object.values = $root.onnx.TensorProto.toObject(message.values, options);\n if (message.indices != null && message.hasOwnProperty(\"indices\"))\n object.indices = $root.onnx.TensorProto.toObject(message.indices, options);\n if (message.dims && message.dims.length) {\n object.dims = [];\n for (var j = 0; j < message.dims.length; ++j)\n if (typeof message.dims[j] === \"number\")\n object.dims[j] = options.longs === String ? String(message.dims[j]) : message.dims[j];\n else\n object.dims[j] = options.longs === String ? $util.Long.prototype.toString.call(message.dims[j]) : options.longs === Number ? new $util.LongBits(message.dims[j].low >>> 0, message.dims[j].high >>> 0).toNumber() : message.dims[j];\n }\n return object;\n };\n\n /**\n * Converts this SparseTensorProto to JSON.\n * @function toJSON\n * @memberof onnx.SparseTensorProto\n * @instance\n * @returns {Object.} JSON object\n */\n SparseTensorProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for SparseTensorProto\n * @function getTypeUrl\n * @memberof onnx.SparseTensorProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n SparseTensorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.SparseTensorProto\";\n };\n\n return SparseTensorProto;\n })();\n\n onnx.TensorShapeProto = (function() {\n\n /**\n * Properties of a TensorShapeProto.\n * @memberof onnx\n * @interface ITensorShapeProto\n * @property {Array.|null} [dim] TensorShapeProto dim\n */\n\n /**\n * Constructs a new TensorShapeProto.\n * @memberof onnx\n * @classdesc Represents a TensorShapeProto.\n * @implements ITensorShapeProto\n * @constructor\n * @param {onnx.ITensorShapeProto=} [properties] Properties to set\n */\n function TensorShapeProto(properties) {\n this.dim = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * TensorShapeProto dim.\n * @member {Array.} dim\n * @memberof onnx.TensorShapeProto\n * @instance\n */\n TensorShapeProto.prototype.dim = $util.emptyArray;\n\n /**\n * Creates a new TensorShapeProto instance using the specified properties.\n * @function create\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {onnx.ITensorShapeProto=} [properties] Properties to set\n * @returns {onnx.TensorShapeProto} TensorShapeProto instance\n */\n TensorShapeProto.create = function create(properties) {\n return new TensorShapeProto(properties);\n };\n\n /**\n * Encodes the specified TensorShapeProto message. Does not implicitly {@link onnx.TensorShapeProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {onnx.ITensorShapeProto} message TensorShapeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TensorShapeProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.dim != null && message.dim.length)\n for (var i = 0; i < message.dim.length; ++i)\n $root.onnx.TensorShapeProto.Dimension.encode(message.dim[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified TensorShapeProto message, length delimited. Does not implicitly {@link onnx.TensorShapeProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {onnx.ITensorShapeProto} message TensorShapeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TensorShapeProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a TensorShapeProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TensorShapeProto} TensorShapeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TensorShapeProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TensorShapeProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n if (!(message.dim && message.dim.length))\n message.dim = [];\n message.dim.push($root.onnx.TensorShapeProto.Dimension.decode(reader, reader.uint32()));\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a TensorShapeProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TensorShapeProto} TensorShapeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TensorShapeProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a TensorShapeProto message.\n * @function verify\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TensorShapeProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.dim != null && message.hasOwnProperty(\"dim\")) {\n if (!Array.isArray(message.dim))\n return \"dim: array expected\";\n for (var i = 0; i < message.dim.length; ++i) {\n var error = $root.onnx.TensorShapeProto.Dimension.verify(message.dim[i]);\n if (error)\n return \"dim.\" + error;\n }\n }\n return null;\n };\n\n /**\n * Creates a TensorShapeProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TensorShapeProto} TensorShapeProto\n */\n TensorShapeProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TensorShapeProto)\n return object;\n var message = new $root.onnx.TensorShapeProto();\n if (object.dim) {\n if (!Array.isArray(object.dim))\n throw TypeError(\".onnx.TensorShapeProto.dim: array expected\");\n message.dim = [];\n for (var i = 0; i < object.dim.length; ++i) {\n if (typeof object.dim[i] !== \"object\")\n throw TypeError(\".onnx.TensorShapeProto.dim: object expected\");\n message.dim[i] = $root.onnx.TensorShapeProto.Dimension.fromObject(object.dim[i]);\n }\n }\n return message;\n };\n\n /**\n * Creates a plain object from a TensorShapeProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {onnx.TensorShapeProto} message TensorShapeProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TensorShapeProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults)\n object.dim = [];\n if (message.dim && message.dim.length) {\n object.dim = [];\n for (var j = 0; j < message.dim.length; ++j)\n object.dim[j] = $root.onnx.TensorShapeProto.Dimension.toObject(message.dim[j], options);\n }\n return object;\n };\n\n /**\n * Converts this TensorShapeProto to JSON.\n * @function toJSON\n * @memberof onnx.TensorShapeProto\n * @instance\n * @returns {Object.} JSON object\n */\n TensorShapeProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for TensorShapeProto\n * @function getTypeUrl\n * @memberof onnx.TensorShapeProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TensorShapeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TensorShapeProto\";\n };\n\n TensorShapeProto.Dimension = (function() {\n\n /**\n * Properties of a Dimension.\n * @memberof onnx.TensorShapeProto\n * @interface IDimension\n * @property {number|Long|null} [dimValue] Dimension dimValue\n * @property {string|null} [dimParam] Dimension dimParam\n * @property {string|null} [denotation] Dimension denotation\n */\n\n /**\n * Constructs a new Dimension.\n * @memberof onnx.TensorShapeProto\n * @classdesc Represents a Dimension.\n * @implements IDimension\n * @constructor\n * @param {onnx.TensorShapeProto.IDimension=} [properties] Properties to set\n */\n function Dimension(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * Dimension dimValue.\n * @member {number|Long|null|undefined} dimValue\n * @memberof onnx.TensorShapeProto.Dimension\n * @instance\n */\n Dimension.prototype.dimValue = null;\n\n /**\n * Dimension dimParam.\n * @member {string|null|undefined} dimParam\n * @memberof onnx.TensorShapeProto.Dimension\n * @instance\n */\n Dimension.prototype.dimParam = null;\n\n /**\n * Dimension denotation.\n * @member {string} denotation\n * @memberof onnx.TensorShapeProto.Dimension\n * @instance\n */\n Dimension.prototype.denotation = \"\";\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * Dimension value.\n * @member {\"dimValue\"|\"dimParam\"|undefined} value\n * @memberof onnx.TensorShapeProto.Dimension\n * @instance\n */\n Object.defineProperty(Dimension.prototype, \"value\", {\n get: $util.oneOfGetter($oneOfFields = [\"dimValue\", \"dimParam\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Creates a new Dimension instance using the specified properties.\n * @function create\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {onnx.TensorShapeProto.IDimension=} [properties] Properties to set\n * @returns {onnx.TensorShapeProto.Dimension} Dimension instance\n */\n Dimension.create = function create(properties) {\n return new Dimension(properties);\n };\n\n /**\n * Encodes the specified Dimension message. Does not implicitly {@link onnx.TensorShapeProto.Dimension.verify|verify} messages.\n * @function encode\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {onnx.TensorShapeProto.IDimension} message Dimension message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Dimension.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.dimValue != null && Object.hasOwnProperty.call(message, \"dimValue\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int64(message.dimValue);\n if (message.dimParam != null && Object.hasOwnProperty.call(message, \"dimParam\"))\n writer.uint32(/* id 2, wireType 2 =*/18).string(message.dimParam);\n if (message.denotation != null && Object.hasOwnProperty.call(message, \"denotation\"))\n writer.uint32(/* id 3, wireType 2 =*/26).string(message.denotation);\n return writer;\n };\n\n /**\n * Encodes the specified Dimension message, length delimited. Does not implicitly {@link onnx.TensorShapeProto.Dimension.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {onnx.TensorShapeProto.IDimension} message Dimension message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Dimension.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a Dimension message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TensorShapeProto.Dimension} Dimension\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Dimension.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TensorShapeProto.Dimension();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.dimValue = reader.int64();\n break;\n }\n case 2: {\n message.dimParam = reader.string();\n break;\n }\n case 3: {\n message.denotation = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a Dimension message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TensorShapeProto.Dimension} Dimension\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Dimension.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a Dimension message.\n * @function verify\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Dimension.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.dimValue != null && message.hasOwnProperty(\"dimValue\")) {\n properties.value = 1;\n if (!$util.isInteger(message.dimValue) && !(message.dimValue && $util.isInteger(message.dimValue.low) && $util.isInteger(message.dimValue.high)))\n return \"dimValue: integer|Long expected\";\n }\n if (message.dimParam != null && message.hasOwnProperty(\"dimParam\")) {\n if (properties.value === 1)\n return \"value: multiple values\";\n properties.value = 1;\n if (!$util.isString(message.dimParam))\n return \"dimParam: string expected\";\n }\n if (message.denotation != null && message.hasOwnProperty(\"denotation\"))\n if (!$util.isString(message.denotation))\n return \"denotation: string expected\";\n return null;\n };\n\n /**\n * Creates a Dimension message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TensorShapeProto.Dimension} Dimension\n */\n Dimension.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TensorShapeProto.Dimension)\n return object;\n var message = new $root.onnx.TensorShapeProto.Dimension();\n if (object.dimValue != null)\n if ($util.Long)\n (message.dimValue = $util.Long.fromValue(object.dimValue)).unsigned = false;\n else if (typeof object.dimValue === \"string\")\n message.dimValue = parseInt(object.dimValue, 10);\n else if (typeof object.dimValue === \"number\")\n message.dimValue = object.dimValue;\n else if (typeof object.dimValue === \"object\")\n message.dimValue = new $util.LongBits(object.dimValue.low >>> 0, object.dimValue.high >>> 0).toNumber();\n if (object.dimParam != null)\n message.dimParam = String(object.dimParam);\n if (object.denotation != null)\n message.denotation = String(object.denotation);\n return message;\n };\n\n /**\n * Creates a plain object from a Dimension message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {onnx.TensorShapeProto.Dimension} message Dimension\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Dimension.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.denotation = \"\";\n if (message.dimValue != null && message.hasOwnProperty(\"dimValue\")) {\n if (typeof message.dimValue === \"number\")\n object.dimValue = options.longs === String ? String(message.dimValue) : message.dimValue;\n else\n object.dimValue = options.longs === String ? $util.Long.prototype.toString.call(message.dimValue) : options.longs === Number ? new $util.LongBits(message.dimValue.low >>> 0, message.dimValue.high >>> 0).toNumber() : message.dimValue;\n if (options.oneofs)\n object.value = \"dimValue\";\n }\n if (message.dimParam != null && message.hasOwnProperty(\"dimParam\")) {\n object.dimParam = message.dimParam;\n if (options.oneofs)\n object.value = \"dimParam\";\n }\n if (message.denotation != null && message.hasOwnProperty(\"denotation\"))\n object.denotation = message.denotation;\n return object;\n };\n\n /**\n * Converts this Dimension to JSON.\n * @function toJSON\n * @memberof onnx.TensorShapeProto.Dimension\n * @instance\n * @returns {Object.} JSON object\n */\n Dimension.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for Dimension\n * @function getTypeUrl\n * @memberof onnx.TensorShapeProto.Dimension\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TensorShapeProto.Dimension\";\n };\n\n return Dimension;\n })();\n\n return TensorShapeProto;\n })();\n\n onnx.TypeProto = (function() {\n\n /**\n * Properties of a TypeProto.\n * @memberof onnx\n * @interface ITypeProto\n * @property {onnx.TypeProto.ITensor|null} [tensorType] TypeProto tensorType\n * @property {onnx.TypeProto.ISequence|null} [sequenceType] TypeProto sequenceType\n * @property {onnx.TypeProto.IMap|null} [mapType] TypeProto mapType\n * @property {onnx.TypeProto.IOptional|null} [optionalType] TypeProto optionalType\n * @property {onnx.TypeProto.ISparseTensor|null} [sparseTensorType] TypeProto sparseTensorType\n * @property {string|null} [denotation] TypeProto denotation\n */\n\n /**\n * Constructs a new TypeProto.\n * @memberof onnx\n * @classdesc Represents a TypeProto.\n * @implements ITypeProto\n * @constructor\n * @param {onnx.ITypeProto=} [properties] Properties to set\n */\n function TypeProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * TypeProto tensorType.\n * @member {onnx.TypeProto.ITensor|null|undefined} tensorType\n * @memberof onnx.TypeProto\n * @instance\n */\n TypeProto.prototype.tensorType = null;\n\n /**\n * TypeProto sequenceType.\n * @member {onnx.TypeProto.ISequence|null|undefined} sequenceType\n * @memberof onnx.TypeProto\n * @instance\n */\n TypeProto.prototype.sequenceType = null;\n\n /**\n * TypeProto mapType.\n * @member {onnx.TypeProto.IMap|null|undefined} mapType\n * @memberof onnx.TypeProto\n * @instance\n */\n TypeProto.prototype.mapType = null;\n\n /**\n * TypeProto optionalType.\n * @member {onnx.TypeProto.IOptional|null|undefined} optionalType\n * @memberof onnx.TypeProto\n * @instance\n */\n TypeProto.prototype.optionalType = null;\n\n /**\n * TypeProto sparseTensorType.\n * @member {onnx.TypeProto.ISparseTensor|null|undefined} sparseTensorType\n * @memberof onnx.TypeProto\n * @instance\n */\n TypeProto.prototype.sparseTensorType = null;\n\n /**\n * TypeProto denotation.\n * @member {string} denotation\n * @memberof onnx.TypeProto\n * @instance\n */\n TypeProto.prototype.denotation = \"\";\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * TypeProto value.\n * @member {\"tensorType\"|\"sequenceType\"|\"mapType\"|\"optionalType\"|\"sparseTensorType\"|undefined} value\n * @memberof onnx.TypeProto\n * @instance\n */\n Object.defineProperty(TypeProto.prototype, \"value\", {\n get: $util.oneOfGetter($oneOfFields = [\"tensorType\", \"sequenceType\", \"mapType\", \"optionalType\", \"sparseTensorType\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Creates a new TypeProto instance using the specified properties.\n * @function create\n * @memberof onnx.TypeProto\n * @static\n * @param {onnx.ITypeProto=} [properties] Properties to set\n * @returns {onnx.TypeProto} TypeProto instance\n */\n TypeProto.create = function create(properties) {\n return new TypeProto(properties);\n };\n\n /**\n * Encodes the specified TypeProto message. Does not implicitly {@link onnx.TypeProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.TypeProto\n * @static\n * @param {onnx.ITypeProto} message TypeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TypeProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.tensorType != null && Object.hasOwnProperty.call(message, \"tensorType\"))\n $root.onnx.TypeProto.Tensor.encode(message.tensorType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n if (message.sequenceType != null && Object.hasOwnProperty.call(message, \"sequenceType\"))\n $root.onnx.TypeProto.Sequence.encode(message.sequenceType, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n if (message.mapType != null && Object.hasOwnProperty.call(message, \"mapType\"))\n $root.onnx.TypeProto.Map.encode(message.mapType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n if (message.denotation != null && Object.hasOwnProperty.call(message, \"denotation\"))\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.denotation);\n if (message.sparseTensorType != null && Object.hasOwnProperty.call(message, \"sparseTensorType\"))\n $root.onnx.TypeProto.SparseTensor.encode(message.sparseTensorType, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n if (message.optionalType != null && Object.hasOwnProperty.call(message, \"optionalType\"))\n $root.onnx.TypeProto.Optional.encode(message.optionalType, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified TypeProto message, length delimited. Does not implicitly {@link onnx.TypeProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TypeProto\n * @static\n * @param {onnx.ITypeProto} message TypeProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n TypeProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a TypeProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TypeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TypeProto} TypeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TypeProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TypeProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.tensorType = $root.onnx.TypeProto.Tensor.decode(reader, reader.uint32());\n break;\n }\n case 4: {\n message.sequenceType = $root.onnx.TypeProto.Sequence.decode(reader, reader.uint32());\n break;\n }\n case 5: {\n message.mapType = $root.onnx.TypeProto.Map.decode(reader, reader.uint32());\n break;\n }\n case 9: {\n message.optionalType = $root.onnx.TypeProto.Optional.decode(reader, reader.uint32());\n break;\n }\n case 8: {\n message.sparseTensorType = $root.onnx.TypeProto.SparseTensor.decode(reader, reader.uint32());\n break;\n }\n case 6: {\n message.denotation = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a TypeProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TypeProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TypeProto} TypeProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n TypeProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a TypeProto message.\n * @function verify\n * @memberof onnx.TypeProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n TypeProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n var properties = {};\n if (message.tensorType != null && message.hasOwnProperty(\"tensorType\")) {\n properties.value = 1;\n {\n var error = $root.onnx.TypeProto.Tensor.verify(message.tensorType);\n if (error)\n return \"tensorType.\" + error;\n }\n }\n if (message.sequenceType != null && message.hasOwnProperty(\"sequenceType\")) {\n if (properties.value === 1)\n return \"value: multiple values\";\n properties.value = 1;\n {\n var error = $root.onnx.TypeProto.Sequence.verify(message.sequenceType);\n if (error)\n return \"sequenceType.\" + error;\n }\n }\n if (message.mapType != null && message.hasOwnProperty(\"mapType\")) {\n if (properties.value === 1)\n return \"value: multiple values\";\n properties.value = 1;\n {\n var error = $root.onnx.TypeProto.Map.verify(message.mapType);\n if (error)\n return \"mapType.\" + error;\n }\n }\n if (message.optionalType != null && message.hasOwnProperty(\"optionalType\")) {\n if (properties.value === 1)\n return \"value: multiple values\";\n properties.value = 1;\n {\n var error = $root.onnx.TypeProto.Optional.verify(message.optionalType);\n if (error)\n return \"optionalType.\" + error;\n }\n }\n if (message.sparseTensorType != null && message.hasOwnProperty(\"sparseTensorType\")) {\n if (properties.value === 1)\n return \"value: multiple values\";\n properties.value = 1;\n {\n var error = $root.onnx.TypeProto.SparseTensor.verify(message.sparseTensorType);\n if (error)\n return \"sparseTensorType.\" + error;\n }\n }\n if (message.denotation != null && message.hasOwnProperty(\"denotation\"))\n if (!$util.isString(message.denotation))\n return \"denotation: string expected\";\n return null;\n };\n\n /**\n * Creates a TypeProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TypeProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TypeProto} TypeProto\n */\n TypeProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TypeProto)\n return object;\n var message = new $root.onnx.TypeProto();\n if (object.tensorType != null) {\n if (typeof object.tensorType !== \"object\")\n throw TypeError(\".onnx.TypeProto.tensorType: object expected\");\n message.tensorType = $root.onnx.TypeProto.Tensor.fromObject(object.tensorType);\n }\n if (object.sequenceType != null) {\n if (typeof object.sequenceType !== \"object\")\n throw TypeError(\".onnx.TypeProto.sequenceType: object expected\");\n message.sequenceType = $root.onnx.TypeProto.Sequence.fromObject(object.sequenceType);\n }\n if (object.mapType != null) {\n if (typeof object.mapType !== \"object\")\n throw TypeError(\".onnx.TypeProto.mapType: object expected\");\n message.mapType = $root.onnx.TypeProto.Map.fromObject(object.mapType);\n }\n if (object.optionalType != null) {\n if (typeof object.optionalType !== \"object\")\n throw TypeError(\".onnx.TypeProto.optionalType: object expected\");\n message.optionalType = $root.onnx.TypeProto.Optional.fromObject(object.optionalType);\n }\n if (object.sparseTensorType != null) {\n if (typeof object.sparseTensorType !== \"object\")\n throw TypeError(\".onnx.TypeProto.sparseTensorType: object expected\");\n message.sparseTensorType = $root.onnx.TypeProto.SparseTensor.fromObject(object.sparseTensorType);\n }\n if (object.denotation != null)\n message.denotation = String(object.denotation);\n return message;\n };\n\n /**\n * Creates a plain object from a TypeProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TypeProto\n * @static\n * @param {onnx.TypeProto} message TypeProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n TypeProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.denotation = \"\";\n if (message.tensorType != null && message.hasOwnProperty(\"tensorType\")) {\n object.tensorType = $root.onnx.TypeProto.Tensor.toObject(message.tensorType, options);\n if (options.oneofs)\n object.value = \"tensorType\";\n }\n if (message.sequenceType != null && message.hasOwnProperty(\"sequenceType\")) {\n object.sequenceType = $root.onnx.TypeProto.Sequence.toObject(message.sequenceType, options);\n if (options.oneofs)\n object.value = \"sequenceType\";\n }\n if (message.mapType != null && message.hasOwnProperty(\"mapType\")) {\n object.mapType = $root.onnx.TypeProto.Map.toObject(message.mapType, options);\n if (options.oneofs)\n object.value = \"mapType\";\n }\n if (message.denotation != null && message.hasOwnProperty(\"denotation\"))\n object.denotation = message.denotation;\n if (message.sparseTensorType != null && message.hasOwnProperty(\"sparseTensorType\")) {\n object.sparseTensorType = $root.onnx.TypeProto.SparseTensor.toObject(message.sparseTensorType, options);\n if (options.oneofs)\n object.value = \"sparseTensorType\";\n }\n if (message.optionalType != null && message.hasOwnProperty(\"optionalType\")) {\n object.optionalType = $root.onnx.TypeProto.Optional.toObject(message.optionalType, options);\n if (options.oneofs)\n object.value = \"optionalType\";\n }\n return object;\n };\n\n /**\n * Converts this TypeProto to JSON.\n * @function toJSON\n * @memberof onnx.TypeProto\n * @instance\n * @returns {Object.} JSON object\n */\n TypeProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for TypeProto\n * @function getTypeUrl\n * @memberof onnx.TypeProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n TypeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TypeProto\";\n };\n\n TypeProto.Tensor = (function() {\n\n /**\n * Properties of a Tensor.\n * @memberof onnx.TypeProto\n * @interface ITensor\n * @property {number|null} [elemType] Tensor elemType\n * @property {onnx.ITensorShapeProto|null} [shape] Tensor shape\n */\n\n /**\n * Constructs a new Tensor.\n * @memberof onnx.TypeProto\n * @classdesc Represents a Tensor.\n * @implements ITensor\n * @constructor\n * @param {onnx.TypeProto.ITensor=} [properties] Properties to set\n */\n function Tensor(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * Tensor elemType.\n * @member {number} elemType\n * @memberof onnx.TypeProto.Tensor\n * @instance\n */\n Tensor.prototype.elemType = 0;\n\n /**\n * Tensor shape.\n * @member {onnx.ITensorShapeProto|null|undefined} shape\n * @memberof onnx.TypeProto.Tensor\n * @instance\n */\n Tensor.prototype.shape = null;\n\n /**\n * Creates a new Tensor instance using the specified properties.\n * @function create\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {onnx.TypeProto.ITensor=} [properties] Properties to set\n * @returns {onnx.TypeProto.Tensor} Tensor instance\n */\n Tensor.create = function create(properties) {\n return new Tensor(properties);\n };\n\n /**\n * Encodes the specified Tensor message. Does not implicitly {@link onnx.TypeProto.Tensor.verify|verify} messages.\n * @function encode\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {onnx.TypeProto.ITensor} message Tensor message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Tensor.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.elemType != null && Object.hasOwnProperty.call(message, \"elemType\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.elemType);\n if (message.shape != null && Object.hasOwnProperty.call(message, \"shape\"))\n $root.onnx.TensorShapeProto.encode(message.shape, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified Tensor message, length delimited. Does not implicitly {@link onnx.TypeProto.Tensor.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {onnx.TypeProto.ITensor} message Tensor message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Tensor.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a Tensor message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TypeProto.Tensor} Tensor\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Tensor.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TypeProto.Tensor();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.elemType = reader.int32();\n break;\n }\n case 2: {\n message.shape = $root.onnx.TensorShapeProto.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a Tensor message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TypeProto.Tensor} Tensor\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Tensor.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a Tensor message.\n * @function verify\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Tensor.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.elemType != null && message.hasOwnProperty(\"elemType\"))\n if (!$util.isInteger(message.elemType))\n return \"elemType: integer expected\";\n if (message.shape != null && message.hasOwnProperty(\"shape\")) {\n var error = $root.onnx.TensorShapeProto.verify(message.shape);\n if (error)\n return \"shape.\" + error;\n }\n return null;\n };\n\n /**\n * Creates a Tensor message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TypeProto.Tensor} Tensor\n */\n Tensor.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TypeProto.Tensor)\n return object;\n var message = new $root.onnx.TypeProto.Tensor();\n if (object.elemType != null)\n message.elemType = object.elemType | 0;\n if (object.shape != null) {\n if (typeof object.shape !== \"object\")\n throw TypeError(\".onnx.TypeProto.Tensor.shape: object expected\");\n message.shape = $root.onnx.TensorShapeProto.fromObject(object.shape);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a Tensor message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {onnx.TypeProto.Tensor} message Tensor\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Tensor.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.elemType = 0;\n object.shape = null;\n }\n if (message.elemType != null && message.hasOwnProperty(\"elemType\"))\n object.elemType = message.elemType;\n if (message.shape != null && message.hasOwnProperty(\"shape\"))\n object.shape = $root.onnx.TensorShapeProto.toObject(message.shape, options);\n return object;\n };\n\n /**\n * Converts this Tensor to JSON.\n * @function toJSON\n * @memberof onnx.TypeProto.Tensor\n * @instance\n * @returns {Object.} JSON object\n */\n Tensor.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for Tensor\n * @function getTypeUrl\n * @memberof onnx.TypeProto.Tensor\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Tensor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TypeProto.Tensor\";\n };\n\n return Tensor;\n })();\n\n TypeProto.Sequence = (function() {\n\n /**\n * Properties of a Sequence.\n * @memberof onnx.TypeProto\n * @interface ISequence\n * @property {onnx.ITypeProto|null} [elemType] Sequence elemType\n */\n\n /**\n * Constructs a new Sequence.\n * @memberof onnx.TypeProto\n * @classdesc Represents a Sequence.\n * @implements ISequence\n * @constructor\n * @param {onnx.TypeProto.ISequence=} [properties] Properties to set\n */\n function Sequence(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * Sequence elemType.\n * @member {onnx.ITypeProto|null|undefined} elemType\n * @memberof onnx.TypeProto.Sequence\n * @instance\n */\n Sequence.prototype.elemType = null;\n\n /**\n * Creates a new Sequence instance using the specified properties.\n * @function create\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {onnx.TypeProto.ISequence=} [properties] Properties to set\n * @returns {onnx.TypeProto.Sequence} Sequence instance\n */\n Sequence.create = function create(properties) {\n return new Sequence(properties);\n };\n\n /**\n * Encodes the specified Sequence message. Does not implicitly {@link onnx.TypeProto.Sequence.verify|verify} messages.\n * @function encode\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {onnx.TypeProto.ISequence} message Sequence message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Sequence.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.elemType != null && Object.hasOwnProperty.call(message, \"elemType\"))\n $root.onnx.TypeProto.encode(message.elemType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified Sequence message, length delimited. Does not implicitly {@link onnx.TypeProto.Sequence.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {onnx.TypeProto.ISequence} message Sequence message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Sequence.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a Sequence message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TypeProto.Sequence} Sequence\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Sequence.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TypeProto.Sequence();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.elemType = $root.onnx.TypeProto.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a Sequence message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TypeProto.Sequence} Sequence\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Sequence.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a Sequence message.\n * @function verify\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Sequence.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.elemType != null && message.hasOwnProperty(\"elemType\")) {\n var error = $root.onnx.TypeProto.verify(message.elemType);\n if (error)\n return \"elemType.\" + error;\n }\n return null;\n };\n\n /**\n * Creates a Sequence message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TypeProto.Sequence} Sequence\n */\n Sequence.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TypeProto.Sequence)\n return object;\n var message = new $root.onnx.TypeProto.Sequence();\n if (object.elemType != null) {\n if (typeof object.elemType !== \"object\")\n throw TypeError(\".onnx.TypeProto.Sequence.elemType: object expected\");\n message.elemType = $root.onnx.TypeProto.fromObject(object.elemType);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a Sequence message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {onnx.TypeProto.Sequence} message Sequence\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Sequence.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.elemType = null;\n if (message.elemType != null && message.hasOwnProperty(\"elemType\"))\n object.elemType = $root.onnx.TypeProto.toObject(message.elemType, options);\n return object;\n };\n\n /**\n * Converts this Sequence to JSON.\n * @function toJSON\n * @memberof onnx.TypeProto.Sequence\n * @instance\n * @returns {Object.} JSON object\n */\n Sequence.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for Sequence\n * @function getTypeUrl\n * @memberof onnx.TypeProto.Sequence\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Sequence.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TypeProto.Sequence\";\n };\n\n return Sequence;\n })();\n\n TypeProto.Map = (function() {\n\n /**\n * Properties of a Map.\n * @memberof onnx.TypeProto\n * @interface IMap\n * @property {number|null} [keyType] Map keyType\n * @property {onnx.ITypeProto|null} [valueType] Map valueType\n */\n\n /**\n * Constructs a new Map.\n * @memberof onnx.TypeProto\n * @classdesc Represents a Map.\n * @implements IMap\n * @constructor\n * @param {onnx.TypeProto.IMap=} [properties] Properties to set\n */\n function Map(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * Map keyType.\n * @member {number} keyType\n * @memberof onnx.TypeProto.Map\n * @instance\n */\n Map.prototype.keyType = 0;\n\n /**\n * Map valueType.\n * @member {onnx.ITypeProto|null|undefined} valueType\n * @memberof onnx.TypeProto.Map\n * @instance\n */\n Map.prototype.valueType = null;\n\n /**\n * Creates a new Map instance using the specified properties.\n * @function create\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {onnx.TypeProto.IMap=} [properties] Properties to set\n * @returns {onnx.TypeProto.Map} Map instance\n */\n Map.create = function create(properties) {\n return new Map(properties);\n };\n\n /**\n * Encodes the specified Map message. Does not implicitly {@link onnx.TypeProto.Map.verify|verify} messages.\n * @function encode\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {onnx.TypeProto.IMap} message Map message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Map.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.keyType != null && Object.hasOwnProperty.call(message, \"keyType\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.keyType);\n if (message.valueType != null && Object.hasOwnProperty.call(message, \"valueType\"))\n $root.onnx.TypeProto.encode(message.valueType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified Map message, length delimited. Does not implicitly {@link onnx.TypeProto.Map.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {onnx.TypeProto.IMap} message Map message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Map.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a Map message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TypeProto.Map} Map\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Map.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TypeProto.Map();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.keyType = reader.int32();\n break;\n }\n case 2: {\n message.valueType = $root.onnx.TypeProto.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a Map message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TypeProto.Map} Map\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Map.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a Map message.\n * @function verify\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Map.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.keyType != null && message.hasOwnProperty(\"keyType\"))\n if (!$util.isInteger(message.keyType))\n return \"keyType: integer expected\";\n if (message.valueType != null && message.hasOwnProperty(\"valueType\")) {\n var error = $root.onnx.TypeProto.verify(message.valueType);\n if (error)\n return \"valueType.\" + error;\n }\n return null;\n };\n\n /**\n * Creates a Map message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TypeProto.Map} Map\n */\n Map.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TypeProto.Map)\n return object;\n var message = new $root.onnx.TypeProto.Map();\n if (object.keyType != null)\n message.keyType = object.keyType | 0;\n if (object.valueType != null) {\n if (typeof object.valueType !== \"object\")\n throw TypeError(\".onnx.TypeProto.Map.valueType: object expected\");\n message.valueType = $root.onnx.TypeProto.fromObject(object.valueType);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a Map message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {onnx.TypeProto.Map} message Map\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Map.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.keyType = 0;\n object.valueType = null;\n }\n if (message.keyType != null && message.hasOwnProperty(\"keyType\"))\n object.keyType = message.keyType;\n if (message.valueType != null && message.hasOwnProperty(\"valueType\"))\n object.valueType = $root.onnx.TypeProto.toObject(message.valueType, options);\n return object;\n };\n\n /**\n * Converts this Map to JSON.\n * @function toJSON\n * @memberof onnx.TypeProto.Map\n * @instance\n * @returns {Object.} JSON object\n */\n Map.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for Map\n * @function getTypeUrl\n * @memberof onnx.TypeProto.Map\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Map.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TypeProto.Map\";\n };\n\n return Map;\n })();\n\n TypeProto.Optional = (function() {\n\n /**\n * Properties of an Optional.\n * @memberof onnx.TypeProto\n * @interface IOptional\n * @property {onnx.ITypeProto|null} [elemType] Optional elemType\n */\n\n /**\n * Constructs a new Optional.\n * @memberof onnx.TypeProto\n * @classdesc Represents an Optional.\n * @implements IOptional\n * @constructor\n * @param {onnx.TypeProto.IOptional=} [properties] Properties to set\n */\n function Optional(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * Optional elemType.\n * @member {onnx.ITypeProto|null|undefined} elemType\n * @memberof onnx.TypeProto.Optional\n * @instance\n */\n Optional.prototype.elemType = null;\n\n /**\n * Creates a new Optional instance using the specified properties.\n * @function create\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {onnx.TypeProto.IOptional=} [properties] Properties to set\n * @returns {onnx.TypeProto.Optional} Optional instance\n */\n Optional.create = function create(properties) {\n return new Optional(properties);\n };\n\n /**\n * Encodes the specified Optional message. Does not implicitly {@link onnx.TypeProto.Optional.verify|verify} messages.\n * @function encode\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {onnx.TypeProto.IOptional} message Optional message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Optional.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.elemType != null && Object.hasOwnProperty.call(message, \"elemType\"))\n $root.onnx.TypeProto.encode(message.elemType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified Optional message, length delimited. Does not implicitly {@link onnx.TypeProto.Optional.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {onnx.TypeProto.IOptional} message Optional message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Optional.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an Optional message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TypeProto.Optional} Optional\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Optional.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TypeProto.Optional();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.elemType = $root.onnx.TypeProto.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an Optional message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TypeProto.Optional} Optional\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Optional.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an Optional message.\n * @function verify\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n Optional.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.elemType != null && message.hasOwnProperty(\"elemType\")) {\n var error = $root.onnx.TypeProto.verify(message.elemType);\n if (error)\n return \"elemType.\" + error;\n }\n return null;\n };\n\n /**\n * Creates an Optional message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TypeProto.Optional} Optional\n */\n Optional.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TypeProto.Optional)\n return object;\n var message = new $root.onnx.TypeProto.Optional();\n if (object.elemType != null) {\n if (typeof object.elemType !== \"object\")\n throw TypeError(\".onnx.TypeProto.Optional.elemType: object expected\");\n message.elemType = $root.onnx.TypeProto.fromObject(object.elemType);\n }\n return message;\n };\n\n /**\n * Creates a plain object from an Optional message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {onnx.TypeProto.Optional} message Optional\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n Optional.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults)\n object.elemType = null;\n if (message.elemType != null && message.hasOwnProperty(\"elemType\"))\n object.elemType = $root.onnx.TypeProto.toObject(message.elemType, options);\n return object;\n };\n\n /**\n * Converts this Optional to JSON.\n * @function toJSON\n * @memberof onnx.TypeProto.Optional\n * @instance\n * @returns {Object.} JSON object\n */\n Optional.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for Optional\n * @function getTypeUrl\n * @memberof onnx.TypeProto.Optional\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n Optional.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TypeProto.Optional\";\n };\n\n return Optional;\n })();\n\n TypeProto.SparseTensor = (function() {\n\n /**\n * Properties of a SparseTensor.\n * @memberof onnx.TypeProto\n * @interface ISparseTensor\n * @property {number|null} [elemType] SparseTensor elemType\n * @property {onnx.ITensorShapeProto|null} [shape] SparseTensor shape\n */\n\n /**\n * Constructs a new SparseTensor.\n * @memberof onnx.TypeProto\n * @classdesc Represents a SparseTensor.\n * @implements ISparseTensor\n * @constructor\n * @param {onnx.TypeProto.ISparseTensor=} [properties] Properties to set\n */\n function SparseTensor(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * SparseTensor elemType.\n * @member {number} elemType\n * @memberof onnx.TypeProto.SparseTensor\n * @instance\n */\n SparseTensor.prototype.elemType = 0;\n\n /**\n * SparseTensor shape.\n * @member {onnx.ITensorShapeProto|null|undefined} shape\n * @memberof onnx.TypeProto.SparseTensor\n * @instance\n */\n SparseTensor.prototype.shape = null;\n\n /**\n * Creates a new SparseTensor instance using the specified properties.\n * @function create\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {onnx.TypeProto.ISparseTensor=} [properties] Properties to set\n * @returns {onnx.TypeProto.SparseTensor} SparseTensor instance\n */\n SparseTensor.create = function create(properties) {\n return new SparseTensor(properties);\n };\n\n /**\n * Encodes the specified SparseTensor message. Does not implicitly {@link onnx.TypeProto.SparseTensor.verify|verify} messages.\n * @function encode\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {onnx.TypeProto.ISparseTensor} message SparseTensor message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SparseTensor.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.elemType != null && Object.hasOwnProperty.call(message, \"elemType\"))\n writer.uint32(/* id 1, wireType 0 =*/8).int32(message.elemType);\n if (message.shape != null && Object.hasOwnProperty.call(message, \"shape\"))\n $root.onnx.TensorShapeProto.encode(message.shape, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified SparseTensor message, length delimited. Does not implicitly {@link onnx.TypeProto.SparseTensor.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {onnx.TypeProto.ISparseTensor} message SparseTensor message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SparseTensor.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a SparseTensor message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.TypeProto.SparseTensor} SparseTensor\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SparseTensor.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.TypeProto.SparseTensor();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.elemType = reader.int32();\n break;\n }\n case 2: {\n message.shape = $root.onnx.TensorShapeProto.decode(reader, reader.uint32());\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a SparseTensor message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.TypeProto.SparseTensor} SparseTensor\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SparseTensor.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a SparseTensor message.\n * @function verify\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n SparseTensor.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.elemType != null && message.hasOwnProperty(\"elemType\"))\n if (!$util.isInteger(message.elemType))\n return \"elemType: integer expected\";\n if (message.shape != null && message.hasOwnProperty(\"shape\")) {\n var error = $root.onnx.TensorShapeProto.verify(message.shape);\n if (error)\n return \"shape.\" + error;\n }\n return null;\n };\n\n /**\n * Creates a SparseTensor message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.TypeProto.SparseTensor} SparseTensor\n */\n SparseTensor.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.TypeProto.SparseTensor)\n return object;\n var message = new $root.onnx.TypeProto.SparseTensor();\n if (object.elemType != null)\n message.elemType = object.elemType | 0;\n if (object.shape != null) {\n if (typeof object.shape !== \"object\")\n throw TypeError(\".onnx.TypeProto.SparseTensor.shape: object expected\");\n message.shape = $root.onnx.TensorShapeProto.fromObject(object.shape);\n }\n return message;\n };\n\n /**\n * Creates a plain object from a SparseTensor message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {onnx.TypeProto.SparseTensor} message SparseTensor\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n SparseTensor.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.elemType = 0;\n object.shape = null;\n }\n if (message.elemType != null && message.hasOwnProperty(\"elemType\"))\n object.elemType = message.elemType;\n if (message.shape != null && message.hasOwnProperty(\"shape\"))\n object.shape = $root.onnx.TensorShapeProto.toObject(message.shape, options);\n return object;\n };\n\n /**\n * Converts this SparseTensor to JSON.\n * @function toJSON\n * @memberof onnx.TypeProto.SparseTensor\n * @instance\n * @returns {Object.} JSON object\n */\n SparseTensor.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for SparseTensor\n * @function getTypeUrl\n * @memberof onnx.TypeProto.SparseTensor\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n SparseTensor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.TypeProto.SparseTensor\";\n };\n\n return SparseTensor;\n })();\n\n return TypeProto;\n })();\n\n onnx.OperatorSetIdProto = (function() {\n\n /**\n * Properties of an OperatorSetIdProto.\n * @memberof onnx\n * @interface IOperatorSetIdProto\n * @property {string|null} [domain] OperatorSetIdProto domain\n * @property {number|Long|null} [version] OperatorSetIdProto version\n */\n\n /**\n * Constructs a new OperatorSetIdProto.\n * @memberof onnx\n * @classdesc Represents an OperatorSetIdProto.\n * @implements IOperatorSetIdProto\n * @constructor\n * @param {onnx.IOperatorSetIdProto=} [properties] Properties to set\n */\n function OperatorSetIdProto(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * OperatorSetIdProto domain.\n * @member {string} domain\n * @memberof onnx.OperatorSetIdProto\n * @instance\n */\n OperatorSetIdProto.prototype.domain = \"\";\n\n /**\n * OperatorSetIdProto version.\n * @member {number|Long} version\n * @memberof onnx.OperatorSetIdProto\n * @instance\n */\n OperatorSetIdProto.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n /**\n * Creates a new OperatorSetIdProto instance using the specified properties.\n * @function create\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {onnx.IOperatorSetIdProto=} [properties] Properties to set\n * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto instance\n */\n OperatorSetIdProto.create = function create(properties) {\n return new OperatorSetIdProto(properties);\n };\n\n /**\n * Encodes the specified OperatorSetIdProto message. Does not implicitly {@link onnx.OperatorSetIdProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {onnx.IOperatorSetIdProto} message OperatorSetIdProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperatorSetIdProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.domain != null && Object.hasOwnProperty.call(message, \"domain\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.domain);\n if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n writer.uint32(/* id 2, wireType 0 =*/16).int64(message.version);\n return writer;\n };\n\n /**\n * Encodes the specified OperatorSetIdProto message, length delimited. Does not implicitly {@link onnx.OperatorSetIdProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {onnx.IOperatorSetIdProto} message OperatorSetIdProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n OperatorSetIdProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes an OperatorSetIdProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperatorSetIdProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.OperatorSetIdProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.domain = reader.string();\n break;\n }\n case 2: {\n message.version = reader.int64();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes an OperatorSetIdProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n OperatorSetIdProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies an OperatorSetIdProto message.\n * @function verify\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n OperatorSetIdProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n if (!$util.isString(message.domain))\n return \"domain: string expected\";\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high)))\n return \"version: integer|Long expected\";\n return null;\n };\n\n /**\n * Creates an OperatorSetIdProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto\n */\n OperatorSetIdProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.OperatorSetIdProto)\n return object;\n var message = new $root.onnx.OperatorSetIdProto();\n if (object.domain != null)\n message.domain = String(object.domain);\n if (object.version != null)\n if ($util.Long)\n (message.version = $util.Long.fromValue(object.version)).unsigned = false;\n else if (typeof object.version === \"string\")\n message.version = parseInt(object.version, 10);\n else if (typeof object.version === \"number\")\n message.version = object.version;\n else if (typeof object.version === \"object\")\n message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber();\n return message;\n };\n\n /**\n * Creates a plain object from an OperatorSetIdProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {onnx.OperatorSetIdProto} message OperatorSetIdProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n OperatorSetIdProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n object.domain = \"\";\n if ($util.Long) {\n var long = new $util.Long(0, 0, false);\n object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.version = options.longs === String ? \"0\" : 0;\n }\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n object.domain = message.domain;\n if (message.version != null && message.hasOwnProperty(\"version\"))\n if (typeof message.version === \"number\")\n object.version = options.longs === String ? String(message.version) : message.version;\n else\n object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version;\n return object;\n };\n\n /**\n * Converts this OperatorSetIdProto to JSON.\n * @function toJSON\n * @memberof onnx.OperatorSetIdProto\n * @instance\n * @returns {Object.} JSON object\n */\n OperatorSetIdProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for OperatorSetIdProto\n * @function getTypeUrl\n * @memberof onnx.OperatorSetIdProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n OperatorSetIdProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.OperatorSetIdProto\";\n };\n\n return OperatorSetIdProto;\n })();\n\n /**\n * OperatorStatus enum.\n * @name onnx.OperatorStatus\n * @enum {number}\n * @property {number} EXPERIMENTAL=0 EXPERIMENTAL value\n * @property {number} STABLE=1 STABLE value\n */\n onnx.OperatorStatus = (function() {\n var valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = \"EXPERIMENTAL\"] = 0;\n values[valuesById[1] = \"STABLE\"] = 1;\n return values;\n })();\n\n onnx.FunctionProto = (function() {\n\n /**\n * Properties of a FunctionProto.\n * @memberof onnx\n * @interface IFunctionProto\n * @property {string|null} [name] FunctionProto name\n * @property {Array.|null} [input] FunctionProto input\n * @property {Array.|null} [output] FunctionProto output\n * @property {Array.|null} [attribute] FunctionProto attribute\n * @property {Array.|null} [attributeProto] FunctionProto attributeProto\n * @property {Array.|null} [node] FunctionProto node\n * @property {string|null} [docString] FunctionProto docString\n * @property {Array.|null} [opsetImport] FunctionProto opsetImport\n * @property {string|null} [domain] FunctionProto domain\n */\n\n /**\n * Constructs a new FunctionProto.\n * @memberof onnx\n * @classdesc Represents a FunctionProto.\n * @implements IFunctionProto\n * @constructor\n * @param {onnx.IFunctionProto=} [properties] Properties to set\n */\n function FunctionProto(properties) {\n this.input = [];\n this.output = [];\n this.attribute = [];\n this.attributeProto = [];\n this.node = [];\n this.opsetImport = [];\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * FunctionProto name.\n * @member {string} name\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.name = \"\";\n\n /**\n * FunctionProto input.\n * @member {Array.} input\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.input = $util.emptyArray;\n\n /**\n * FunctionProto output.\n * @member {Array.} output\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.output = $util.emptyArray;\n\n /**\n * FunctionProto attribute.\n * @member {Array.} attribute\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.attribute = $util.emptyArray;\n\n /**\n * FunctionProto attributeProto.\n * @member {Array.} attributeProto\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.attributeProto = $util.emptyArray;\n\n /**\n * FunctionProto node.\n * @member {Array.} node\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.node = $util.emptyArray;\n\n /**\n * FunctionProto docString.\n * @member {string} docString\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.docString = \"\";\n\n /**\n * FunctionProto opsetImport.\n * @member {Array.} opsetImport\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.opsetImport = $util.emptyArray;\n\n /**\n * FunctionProto domain.\n * @member {string} domain\n * @memberof onnx.FunctionProto\n * @instance\n */\n FunctionProto.prototype.domain = \"\";\n\n /**\n * Creates a new FunctionProto instance using the specified properties.\n * @function create\n * @memberof onnx.FunctionProto\n * @static\n * @param {onnx.IFunctionProto=} [properties] Properties to set\n * @returns {onnx.FunctionProto} FunctionProto instance\n */\n FunctionProto.create = function create(properties) {\n return new FunctionProto(properties);\n };\n\n /**\n * Encodes the specified FunctionProto message. Does not implicitly {@link onnx.FunctionProto.verify|verify} messages.\n * @function encode\n * @memberof onnx.FunctionProto\n * @static\n * @param {onnx.IFunctionProto} message FunctionProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FunctionProto.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n if (message.input != null && message.input.length)\n for (var i = 0; i < message.input.length; ++i)\n writer.uint32(/* id 4, wireType 2 =*/34).string(message.input[i]);\n if (message.output != null && message.output.length)\n for (var i = 0; i < message.output.length; ++i)\n writer.uint32(/* id 5, wireType 2 =*/42).string(message.output[i]);\n if (message.attribute != null && message.attribute.length)\n for (var i = 0; i < message.attribute.length; ++i)\n writer.uint32(/* id 6, wireType 2 =*/50).string(message.attribute[i]);\n if (message.node != null && message.node.length)\n for (var i = 0; i < message.node.length; ++i)\n $root.onnx.NodeProto.encode(message.node[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n if (message.docString != null && Object.hasOwnProperty.call(message, \"docString\"))\n writer.uint32(/* id 8, wireType 2 =*/66).string(message.docString);\n if (message.opsetImport != null && message.opsetImport.length)\n for (var i = 0; i < message.opsetImport.length; ++i)\n $root.onnx.OperatorSetIdProto.encode(message.opsetImport[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n if (message.domain != null && Object.hasOwnProperty.call(message, \"domain\"))\n writer.uint32(/* id 10, wireType 2 =*/82).string(message.domain);\n if (message.attributeProto != null && message.attributeProto.length)\n for (var i = 0; i < message.attributeProto.length; ++i)\n $root.onnx.AttributeProto.encode(message.attributeProto[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();\n return writer;\n };\n\n /**\n * Encodes the specified FunctionProto message, length delimited. Does not implicitly {@link onnx.FunctionProto.verify|verify} messages.\n * @function encodeDelimited\n * @memberof onnx.FunctionProto\n * @static\n * @param {onnx.IFunctionProto} message FunctionProto message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n FunctionProto.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a FunctionProto message from the specified reader or buffer.\n * @function decode\n * @memberof onnx.FunctionProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {onnx.FunctionProto} FunctionProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FunctionProto.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.onnx.FunctionProto();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.name = reader.string();\n break;\n }\n case 4: {\n if (!(message.input && message.input.length))\n message.input = [];\n message.input.push(reader.string());\n break;\n }\n case 5: {\n if (!(message.output && message.output.length))\n message.output = [];\n message.output.push(reader.string());\n break;\n }\n case 6: {\n if (!(message.attribute && message.attribute.length))\n message.attribute = [];\n message.attribute.push(reader.string());\n break;\n }\n case 11: {\n if (!(message.attributeProto && message.attributeProto.length))\n message.attributeProto = [];\n message.attributeProto.push($root.onnx.AttributeProto.decode(reader, reader.uint32()));\n break;\n }\n case 7: {\n if (!(message.node && message.node.length))\n message.node = [];\n message.node.push($root.onnx.NodeProto.decode(reader, reader.uint32()));\n break;\n }\n case 8: {\n message.docString = reader.string();\n break;\n }\n case 9: {\n if (!(message.opsetImport && message.opsetImport.length))\n message.opsetImport = [];\n message.opsetImport.push($root.onnx.OperatorSetIdProto.decode(reader, reader.uint32()));\n break;\n }\n case 10: {\n message.domain = reader.string();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a FunctionProto message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof onnx.FunctionProto\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {onnx.FunctionProto} FunctionProto\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n FunctionProto.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a FunctionProto message.\n * @function verify\n * @memberof onnx.FunctionProto\n * @static\n * @param {Object.} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n FunctionProto.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.name != null && message.hasOwnProperty(\"name\"))\n if (!$util.isString(message.name))\n return \"name: string expected\";\n if (message.input != null && message.hasOwnProperty(\"input\")) {\n if (!Array.isArray(message.input))\n return \"input: array expected\";\n for (var i = 0; i < message.input.length; ++i)\n if (!$util.isString(message.input[i]))\n return \"input: string[] expected\";\n }\n if (message.output != null && message.hasOwnProperty(\"output\")) {\n if (!Array.isArray(message.output))\n return \"output: array expected\";\n for (var i = 0; i < message.output.length; ++i)\n if (!$util.isString(message.output[i]))\n return \"output: string[] expected\";\n }\n if (message.attribute != null && message.hasOwnProperty(\"attribute\")) {\n if (!Array.isArray(message.attribute))\n return \"attribute: array expected\";\n for (var i = 0; i < message.attribute.length; ++i)\n if (!$util.isString(message.attribute[i]))\n return \"attribute: string[] expected\";\n }\n if (message.attributeProto != null && message.hasOwnProperty(\"attributeProto\")) {\n if (!Array.isArray(message.attributeProto))\n return \"attributeProto: array expected\";\n for (var i = 0; i < message.attributeProto.length; ++i) {\n var error = $root.onnx.AttributeProto.verify(message.attributeProto[i]);\n if (error)\n return \"attributeProto.\" + error;\n }\n }\n if (message.node != null && message.hasOwnProperty(\"node\")) {\n if (!Array.isArray(message.node))\n return \"node: array expected\";\n for (var i = 0; i < message.node.length; ++i) {\n var error = $root.onnx.NodeProto.verify(message.node[i]);\n if (error)\n return \"node.\" + error;\n }\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n if (!$util.isString(message.docString))\n return \"docString: string expected\";\n if (message.opsetImport != null && message.hasOwnProperty(\"opsetImport\")) {\n if (!Array.isArray(message.opsetImport))\n return \"opsetImport: array expected\";\n for (var i = 0; i < message.opsetImport.length; ++i) {\n var error = $root.onnx.OperatorSetIdProto.verify(message.opsetImport[i]);\n if (error)\n return \"opsetImport.\" + error;\n }\n }\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n if (!$util.isString(message.domain))\n return \"domain: string expected\";\n return null;\n };\n\n /**\n * Creates a FunctionProto message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof onnx.FunctionProto\n * @static\n * @param {Object.} object Plain object\n * @returns {onnx.FunctionProto} FunctionProto\n */\n FunctionProto.fromObject = function fromObject(object) {\n if (object instanceof $root.onnx.FunctionProto)\n return object;\n var message = new $root.onnx.FunctionProto();\n if (object.name != null)\n message.name = String(object.name);\n if (object.input) {\n if (!Array.isArray(object.input))\n throw TypeError(\".onnx.FunctionProto.input: array expected\");\n message.input = [];\n for (var i = 0; i < object.input.length; ++i)\n message.input[i] = String(object.input[i]);\n }\n if (object.output) {\n if (!Array.isArray(object.output))\n throw TypeError(\".onnx.FunctionProto.output: array expected\");\n message.output = [];\n for (var i = 0; i < object.output.length; ++i)\n message.output[i] = String(object.output[i]);\n }\n if (object.attribute) {\n if (!Array.isArray(object.attribute))\n throw TypeError(\".onnx.FunctionProto.attribute: array expected\");\n message.attribute = [];\n for (var i = 0; i < object.attribute.length; ++i)\n message.attribute[i] = String(object.attribute[i]);\n }\n if (object.attributeProto) {\n if (!Array.isArray(object.attributeProto))\n throw TypeError(\".onnx.FunctionProto.attributeProto: array expected\");\n message.attributeProto = [];\n for (var i = 0; i < object.attributeProto.length; ++i) {\n if (typeof object.attributeProto[i] !== \"object\")\n throw TypeError(\".onnx.FunctionProto.attributeProto: object expected\");\n message.attributeProto[i] = $root.onnx.AttributeProto.fromObject(object.attributeProto[i]);\n }\n }\n if (object.node) {\n if (!Array.isArray(object.node))\n throw TypeError(\".onnx.FunctionProto.node: array expected\");\n message.node = [];\n for (var i = 0; i < object.node.length; ++i) {\n if (typeof object.node[i] !== \"object\")\n throw TypeError(\".onnx.FunctionProto.node: object expected\");\n message.node[i] = $root.onnx.NodeProto.fromObject(object.node[i]);\n }\n }\n if (object.docString != null)\n message.docString = String(object.docString);\n if (object.opsetImport) {\n if (!Array.isArray(object.opsetImport))\n throw TypeError(\".onnx.FunctionProto.opsetImport: array expected\");\n message.opsetImport = [];\n for (var i = 0; i < object.opsetImport.length; ++i) {\n if (typeof object.opsetImport[i] !== \"object\")\n throw TypeError(\".onnx.FunctionProto.opsetImport: object expected\");\n message.opsetImport[i] = $root.onnx.OperatorSetIdProto.fromObject(object.opsetImport[i]);\n }\n }\n if (object.domain != null)\n message.domain = String(object.domain);\n return message;\n };\n\n /**\n * Creates a plain object from a FunctionProto message. Also converts values to other types if specified.\n * @function toObject\n * @memberof onnx.FunctionProto\n * @static\n * @param {onnx.FunctionProto} message FunctionProto\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.} Plain object\n */\n FunctionProto.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.arrays || options.defaults) {\n object.input = [];\n object.output = [];\n object.attribute = [];\n object.node = [];\n object.opsetImport = [];\n object.attributeProto = [];\n }\n if (options.defaults) {\n object.name = \"\";\n object.docString = \"\";\n object.domain = \"\";\n }\n if (message.name != null && message.hasOwnProperty(\"name\"))\n object.name = message.name;\n if (message.input && message.input.length) {\n object.input = [];\n for (var j = 0; j < message.input.length; ++j)\n object.input[j] = message.input[j];\n }\n if (message.output && message.output.length) {\n object.output = [];\n for (var j = 0; j < message.output.length; ++j)\n object.output[j] = message.output[j];\n }\n if (message.attribute && message.attribute.length) {\n object.attribute = [];\n for (var j = 0; j < message.attribute.length; ++j)\n object.attribute[j] = message.attribute[j];\n }\n if (message.node && message.node.length) {\n object.node = [];\n for (var j = 0; j < message.node.length; ++j)\n object.node[j] = $root.onnx.NodeProto.toObject(message.node[j], options);\n }\n if (message.docString != null && message.hasOwnProperty(\"docString\"))\n object.docString = message.docString;\n if (message.opsetImport && message.opsetImport.length) {\n object.opsetImport = [];\n for (var j = 0; j < message.opsetImport.length; ++j)\n object.opsetImport[j] = $root.onnx.OperatorSetIdProto.toObject(message.opsetImport[j], options);\n }\n if (message.domain != null && message.hasOwnProperty(\"domain\"))\n object.domain = message.domain;\n if (message.attributeProto && message.attributeProto.length) {\n object.attributeProto = [];\n for (var j = 0; j < message.attributeProto.length; ++j)\n object.attributeProto[j] = $root.onnx.AttributeProto.toObject(message.attributeProto[j], options);\n }\n return object;\n };\n\n /**\n * Converts this FunctionProto to JSON.\n * @function toJSON\n * @memberof onnx.FunctionProto\n * @instance\n * @returns {Object.} JSON object\n */\n FunctionProto.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for FunctionProto\n * @function getTypeUrl\n * @memberof onnx.FunctionProto\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n FunctionProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/onnx.FunctionProto\";\n };\n\n return FunctionProto;\n })();\n\n return onnx;\n})();\n\nmodule.exports = $root;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {flatbuffers} from 'flatbuffers';\nimport Long from 'long';\n\nimport {Graph} from './graph';\nimport {onnxruntime} from './ort-schema/flatbuffers/ort-generated';\nimport {onnx} from './ort-schema/protobuf/onnx';\nimport {Tensor} from './tensor';\n\n// check the inputs shape before running an OP.\n// return true when the inputs pass the check\n// return false when the inputs do not fit the requirement\n// throw exception when fatal error or not implemented\nexport function checkInputsShape(inputs: Tensor[], ...expectedDimensions: number[]): boolean {\n if (!inputs || inputs.length !== expectedDimensions.length) {\n return false;\n }\n for (let i = 0; i < inputs.length; i++) {\n if (!inputs[i].dims || inputs[i].dims.length !== expectedDimensions[i]) {\n return false;\n }\n }\n return true;\n}\n\n// Evaluates the given expression and asserts error message if condition is unmet.\nexport function assert(expr: boolean, msg: () => string) {\n if (!expr) {\n throw new Error(typeof msg === 'string' ? msg : msg());\n }\n}\n\nexport class ArrayUtil {\n /**\n * Verifies if 2 input arrays contain the same elements.\n * @param n1 Array 1\n * @param n2 Array 2\n * @returns Whether these 2 are equal\n */\n static arraysEqual(\n n1: readonly number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Uint8ClampedArray|\n Float32Array|Float64Array,\n n2: readonly number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Uint8ClampedArray|\n Float32Array|Float64Array) {\n if (n1.length !== n2.length) {\n return false;\n }\n for (let i = 0; i < n1.length; i++) {\n if (n1[i] !== n2[i]) {\n return false;\n }\n }\n return true;\n }\n}\n\nexport class MatMulUtil {\n /**\n * Fix the input shapes for MatMul operation if they need fixing\n * @param dimsA The shape of tensor A. Should be an array of positive integers\n * @param dimsB The shape of tensor B. Should be an array of positive integers\n * @returns A tuple containing the preprocessed input shapes as required by ONNX specifications\n */\n static preprocessInputShapes(dimsA: readonly number[], dimsB: readonly number[]):\n [readonly number[], readonly number[]] {\n // If the first argument is 1-D, it is promoted to a matrix by prepending\n // a 1 to its dimensions. After matrix multiplication the prepended 1 is\n // removed.\n const a = (dimsA.length === 1) ? [1, dimsA[0]] : dimsA;\n\n // If the second argument is 1-D, it is promoted to a matrix by appending\n // a 1 to its dimensions. After matrix multiplication the appended 1 is\n // removed.\n const b = (dimsB.length === 1) ? [dimsB[0], 1] : dimsB;\n\n return [a, b];\n }\n\n /**\n * Fix the output shape computed for MatMul operation if it needs fixing\n * @param outputShape The computed outputShape. Should be an array (atleast of length 2) of positive integers.\n * This will be mutated.\n * @param aRank The rank of tensor A.\n * @param bRank The rank of tensor B.\n */\n static postprocessOutputShape(outputShape: number[], aRank: number, bRank: number) {\n // Remove prepended dimension if first input is 1d\n if (aRank === 1) {\n // outputShape = outputShape.slice(0, outputShape.length - 2).concat(outputShape.slice(outputShape.length - 1));\n outputShape.splice(outputShape.length - 2, 1);\n }\n // Remove appended dimension if second input is 1d\n if (bRank === 1) {\n outputShape.pop();\n }\n }\n\n /**\n * Calculate the expected shape when matrix multiplication\n * @param a The shape of tensor A. Should be a tuple of 2 positive integers\n * @param b The shape of tensor B. Should be a tuple of 2 positive integers\n * @returns The expected shape of the result, or undefined if N/A\n */\n static calcMatMulShape(a: [number, number], b: [number, number]): [number, number]|undefined {\n return (a[1] !== b[0]) ? undefined : [a[0], b[1]];\n }\n}\n\nexport class BroadcastUtil {\n /**\n * Calculate the expected shape when broadcasting 2 tensors\n * @param a The shape of tensor A. Should be an array of positive integers\n * @param b The shape of tensor B. Should be an array of positive integers\n * @param isMatMul Whether the operation is MatMul\n * @returns The expected shape of the result, or undefined if N/A\n */\n static calcShape(adims: readonly number[], bdims: readonly number[], isMatMul = false): readonly number[]|undefined {\n const arank = adims.length;\n const brank = bdims.length;\n if (arank === 0) {\n return bdims;\n }\n if (brank === 0) {\n return adims;\n }\n const crank = Math.max(adims.length, bdims.length);\n const cdims = new Array(crank);\n\n // calculate the last 2 dimension if it is MatMul\n if (isMatMul) {\n if (arank < 2 || brank < 2) {\n return undefined;\n }\n const cShapeMatMul =\n MatMulUtil.calcMatMulShape([adims[arank - 2], adims[arank - 1]], [bdims[brank - 2], bdims[brank - 1]]);\n if (cShapeMatMul === undefined) {\n return undefined;\n }\n [cdims[crank - 2], cdims[crank - 1]] = cShapeMatMul;\n }\n\n for (let i = isMatMul ? 3 : 1; i <= crank; i++) {\n const aLen = arank - i < 0 ? 1 : adims[arank - i];\n const bLen = brank - i < 0 ? 1 : bdims[brank - i];\n\n if (aLen !== bLen && aLen > 1 && bLen > 1) {\n return undefined;\n }\n cdims[crank - i] = Math.max(aLen, bLen);\n }\n\n return cdims;\n }\n\n /**\n * Given the indices of a broadcasted tensor, calculate the original indices\n * @param broadcastedIndices The given indices of the broadcasted tensor.\n * @param originalShape The original shape of the tensor before broadcas\n * @returns The calculated indices that maps to the original tensor.\n */\n static index(broadcastedIndices: readonly number[], originalShape: readonly number[]): number[] {\n // NOTE 1: we assume the parameter broadcastedIndices is valid. ie. it should have the same\n // length as the broadcasted shape, and for each dimension the index should\n // not be out of range.\n const originalIndices = new Array(originalShape.length);\n BroadcastUtil.fillIndex(broadcastedIndices, originalShape, originalIndices);\n return originalIndices;\n }\n\n /**\n * Given the indices of a broadcasted tensor, calculate the original indices\n * @param broadcastedIndices The given indices of the broadcasted tensor.\n * @param originalShape The original shape of the tensor before broadcast\n * @param originalIndices The mapping of broadcastedIndices to the originalIndices (output parameter - will be\n * mutated).\n */\n static fillIndex(broadcastedIndices: readonly number[], originalShape: readonly number[], originalIndices: number[]) {\n // NOTE 1: we assume the parameter broadcastedIndices is valid. ie. it should have the same length as the\n // broadcasted shape, and for each dimension the index should not be out of range.\n // NOTE 2: we assume the parameter originalIndices has the same length as the originalShape\n const dimOffset = broadcastedIndices.length - originalShape.length;\n for (let i = 0; i < originalShape.length; i++) {\n originalIndices[i] = broadcastedIndices[dimOffset + i] % originalShape[i];\n }\n }\n\n /**\n * Perform the broadcasting operation on the specific operator\n * @param a The input tensor A\n * @param b The input tensor B\n * @param op The operator lambda function\n * @param inplace Whether to write the result back to A.\n * @returns The result tensor, or undefined if input not broadcastable.\n */\n static calc(\n a: Tensor, b: Tensor, op: (a: string|number, b: string|number) => (string | number), inplace: boolean,\n resultType?: Tensor.DataType): Tensor|undefined {\n const outputShape = BroadcastUtil.calcShape(a.dims, b.dims);\n\n if (outputShape) {\n if (inplace && !ShapeUtil.areEqual(outputShape, a.dims)) {\n // B is not broadcastable to A, failed to calculate inplace.\n return undefined;\n }\n\n const size = ShapeUtil.size(outputShape);\n const c = inplace ? a : new Tensor(outputShape, resultType || a.type);\n\n // both inputs are scalars\n if (outputShape.length === 0) {\n c.set([], op(a.get([]) as number, b.get([]) as number));\n }\n\n // atleast one input is a non-scalar\n else {\n const outputIndices = new Array(outputShape.length);\n const originalIndicesA = new Array(a.dims.length);\n const originalIndicesB = new Array(b.dims.length);\n let valA: string|number = 0;\n let valB: string|number = 0;\n let isAScalar = false;\n let isBScalar = false;\n if (a.dims.length === 0) {\n valA = a.get([]) as number;\n isAScalar = true;\n }\n if (b.dims.length === 0) {\n valB = b.get([]) as number;\n isBScalar = true;\n }\n let rest: number;\n for (let i = 0; i < size; i++) {\n // traversal indices\n rest = i;\n for (let j = outputShape.length - 1; j >= 0; j--) {\n outputIndices[j] = rest % outputShape[j];\n rest = Math.floor(rest / outputShape[j]);\n }\n\n if (!isAScalar) {\n // map outputIndices (which is actually broadcasted) to the originalIndices\n BroadcastUtil.fillIndex(outputIndices, a.dims, originalIndicesA);\n valA = a.get(originalIndicesA) as number;\n }\n if (!isBScalar) {\n BroadcastUtil.fillIndex(outputIndices, b.dims, originalIndicesB);\n valB = b.get(originalIndicesB) as number;\n }\n\n c.set(outputIndices, op(valA, valB));\n }\n }\n\n return c;\n }\n\n return undefined;\n }\n\n /**\n * Determine if a shape is unidirectional broadcastable to another shape\n * @param shape The input shape\n * @param finalShape The desired shape after broadcasting\n */\n static isValidBroadcast(shape: readonly number[], finalShape: readonly number[]): boolean {\n // align shape to the right\n const inputRank = shape.length;\n const finalRank = finalShape.length;\n if (inputRank > finalRank) {\n return false;\n }\n for (let i = 1; i <= inputRank; i++) {\n if (shape[inputRank - i] !== 1 && shape[inputRank - i] !== finalShape[finalRank - i]) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Determine the broadcasted dims in input shape based on the given output shape.\n * Note that this function only returns the broadcasted dims.\n * @param inputShape The input shape\n * @param outputShape The output shape\n * @returns The broadcasted dims in input shape.\n */\n static getBroadcastDims(inputShape: readonly number[], outputShape: readonly number[]): number[] {\n const inRank = inputShape.length;\n const dims: number[] = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inputShape[dim] || 1;\n const b = outputShape[outputShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n }\n}\n\n// copy array helper\n// mimics memcpy as much as possible\nexport function arrayCopyHelper(\n target: number[]|Tensor.NumberType, source: number[]|Tensor.NumberType, targetIndex: number, sourceIndex: number,\n blockSize: number) {\n if (sourceIndex < 0 || sourceIndex >= source.length) {\n throw new Error('sourceIndex out of bounds');\n }\n if (targetIndex < 0 || targetIndex >= target.length) {\n throw new Error('targetIndex out of bounds');\n }\n if (sourceIndex + blockSize > source.length) {\n throw new Error('source indices to be copied are outside bounds');\n }\n if (targetIndex + blockSize > target.length) {\n throw new Error('target array is too small to hold result');\n }\n\n for (let offset = 0; offset < blockSize; offset++) {\n target[targetIndex + offset] = source[sourceIndex + offset];\n }\n}\n\nexport class GemmUtil {\n // will make sure input shapes are compatible for this op\n // and return back the shape of the output in the form of a tuple\n // will throw exception if the input shapes are not compatible\n static getShapeOfGemmResult(\n leftShape: readonly number[], transLeft: boolean, rightShape: readonly number[], transRight: boolean,\n biasShape?: readonly number[]): readonly number[] {\n if (leftShape.length !== 2 || rightShape.length !== 2) {\n throw new Error('shape need to be of size 2');\n }\n\n let M: number;\n let K: number;\n let N: number;\n\n if (transLeft) {\n M = leftShape[1];\n K = leftShape[0];\n } else {\n M = leftShape[0];\n K = leftShape[1];\n }\n\n let kDim = -1;\n\n if (transRight) {\n N = rightShape[0];\n kDim = 1;\n } else {\n N = rightShape[1];\n kDim = 0;\n }\n\n if (rightShape[kDim] !== K) {\n throw new Error('dimension mismatch');\n }\n\n if (M <= 0 || N <= 0 || K <= 0) {\n throw new Error('invalid shape specified');\n }\n\n if (biasShape && !BroadcastUtil.isValidBroadcast(biasShape, [M, N])) {\n throw new Error('gemm: invalid bias shape for broadcast');\n }\n\n return [M, N, K];\n }\n}\n\nexport class ProtoUtil {\n static tensorDataTypeFromProto(typeProto: onnx.TensorProto.DataType|\n onnxruntime.experimental.fbs.TensorDataType): Tensor.DataType {\n switch (typeProto) {\n case onnx.TensorProto.DataType.INT8:\n return 'int8';\n case onnx.TensorProto.DataType.UINT8:\n return 'uint8';\n case onnx.TensorProto.DataType.BOOL:\n return 'bool';\n case onnx.TensorProto.DataType.INT16:\n return 'int16';\n case onnx.TensorProto.DataType.UINT16:\n return 'uint16';\n case onnx.TensorProto.DataType.INT32:\n return 'int32';\n case onnx.TensorProto.DataType.UINT32:\n return 'uint32';\n case onnx.TensorProto.DataType.FLOAT:\n return 'float32';\n case onnx.TensorProto.DataType.DOUBLE:\n return 'float64';\n case onnx.TensorProto.DataType.STRING:\n return 'string';\n\n // For INT64/UINT64, reduce their value to 32-bits.\n // Should throw exception when overflow\n case onnx.TensorProto.DataType.INT64:\n return 'int32';\n case onnx.TensorProto.DataType.UINT64:\n return 'uint32';\n\n default:\n throw new Error(`unsupported data type: ${onnx.TensorProto.DataType[typeProto]}`);\n }\n }\n\n static tensorDataTypeStringToEnum(type: string): onnx.TensorProto.DataType {\n switch (type) {\n case 'int8':\n return onnx.TensorProto.DataType.INT8;\n case 'uint8':\n return onnx.TensorProto.DataType.UINT8;\n case 'bool':\n return onnx.TensorProto.DataType.BOOL;\n case 'int16':\n return onnx.TensorProto.DataType.INT16;\n case 'uint16':\n return onnx.TensorProto.DataType.UINT16;\n case 'int32':\n return onnx.TensorProto.DataType.INT32;\n case 'uint32':\n return onnx.TensorProto.DataType.UINT32;\n case 'float32':\n return onnx.TensorProto.DataType.FLOAT;\n case 'float64':\n return onnx.TensorProto.DataType.DOUBLE;\n case 'string':\n return onnx.TensorProto.DataType.STRING;\n case 'int64':\n return onnx.TensorProto.DataType.INT64;\n case 'uint64':\n return onnx.TensorProto.DataType.UINT64;\n\n default:\n throw new Error(`unsupported data type: ${type}`);\n }\n }\n\n static tensorDimsFromProto(dims: Array): number[] {\n // get rid of Long type for dims\n return dims.map(d => Long.isLong(d) ? d.toNumber() : d);\n }\n\n static tensorValueTypeFromProto(valueType: onnx.TypeProto.ITensor): Graph.ValueType {\n return {\n tensorType: ProtoUtil.tensorDataTypeFromProto(valueType.elemType!),\n shape: {dims: ProtoUtil.tensorDimsFromProto(valueType.shape!.dim!.map(d => d.dimValue!))}\n };\n }\n\n static tensorDimsFromORTFormat(tensor: onnxruntime.experimental.fbs.Tensor) {\n const dims = [];\n for (let i = 0; i < tensor.dimsLength(); i++) {\n dims.push(LongUtil.longToNumber(tensor.dims(i)!));\n }\n return dims;\n }\n\n static tensorAttributesFromORTFormat(node: onnxruntime.experimental.fbs.Node) {\n const attributes = [];\n for (let i = 0; i < node.attributesLength(); i++) {\n attributes.push(node.attributes(i)!);\n }\n return attributes;\n }\n}\n\nexport class LongUtil {\n // This function is called to get a number from long type of data for attribute, dim, and ir version,\n // which values are signed integers.\n // To make it more generic, add an optional paramter to convert to a unsigned number.\n static longToNumber(n: Long|flatbuffers.Long|number, unsigned?: boolean) {\n if (Long.isLong(n)) {\n return n.toNumber();\n } else if (n instanceof flatbuffers.Long) {\n return Long.fromValue({low: n.low, high: n.high, unsigned: unsigned ?? false}).toNumber();\n }\n return n;\n }\n static isLong(n: unknown) {\n return Long.isLong(n) || n instanceof flatbuffers.Long;\n }\n}\n\nexport class ShapeUtil {\n static size(dims: readonly number[]): number {\n return ShapeUtil.getSizeFromDimensionRange(dims, 0, dims.length);\n }\n\n // `axis` inclusive\n static sizeFromDimension(dims: readonly number[], axis: number): number {\n if (axis < 0 || axis > dims.length) {\n throw new Error(`invalid dimension of ${axis} for sizeFromDimension as Tensor has ${dims.length} dimensions.`);\n }\n return ShapeUtil.getSizeFromDimensionRange(dims, axis, dims.length);\n }\n\n // `axis` exclusive\n static sizeToDimension(dims: readonly number[], axis: number): number {\n if (axis < 0 || axis > dims.length) {\n throw new Error(`invalid dimension of ${axis} for sizeToDimension as Tensor has ${dims.length} dimensions.`);\n }\n return ShapeUtil.getSizeFromDimensionRange(dims, 0, axis);\n }\n\n static getSizeFromDimensionRange(dims: readonly number[], start: number, end: number): number {\n let size = 1;\n for (let i = start; i < end; i++) {\n // safety check as this method is called by multiple other methods requiring size.\n // size cannot be 0 or negative.\n if (dims[i] <= 0) {\n throw new Error(\n // eslint-disable-next-line max-len\n 'cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.');\n }\n size *= dims[i];\n }\n return size;\n }\n\n static computeStrides(dims: readonly number[]): readonly number[] {\n const rank = dims.length;\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [1];\n }\n const strides = new Array(rank);\n strides[rank - 1] = 1;\n strides[rank - 2] = dims[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * dims[i + 1];\n }\n return strides;\n }\n\n static transpose(dims: readonly number[]): readonly number[] {\n const copy = dims.slice();\n return copy.reverse();\n }\n\n static indicesToOffset(indices: readonly number[], strides: readonly number[], axis?: number): number {\n if (axis === undefined) {\n axis = indices.length;\n }\n let offset = 0;\n for (let i = 0; i < axis; ++i) {\n offset += strides[i] * indices[i];\n }\n return offset;\n }\n\n static offsetToIndices(offset: number, strides: readonly number[]): readonly number[] {\n const rank = strides.length;\n if (rank === 0) {\n return [];\n } else if (rank === 1) {\n return [offset * strides[0]];\n }\n const indices: number[] = new Array(strides.length);\n for (let i = 0; i < indices.length - 1; ++i) {\n indices[i] = Math.floor(offset / strides[i]);\n offset -= indices[i] * strides[i];\n }\n indices[indices.length - 1] = offset;\n return indices;\n }\n\n /**\n * normailze axis of range [-r, r) into [0, r).\n */\n static normalizeAxis(axis: number, tensorRank: number): number {\n if (axis < -tensorRank && axis >= tensorRank) {\n throw new Error('unsupported axis for this operation.');\n }\n return axis < 0 ? axis + tensorRank : axis;\n }\n\n static normalizeAxes(axes: readonly number[], tensorRank: number): number[] {\n return axes.map(x => this.normalizeAxis(x, tensorRank));\n }\n\n // Increment an index into a tensor (in lexicographic\n // ordering), wrapping around the specified upper_bound.\n /**\n * Increment an index into a tensor (in lexicographic ordering), wrapping around the specified upper_bound.\n * @param index Given index to increment (Will be mutated)\n * @param dims The dimensions of the tensor for which the given index corresponds to\n * @param axisToIncrementOn The 1-indexed axis to increment on. If undefined, axisToIncrementOn == rank\n */\n static incrementIndex(index: number[], dims: readonly number[], axisToIncrementOn?: number) {\n if (dims.length === 0 || index.length === 0) {\n throw new Error('Index incrementing unsupported for scalar Tensor');\n }\n if (axisToIncrementOn === undefined) {\n axisToIncrementOn = dims.length;\n } else {\n if (axisToIncrementOn <= 0 || axisToIncrementOn > dims.length) {\n throw new Error('Incorrect axis to increment on');\n }\n }\n\n for (let k = axisToIncrementOn - 1; k >= 0; --k) {\n index[k]++;\n if (index[k] < dims[k]) {\n break;\n }\n index[k] = 0;\n }\n }\n\n /**\n * Produces a new dimensions array based on the values in the 'originalDimensions' and 'shape' array\n * Used in Reshape\n * @param originalDims Original Shape array\n * @param shapeHints array containing values to compute the new dimensions\n * For example:\n * originalDims = [2,2] and shapeHints = [0,-1] will return [2,2]\n * originalDims = [2,2] and shapeHints = [4] will return [4]\n * originalDims = [2,2] and shapeHints = [5] will throw an exception\n * https://github.com/onnx/onnx/blob/main/docs/Operators.md#Reshape\n */\n\n static calculateReshapedDims(originalDims: readonly number[], shapeHints: ArrayLike): number[] {\n // reshape to a Scalar Tensor\n if (shapeHints.length === 0) {\n if (originalDims.length === 0 || ShapeUtil.size(originalDims) === 1) {\n return [];\n } else {\n throw new Error('cannot reshape to a scalar Tensor');\n }\n }\n\n const nDims = shapeHints.length;\n const reshapedDims = new Array(nDims);\n let unknownDimension = -1;\n let newTensorSize = 1;\n for (let i = 0; i < nDims; i++) {\n if (shapeHints[i] < -1) {\n throw new Error('a dimension in shape hints cannot be less than -1');\n }\n if (shapeHints[i] === -1) {\n if (unknownDimension !== -1) {\n throw new Error('at most one dimension in shape hints can be -1');\n }\n unknownDimension = i;\n } else {\n if (shapeHints[i] === 0) {\n if (i >= originalDims.length) {\n throw new Error('the dimension with value zero exceeds the dimension size of the input tensor');\n }\n reshapedDims[i] = originalDims[i];\n } else {\n reshapedDims[i] = shapeHints[i];\n }\n newTensorSize *= reshapedDims[i];\n }\n }\n\n const oldTensorSize = ShapeUtil.size(originalDims);\n if (unknownDimension !== -1) {\n if (oldTensorSize % newTensorSize !== 0) {\n throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${\n originalDims}] Output shape: [${shapeHints}]`);\n }\n reshapedDims[unknownDimension] = oldTensorSize / newTensorSize;\n }\n // validate sizes from originalDims and reshapedDims match\n else {\n if (newTensorSize !== oldTensorSize) {\n throw new Error('reshapedDims and originalDims don\\'t have matching sizes');\n }\n }\n return reshapedDims;\n }\n\n /**\n * Sorts a given array based on the indices in the Perm array\n * Used in Transpose\n * @param a Array to be sorted such as dims or strides\n * @param perm Perm given; if null a will be reversed\n */\n static sortBasedOnPerm(a: readonly number[], perm?: readonly number[]): readonly number[] {\n if (perm) {\n return perm.map((v) => a[v]);\n } else {\n return a.slice().reverse();\n }\n }\n\n /**\n * Pads a given shape according to the padding values\n * @param dims shape of the Tensor to be padded\n * @param pad pad values\n */\n static padShape(dims: readonly number[], pad: readonly number[]): readonly number[] {\n const rank = dims.length;\n return dims.map((v, i) => v + pad[i] + pad[i + rank]);\n }\n\n /**\n * Determines if the two shapes are identical\n * @param shape1\n * @param shape2\n */\n static areEqual(shape1: readonly number[], shape2: readonly number[]): boolean {\n if (shape1.length !== shape2.length) {\n return false;\n }\n return shape1.every((v, i) => v === shape2[i]);\n }\n\n /**\n * Validates if the given `dims` or `shape` is valid in ONNX.js context and returns data size\n * @param dims - input `dims` that needs to be checked\n */\n static validateDimsAndCalcSize(dims: readonly number[]): number {\n if (dims.length > 6) {\n throw new TypeError('Only rank 0 to 6 is supported for tensor shape.');\n }\n let size = 1;\n for (const n of dims) {\n if (!Number.isInteger(n)) {\n throw new TypeError(`Invalid shape: ${n} is not an integer`);\n }\n if (n < 0 || n > 2147483647) {\n throw new TypeError(`Invalid shape: length ${n} is not allowed`);\n }\n size *= n;\n }\n return size;\n }\n\n /**\n * Determines the shape of output tensor y = flatten(x, axis)\n * @param dims - shape of input tensor\n * @param axis - flatten axis, in the range [-r, r]\n */\n static flattenShape(dims: readonly number[], axis: number): readonly number[] {\n if (axis < 0) {\n axis += dims.length;\n }\n const total = dims.reduce((x, y) => x * y, 1);\n const right = dims.slice(axis).reduce((x, y) => x * y, 1);\n const outputDims = [total / right, right];\n\n return outputDims;\n }\n\n /**\n * Determines the shape of output tensor y = squeeze(x, axes)\n * @param dims - shape of input tensor\n * @param axes - squeeze axes\n */\n static squeezeShape(dims: readonly number[], axes: readonly number[]): readonly number[] {\n const outputDims = new Array();\n\n // sanity check\n axes = ShapeUtil.normalizeAxes(axes, dims.length);\n\n for (let i = 0; i < dims.length; i++) {\n const inSqueezeList = axes.indexOf(i) >= 0;\n if (inSqueezeList && dims[i] !== 1) {\n throw new Error('squeeze an axis of size different than 1');\n }\n\n if ((axes.length === 0 && dims[i] > 1) || (axes.length > 0 && !inSqueezeList)) {\n outputDims.push(dims[i]);\n }\n }\n\n return outputDims;\n }\n\n /**\n * Determines the shape of output tensor y = unsqueeze(x, axes)\n * @param dims - shape of input tensor\n * @param axes - unsqueeze axes\n */\n static unsqueezeShape(dims: readonly number[], axes: readonly number[]): readonly number[] {\n const outputDims = new Array(dims.length + axes.length);\n\n // initialize the array elements to 0\n outputDims.fill(0);\n\n // set all axes indices to 1 in outputDims and check for duplicates\n for (let i = 0; i < axes.length; i++) {\n const axis = ShapeUtil.normalizeAxis(axes[i], outputDims.length);\n if (axis >= outputDims.length) {\n throw new Error('\\'axes\\' has an out of range axis');\n }\n if (outputDims[axis] !== 0) {\n throw new Error('\\'axes\\' has a duplicate axis');\n }\n\n outputDims[axis] = 1;\n }\n\n // fill in the zero entries of outputDims with the input tensor's shape\n let inputDimsIterator = 0;\n for (let i = 0; i < outputDims.length; i++) {\n if (outputDims[i] === 0) {\n outputDims[i] = dims[inputDimsIterator++];\n }\n }\n\n // sanity check assertion. 'inputDimsIterator'\n // should be equal to the length of 'dims'\n if (inputDimsIterator !== dims.length) {\n throw new Error('the unsqueezed dimension could not be established');\n }\n\n return outputDims;\n }\n}\n\n// bunch of helper methods that do a variety of math operations\nexport class MathUtil {\n // y = (x*x) + y\n static sqr(\n target: number[]|Tensor.NumberType, source: number[]|Tensor.NumberType, targetIndex: number, sourceIndex: number,\n blockSize: number) {\n if (sourceIndex < 0 || sourceIndex >= source.length) {\n throw new Error('sourceIndex out of bounds');\n }\n if (targetIndex < 0 || targetIndex >= target.length) {\n throw new Error('targetIndex out of bounds');\n }\n if (sourceIndex + blockSize > source.length) {\n throw new Error('source indices to be copied are outside bounds');\n }\n if (targetIndex + blockSize > target.length) {\n throw new Error('target array is too small to hold result');\n }\n\n for (let offset = 0; offset < blockSize; offset++) {\n target[targetIndex + offset] += Math.pow(source[sourceIndex + offset], 2);\n }\n }\n\n // y = ax + y\n static axpy(\n target: number[]|Tensor.NumberType, source: number[]|Tensor.NumberType, targetIndex: number, sourceIndex: number,\n blockSize: number, alpha: number) {\n if (sourceIndex < 0 || sourceIndex >= source.length) {\n throw new Error('sourceIndex out of bounds');\n }\n if (targetIndex < 0 || targetIndex >= target.length) {\n throw new Error('targetIndex out of bounds');\n }\n if (sourceIndex + blockSize > source.length) {\n throw new Error('source indices to be copied are outside bounds');\n }\n if (targetIndex + blockSize > target.length) {\n throw new Error('target array is too small to hold result');\n }\n\n for (let offset = 0; offset < blockSize; offset++) {\n target[targetIndex + offset] += (alpha * source[sourceIndex + offset]);\n }\n }\n\n // y = pow(x, b)\n static powx(\n target: number[]|Tensor.NumberType, source: number[]|Tensor.NumberType, targetIndex: number, sourceIndex: number,\n blockSize: number, b: number) {\n if (sourceIndex < 0 || sourceIndex >= source.length) {\n throw new Error('sourceIndex out of bounds');\n }\n if (targetIndex < 0 || targetIndex >= target.length) {\n throw new Error('targetIndex out of bounds');\n }\n if (sourceIndex + blockSize > source.length) {\n throw new Error('source indices to be copied are outside bounds');\n }\n if (targetIndex + blockSize > target.length) {\n throw new Error('target array is too small to hold result');\n }\n\n for (let offset = 0; offset < blockSize; offset++) {\n target[targetIndex + offset] = Math.pow(source[sourceIndex + offset], b);\n }\n }\n\n // y = x * y\n static mul(\n target: number[]|Tensor.NumberType, source: number[]|Tensor.NumberType, targetIndex: number, sourceIndex: number,\n blockSize: number) {\n if (sourceIndex < 0 || sourceIndex >= source.length) {\n throw new Error('sourceIndex out of bounds');\n }\n if (targetIndex < 0 || targetIndex >= target.length) {\n throw new Error('targetIndex out of bounds');\n }\n if (sourceIndex + blockSize > source.length) {\n throw new Error('source indices to be copied are outside bounds');\n }\n if (targetIndex + blockSize > target.length) {\n throw new Error('target array is too small to hold result');\n }\n\n for (let offset = 0; offset < blockSize; offset++) {\n target[targetIndex + offset] = (source[sourceIndex + offset] * target[targetIndex + offset]);\n }\n }\n}\n\nexport class SplitUtil {\n /**\n * Calculates new Shapes from existing one and the splits given along the axis provides\n * @param dims Shape of the Tensor to be splitted into two or more Shapes\n * @param axis The dimension along which the Tensor will be split\n * @param splits Offsets for the start of each split\n */\n static splitShape(dims: readonly number[], axis: number, split: number[], numOutputs?: number):\n [number[][], number[]] {\n if (split.length === 0) {\n if (!numOutputs) {\n throw new Error('need to know number of outputs when the \\'split\\' attribute is not specified');\n }\n SplitUtil.determineSplit(dims[axis], numOutputs, split);\n }\n\n const shapes: number[][] = [];\n const offsets = [0];\n for (let i = 0; i < split.length; ++i) {\n if (i !== 0) {\n offsets.push(offsets[i - 1] + split[i - 1]);\n }\n const shape = dims.slice();\n shape[axis] = split[i];\n shapes.push(shape);\n }\n return [shapes, offsets];\n }\n\n static determineSplit(numElementsAlongAxis: number, numOutputs: number, split: number[]) {\n // If 'split' is not specified by the user, we need to partition the number of elements equally among the outputs\n if (numElementsAlongAxis % numOutputs !== 0) {\n throw new Error('cannot split tensor to equal sized parts');\n }\n for (let i = 0; i < numOutputs; ++i) {\n split.push(numElementsAlongAxis / numOutputs);\n }\n }\n}\n\nexport class ReduceUtil {\n /**\n * Perform reduce operations on the specific operator\n * @param a Input tensor data\n * @param axes The dimensions along which the Tensor will be reduced\n * @param keepdims If set to true, the axes which are reduced are left in the\n * result as dimensions with size one.\n * @param op1 The operation to be performed on each element in the tensor\n * @param op2 The operation to be performed between elements in the tensor\n */\n static calcReduce(\n a: Tensor, axes: number[], keepdims: boolean, op1: (b: number) => number,\n op2: (a: number, b: number) => number): Tensor {\n const dims = a.dims.slice(0);\n // if axes is not set, perform reduce on all axes\n if (axes.length === 0) {\n dims.forEach((_d, ind) => axes.push(ind));\n }\n // get a temporary broadcastable output shape\n const outputDims = ReduceUtil.calcReduceShape(dims, axes, true);\n\n // loop through the output and calculate result one by one\n const size = ShapeUtil.size(outputDims);\n const y = new Tensor(outputDims, a.type);\n const strides = ShapeUtil.computeStrides(outputDims);\n const inputStrides = ShapeUtil.computeStrides(dims);\n const indicesY = new Array(dims.length);\n for (let i = 0; i < size; i++) {\n const indices = ShapeUtil.offsetToIndices(i, strides);\n // map index\n BroadcastUtil.fillIndex(indices, dims, indicesY);\n y.set(\n indices,\n ReduceUtil.calcReduceByAxis(\n a.numberData, axes, dims, 0, ShapeUtil.indicesToOffset(indicesY, inputStrides), op1, op2));\n }\n\n if (keepdims) {\n return y;\n } else {\n // keepdims == 0, calculate the expected shape\n return new Tensor(\n ReduceUtil.calcReduceShape(dims, axes, keepdims), y.type, undefined, undefined, y.data, y.dataId);\n }\n }\n\n /**\n * Perform reduce operations on the specific operator on specific axes\n * @param a Input tensor data\n * @param axes The dimensions along which the Tensor will be reduced\n * @param dims The input dimension.\n * @param curAxisInd Index in axes specifying the current dimension along\n * which the tensor will be reduced\n * @param pos The current index of element to perform operation\n * @param op1 The operation to be performed on each element in the tensor\n * @param op2 The operation to be performed between elements in the tensor\n */\n static calcReduceByAxis(\n input: Tensor.NumberType, axes: number[], dims: number[], curAxisInd: number, pos: number,\n op1: (b: number) => number, op2: (a: number, b: number) => number): number {\n let res = 0;\n if (curAxisInd >= axes.length) {\n return op1(input[pos]);\n }\n const axis = axes[curAxisInd];\n const step = axis >= dims.length ? 1 : ShapeUtil.size(dims.slice(axis + 1));\n for (let i = 0; i < dims[axis]; i++) {\n res = i === 0 ? ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2) :\n op2(res, ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2));\n pos += step;\n }\n return res;\n }\n\n /**\n * Calculate the expected shape of a reduce operation\n * @param dims The input tensor dimension\n * @param axes The dimensions along which the Tensor will be reduced\n * @param keepdims If set to true, the axes which are reduced are left in the\n * result as dimensions with size one.\n */\n static calcReduceShape(dims: readonly number[], axes: readonly number[], keepDims: boolean): number[] {\n const outputDims = dims.slice();\n for (let i = 0; i < axes.length; i++) {\n if (keepDims) {\n outputDims[axes[i]] = 1;\n } else {\n outputDims[axes[i]] = 0;\n }\n }\n return outputDims.filter(dim => dim !== 0);\n }\n}\n\nexport class PoolConvUtil {\n /**\n * Adjust the kernel, strides, pads to correct rank. Set to default value if not present\n * @param isGlobalOperator If true, perform global pooling.\n * @param inputDims The input tensor dimension.\n * @param kernelShape The size of the kernel along each axis.\n * @param strides Stride along each axis.\n * @param dilations Dilation along each axis.\n * @param pads Padding for the beginning and ending along each axis.\n */\n static adjustPoolAttributes(\n isGlobalOperator: boolean, inputDims: readonly number[], kernelShape: number[], strides: number[],\n dilations: number[], pads: number[]) {\n if (!isGlobalOperator && kernelShape.length !== inputDims.length - 2) {\n throw new Error('length of specified kernel shapes should be 2 less than length of input dimensions');\n }\n\n if (isGlobalOperator) {\n // adjust kernel shape to cover the input dims\n for (let dim = 0; dim < inputDims.length - 2; dim++) {\n if (dim >= kernelShape.length) {\n kernelShape.push(inputDims[dim + 2]);\n } else {\n kernelShape[dim] = inputDims[dim + 2];\n }\n }\n }\n\n // adjust strides length to match kernel shape length\n for (let dim = 0; dim < kernelShape.length; dim++) {\n if (dim < strides.length) {\n if (strides[dim] < 0) {\n throw new Error('strides should be greater than or equal to 1');\n }\n } else {\n strides.push(1);\n }\n }\n\n // adjust dilation value\n for (let dim = 0; dim < kernelShape.length; dim++) {\n if (dim < dilations.length) {\n if (dilations[dim] < 0) {\n throw new Error('dilations should be greater than or equal to 1');\n }\n } else {\n dilations.push(1);\n }\n }\n\n // adjust pads length to match 2 * kernel shape length\n for (let dim = 0; dim < kernelShape.length * 2; dim++) {\n if (dim < pads.length) {\n if (pads[dim] < 0) {\n throw new Error('pad should be greater than or equal to 1');\n }\n } else {\n pads.push(0);\n }\n }\n\n // sanity checks for values in kernel shapes and pads\n for (let dim = 0; dim < kernelShape.length; dim++) {\n if (kernelShape[dim] <= 0) {\n throw new Error('kernel shapes need to be greater than 0');\n }\n\n if (pads[dim] >= kernelShape[dim] || pads[dim + kernelShape.length] >= kernelShape[dim]) {\n throw new Error('pads should be smaller than kernel');\n }\n }\n }\n\n // adjust pad values based on 'autoPad' attribute\n static adjustPadsBasedOnAutoPad(\n inputDims: readonly number[], strides: readonly number[], dilations: readonly number[],\n kernelShape: readonly number[], pads: number[], autoPad?: string) {\n if (!autoPad) {\n return;\n }\n\n if (pads.length !== 2 * (inputDims.length - 2)) {\n throw new Error('length of pads should be twice the length of data dimensions');\n }\n\n if (strides.length !== (inputDims.length - 2)) {\n throw new Error('length of strides should be the length of data dimensions');\n }\n\n if (kernelShape.length !== (inputDims.length - 2)) {\n throw new Error('length of kernel shapes should be the length of data dimensions');\n }\n\n for (let dim = 0; dim < inputDims.length - 2; dim++) {\n PoolConvUtil.adjustPadAndReturnShape(\n inputDims[dim + 2], strides[dim], dilations[dim], kernelShape[dim], pads, dim, dim + inputDims.length - 2,\n autoPad);\n }\n }\n\n /**\n * Calculate the output shape for Pool ops based on input attributes. (Should be used only for Pool ops)\n * @param isGlobalOperator If true, perform global pooling.\n * @param inputDims The input tensor dimension. (inputs[0].dims)\n * @param strides Stride along each axis.\n * @param dilations Dilation along each axis.\n * @param kernelShape The size of the kernel along each axis.\n * @param pads Padding for the beginning and ending along each axis.\n * @param autoPad DEPRECATED attribute supported for legacy models. Specifies how to implicitly calculate pads in each\n * dimension. Can take values NOTSET, SAME_UPPER, SAME_LOWER, or VALID.\n */\n static computePoolOutputShape(\n isGlobalOperator: boolean, inputDims: readonly number[], strides: number[], dilations: number[],\n kernelShape: number[], pads: number[], autoPad?: string): number[] {\n if (inputDims.length <= 0) {\n throw new Error('input shape must be of size greater than 0');\n }\n\n // Add batch size and number of channels of output\n const outputDims = [inputDims[0], inputDims[1]];\n\n PoolConvUtil.computeShapeHelper(\n isGlobalOperator, inputDims, outputDims, strides, dilations, kernelShape, pads, autoPad);\n return outputDims;\n }\n\n /**\n * Calculate the output shape for Conv op based on input attributes. (Should be used only for Conv op)\n * @param inputDims The input tensor dimension. (inputs[0].dims)\n * @param filterDims The filter tensor dimension. (inputs[1].dims)\n * @param strides Stride along each axis.\n * @param kernelShape The size of the kernel along each axis.\n * @param pads Padding for the beginning and ending along each axis.\n * @param autoPad DEPRECATED attribute supported for legacy models. Specifies how to implicitly calculate pads in each\n * dimension. Can take values NOTSET, SAME_UPPER, SAME_LOWER, or VALID.\n */\n static computeConvOutputShape(\n inputDims: readonly number[], filterDims: readonly number[], strides: number[], dilations: number[],\n kernelShape: number[], pads: number[], autoPad?: string): number[] {\n if (inputDims.length <= 0 || filterDims.length <= 0) {\n throw new Error('invalid input tensor dims or invalid filter tensor dims');\n }\n\n // Add batch size and number of channels of output\n const outputDims = [inputDims[0], filterDims[0]];\n\n PoolConvUtil.computeShapeHelper(false, inputDims, outputDims, strides, dilations, kernelShape, pads, autoPad);\n return outputDims;\n }\n\n // will compute output shapes for data dimensions ONLY (i.e.) no batch size and channels\n // called by computePoolOutputShape() and computeConvOutputShape()\n // adjust pads based on 'autoPad' attribute prior to shape computation\n private static computeShapeHelper(\n isGlobalOperator: boolean, inputDims: readonly number[], outputDims: number[], strides: readonly number[],\n dilations: readonly number[], kernelShape: readonly number[], pads: number[], autoPad?: string) {\n if (isGlobalOperator) {\n for (let dim = 0; dim < inputDims.length - 2; dim++) {\n outputDims.push(1);\n }\n } else {\n for (let dim = 0; dim < inputDims.length - 2; dim++) {\n outputDims.push(PoolConvUtil.adjustPadAndReturnShape(\n inputDims[dim + 2], strides[dim], dilations[dim], kernelShape[dim], pads, dim, dim + inputDims.length - 2,\n autoPad));\n }\n }\n }\n\n // helper for computeShapeHelper() and adjustPadsBasedOnAutoPad()\n // adjusts pad value for given 'autoPad' string and computes output shape along a particular dimension\n private static adjustPadAndReturnShape(\n inSize: number, stride: number, dilation: number, kernel: number, pads: number[], padHeadIndex: number,\n padTailIndex: number, autoPad?: string): number {\n const dkernel = dilation * (kernel - 1) + 1;\n if (autoPad && autoPad !== 'NOTSET') {\n switch (autoPad) {\n case 'VALID':\n pads[padHeadIndex] = 0;\n pads[padTailIndex] = 0;\n return Math.floor(((inSize - dkernel) / stride) + 1);\n case 'SAME_LOWER':\n case 'SAME_UPPER':\n if (dilation !== 1) {\n throw new Error('Dilation not supported for SAME_UPPER or SAME_LOWER');\n } else {\n const legacyTargetSize = (inSize + stride - 1) / stride;\n const padNeeded = (legacyTargetSize - 1) * stride + kernel - inSize;\n pads[padHeadIndex] =\n (autoPad === 'SAME_LOWER') ? Math.floor((padNeeded + 1) / 2) : Math.floor(padNeeded / 2);\n pads[padTailIndex] = padNeeded - pads[padHeadIndex];\n return Math.floor(((inSize + padNeeded - kernel) / stride) + 1);\n }\n default:\n throw new Error('Unsupported AutoPad type');\n }\n } else {\n return Math.floor(((inSize + pads[padHeadIndex] + pads[padTailIndex] - dkernel) / stride) + 1);\n }\n }\n}\n\nexport const MIN_CLIP = -3.4028234663852886e+38;\nexport const MAX_CLIP = 3.4028234663852886e+38;\n\nexport function decodeUtf8String(buffer: Uint8Array): string {\n return new TextDecoder().decode(buffer);\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Guid} from 'guid-typescript';\nimport Long from 'long';\n\nimport {onnxruntime} from './ort-schema/flatbuffers/ort-generated';\nimport {onnx} from './ort-schema/protobuf/onnx';\nimport {decodeUtf8String, ProtoUtil, ShapeUtil} from './util';\n\nimport ortFbs = onnxruntime.experimental.fbs;\n\nexport declare namespace Tensor {\n export interface DataTypeMap {\n bool: Uint8Array;\n float32: Float32Array;\n float64: Float64Array;\n string: string[];\n int8: Int8Array;\n uint8: Uint8Array;\n int16: Int16Array;\n uint16: Uint16Array;\n int32: Int32Array;\n uint32: Uint32Array;\n int64: BigInt64Array;\n }\n\n export type DataType = keyof DataTypeMap;\n\n export type StringType = Tensor.DataTypeMap['string'];\n export type BooleanType = Tensor.DataTypeMap['bool'];\n export type IntegerType = Tensor.DataTypeMap['int8']|Tensor.DataTypeMap['uint8']|Tensor.DataTypeMap['int16']|\n Tensor.DataTypeMap['uint16']|Tensor.DataTypeMap['int32']|Tensor.DataTypeMap['uint32'];\n export type FloatType = Tensor.DataTypeMap['float32']|Tensor.DataTypeMap['float64'];\n export type NumberType = BooleanType|IntegerType|FloatType;\n\n export type Id = Guid;\n}\n\ntype TensorData = Tensor.DataTypeMap[Tensor.DataType];\n\ntype DataProvider = (id: Tensor.Id) => TensorData;\ntype AsyncDataProvider = (id: Tensor.Id) => Promise;\n\nexport class Tensor {\n /**\n * get the underlying tensor data\n */\n get data(): TensorData {\n if (this.cache === undefined) {\n const data = this.dataProvider!(this.dataId);\n if (data.length !== this.size) {\n throw new Error('Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.');\n }\n this.cache = data;\n }\n return this.cache;\n }\n\n /**\n * get the underlying string tensor data. Should only use when type is STRING\n */\n get stringData() {\n if (this.type !== 'string') {\n throw new TypeError('data type is not string');\n }\n\n return this.data as Tensor.StringType;\n }\n\n /**\n * get the underlying integer tensor data. Should only use when type is one of the following: (UINT8, INT8, UINT16,\n * INT16, INT32, UINT32, BOOL)\n */\n get integerData() {\n switch (this.type) {\n case 'uint8':\n case 'int8':\n case 'uint16':\n case 'int16':\n case 'int32':\n case 'uint32':\n case 'bool':\n return this.data as Tensor.IntegerType;\n\n default:\n throw new TypeError('data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)');\n }\n }\n\n /**\n * get the underlying float tensor data. Should only use when type is one of the following: (FLOAT, DOUBLE)\n */\n get floatData() {\n switch (this.type) {\n case 'float32':\n case 'float64':\n return this.data as Tensor.FloatType;\n\n default:\n throw new TypeError('data type is not float (float32, float64)');\n }\n }\n\n /**\n * get the underlying number tensor data. Should only use when type is one of the following: (UINT8, INT8, UINT16,\n * INT16, INT32, UINT32, BOOL, FLOAT, DOUBLE)\n */\n get numberData() {\n if (this.type !== 'string') {\n return this.data as Tensor.NumberType;\n }\n throw new TypeError('type cannot be non-number (string)');\n }\n\n /**\n * get value of an element at the given indices\n */\n get(indices: readonly number[]): Tensor.DataTypeMap[Tensor.DataType][number] {\n return this.data[ShapeUtil.indicesToOffset(indices, this.strides)];\n }\n\n /**\n * set value of an element at the given indices\n */\n set(indices: readonly number[], value: Tensor.DataTypeMap[Tensor.DataType][number]) {\n this.data[ShapeUtil.indicesToOffset(indices, this.strides)] = value;\n }\n\n /**\n * get the underlying tensor data asynchronously\n */\n async getData(): Promise {\n if (this.cache === undefined) {\n this.cache = await this.asyncDataProvider!(this.dataId);\n }\n return this.cache;\n }\n\n /**\n * get the number of elements in the tensor\n */\n public readonly size: number;\n\n private _strides: readonly number[];\n /**\n * get the strides for each dimension\n */\n get strides(): readonly number[] {\n if (!this._strides) {\n this._strides = ShapeUtil.computeStrides(this.dims);\n }\n return this._strides;\n }\n\n constructor(\n /**\n * get the dimensions of the tensor\n */\n public readonly dims: readonly number[],\n /**\n * get the type of the tensor\n */\n public readonly type: Tensor.DataType, private dataProvider?: DataProvider,\n private asyncDataProvider?: AsyncDataProvider, private cache?: TensorData,\n /**\n * get the data ID that used to map to a tensor data\n */\n public readonly dataId: Guid = Guid.create()) {\n this.size = ShapeUtil.validateDimsAndCalcSize(dims);\n const size = this.size;\n const empty = (dataProvider === undefined && asyncDataProvider === undefined && cache === undefined);\n\n if (cache !== undefined) {\n if (cache.length !== size) {\n throw new RangeError('Input dims doesn\\'t match data length.');\n }\n }\n\n if (type === 'string') {\n if (cache !== undefined && (!Array.isArray(cache) || !cache.every(i => typeof i === 'string'))) {\n throw new TypeError('cache should be a string array');\n }\n\n if (empty) {\n this.cache = new Array(size);\n }\n } else {\n if (cache !== undefined) {\n const constructor = dataviewConstructor(type);\n if (!(cache instanceof constructor)) {\n throw new TypeError(`cache should be type ${constructor.name}`);\n }\n }\n\n if (empty) {\n const buf = new ArrayBuffer(size * sizeof(type));\n this.cache = createView(buf, type);\n }\n }\n }\n\n /**\n * Construct new Tensor from a ONNX Tensor object\n * @param tensorProto the ONNX Tensor\n */\n static fromProto(tensorProto: onnx.ITensorProto): Tensor {\n if (!tensorProto) {\n throw new Error('cannot construct Value from an empty tensor');\n }\n const type = ProtoUtil.tensorDataTypeFromProto(tensorProto.dataType!);\n const dims = ProtoUtil.tensorDimsFromProto(tensorProto.dims!);\n\n const value = new Tensor(dims, type);\n\n if (type === 'string') {\n // When it's STRING type, the value should always be stored in field\n // 'stringData'\n tensorProto.stringData!.forEach((str, i) => {\n value.data[i] = decodeUtf8String(str);\n });\n\n } else if (\n tensorProto.rawData && typeof tensorProto.rawData.byteLength === 'number' &&\n tensorProto.rawData.byteLength > 0) {\n // NOT considering segment for now (IMPORTANT)\n\n // populate value from rawData\n const dataDest = value.data;\n const dataSource =\n new DataView(tensorProto.rawData.buffer, tensorProto.rawData.byteOffset, tensorProto.rawData.byteLength);\n const elementSize = sizeofProto(tensorProto.dataType!);\n const length = tensorProto.rawData.byteLength / elementSize;\n\n if (tensorProto.rawData.byteLength % elementSize !== 0) {\n throw new Error('invalid buffer length');\n }\n if (dataDest.length !== length) {\n throw new Error('buffer length mismatch');\n }\n\n for (let i = 0; i < length; i++) {\n const n = readProto(dataSource, tensorProto.dataType!, i * elementSize);\n dataDest[i] = n;\n }\n } else {\n // populate value from array\n let array: Array;\n switch (tensorProto.dataType) {\n case onnx.TensorProto.DataType.FLOAT:\n array = tensorProto.floatData!;\n break;\n case onnx.TensorProto.DataType.INT32:\n case onnx.TensorProto.DataType.INT16:\n case onnx.TensorProto.DataType.UINT16:\n case onnx.TensorProto.DataType.INT8:\n case onnx.TensorProto.DataType.UINT8:\n case onnx.TensorProto.DataType.BOOL:\n array = tensorProto.int32Data!;\n break;\n case onnx.TensorProto.DataType.INT64:\n array = tensorProto.int64Data!;\n break;\n case onnx.TensorProto.DataType.DOUBLE:\n array = tensorProto.doubleData!;\n break;\n case onnx.TensorProto.DataType.UINT32:\n case onnx.TensorProto.DataType.UINT64:\n array = tensorProto.uint64Data!;\n break;\n default:\n // should never run here\n throw new Error('unspecific error');\n }\n\n if (array === null || array === undefined) {\n throw new Error('failed to populate data from a tensorproto value');\n }\n\n const data = value.data;\n if (data.length !== array.length) {\n throw new Error('array length mismatch');\n }\n\n for (let i = 0; i < array.length; i++) {\n const element = array[i];\n if (Long.isLong(element)) {\n data[i] = longToNumber(element, tensorProto.dataType);\n } else {\n data[i] = element;\n }\n }\n }\n\n return value;\n }\n\n /**\n * Construct new Tensor from raw data\n * @param data the raw data object. Should be a string array for 'string' tensor, and the corresponding typed array\n * for other types of tensor.\n * @param dims the dimensions of the tensor\n * @param type the type of the tensor\n */\n static fromData(data: Tensor.DataTypeMap[Tensor.DataType], dims: readonly number[], type: Tensor.DataType) {\n return new Tensor(dims, type, undefined, undefined, data);\n }\n\n static fromOrtTensor(ortTensor: ortFbs.Tensor) {\n if (!ortTensor) {\n throw new Error('cannot construct Value from an empty tensor');\n }\n const dims = ProtoUtil.tensorDimsFromORTFormat(ortTensor);\n const type = ProtoUtil.tensorDataTypeFromProto(ortTensor.dataType());\n\n const value = new Tensor(dims, type);\n\n if (type === 'string') {\n // When it's STRING type, the value should always be stored in field\n // 'stringData'\n for (let i = 0; i < ortTensor.stringDataLength(); i++) {\n value.data[i] = ortTensor.stringData(i);\n }\n\n } else if (\n ortTensor.rawDataArray() && typeof ortTensor.rawDataLength() === 'number' && ortTensor.rawDataLength() > 0) {\n // NOT considering segment for now (IMPORTANT)\n\n // populate value from rawData\n const dataDest = value.data;\n const dataSource = new DataView(\n ortTensor.rawDataArray()!.buffer, ortTensor.rawDataArray()!.byteOffset, ortTensor.rawDataLength());\n const elementSize = sizeofProto(ortTensor.dataType());\n const length = ortTensor.rawDataLength() / elementSize;\n\n if (ortTensor.rawDataLength() % elementSize !== 0) {\n throw new Error('invalid buffer length');\n }\n if (dataDest.length !== length) {\n throw new Error('buffer length mismatch');\n }\n\n for (let i = 0; i < length; i++) {\n const n = readProto(dataSource, ortTensor.dataType(), i * elementSize);\n dataDest[i] = n;\n }\n }\n return value;\n }\n}\n\nfunction sizeof(type: Tensor.DataType): number {\n switch (type) {\n case 'bool':\n case 'int8':\n case 'uint8':\n return 1;\n case 'int16':\n case 'uint16':\n return 2;\n case 'int32':\n case 'uint32':\n case 'float32':\n return 4;\n case 'float64':\n return 8;\n default:\n throw new Error(`cannot calculate sizeof() on type ${type}`);\n }\n}\n\nfunction sizeofProto(type: onnx.TensorProto.DataType|ortFbs.TensorDataType): number {\n switch (type) {\n case onnx.TensorProto.DataType.UINT8:\n case onnx.TensorProto.DataType.INT8:\n case onnx.TensorProto.DataType.BOOL:\n return 1;\n case onnx.TensorProto.DataType.UINT16:\n case onnx.TensorProto.DataType.INT16:\n return 2;\n case onnx.TensorProto.DataType.FLOAT:\n case onnx.TensorProto.DataType.INT32:\n case onnx.TensorProto.DataType.UINT32:\n return 4;\n case onnx.TensorProto.DataType.INT64:\n case onnx.TensorProto.DataType.DOUBLE:\n case onnx.TensorProto.DataType.UINT64:\n return 8;\n default:\n throw new Error(`cannot calculate sizeof() on type ${onnx.TensorProto.DataType[type]}`);\n }\n}\n\nfunction createView(dataBuffer: ArrayBuffer, type: Tensor.DataType) {\n return new (dataviewConstructor(type))(dataBuffer);\n}\n\nfunction dataviewConstructor(type: Tensor.DataType) {\n switch (type) {\n case 'bool':\n case 'uint8':\n return Uint8Array;\n case 'int8':\n return Int8Array;\n case 'int16':\n return Int16Array;\n case 'uint16':\n return Uint16Array;\n case 'int32':\n return Int32Array;\n case 'uint32':\n return Uint32Array;\n case 'int64':\n return BigInt64Array;\n case 'float32':\n return Float32Array;\n case 'float64':\n return Float64Array;\n default:\n // should never run to here\n throw new Error('unspecified error');\n }\n}\n\n// convert a long number to a 32-bit integer (cast-down)\nfunction longToNumber(i: Long, type: onnx.TensorProto.DataType|ortFbs.TensorDataType): number {\n // INT64, UINT32, UINT64\n if (type === onnx.TensorProto.DataType.INT64 || type === ortFbs.TensorDataType.INT64) {\n if (i.greaterThanOrEqual(2147483648) || i.lessThan(-2147483648)) {\n throw new TypeError('int64 is not supported');\n }\n } else if (\n type === onnx.TensorProto.DataType.UINT32 || type === ortFbs.TensorDataType.UINT32 ||\n type === onnx.TensorProto.DataType.UINT64 || type === ortFbs.TensorDataType.UINT64) {\n if (i.greaterThanOrEqual(4294967296) || i.lessThan(0)) {\n throw new TypeError('uint64 is not supported');\n }\n } else {\n throw new TypeError(`not a LONG type: ${onnx.TensorProto.DataType[type]}`);\n }\n\n return i.toNumber();\n}\n\n// read one value from TensorProto\nfunction readProto(view: DataView, type: onnx.TensorProto.DataType|ortFbs.TensorDataType, byteOffset: number): number {\n switch (type) {\n case onnx.TensorProto.DataType.BOOL:\n case onnx.TensorProto.DataType.UINT8:\n return view.getUint8(byteOffset);\n case onnx.TensorProto.DataType.INT8:\n return view.getInt8(byteOffset);\n case onnx.TensorProto.DataType.UINT16:\n return view.getUint16(byteOffset, true);\n case onnx.TensorProto.DataType.INT16:\n return view.getInt16(byteOffset, true);\n case onnx.TensorProto.DataType.FLOAT:\n return view.getFloat32(byteOffset, true);\n case onnx.TensorProto.DataType.INT32:\n return view.getInt32(byteOffset, true);\n case onnx.TensorProto.DataType.UINT32:\n return view.getUint32(byteOffset, true);\n case onnx.TensorProto.DataType.INT64:\n return longToNumber(\n Long.fromBits(view.getUint32(byteOffset, true), view.getUint32(byteOffset + 4, true), false), type);\n case onnx.TensorProto.DataType.DOUBLE:\n return view.getFloat64(byteOffset, true);\n case onnx.TensorProto.DataType.UINT64:\n return longToNumber(\n Long.fromBits(view.getUint32(byteOffset, true), view.getUint32(byteOffset + 4, true), true), type);\n default:\n throw new Error(`cannot read from DataView for type ${onnx.TensorProto.DataType[type]}`);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * represent a version irrelevant abstraction of for GLSL source code\n */\nexport interface Glsl {\n readonly version: string;\n readonly attribute: string;\n readonly varyingVertex: string;\n readonly varyingFrag: string;\n readonly texture2D: string;\n readonly output: string;\n readonly outputDeclaration: string;\n}\n\nconst GLSL_ES_2_0: Glsl = {\n version: '',\n attribute: 'attribute',\n varyingVertex: 'varying',\n varyingFrag: 'varying',\n texture2D: 'texture2D',\n output: 'gl_FragColor',\n outputDeclaration: '',\n};\nconst GLSL_ES_3_0: Glsl = {\n version: '#version 300 es',\n attribute: 'in',\n varyingVertex: 'out',\n varyingFrag: 'in',\n texture2D: 'texture',\n output: 'outputColor',\n outputDeclaration: 'out vec4 outputColor;',\n};\n\nexport function getGlsl(version: 1|2) {\n return version === 1 ? GLSL_ES_2_0 : GLSL_ES_3_0;\n}\n\nexport function getVertexShaderSource(version: 1|2): string {\n const glsl = getGlsl(version);\n return `${glsl.version}\n precision highp float;\n ${glsl.attribute} vec3 position;\n ${glsl.attribute} vec2 textureCoord;\n\n ${glsl.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`;\n}\n\nexport function getFragShaderPreamble(version: 1|2): string {\n const glsl = getGlsl(version);\n return `${glsl.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${glsl.varyingFrag} vec2 TexCoords;\n ${glsl.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `;\n}\n\nexport function getDefaultFragShaderMain(version: 1|2, outputShapeLength: number): string {\n const glsl = getGlsl(version);\n return `\n void main() {\n int indices[${outputShapeLength}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${glsl.output} = result;\n }\n `;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../tensor';\n\n/**\n * Layout info is used for mapping n-dimensional array to 2D textures\n * The layout is created by the TextureLayoutStrategy based on\n * the Tensor's dimensions and strides\n */\nexport interface TextureLayout {\n width: number;\n height: number;\n /**\n * specify the number of value that encoded in a single pixel\n */\n channels: 1|2|3|4;\n /**\n * whether in packed mode or not\n */\n isPacked?: boolean;\n /**\n * the normalized shape\n */\n shape: readonly number[];\n /**\n * the stride of each dimensions, calculated according to shape\n */\n strides: readonly number[];\n /**\n * the original shape(dims) of the corresponding tensor\n */\n unpackedShape: readonly number[];\n\n reversedWH?: boolean;\n}\nexport interface TextureData extends TextureLayout {\n tensor: Tensor;\n texture: WebGLTexture;\n}\n\nexport enum TextureType {\n unpacked, // <-- normal unpacked texture\n unpackedReversed, // <-- unpacked texture used in old ONNX.js implementation (deprecated)\n packed, // <-- normal packed texture\n downloadUint8AsFloat, // <-- ONLY used in texture downloading for iOS devices\n packedLastDimension // <-- ONLY used in old ONNX.js Conv implementation for input W (deprecated)\n}\n\nexport interface TensorInfo {\n id?: Tensor.Id;\n dims: readonly number[];\n type: Tensor.DataType;\n textureType: TextureType;\n}\n\nexport interface ProgramVariable {\n type: 'float'|'int';\n name: string;\n arrayLength?: number;\n data: number|number[];\n}\n\n/**\n * A set of metadata of a shader program.\n */\nexport interface ProgramMetadata {\n /**\n * the name of the program. used for debugging and profiling\n */\n name: string;\n /**\n * texture types for each input\n */\n inputTypes: TextureType[];\n /**\n * names of each input\n */\n inputNames: string[];\n /**\n * an optional string as a cache hint in the artifact cache\n */\n cacheHint?: string;\n}\n\n/**\n * A ProgramInfoLoader allows\n */\nexport interface ProgramInfoLoader extends ProgramMetadata {\n /**\n * a function to get the program info\n */\n get(): ProgramInfo;\n}\n\n/**\n * A set of data that represent a shader program\n */\nexport interface ProgramInfo extends ProgramMetadata {\n /**\n * information of uniform variables\n */\n variables?: ProgramVariable[];\n /**\n * tensor info for output\n */\n output: TensorInfo;\n /**\n * the shader's processing source code\n */\n shaderSource: string;\n /**\n * whether the shader source contains a customized main function implementation\n */\n hasMain?: boolean;\n}\n\nexport interface VariableInfo {\n type: 'float'|'int';\n name: string;\n arrayLength?: number;\n}\n\nexport interface ProgramVariable {\n type: 'float'|'int';\n name: string;\n arrayLength?: number;\n data: number|number[];\n}\n\n/**\n * Information of uniforms that shader uses\n */\nexport interface UniformInfo {\n type: 'sampler2D'|VariableInfo['type'];\n name: string;\n arrayLength?: number;\n}\n\nexport interface UniformLocation extends UniformInfo {\n location: WebGLUniformLocation;\n}\n\n/**\n * Artifact is the result of compilation\n * It does not contain input of output data\n * However anything that could be run as a \"program\"\n */\nexport interface Artifact {\n programInfo: ProgramInfo;\n program: WebGLProgram;\n uniformLocations: UniformLocation[];\n attribLocations: {position: number; textureCoord: number};\n}\nexport declare namespace Artifact {\n type UniformLocations = Artifact['uniformLocations'];\n type AttribLocations = Artifact['attribLocations'];\n}\n\nexport interface UniformData {\n [name: string]: number|number[];\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {assert} from '../../util';\n/**\n * Given a non RGBA shape calculate the R version\n * It is assumed that the dimensions are multiples of given channels\n * NOTE: it is always the last dim that gets packed.\n * @param unpackedShape original shape to create a packed version from\n */\nexport function getPackedShape(unpackedShape: readonly number[]): readonly number[] {\n const len = unpackedShape.length;\n return unpackedShape.slice(0, len - 1).concat(unpackedShape[len - 1] / 4);\n}\n\nexport async function repeatedTry(\n checkFn: () => boolean, delayFn = (_counter: number) => 0, maxCounter?: number): Promise {\n return new Promise((resolve, reject) => {\n let tryCount = 0;\n\n const tryFn = () => {\n if (checkFn()) {\n resolve();\n return;\n }\n\n tryCount++;\n\n const nextBackoff = delayFn(tryCount);\n\n if (maxCounter != null && tryCount >= maxCounter) {\n reject();\n return;\n }\n setTimeout(tryFn, nextBackoff);\n };\n\n tryFn();\n });\n}\n\n/**\n * Generates the function name from an input sampler name.\n * @param samplerName Name of the sampler.\n */\nexport function generateShaderFuncNameFromInputSamplerName(samplerName: string): string {\n assert(typeof samplerName !== 'undefined' && samplerName.length !== 0, () => 'empty string found for sampler name');\n return 'get' + samplerName.charAt(0).toUpperCase() + samplerName.slice(1);\n}\n\n/**\n * Generates the function name from an input sampler name at output coordinates.\n * @param samplerName Name of the sampler.\n */\nexport function generateShaderFuncNameFromInputSamplerNameAtOutCoords(samplerName: string): string {\n assert(typeof samplerName !== 'undefined' && samplerName.length !== 0, () => 'empty string found for sampler name');\n return 'get' + samplerName.charAt(0).toUpperCase() + samplerName.slice(1) + 'AtOutCoords';\n}\n\n/** Returns a new input shape (a copy) that has a squeezed logical shape. */\nexport function squeezeInputShape(inputShape: readonly number[], squeezedShape: number[]): number[] {\n // Deep copy.\n let newInputShape: number[] = JSON.parse(JSON.stringify(inputShape));\n newInputShape = squeezedShape;\n return newInputShape;\n}\n\n/** Returns a list of squeezed parameters for shader functions */\nexport function getSqueezedParams(params: string[], keptDims: number[]): string {\n return keptDims.map(d => params[d]).join(', ');\n}\n\n/** Returns the data type for different ranks. */\nexport function getCoordsDataType(rank: number): string {\n if (rank <= 1) {\n return 'int';\n } else if (rank === 2) {\n return 'ivec2';\n } else if (rank === 3) {\n return 'ivec3';\n } else if (rank === 4) {\n return 'ivec4';\n } else if (rank === 5) {\n return 'ivec5';\n } else if (rank === 6) {\n return 'ivec6';\n } else {\n throw Error(`GPU for rank ${rank} is not yet supported`);\n }\n}\n\nexport function getGlChannels(rank = 6): string[] {\n return ['x', 'y', 'z', 'w', 'u', 'v'].slice(0, rank);\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {getGlChannels} from '../utils';\n\nexport function getVecChannels(name: string, rank: number): string[] {\n return getGlChannels(rank).map(d => `${name}.${d}`);\n}\n\nexport function getChannels(name: string, rank: number): string[] {\n if (rank === 1) {\n return [name];\n }\n return getVecChannels(name, rank);\n}\n\nexport function unpackFromChannel(): string {\n return `\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n `;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, TextureType} from '../types';\nimport {getCoordsDataType} from '../utils';\n\nimport {getChannels} from './packing-utils';\n\nconst packProgramMetadata = {\n name: 'pack',\n inputNames: ['A'],\n inputTypes: [TextureType.unpackedReversed]\n};\n\nconst createPackProgramInfo = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfo => {\n const glsl = getGlsl(handler.session.backend.glContext.version);\n const inputShape = input.dims;\n\n const inputRank = inputShape.length;\n // createTextureLayoutFromShape won't change output rank. Need to verify by running tests\n const outputRank = input.dims.length;\n\n const coordsDataType = getCoordsDataType(outputRank);\n const channels = getChannels('rc', outputRank);\n const setup = getSetup(outputRank, channels, inputShape[inputShape.length - 2], inputShape[inputShape.length - 1]);\n\n let reversedInputWH;\n if (inputRank === 0) {\n reversedInputWH = [1, 1];\n } else if (inputRank === 1) {\n reversedInputWH = [inputShape[0], 1];\n } else {\n reversedInputWH = [inputShape[outputRank - 1], inputShape[outputRank - 2]];\n }\n const outOfBoundsCondition = getOutOfBoundsCondition(outputRank, reversedInputWH, channels);\n const output = getOutput(inputShape, channels);\n\n const shaderSource = `\n void main() {\n ${coordsDataType} rc = getOutputCoords();\n\n if(${outOfBoundsCondition}) {\n ${glsl.output} = vec4(0);\n } else {\n ${setup}\n\n ${glsl.output} = vec4(${output});\n }\n }\n `;\n return {\n ...packProgramMetadata,\n hasMain: true,\n output: {dims: input.dims, type: input.type, textureType: TextureType.packed},\n shaderSource\n };\n};\n\nexport const createPackProgramInfoLoader = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfoLoader =>\n ({...packProgramMetadata, get: () => createPackProgramInfo(handler, input)});\n\n/**\n * check output coordinate location and return false if it is outside input's width/height boundary\n */\nfunction getOutOfBoundsCondition(rank: number, shape: readonly number[], dims: string[]): string {\n if (rank === 0) {\n return 'false';\n }\n if (rank === 1) {\n return `rc > ${shape[0]}`;\n }\n\n let cond = '';\n for (let i = rank - 2; i < rank; i++) {\n cond += `${dims[i]} >= ${shape[i - rank + 2]}`;\n if (i < rank - 1) {\n cond += '||';\n }\n }\n\n return cond;\n}\n\n/**\n * code snippet to sample input texture with output coordiantes\n */\nfunction getOutput(shape: readonly number[], dims: string[]): string {\n const rank = shape.length;\n\n if (rank === 0) {\n return 'getA(), 0, 0, 0';\n }\n\n if (rank === 1) {\n return `getA(rc),\n rc + 1 >= ${shape[0]} ? 0. : getA(rc + 1),\n 0, 0`;\n }\n\n const coord00 = 'r, c';\n const coord01 = 'r, cp1';\n const coord10 = 'rp1, c';\n const coord11 = 'rp1, cp1';\n let D = '';\n if (rank > 2) {\n for (let i = 0; i < rank - 2; ++i) {\n D = D + `${dims[i]},`;\n }\n }\n return `getA(${D}${coord00}),\n rEdge ? 0. : getA(${D}${coord10}),\n cEdge ? 0. : getA(${D}${coord01}),\n rEdge || cEdge ? 0. : getA(${D}${coord11})`;\n}\n\n/**\n * code snippet to setup 4 coordinates and edge conditions\n */\nfunction getSetup(rank: number, dims: string[], rows: number, cols: number): string {\n if (rank === 0 || rank === 1) {\n return '';\n }\n // rank >= 2 for width+height pack.\n else {\n const setup = `\n int r = ${dims[rank - 2]};\n int c = ${dims[rank - 1]};\n int rp1 = ${dims[rank - 2]} + 1;\n int cp1 = ${dims[rank - 1]} + 1;\n bool rEdge = rp1 >= ${cols};\n bool cEdge = cp1 >= ${rows};\n `;\n return setup;\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {unpackFromChannel} from './packing-utils';\n\nconst createPackedReshape3DProgramMetadata = (outputShape3D: readonly number[]) =>\n ({name: 'Reshape (packed)', inputTypes: [TextureType.packed], inputNames: ['A'], cacheHint: `${outputShape3D}`});\n\nconst createPackedReshape3DProgramInfo =\n (handler: WebGLInferenceHandler, input3D: Tensor, metadata: ProgramMetadata, outputShape3D: readonly number[]):\n ProgramInfo => {\n const inputShape3D = input3D.dims as [number, number, number];\n const squeezedOutputShape = outputShape3D as [number, number, number];\n\n let mainLoop = '';\n for (let i = 0; i < 4; i++) {\n let outputCoords = '';\n switch (i) {\n case 0:\n outputCoords = 'outputCoords = rc;';\n break;\n case 1:\n outputCoords = 'outputCoords = ivec3(rc.x, rc.y+1, rc.z);';\n break;\n case 2:\n outputCoords = 'outputCoords = ivec3(rc.x, rc.y, rc.z+1);';\n break;\n case 3:\n outputCoords = 'outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);';\n break;\n default:\n throw new Error();\n }\n\n mainLoop += `\n ${outputCoords}\n ${i > 0 ? 'if(outputCoords.y < rows && outputCoords.z < cols){' : ''}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${i}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${i > 0 ? '}' : ''}\n `;\n }\n const glsl = getGlsl(handler.session.backend.glContext.version);\n\n const shaderSource = `\n ${getReshapedInputCoords(inputShape3D)}\n ${getFlattenedIndexFrom3D(squeezedOutputShape)}\n ${unpackFromChannel()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${squeezedOutputShape[2]};\n int cols = ${squeezedOutputShape[1]};\n\n ${mainLoop}\n ${glsl.output} = result;\n }\n `;\n\n return {\n ...metadata,\n output: {dims: squeezedOutputShape, type: input3D.type, textureType: TextureType.packed},\n shaderSource,\n hasMain: true\n };\n };\n\nexport const createPackedReshape3DProgramInfoLoader =\n (handler: WebGLInferenceHandler, input3D: Tensor, outputShape3D: readonly number[]): ProgramInfoLoader => {\n const metadata = createPackedReshape3DProgramMetadata(outputShape3D);\n return {...metadata, get: () => createPackedReshape3DProgramInfo(handler, input3D, metadata, outputShape3D)};\n };\n\nexport function processDims3D(shape: ArrayLike): [number, number, number] {\n if (shape.length === 0) {\n return [1, 1, 1];\n }\n // TODO: squeeze other shapes to 2D case\n let batch = 1;\n for (let i = 0; i < shape.length - 2; ++i) {\n batch *= shape[i];\n }\n return [batch, shape.length > 1 ? shape[shape.length - 2] : 1, shape[shape.length - 1]];\n}\n\n// For packed reshape, we need to re-arrange texel data for output shape.\n// Our pack is designed to pack a 2x2 tile in last h and w dimension, so\n// for the reshaped new tensor, we just need to re-arrange the last h and\n// w dimension. For any shape that is not in 3D, i.e. [batch, W, H], we\n// first convert it to 3D by collapsing other dimension to batch dim, then\n// process with the last two dimensions.\n// Note: we only need the shape tensor to calculate output shape, so the\n// content in shape tensor is never uploaded to GPU. It is always kept in CPU.\n// TODO: optimize the algorithm -- in some cases, if the last two dims are\n// the same between input shape and output shape, the packed reshape can be\n// treated as no-op.\nexport function isReshapeCheap(dims: readonly number[], reshapedDims: readonly number[]) {\n let isCheapReshape = false;\n if (dims.length === 0 || reshapedDims.length === 0) { // scalar\n isCheapReshape = true;\n } else if (dims.length < 2 || reshapedDims.length < 2) { // 1D\n isCheapReshape = dims[dims.length - 1] === reshapedDims[reshapedDims.length - 1];\n } else { // 2D +\n isCheapReshape = dims[dims.length - 1] === reshapedDims[reshapedDims.length - 1] &&\n dims[dims.length - 2] === reshapedDims[reshapedDims.length - 2];\n }\n\n return isCheapReshape;\n}\n\nfunction getReshapedInputCoords(shape: [number, number, number]): string {\n const strides = ShapeUtil.computeStrides(shape);\n const coords = ['b', 'r', 'c'];\n const index = 'index';\n const coordsFromIndexSnippet = strides\n .map((stride, i) => {\n const line1 = `int ${coords[i]} = ${index} / ${stride}`;\n const line2 = i === strides.length - 1 ?\n `int ${coords[i + 1]} = ${index} - ${coords[i]} * ${stride}` :\n `index -= ${coords[i]} * ${stride}`;\n return `${line1}; ${line2};`;\n })\n .join('');\n\n return `\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${coordsFromIndexSnippet}\n return ivec3(b, r, c);\n }\n `;\n}\n\nfunction getFlattenedIndexFrom3D(shape: [number, number, number]): string {\n const strides = ShapeUtil.computeStrides(shape);\n\n return `\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${strides[0]} + coords.z * ${strides[1]} + coords.y;\n }\n`;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {TextureData, TextureType} from '../types';\n\nexport const encodeAsUint8 = (inferenceHandler: WebGLInferenceHandler, input: TextureData): TextureData => {\n const outputShape = input.shape;\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n /**\n * https://github.com/tensorflow/tfjs-core/blob/master/src/kernels/webgl/encode_float_gpu.ts\n */\n const shaderSource = `\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${glsl.texture2D}(X,TexCoords).r;\n ${glsl.output} = encodeAsUint8(value);\n }`;\n const programInfo = {\n name: 'Uint8Encode',\n inputTypes: [TextureType.unpacked],\n inputNames: ['X'],\n output: {dims: outputShape, type: input.tensor.type, textureType: TextureType.downloadUint8AsFloat},\n shaderSource,\n hasMain: true\n };\n return inferenceHandler.executeProgram(programInfo, [input.tensor]);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, TextureType} from '../types';\nimport {getCoordsDataType} from '../utils';\n\nimport {getChannels, unpackFromChannel} from './packing-utils';\n\nconst unpackProgramMetadata = {\n name: 'unpack',\n inputNames: ['A'],\n inputTypes: [TextureType.packed]\n};\n\nexport const createUnpackProgramInfo = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfo => {\n const rank = input.dims.length;\n\n const channels = getChannels('rc', rank);\n const innerDims = channels.slice(-2);\n const coordsDataType = getCoordsDataType(rank);\n const unpackChannel = unpackFromChannel();\n const isScalar = (input.dims.length === 0);\n const sourceCoords = isScalar ? '' : getSourceCoords(rank, channels);\n const coords = rank <= 1 ? 'rc' : `vec2(${innerDims.join(',')})`;\n const glsl = getGlsl(handler.session.backend.glContext.version);\n const shaderSource = `\n ${unpackChannel}\n void main() {\n ${coordsDataType} rc = getOutputCoords();\n\n // Sample the texture with the coords to get the rgba channel value.\n vec4 packedInput = getA(${sourceCoords});\n\n ${glsl.output} = vec4(getChannel(packedInput, ${coords}), 0, 0, 0);\n }\n `;\n\n return {\n ...unpackProgramMetadata,\n hasMain: true,\n output: {dims: input.dims, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n};\n\nexport const createUnpackProgramInfoLoader = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfoLoader =>\n ({...unpackProgramMetadata, get: () => createUnpackProgramInfo(handler, input)});\n\nfunction getSourceCoords(rank: number, dims: string[]): string {\n if (rank === 1) {\n return 'rc';\n }\n\n let coords = '';\n for (let i = 0; i < rank; i++) {\n coords += dims[i];\n if (i < rank - 1) {\n coords += ',';\n }\n }\n return coords;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Logger} from '../../instrument';\n\nexport declare namespace Encoder {\n export interface DataTypeMap {\n float: Float32Array;\n byte: Uint8Array;\n int: Uint32Array;\n }\n export type DataType = keyof DataTypeMap;\n type DataArrayType = DataTypeMap[DataType];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const enum EncoderUsage {\n Default = 0,\n UploadOnly,\n Download4BytesAsFloat32,\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Abstraction for mapping data types to texture texlets\n * Encoding means how a Float32 is mapped to 1 or 4 channels for each texlet\n * Decoding means how a texlet's channels are mapped to a resulting Float32\n */\nexport interface DataEncoder {\n internalFormat: number;\n format: number;\n textureType: number;\n channelSize: number;\n encode(src: Encoder.DataArrayType, textureSize: number): Encoder.DataArrayType;\n allocate(size: number): Encoder.DataArrayType;\n decode(buffer: Encoder.DataArrayType, dataSize: number): Encoder.DataArrayType;\n}\n/**\n * WebGL2 data encoder\n * Uses R32F as the format for texlet\n */\nexport class RedFloat32DataEncoder implements DataEncoder {\n internalFormat: number;\n format: number;\n textureType: number;\n channelSize: number;\n constructor(gl: WebGL2RenderingContext, channels = 1) {\n if (channels === 1) {\n this.internalFormat = gl.R32F;\n this.format = gl.RED;\n this.textureType = gl.FLOAT;\n this.channelSize = channels;\n } else if (channels === 4) {\n this.internalFormat = gl.RGBA32F;\n this.format = gl.RGBA;\n this.textureType = gl.FLOAT;\n this.channelSize = channels;\n } else {\n throw new Error(`Invalid number of channels: ${channels}`);\n }\n }\n encode(src: Encoder.DataArrayType, textureSize: number): Encoder.DataArrayType {\n let result: Float32Array;\n let source: Float32Array;\n if (src.constructor !== Float32Array) {\n Logger.warning('Encoder', 'data was not of type Float32; creating new Float32Array');\n source = new Float32Array(src);\n }\n if (textureSize * this.channelSize > src.length) {\n Logger.warning('Encoder', 'Source data too small. Allocating larger array');\n source = src as Float32Array;\n result = this.allocate(textureSize * this.channelSize) as Float32Array;\n source.forEach((v, i) => result[i] = v);\n } else {\n source = src as Float32Array;\n result = source;\n }\n return result;\n }\n allocate(size: number): Encoder.DataArrayType {\n return new Float32Array(size * 4);\n }\n decode(buffer: Encoder.DataArrayType, dataSize: number): Float32Array {\n if (this.channelSize === 1) {\n const filteredData = (buffer as Float32Array).filter((_value, index) => index % 4 === 0).subarray(0, dataSize);\n return filteredData;\n }\n return buffer.subarray(0, dataSize) as Float32Array;\n }\n}\n/**\n * Data encoder for WebGL 1 with support for floating point texture\n */\nexport class RGBAFloatDataEncoder implements DataEncoder {\n internalFormat: number;\n format: number;\n textureType: number;\n channelSize: number;\n constructor(gl: WebGLRenderingContext, channels = 1, textureType?: number) {\n if (channels !== 1 && channels !== 4) {\n throw new Error(`Invalid number of channels: ${channels}`);\n }\n this.internalFormat = gl.RGBA;\n this.format = gl.RGBA;\n this.channelSize = channels;\n this.textureType = textureType || gl.FLOAT;\n }\n encode(src: Float32Array, textureSize: number): Encoder.DataArrayType {\n let dest = src;\n if (this.channelSize === 1) {\n Logger.verbose('Encoder', 'Exploding into a larger array');\n dest = this.allocate(textureSize) as Float32Array;\n src.forEach((v, i) => dest[i * 4] = v);\n }\n return dest;\n }\n allocate(size: number): Encoder.DataArrayType {\n return new Float32Array(size * 4);\n }\n decode(buffer: Encoder.DataArrayType, dataSize: number): Float32Array {\n if (this.channelSize === 1) {\n const filteredData = (buffer as Float32Array).filter((_value, index) => index % 4 === 0).subarray(0, dataSize);\n return filteredData;\n }\n return buffer.subarray(0, dataSize) as Float32Array;\n }\n}\n\nexport class Uint8DataEncoder implements DataEncoder {\n internalFormat: number;\n format: number;\n textureType: number;\n channelSize = 4;\n constructor(gl: WebGLRenderingContext, channels = 1) {\n if (channels === 1) {\n this.internalFormat = gl.ALPHA;\n this.format = gl.ALPHA; // not tested\n this.textureType = gl.UNSIGNED_BYTE;\n this.channelSize = channels;\n } else if (channels === 4) {\n this.internalFormat = gl.RGBA;\n this.format = gl.RGBA;\n this.textureType = gl.UNSIGNED_BYTE;\n this.channelSize = channels;\n } else {\n throw new Error(`Invalid number of channels: ${channels}`);\n }\n }\n encode(src: Uint8Array, _textureSize: number): Encoder.DataArrayType {\n return new Uint8Array(src.buffer, src.byteOffset, src.byteLength);\n }\n allocate(size: number): Encoder.DataArrayType {\n return new Uint8Array(size * this.channelSize);\n }\n decode(buffer: Encoder.DataArrayType, dataSize: number): Uint8Array {\n if (buffer instanceof Uint8Array) {\n return buffer.subarray(0, dataSize);\n }\n throw new Error(`Invalid array type: ${buffer.constructor}`);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {ShapeUtil} from '../../util';\n\nimport {TextureLayoutStrategy, WidthHeightPrefs} from './texture-layout-strategy';\nimport {TextureLayout, TextureType} from './types';\n\nexport const createTextureLayoutFromTextureType =\n (textureLayoutStrategy: TextureLayoutStrategy, shape: readonly number[],\n textureType: TextureType): TextureLayout => {\n const channel = (textureType === TextureType.unpacked || textureType === TextureType.unpackedReversed) ? 1 : 4;\n const isPacked = textureType === TextureType.packed;\n const reverseWH = (textureType === TextureType.unpackedReversed || textureType === TextureType.packed);\n const breakAxis = textureType === TextureType.packedLastDimension ? shape.length - 1 : undefined;\n const unpackedShape = textureType === TextureType.packedLastDimension ?\n shape.map((d, i) => i === shape.length - 1 ? d * 4 : d) :\n undefined;\n return createTextureLayoutFromShape(\n textureLayoutStrategy, shape, channel, unpackedShape, {isPacked, reverseWH, breakAxis});\n };\n\nexport const calculateTextureWidthAndHeight =\n (textureLayoutStrategy: TextureLayoutStrategy, shape: readonly number[], textureType: TextureType):\n [number, number] => {\n const layout = createTextureLayoutFromTextureType(textureLayoutStrategy, shape, textureType);\n return [layout.width, layout.height];\n };\n\n/**\n * Create a TextureLayout object from shape.\n */\nexport const createTextureLayoutFromShape =\n (textureLayoutStrategy: TextureLayoutStrategy, shape: readonly number[], channels: 1|4 = 1,\n unpackedShape?: readonly number[], prefs?: WidthHeightPrefs): TextureLayout => {\n const isPacked = !!(prefs && prefs.isPacked);\n const [width, height] = textureLayoutStrategy.computeTextureWH(isPacked ? unpackedShape || shape : shape, prefs);\n const rank = shape.length;\n let inferredDims = shape.slice(0);\n if (rank === 0) {\n inferredDims = [1];\n }\n if (channels === 1) {\n // unpackedShape will take `shape` and not `inferredDims` so as to create a scalar Tensor if need be\n unpackedShape = shape;\n } else if (isPacked) {\n if (channels !== 4) {\n throw new Error('a packed texture must be 4-channel');\n }\n unpackedShape = shape;\n if (rank > 0) {\n inferredDims[rank - 1] = Math.ceil(inferredDims[rank - 1] / 2);\n }\n if (rank > 1) {\n inferredDims[rank - 2] = Math.ceil(inferredDims[rank - 2] / 2);\n }\n } else if (!unpackedShape) {\n throw new Error('Unpacked shape is needed when using channels > 1');\n }\n return {\n width,\n height,\n channels,\n isPacked,\n shape: inferredDims,\n strides: ShapeUtil.computeStrides(inferredDims),\n unpackedShape,\n reversedWH: (prefs && prefs.reverseWH)\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceHandler} from '../../backend';\nimport {Logger} from '../../instrument';\nimport {Tensor} from '../../tensor';\nimport {ShapeUtil} from '../../util';\n\nimport {createPackProgramInfoLoader} from './ops/pack';\nimport {createPackedReshape3DProgramInfoLoader, isReshapeCheap, processDims3D} from './ops/reshape-packed';\nimport {encodeAsUint8} from './ops/uint8-encode';\nimport {createUnpackProgramInfoLoader} from './ops/unpack';\nimport {WebGLSessionHandler} from './session-handler';\nimport {EncoderUsage} from './texture-data-encoder';\nimport {calculateTextureWidthAndHeight, createTextureLayoutFromShape, createTextureLayoutFromTextureType} from './texture-layout';\nimport {Artifact, ProgramInfo, ProgramInfoLoader, TextureData, TextureLayout, TextureType} from './types';\n\nconst getProgramInfoUniqueKey =\n (programInfo: ProgramInfo|ProgramInfoLoader, inputTextureDatas: TextureData[]): string => {\n const inputs =\n inputTextureDatas.map(texture => `${texture.unpackedShape.join(',')};${texture.width}x${texture.height}`)\n .join('_');\n let key = programInfo.name;\n if (programInfo.cacheHint) {\n key += '[' + programInfo.cacheHint + ']';\n }\n key += ':' + inputs;\n return key;\n };\n\nexport class WebGLInferenceHandler implements InferenceHandler {\n private packedTextureDataCache: Map;\n private unpackedTextureDataCache: Map;\n constructor(public session: WebGLSessionHandler) {\n this.packedTextureDataCache = new Map();\n this.unpackedTextureDataCache = new Map();\n }\n\n /**\n * @returns [width, height]\n */\n calculateTextureWidthAndHeight(shape: readonly number[], textureType: TextureType): [number, number] {\n return calculateTextureWidthAndHeight(this.session.layoutStrategy, shape, textureType);\n }\n\n executeProgram(program: ProgramInfo|ProgramInfoLoader, inputs: readonly Tensor[]): TextureData {\n if (inputs.length < program.inputNames.length) {\n throw new Error(`Input size mustn't be less than ${program.inputNames.length}.`);\n }\n if (program.inputNames.length !== program.inputTypes.length) {\n throw new Error('input names size does not match input types');\n }\n\n // create texture info for input\n const inputTextureDatas: TextureData[] = [];\n for (let i = 0; i < program.inputNames.length; ++i) {\n inputTextureDatas[i] = this.getOrCreateTextureData(inputs[i], program.inputTypes[i]);\n }\n\n const key = getProgramInfoUniqueKey(program, inputTextureDatas);\n let artifact = this.session.programManager.getArtifact(key);\n const programInfo = artifact ?\n artifact.programInfo :\n (typeof (program as ProgramInfoLoader).get === 'function' ? (program as ProgramInfoLoader).get() :\n (program as ProgramInfo));\n\n // create texture info for output\n const outputTextureLayout = createTextureLayoutFromTextureType(\n this.session.layoutStrategy, programInfo.output.dims, programInfo.output.textureType);\n const outputTextureData = this.createTextureData(outputTextureLayout, programInfo.output.type);\n\n if (!artifact) {\n artifact = this.session.programManager.build(programInfo, inputTextureDatas, outputTextureData);\n this.session.programManager.setArtifact(key, artifact);\n }\n\n this.runProgram(artifact, inputTextureDatas, outputTextureData);\n return outputTextureData;\n }\n\n run(program: ProgramInfoLoader, inputs: readonly Tensor[]): Tensor {\n const outputTextureData = this.executeProgram(program, inputs);\n return outputTextureData.tensor;\n }\n\n private runProgram(artifact: Artifact, inputs: TextureData[], output: TextureData): void {\n // input should match\n for (let i = 0; i < inputs.length; ++i) {\n if (!!inputs[i].isPacked !== (artifact.programInfo.inputTypes[i] === TextureType.packed)) {\n throw new Error(`input[${i}] property packed inconsistent`);\n }\n }\n\n // output should match\n if (!!output.isPacked !== (artifact.programInfo.output.textureType === TextureType.packed)) {\n throw new Error('output property packed inconsistent');\n }\n\n this.session.programManager.run(artifact, inputs, output);\n }\n\n /**\n * Create a TextureData object from a tensor.\n * Usage = EncoderUsage.UploadOnly.\n * If a related texture data is found in cache, returns it;\n * Otherwise:\n * Creates a new texture layout if not provided;\n * Creates WebGLTexture with the layout;\n * Upload tensor data to the texture;\n * Creates a texture data object associated with the given tensor.\n * @param tensor the tensor with data to upload\n */\n private getOrCreateTextureData(tensor: Tensor, textureType: TextureType) {\n let td = this.getTextureData(tensor.dataId, textureType === TextureType.packed);\n\n if (!td) {\n // check if we have texture data in different type\n td = this.getTextureData(tensor.dataId, textureType !== TextureType.packed);\n if (td) {\n if (textureType === TextureType.packed) {\n return this.pack(td);\n } else {\n return this.unpack(td);\n }\n }\n }\n\n if (!td) {\n const layout = createTextureLayoutFromTextureType(this.session.layoutStrategy, tensor.dims, textureType);\n\n if (textureType === TextureType.packedLastDimension) {\n const group = 1;\n const channels = 4;\n const shape = tensor.dims;\n if (shape.length === 4) {\n // pre-processing for kernel data of Conv.\n //\n // TODO: currently this is a hacking to overwrite Conv's weight. The correct way to do this should be:\n // 1. implement texture based const-folding\n // 2. create a WebGL program \"preprocessConvWeight\" to do the same work as below\n // 3. run the program before dotProduct.\n //\n const adjustedKernelShape = [shape[0], Math.ceil((shape[1] * shape[2] * shape[3]) / channels)];\n const adjustedLayout =\n createTextureLayoutFromTextureType(this.session.layoutStrategy, adjustedKernelShape, textureType);\n let buffer = tensor.numberData;\n if (shape[1] * shape[2] * shape[3] % channels !== 0) {\n const numFeatureMaps = shape[0];\n const oldRowSize = shape[1] * shape[2] * shape[3];\n const newRowSize = Math.ceil(oldRowSize * group / channels) * channels;\n const newSize = numFeatureMaps * newRowSize;\n buffer = new Float32Array(newSize);\n for (let f = 0; f < numFeatureMaps; ++f) {\n const oldOffset = f * oldRowSize;\n const newOffset = f * newRowSize + f % group * oldRowSize;\n buffer.set(tensor.numberData.subarray(oldOffset, oldOffset + oldRowSize), newOffset);\n }\n }\n return this.createTextureData(adjustedLayout, tensor.type, buffer, tensor, EncoderUsage.UploadOnly);\n }\n }\n\n if (textureType === TextureType.packed) {\n const unpackedTextureLayout =\n createTextureLayoutFromShape(this.session.layoutStrategy, tensor.dims, 1, [], {reverseWH: true});\n const unpackedTextureData = this.createTextureData(\n unpackedTextureLayout, tensor.type, tensor.numberData, tensor, EncoderUsage.UploadOnly);\n td = this.pack(unpackedTextureData);\n } else {\n td = this.createTextureData(layout, tensor.type, tensor.numberData, tensor, EncoderUsage.UploadOnly);\n }\n }\n return td;\n }\n\n /**\n * Create a TextureData object using the given data and bind to the given tensor.\n * Usage = EncoderUsage.UploadOnly.\n * NOTE: this function is a hack for Conv implementation. should remove this function, after rewriting Conv\n * implementation by Graph.Transformer\n * @param dataType the tensor data type\n * @param data the actual data to upload\n * @param tensor the tensor to bind. tensor's data is ignored.\n */\n createTextureDataFromLayoutBindTensor(\n layout: TextureLayout, dataType: Tensor.DataType, data: Tensor.NumberType, tensor: Tensor): TextureData {\n return this.createTextureData(layout, dataType, data, tensor, EncoderUsage.UploadOnly);\n }\n\n private createTextureData(\n layout: TextureLayout, dataType: Tensor.DataType, data?: Tensor.NumberType, tensor?: Tensor,\n usage?: EncoderUsage): TextureData {\n Logger.verbose('InferenceHandler', `Creating TextureData: layout:[${JSON.stringify(layout)}]`);\n const texture = this.session.textureManager.createTextureFromLayout(dataType, layout, data, usage);\n return this.createTextureDataFromTexture(layout, dataType, texture, tensor);\n }\n\n reshapeUnpacked(input: Tensor, reshapedDims: readonly number[]): Tensor {\n const inputTD = this.getOrCreateTextureData(input, TextureType.unpacked);\n const newTextureLayout: TextureLayout = {\n channels: inputTD.channels,\n height: inputTD.height,\n width: inputTD.width,\n // handle reshaping into scalar Tensors\n shape: reshapedDims.length !== 0 ? reshapedDims : [1],\n strides: ShapeUtil.computeStrides(reshapedDims),\n unpackedShape: reshapedDims,\n };\n const newTextureData = this.createTextureDataFromTexture(newTextureLayout, input.type, inputTD.texture);\n return newTextureData.tensor;\n }\n\n reshapePacked(input: Tensor, reshapedDims: readonly number[]): Tensor {\n const inputTD = this.getOrCreateTextureData(input, TextureType.packed);\n\n // check if the reshape is 'cheap'\n if (isReshapeCheap(input.dims, reshapedDims)) {\n const newTextureLayout: TextureLayout = {\n channels: inputTD.channels,\n height: inputTD.height,\n width: inputTD.width,\n // handle reshaping into scalar Tensors\n shape: reshapedDims.length !== 0 ? reshapedDims : [1],\n strides: ShapeUtil.computeStrides(reshapedDims),\n unpackedShape: reshapedDims,\n isPacked: true\n };\n const newTextureData = this.createTextureDataFromTexture(newTextureLayout, input.type, inputTD.texture);\n return newTextureData.tensor;\n }\n\n const squeezedInputShape = processDims3D(input.dims);\n const squeezedOutputShape = processDims3D(reshapedDims);\n\n const squeezedInputTensor = this.reshapePacked(input, squeezedInputShape);\n const squeezedOutputTensor = this.run(\n createPackedReshape3DProgramInfoLoader(this, squeezedInputTensor, squeezedOutputShape), [squeezedInputTensor]);\n const outputTensor = this.reshapePacked(squeezedOutputTensor, reshapedDims);\n return outputTensor;\n }\n\n cast(input: Tensor, type: Tensor.DataType): Tensor {\n const inputTD = this.getOrCreateTextureData(input, TextureType.unpacked);\n const newTextureData = this.createTextureDataFromTexture(inputTD as TextureLayout, type, inputTD.texture);\n return newTextureData.tensor;\n }\n\n private createTextureDataFromTexture(\n layout: TextureLayout, dataType: Tensor.DataType, texture: WebGLTexture, tensor?: Tensor, tensorId?: Tensor.Id) {\n const textureData: TextureData = {\n ...layout,\n tensor: tensor ||\n new Tensor(\n layout.unpackedShape, dataType, (_id: Tensor.Id) => this.readTexture(textureData),\n async (_id: Tensor.Id) => this.readTextureAsync(textureData), undefined, tensorId),\n texture\n };\n this.setTextureData(textureData.tensor.dataId, textureData, layout.isPacked);\n return textureData;\n }\n\n private getTextureData(tensorId: Tensor.Id, isPacked = false): TextureData|undefined {\n return this.session.isInitializer(tensorId) ? this.session.getTextureData(tensorId, isPacked) :\n isPacked ? this.packedTextureDataCache.get(tensorId) :\n this.unpackedTextureDataCache.get(tensorId);\n }\n setTextureData(tensorId: Tensor.Id, td: TextureData, isPacked = false): void {\n if (this.session.isInitializer(tensorId)) {\n this.session.setTextureData(tensorId, td, isPacked);\n } else {\n (isPacked ? this.packedTextureDataCache : this.unpackedTextureDataCache).set(tensorId, td);\n }\n }\n isTextureLayoutCached(tensor: Tensor, isPacked = false): boolean {\n return !!this.getTextureData(tensor.dataId, isPacked);\n }\n\n dispose(): void {\n this.session.textureManager.clearActiveTextures();\n this.packedTextureDataCache.forEach(td => this.session.textureManager.releaseTexture(td));\n this.packedTextureDataCache = new Map();\n this.unpackedTextureDataCache.forEach(td => this.session.textureManager.releaseTexture(td));\n this.unpackedTextureDataCache = new Map();\n }\n\n readTexture(textureData: TextureData): Tensor.NumberType {\n if (textureData.isPacked) {\n return this.readTexture(this.unpack(textureData));\n }\n if (!this.session.backend.glContext.isFloat32DownloadSupported) {\n return this.session.textureManager.readUint8TextureAsFloat(encodeAsUint8(this, textureData));\n }\n return this.session.textureManager.readTexture(textureData, textureData.tensor.type, textureData.channels);\n }\n\n async readTextureAsync(textureData: TextureData): Promise {\n if (textureData.isPacked) {\n return this.readTextureAsync(this.unpack(textureData));\n }\n if (!this.session.backend.glContext.isFloat32DownloadSupported) {\n return this.session.textureManager.readUint8TextureAsFloat(encodeAsUint8(this, textureData));\n }\n return this.session.textureManager.readTextureAsync(textureData, textureData.tensor.type, textureData.channels);\n }\n\n pack(input: TextureData): TextureData {\n const outputTextureData = this.executeProgram(createPackProgramInfoLoader(this, input.tensor), [input.tensor]);\n return outputTextureData;\n }\n\n unpack(input: TextureData): TextureData {\n const outputTextureData = this.executeProgram(createUnpackProgramInfoLoader(this, input.tensor), [input.tensor]);\n return outputTextureData;\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nclass AttributeWithCacheKeyImpl {\n constructor(attribute: Record) {\n Object.assign(this, attribute);\n }\n\n private key: string;\n public get cacheKey(): string {\n if (!this.key) {\n this.key =\n Object.getOwnPropertyNames(this).sort().map(name => `${(this as Record)[name]}`).join(';');\n }\n return this.key;\n }\n}\n\nexport interface AttributeWithCacheKey {\n readonly cacheKey: string;\n}\n\nexport const createAttributeWithCacheKey = >(attribute: T): T&AttributeWithCacheKey =>\n new AttributeWithCacheKeyImpl(attribute) as unknown as T & AttributeWithCacheKey;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nexport interface BatchNormalizationAttributes extends AttributeWithCacheKey {\n epsilon: number;\n momentum: number;\n spatial: number;\n}\n\nconst batchNormalizationProgramMetadata = {\n name: 'BatchNormalization',\n inputNames: ['A', 'Scale', 'B', 'Mean', 'Variance'],\n inputTypes:\n [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked, TextureType.unpacked, TextureType.unpacked]\n};\n\nexport const batchNormalization: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: BatchNormalizationAttributes): Tensor[] => {\n validateInputs(inputs);\n const output = inferenceHandler.run(\n {\n ...batchNormalizationProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createBatchNormalizationProgramInfo(inferenceHandler, inputs, attributes)\n },\n inputs);\n return [output];\n };\n\nexport const parseBatchNormalizationAttributes: OperatorInitialization =\n (node: Graph.Node): BatchNormalizationAttributes => {\n const epsilon = node.attributes.getFloat('epsilon', 1e-5);\n const momentum = node.attributes.getFloat('momentum', 0.9);\n const spatial = node.attributes.getInt('spatial', 1);\n return createAttributeWithCacheKey({epsilon, momentum, spatial});\n };\n\nconst createBatchNormalizationProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: BatchNormalizationAttributes):\n ProgramInfo => {\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const rank = inputs[0].dims.length;\n const [scaleWidth, scaleHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(inputs[1].dims, TextureType.unpacked);\n const shaderSource = `\n float process(int[${rank}] indices) {\n vec2 position = offsetToCoords(indices[1], ${scaleWidth}, ${scaleHeight});\n float scale = getColorAsFloat(${glsl.texture2D}(Scale, position));\n float mean = getColorAsFloat(${glsl.texture2D}(Mean, position));\n float variance = getColorAsFloat(${glsl.texture2D}(Variance, position));\n float b = getColorAsFloat(${glsl.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${attributes.epsilon})) ) + b;\n }`;\n return {\n ...batchNormalizationProgramMetadata,\n output: {dims: inputs[0].dims, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 5) {\n throw new Error('BatchNormalization requires 5 inputs.');\n }\n\n const X = inputs[0];\n const scale = inputs[1];\n const B = inputs[2];\n const mean = inputs[3];\n const var_ = inputs[4];\n\n // input should atleast have three dimensions - N,C,dim1,...,dimn\n // other inputs can have only one dimensions\n if (X.dims.length < 3 || scale.dims.length !== 1 || B.dims.length !== 1 || mean.dims.length !== 1 ||\n var_.dims.length !== 1) {\n throw new Error('invalid input shape.');\n }\n if (scale.dims[0] !== X.dims[1] || B.dims[0] !== X.dims[1] || mean.dims[0] !== X.dims[1] ||\n var_.dims[0] !== X.dims[1]) {\n throw new Error('invalid input shape.');\n }\n if ((X.type !== 'float32' && X.type !== 'float64') || (scale.type !== 'float32' && scale.type !== 'float64') ||\n (B.type !== 'float32' && B.type !== 'float64') || (mean.type !== 'float32' && mean.type !== 'float64') ||\n (var_.type !== 'float32' && var_.type !== 'float64')) {\n throw new Error('invalid input tensor types.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {ProgramInfo, TextureLayout} from './types';\nimport {WebGLContext} from './webgl-context';\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum FunctionType {\n ValueBased,\n Positional\n}\nexport interface GlslFunction {\n body: string;\n name: string;\n type: T;\n}\nexport type GlslValueFunction = GlslFunction;\nexport interface GlslPositionalFunction extends GlslFunction {\n inputShape: readonly number[];\n outputShape: readonly number[];\n}\n\nexport class GlslContext {\n constructor(\n public glContext: WebGLContext, public programInfo: ProgramInfo, public inputTextureLayouts: TextureLayout[],\n public outputTextureLayout: TextureLayout) {}\n}\nexport abstract class GlslLib {\n constructor(public context: GlslContext) {}\n abstract getFunctions(): {[name: string]: GlslLibRoutine};\n abstract getCustomTypes(): {[name: string]: string};\n}\n\n// abstraction to represent a GLSL library routine and it's dependencies\nexport class GlslLibRoutine {\n constructor(public routineBody: string, public dependencies?: string[]) {}\n}\n\n// abstraction to represent a GLSL library routine and it's dependencies AS GRAPH Nodes\n// this level of abstraction is used to topologically sort routines before fragment shade inclusion\nexport class GlslLibRoutineNode {\n dependencies: GlslLibRoutineNode[];\n routineBody: string;\n constructor(public name: string, routineBody?: string, dependencies?: GlslLibRoutineNode[]) {\n if (dependencies) {\n this.dependencies = dependencies;\n } else {\n this.dependencies = [];\n }\n\n if (routineBody) {\n this.routineBody = routineBody;\n }\n }\n addDependency(node: GlslLibRoutineNode) {\n if (node) {\n this.dependencies.push(node);\n }\n }\n}\n\n// topologically sort GLSL library routines (graph nodes abstraction) before shader script inclusion\nexport class TopologicalSortGlslRoutines {\n static returnOrderedNodes(nodes: GlslLibRoutineNode[]): GlslLibRoutineNode[] {\n if (!nodes || nodes.length === 0) {\n return [];\n }\n\n if (nodes.length === 1) {\n return nodes;\n }\n\n const cycleCheck = new Set();\n const alreadyTraversed = new Set();\n const result = new Array();\n\n this.createOrderedNodes(nodes, cycleCheck, alreadyTraversed, result);\n return result;\n }\n\n private static createOrderedNodes(\n graphNodes: GlslLibRoutineNode[], cycleCheck: Set, alreadyTraversed: Set,\n result: GlslLibRoutineNode[]) {\n for (let i = 0; i < graphNodes.length; ++i) {\n this.dfsTraverse(graphNodes[i], cycleCheck, alreadyTraversed, result);\n }\n }\n\n private static dfsTraverse(\n root: GlslLibRoutineNode, cycleCheck: Set, alreadyTraversed: Set, result: GlslLibRoutineNode[]) {\n // if this root has already been traversed return\n if (!root || alreadyTraversed.has(root.name)) {\n return;\n }\n\n // cyclic dependency has been detected\n if (cycleCheck.has(root.name)) {\n throw new Error('Cyclic dependency detected. Can\\'t topologically sort routines needed for shader.');\n }\n\n // hold this node to detect cycles if any\n cycleCheck.add(root.name);\n\n // traverse children in a dfs fashion\n const dependencies = root.dependencies;\n if (dependencies && dependencies.length > 0) {\n for (let i = 0; i < dependencies.length; ++i) {\n this.dfsTraverse(dependencies[i], cycleCheck, alreadyTraversed, result);\n }\n }\n\n // add to result holder\n result.push(root);\n\n // mark this node as traversed so that we don't traverse from this again\n alreadyTraversed.add(root.name);\n\n // release the hold\n cycleCheck.delete(root.name);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {BroadcastUtil, ShapeUtil} from '../../../util';\nimport {FunctionType, GlslValueFunction} from '../glsl-definitions';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, TextureType} from '../types';\n\nexport function glslAdd(): GlslValueFunction {\n const name = 'add_';\n const body = `\n float ${name}(float a, float b) {\n return a + b;\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslDiv(): GlslValueFunction {\n const name = 'div_';\n const body = `\n float ${name}(float a, float b) {\n return a / b;\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslMul(): GlslValueFunction {\n const name = 'mul_';\n const body = `\n float ${name}(float a, float b) {\n return a * b;\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslSub(): GlslValueFunction {\n const name = 'sub_';\n const body = `\n float ${name}(float a, float b) {\n return a - b;\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslEqual(): GlslValueFunction {\n const name = 'equal_';\n const body = `\n float ${name}(float a, float b) {\n return float(a == b);\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslGreater(): GlslValueFunction {\n const name = 'greater_';\n const body = `\n float ${name}(float a, float b) {\n return float(a > b);\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslLess(): GlslValueFunction {\n const name = 'less_';\n const body = `\n float ${name}(float a, float b) {\n return float(a < b);\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslAnd(): GlslValueFunction {\n const name = 'and_';\n const body = `\n float ${name}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslOr(): GlslValueFunction {\n const name = 'or_';\n const body = `\n float ${name}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslXor(): GlslValueFunction {\n const name = 'xor_';\n const body = `\n float ${name}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslPow(): GlslValueFunction {\n return glslBuiltinBinary('pow');\n}\nexport function glslPRelu(): GlslValueFunction {\n const name = 'prelu_';\n const body = `\n float ${name}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\n\nfunction glslBuiltinBinary(fname: string): GlslValueFunction {\n const name = `${fname}_`;\n const body = `\n float ${name}(float a, float b) {\n return ${fname}(a, b);\n }\n vec4 ${name}(vec4 v1, vec4 v2) {\n return ${fname}(v1, v2);\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\n\nconst createBinaryProgramInfoLoader =\n (handler: WebGLInferenceHandler, inputs: Tensor[], glslFunc: GlslValueFunction,\n outputTensorType: Tensor.DataType = inputs[0].type, cacheKey?: string): ProgramInfoLoader => {\n const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n return {\n name: glslFunc.name,\n inputNames: ['A', 'B'],\n inputTypes: [textureType, textureType],\n cacheHint: cacheKey,\n get: () => createBinaryProgramInfo(handler, inputs, glslFunc, outputTensorType)\n };\n };\n\nconst createBinaryProgramInfo =\n (handler: WebGLInferenceHandler, inputs: Tensor[], glslFunc: GlslValueFunction,\n outputTensorType: Tensor.DataType = inputs[0].type): ProgramInfo => {\n const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n const isBroadcast = !ShapeUtil.areEqual(inputs[0].dims, inputs[1].dims);\n let outputShape = inputs[0].dims;\n\n const usePackedTexture = handler.session.pack;\n\n if (isBroadcast) {\n const calculatedShape = BroadcastUtil.calcShape(inputs[0].dims, inputs[1].dims, false);\n if (!calculatedShape) {\n throw new Error('Can\\'t perform binary op on the given tensors');\n }\n outputShape = calculatedShape;\n const outputRank = outputShape.length;\n const aRank = inputs[0].dims.length !== 0 ? inputs[0].dims.length : 1;\n const bRank = inputs[1].dims.length !== 0 ? inputs[1].dims.length : 1;\n const aBcast = inputs[0].dims.length !== 0 ? 'bcastIndices_A(indices, aindices);' : 'aindices[0] = 0;';\n const bBcast = inputs[1].dims.length !== 0 ? 'bcastIndices_B(indices, bindices);' : 'bindices[0] = 0;';\n\n const glsl = getGlsl(handler.session.backend.glContext.version);\n const shaderSource = usePackedTexture ? `\n ${glslFunc.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${glslFunc.name}(a, b);\n ${glsl.output} = result;\n }` :\n `\n ${glslFunc.body}\n float process(int indices[${outputRank}]) {\n int aindices[${aRank}];\n int bindices[${bRank}];\n ${aBcast}\n ${bBcast}\n return ${glslFunc.name}(_A(aindices), _B(bindices));\n }`;\n\n return {\n name: glslFunc.name,\n inputNames: ['A', 'B'],\n inputTypes: [textureType, textureType],\n output: {dims: outputShape, type: outputTensorType, textureType},\n shaderSource,\n hasMain: usePackedTexture\n };\n }\n const glsl = getGlsl(handler.session.backend.glContext.version);\n const shaderSource = `\n ${glslFunc.body}\n void main() {\n vec4 v1 = ${glsl.texture2D}(A, TexCoords);\n vec4 v2 = ${glsl.texture2D}(B, TexCoords);\n vec4 result = ${glslFunc.name}(v1, v2);\n ${glsl.output} = result;\n }\n `;\n\n return {\n name: glslFunc.name,\n inputNames: ['A', 'B'],\n inputTypes: [textureType, textureType],\n output: {dims: inputs[0].dims, type: outputTensorType, textureType},\n shaderSource,\n hasMain: true\n };\n };\n\nexport const add = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslAdd()), inputs)];\n\nexport const and = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslAnd(), 'bool'), inputs)];\n\nexport const div = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslDiv()), inputs)];\n\nexport const equal = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslEqual(), 'bool'), inputs)];\n\nexport const greater = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslGreater(), 'bool'), inputs)];\n\nexport const less = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslLess(), 'bool'), inputs)];\n\nexport const mul = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslMul()), inputs)];\n\nexport const or = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslOr(), 'bool'), inputs)];\n\nexport const pow = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslPow()), inputs)];\n\nexport const pRelu = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslPRelu()), inputs)];\n\nexport const sub = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslSub()), inputs)];\n\nexport const xor = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createBinaryProgramInfoLoader(handler, inputs, glslXor(), 'bool'), inputs)];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ProtoUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nexport const cast: OperatorImplementation =\n (handler: WebGLInferenceHandler, inputs: Tensor[], to: Tensor.DataType): Tensor[] => {\n validateInputs(inputs);\n return [handler.cast(inputs[0], to)];\n };\n\nexport const parseCastAttributes: OperatorInitialization = (node: Graph.Node): Tensor.DataType =>\n ProtoUtil.tensorDataTypeFromProto(node.attributes.getInt('to'));\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Cast requires 1 input.');\n }\n\n if (inputs[0].type === 'string') {\n throw new Error('Invalid input type.');\n }\n};", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\nimport {getCoordsDataType, getGlChannels} from '../utils';\n\nimport {ConcatAttributes} from './concat';\nimport {getChannels, unpackFromChannel} from './packing-utils';\n\nconst createPackedConcatProgramMetadata = (inputCount: number, cacheHint: string) => ({\n name: 'Concat (packed)',\n inputNames: Array.from({length: inputCount}, (_v, i) => `X${i}`),\n inputTypes: Array(inputCount).fill(TextureType.packed),\n cacheHint\n});\n\nconst createPackedConcatProgramInfo =\n (handler: WebGLInferenceHandler, metadata: ProgramMetadata, inputs: Tensor[], axis: number): ProgramInfo => {\n const inputShape = inputs[0].dims.slice();\n if (axis >= inputShape.length || axis < (-1 * inputShape.length)) {\n throw new Error('axis specified for concat doesn\\'t match input dimensionality');\n }\n if (axis < 0) {\n axis = inputShape.length + axis;\n }\n // ensure all of the non-concatenated axes match each other\n // calculate the shape of the output tensor while we do that\n const outputShape = inputShape.slice(0);\n for (let i = 1; i < inputs.length; i++) {\n const dataNShape = inputs[i].dims.slice();\n for (let axisIndex = 0; axisIndex < inputShape.length; axisIndex++) {\n // add to the placeholder for computing output shape\n if (axisIndex === axis) {\n outputShape[axis] += dataNShape[axisIndex];\n }\n // ensure all non-cancatenated axes match each other\n else if (inputShape[axisIndex] !== dataNShape[axisIndex]) {\n throw new Error('non concat dimensions must match');\n }\n }\n }\n\n const rank = outputShape.length;\n const coords = getChannels('coords', rank);\n const dtype = getCoordsDataType(rank);\n const unpackChannel = unpackFromChannel();\n\n const shapes = inputs.map(i => i.dims);\n const channels = getGlChannels(rank);\n const offsets: number[] = new Array(shapes.length - 1);\n\n offsets[0] = shapes[0][axis];\n for (let i = 1; i < offsets.length; i++) {\n offsets[i] = offsets[i - 1] + shapes[i][axis];\n }\n\n const channel = channels[axis];\n const lastChannels = channels.slice(-2);\n const allChannels = channels.join();\n\n let getValueSnippet = `if (${channel} < ${offsets[0]}) {\n return getChannel(\n getX0(${allChannels}), vec2(${lastChannels.join()}));\n }`;\n for (let i = 1; i < offsets.length; i++) {\n const shift = offsets[i - 1];\n getValueSnippet += `\n if (${channel} < ${offsets[i]} && ${channel} >= ${offsets[i - 1]}) {\n return getChannel(\n getX${i}(${getShiftedChannelsSnippet(channels, channel, shift)}),\n vec2(${getShiftedChannelsSnippet(lastChannels, channel, shift)}));\n }`;\n }\n const lastIndex = offsets.length;\n const shift = offsets[offsets.length - 1];\n getValueSnippet += `\n return getChannel(\n getX${lastIndex}(${getShiftedChannelsSnippet(channels, channel, shift)}),\n vec2(${getShiftedChannelsSnippet(lastChannels, channel, shift)}));`;\n\n const glsl = getGlsl(handler.session.backend.glContext.version);\n\n const shaderSource = `\n ${unpackChannel}\n float getValue(${channels.map(x => 'int ' + x)}) {\n ${getValueSnippet}\n }\n\n void main() {\n ${dtype} coords = getOutputCoords();\n int lastDim = coords.${channels[rank - 1]};\n coords.${channels[rank - 1]} = coords.${channels[rank - 2]};\n coords.${channels[rank - 2]} = lastDim;\n\n vec4 result = vec4(getValue(${coords}), 0., 0., 0.);\n\n ${coords[rank - 1]} = ${coords[rank - 1]} + 1;\n if (${coords[rank - 1]} < ${outputShape[rank - 1]}) {\n result.g = getValue(${coords});\n }\n\n ${coords[rank - 2]} = ${coords[rank - 2]} + 1;\n if (${coords[rank - 2]} < ${outputShape[rank - 2]}) {\n result.a = getValue(${coords});\n }\n\n ${coords[rank - 1]} = ${coords[rank - 1]} - 1;\n if (${coords[rank - 2]} < ${outputShape[rank - 2]} &&\n ${coords[rank - 1]} < ${outputShape[rank - 1]}) {\n result.b = getValue(${coords});\n }\n ${glsl.output} = result;\n }\n `;\n\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.packed},\n shaderSource,\n hasMain: true,\n };\n };\n\nexport const createPackedConcatProgramInfoLoader =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: ConcatAttributes): ProgramInfoLoader => {\n const metadata = createPackedConcatProgramMetadata(inputs.length, attributes.cacheKey);\n return {...metadata, get: () => createPackedConcatProgramInfo(handler, metadata, inputs, attributes.axis)};\n };\n\nconst getShiftedChannelsSnippet = (channels: string[], channel: string, shift: number): string => {\n const channelIdx = channels.indexOf(channel);\n const res = channels.map((c, idx) => {\n if (idx === channelIdx) {\n return `${c} - ${shift}`;\n } else {\n return c;\n }\n });\n return res.join();\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {createPackedConcatProgramInfoLoader} from './concat-packed';\n\nexport interface ConcatAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n}\n\nexport const concat: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ConcatAttributes): Tensor[] => {\n validateInputs(inputs);\n if (inferenceHandler.session.pack && inputs[0].dims.length > 1) {\n const output =\n inferenceHandler.run(createPackedConcatProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n return [output];\n } else {\n const output =\n inferenceHandler.run(createUnpackedConcatProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n return [output];\n }\n };\n\nconst createUnpackedConcatProgramMetadata = (inputCount: number, cacheHint: string) => ({\n name: 'Concat',\n inputNames: Array.from({length: inputCount}, (_v, i) => `X${i}`),\n inputTypes: Array(inputCount).fill(TextureType.unpacked),\n cacheHint\n});\n\nconst createUnpackedConcatProgramInfo =\n (_handler: WebGLInferenceHandler, metadata: ProgramMetadata, inputs: Tensor[], axis: number): ProgramInfo => {\n const inputShape = inputs[0].dims.slice();\n if (axis >= inputShape.length || axis < (-1 * inputShape.length)) {\n throw new Error('axis specified for concat doesn\\'t match input dimensionality');\n }\n if (axis < 0) {\n axis = inputShape.length + axis;\n }\n // ensure all of the non-concatenated axes match each other\n // calculate the shape of the output tensor while we do that\n const outputShape = inputShape.slice(0);\n for (let i = 1; i < inputs.length; i++) {\n const dataNShape = inputs[i].dims.slice();\n for (let axisIndex = 0; axisIndex < inputShape.length; axisIndex++) {\n // add to the placeholder for computing output shape\n if (axisIndex === axis) {\n outputShape[axis] += dataNShape[axisIndex];\n }\n // ensure all non-cancatenated axes match each other\n else if (inputShape[axisIndex] !== dataNShape[axisIndex]) {\n throw new Error('non concat dimensions must match');\n }\n }\n }\n\n const rank = outputShape.length;\n\n const sizeInConcatAxis = new Array(inputs.length);\n let previousSum = 0;\n for (let i = 0; i < sizeInConcatAxis.length; ++i) {\n previousSum += inputs[i].dims[axis];\n sizeInConcatAxis[i] = previousSum;\n }\n\n let getTextureIndexWhereDataResidesMethod = '';\n // in most cases linear search is sufficient, as in most scenarios, only 2 tensors are concatenated\n if (inputs.length < 5) {\n getTextureIndexWhereDataResidesMethod = getTextureIndexWhereDataResidesLinearSearch(sizeInConcatAxis);\n } else {\n getTextureIndexWhereDataResidesMethod = getTextureIndexWhereDataResidesBinarySearch(sizeInConcatAxis);\n }\n\n const fetchDataFromCorrectTextureMethod = getFetchDataFromCorrectTextureMethod(inputs.length, rank);\n const getSizeInConcatAxisValueFromIndexMethod = getGetSizeInConcatAxisValueFromIndexMethod(sizeInConcatAxis);\n const shaderSource = `\n ${fetchDataFromCorrectTextureMethod}\n ${getSizeInConcatAxisValueFromIndexMethod}\n ${getTextureIndexWhereDataResidesMethod}\n float process(int indices[${rank}]) {\n int textureIndex = getTextureWhereDataResides (indices[${axis}]);\n\n if(textureIndex != 0) {\n indices[${axis}] = indices[${axis}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n }\n\n return fetchDataFromCorrectTexture(textureIndex, indices);\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource,\n };\n };\n\nconst createUnpackedConcatProgramInfoLoader =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: ConcatAttributes): ProgramInfoLoader => {\n const metadata = createUnpackedConcatProgramMetadata(inputs.length, attributes.cacheKey);\n return {...metadata, get: () => createUnpackedConcatProgramInfo(handler, metadata, inputs, attributes.axis)};\n };\n\nconst getTextureIndexWhereDataResidesLinearSearch = (sizeInConcatAxis: number[]): string => {\n const searchAxis = sizeInConcatAxis.map((size, i) => `if(index<${size}) {return ${i};}\n`);\n return `int getTextureWhereDataResides(int index) {\n ${searchAxis.join('')}\n }`;\n};\n\n// TODO: Implement BinarySearch in GLSL\nconst getTextureIndexWhereDataResidesBinarySearch = (sizeInConcatAxis: number[]): string =>\n getTextureIndexWhereDataResidesLinearSearch(sizeInConcatAxis);\n\nconst getFetchDataFromCorrectTextureMethod = (numberOfTensors: number, tensorRank: number) => {\n const codeLines: string[] = [`float fetchDataFromCorrectTexture(int textureIndex, int indices[${tensorRank}]) {`];\n for (let i = 0; i < numberOfTensors; ++i) {\n if (i === 0) {\n codeLines.push(\n '\\t' +\n `if (textureIndex == ${i}) { return _X${i}(indices); }`);\n } else if (i === numberOfTensors - 1) {\n codeLines.push(\n '\\t' +\n `else { return _X${i}(indices); }`);\n } else {\n codeLines.push(\n '\\t' +\n `else if (textureIndex == ${i}) { return _X${i}(indices); }`);\n }\n }\n codeLines.push(\n '\\t' +\n '}');\n return codeLines.join('\\n');\n};\n\nconst getGetSizeInConcatAxisValueFromIndexMethod = (sizeInConcatAxis: number[]): string => {\n const codeLines: string[] = ['int getSizeInConcatAxisValueFromIndex(int index) {'];\n for (let i = 0; i < sizeInConcatAxis.length; ++i) {\n if (i === 0) {\n codeLines.push(\n '\\t' +\n `if (index == ${i}) { return ${sizeInConcatAxis[i]}; }`);\n } else if (i === sizeInConcatAxis.length - 1) {\n codeLines.push(\n '\\t' +\n `else { return ${sizeInConcatAxis[i]}; }`);\n } else {\n codeLines.push(\n '\\t' +\n `else if (index == ${i}) { return ${sizeInConcatAxis[i]}; }`);\n }\n }\n codeLines.push(\n '\\t' +\n '}');\n\n return codeLines.join('\\n');\n};\n\nexport const parseConcatAttributes: OperatorInitialization = (node: Graph.Node): ConcatAttributes =>\n createAttributeWithCacheKey({axis: node.attributes.getInt('axis')});\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length < 1) {\n throw new Error('too few inputs');\n }\n\n const inputType = inputs[0].type;\n const inputDimensionality = inputs[0].dims.length;\n\n // TODO: Support string concat\n if (inputType === 'string') {\n throw new Error('string tensor is not supported yet');\n }\n\n for (const input of inputs) {\n // make sure types of all inputs match\n if (input.type !== inputType) {\n throw new Error('input tensors should be one type');\n }\n\n // make sure the dimensionality of all inputs are the same\n if (input.dims.length !== inputDimensionality) {\n throw new Error('input tensors should have the same shape');\n }\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {Tensor} from '../../../tensor';\nimport {MAX_CLIP, MIN_CLIP} from '../../../util';\nimport {FunctionType, GlslValueFunction} from '../glsl-definitions';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nexport function glslAbs(): GlslValueFunction {\n return glslBuiltinUnary('abs');\n}\nexport function glslAcos(): GlslValueFunction {\n return glslBuiltinUnary('acos');\n}\nexport function glslAsin(): GlslValueFunction {\n return glslBuiltinUnary('asin');\n}\nexport function glslAtan(): GlslValueFunction {\n return glslBuiltinUnary('atan');\n}\nexport function glslCeil(): GlslValueFunction {\n return glslBuiltinUnary('ceil');\n}\nexport function glslCos(): GlslValueFunction {\n return glslBuiltinUnary('cos');\n}\nexport function glslElu(alpha: number): GlslValueFunction {\n const name = 'elu';\n const body = `\n const float alpha = float(${alpha});\n\n float ${name}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${name}_(vec4 v) {\n return vec4(${name}_(v.x), ${name}_(v.y), ${name}_(v.z), ${name}_(v.w));\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslExp(): GlslValueFunction {\n return glslBuiltinUnary('exp');\n}\nexport function glslFloor(): GlslValueFunction {\n return glslBuiltinUnary('floor');\n}\nexport function glslClip(min: number, max: number): GlslValueFunction {\n const name = 'clip';\n const body = `\n const float min = float(${min});\n const float max = float(${max});\n\n float ${name}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${name}_(vec4 v) {\n return clamp(v, min, max);\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslIdentity(): GlslValueFunction {\n const name = 'indentity';\n const body = `\n float ${name}_(float a) {\n return a;\n }\n vec4 ${name}_(vec4 v) {\n return v;\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslLeakyRelu(alpha: number): GlslValueFunction {\n const name = 'leakyRelu';\n const body = `\n const float alpha = float(${alpha});\n\n float ${name}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${name}_(vec4 v) {\n return vec4(${name}_(v.x), ${name}_(v.y), ${name}_(v.z), ${name}_(v.w));\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslLog(): GlslValueFunction {\n return glslBuiltinUnary('log');\n}\nexport function glslNeg(): GlslValueFunction {\n const name = 'neg';\n const body = `\n float ${name}_(float a) {\n return -a;\n }\n vec4 ${name}_(vec4 v) {\n return -v;\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslNot(): GlslValueFunction {\n const name = 'not';\n const body = `\n float ${name}_(float a) {\n return float( ! bool(a) );\n }\n bool ${name}_(bool a) {\n return !a;\n }\n vec4 ${name}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${name}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslSin(): GlslValueFunction {\n return glslBuiltinUnary('sin');\n}\nexport function glslRelu(): GlslValueFunction {\n const name = 'relu';\n const body = `\n float ${name}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${name}_(vec4 v) {\n return max( v, 0.0 );\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslSigmoid(): GlslValueFunction {\n const name = 'sigmoid';\n const body = `\n float ${name}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${name}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nexport function glslSqrt(): GlslValueFunction {\n return glslBuiltinUnary('sqrt');\n}\nexport function glslTan(): GlslValueFunction {\n return glslBuiltinUnary('tan');\n}\nexport function glslTanh(): GlslValueFunction {\n const name = 'tanh';\n const body = `\n float ${name}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${name}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\nfunction glslBuiltinUnary(name: string): GlslValueFunction {\n const body = `\n float ${name}_(float a) {\n return ${name}(a);\n }\n vec4 ${name}_(vec4 v) {\n return ${name}(v);\n }\n `;\n return {body, name, type: FunctionType.ValueBased};\n}\n\n/////\n/////\n/////\n\nconst createElementwiseProgramInfo =\n (handler: WebGLInferenceHandler, metadata: ProgramMetadata, input: Tensor, glslFunc: GlslValueFunction):\n ProgramInfo => {\n const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n const glsl = getGlsl(handler.session.backend.glContext.version);\n return {\n ...metadata,\n output: {dims: input.dims, type: input.type, textureType},\n shaderSource: `\n ${glslFunc.body}\n void main() {\n vec4 v = ${glsl.texture2D}(A, TexCoords);\n v = ${glslFunc.name}_(v);\n ${glsl.output} = v;\n }\n `,\n hasMain: true\n };\n };\n\nconst createElementwiseProgramInfoLoader =\n (handler: WebGLInferenceHandler, input: Tensor, glslFunc: GlslValueFunction, cacheKey?: string):\n ProgramInfoLoader => {\n const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n const metadata = {name: glslFunc.name, inputTypes: [textureType], inputNames: ['A'], cacheHint: cacheKey};\n return {...metadata, get: () => createElementwiseProgramInfo(handler, metadata, input, glslFunc)};\n };\n\nexport const abs = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAbs()), inputs)];\n\nexport const acos = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAcos()), inputs)];\n\nexport const asin = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAsin()), inputs)];\n\nexport const atan = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAtan()), inputs)];\n\nexport interface ClipAttributes extends AttributeWithCacheKey {\n readonly min: number;\n readonly max: number;\n}\n\nexport const clip =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: ClipAttributes): Tensor[] => [handler.run(\n createElementwiseProgramInfoLoader(\n handler, inputs[0], glslClip(attributes.min, attributes.max), attributes.cacheKey),\n inputs)];\n\nexport const parseClipAttributes = (node: Graph.Node): ClipAttributes => createAttributeWithCacheKey(\n {min: node.attributes.getFloat('min', MIN_CLIP), max: node.attributes.getFloat('max', MAX_CLIP)});\n\nexport const clipV11 = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n const attributes = generateClipAttributesFromInputs(handler, inputs);\n return clip(handler, [inputs[0]], attributes);\n};\n\nconst generateClipAttributesFromInputs = (handler: WebGLInferenceHandler, inputs: Tensor[]): ClipAttributes => {\n if (inputs.length >= 3 &&\n (!handler.session.isInitializer(inputs[1].dataId) || !handler.session.isInitializer(inputs[2].dataId))) {\n throw new Error('dynamic clip attributes are not allowed');\n }\n\n const min = (inputs.length >= 3) ? inputs[1].numberData[0] : MIN_CLIP;\n const max = (inputs.length >= 3) ? inputs[2].numberData[0] : MAX_CLIP;\n return createAttributeWithCacheKey({min, max});\n};\n\nexport const ceil = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslCeil()), inputs)];\n\nexport const cos = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslCos()), inputs)];\n\nexport interface EluAttributes extends AttributeWithCacheKey {\n readonly alpha: number;\n}\n\nexport const elu =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: EluAttributes): Tensor[] => [handler.run(\n createElementwiseProgramInfoLoader(handler, inputs[0], glslElu(attributes.alpha), attributes.cacheKey),\n inputs)];\n\nexport const parseEluAttributes = (node: Graph.Node): EluAttributes =>\n createAttributeWithCacheKey({alpha: node.attributes.getFloat('alpha', 1.0)});\n\nexport const exp = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslExp()), inputs)];\n\nexport const floor = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslFloor()), inputs)];\n\nexport const identity = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslIdentity()), inputs)];\n\nexport interface LeakyReluAttributes extends AttributeWithCacheKey {\n readonly alpha: number;\n}\n\nexport const leakyRelu =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: LeakyReluAttributes): Tensor[] => [handler.run(\n createElementwiseProgramInfoLoader(handler, inputs[0], glslLeakyRelu(attributes.alpha), attributes.cacheKey),\n inputs)];\n\nexport const parseLeakyReluAttributes = (node: Graph.Node): LeakyReluAttributes =>\n createAttributeWithCacheKey({alpha: node.attributes.getFloat('alpha', 0.01)});\n\nexport const log = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslLog()), inputs)];\n\nexport const neg = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslNeg()), inputs)];\n\nexport const not = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslNot()), inputs)];\n\nexport const relu = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslRelu()), inputs)];\n\nexport const sigmoid = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslSigmoid()), inputs)];\n\nexport const sin = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslSin()), inputs)];\n\nexport const sqrt = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslSqrt()), inputs)];\n\nexport const tan = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslTan()), inputs)];\n\nexport const tanh = (handler: WebGLInferenceHandler, inputs: Tensor[]):\n Tensor[] => [handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslTanh()), inputs)];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Attribute} from '../../../attribute';\nimport {MAX_CLIP, MIN_CLIP} from '../../../util';\nimport {GlslValueFunction} from '../glsl-definitions';\n\nimport {glslClip, glslRelu, glslSigmoid} from './unary-op';\n\nexport interface InternalActivationAttributes {\n readonly activation: string;\n readonly clipMin?: number;\n readonly clipMax?: number;\n readonly activationCacheKey: string;\n}\n\nexport function getActivationSnippet(attributes: InternalActivationAttributes) {\n let func: GlslValueFunction;\n switch (attributes.activation) {\n case 'Relu':\n func = glslRelu();\n break;\n case 'Sigmoid':\n func = glslSigmoid();\n break;\n case 'Clip':\n func = glslClip(attributes.clipMin!, attributes.clipMax!);\n break;\n // TODO: adding other activations that can be fused.\n default:\n return {activationFunction: '', applyActivation: ''};\n }\n\n const activationName = func.name;\n const activationFunction = func.body;\n const applyActivation = `value = ${activationName}_(value);`;\n return {activationFunction, applyActivation};\n}\n\nexport const parseInternalActivationAttributes = (attributes: Attribute): InternalActivationAttributes => {\n const activation = attributes.getString('activation', '');\n\n if (activation === 'Clip') {\n const [clipMin, clipMax] = attributes.getFloats('activation_params', [MIN_CLIP, MAX_CLIP]);\n return {activation, clipMax, clipMin, activationCacheKey: `${activation}:${clipMin},${clipMax}`};\n }\n return {activation, activationCacheKey: activation};\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Logger} from '../../../instrument';\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {calculateOutputShape, ConvAttributes} from './conv';\nimport {getActivationSnippet} from './fuse-utils';\n\nconst createUnpackedGroupedConvProgramMetadata = (hasBias: boolean, cacheHint: string): ProgramMetadata => ({\n name: 'GroupedConv',\n inputNames: hasBias ? ['X', 'W', 'Bias'] : ['X', 'W'],\n inputTypes: hasBias ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked] :\n [TextureType.unpacked, TextureType.unpacked],\n cacheHint\n});\n\nconst createUnpackedGroupedConvProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], metadata: ProgramMetadata,\n attributes: ConvAttributes): ProgramInfo => {\n const hasBias = inputs.length > 2;\n const processBias = hasBias ? 'value += getBias(output_channel);' : '';\n const xShape = inputs[0].dims.slice();\n const wShape = inputs[1].dims.slice();\n const outputChannelsPerGroup = wShape[0] / attributes.group;\n Logger.verbose(\n 'GroupedConv',\n `autpPad:${attributes.autoPad}, dilations:${attributes.dilations}, group:${attributes.group}, kernelShape:${\n attributes.kernelShape}, pads:${attributes.pads}, strides:${attributes.strides}`);\n const outputShape =\n calculateOutputShape(xShape, wShape, attributes.dilations, attributes.pads, attributes.strides);\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const {activationFunction, applyActivation} = getActivationSnippet(attributes);\n\n const shaderSource = `\n const ivec2 strides = ivec2(${attributes.strides[0]}, ${attributes.strides[1]});\n const ivec2 pads = ivec2(${attributes.pads[0]}, ${attributes.pads[1]});\n ${activationFunction}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${outputChannelsPerGroup};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${wShape[1]}; wInChannel++) {\n int input_channel = group_id * ${wShape[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${wShape[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${attributes.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${xShape[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${wShape[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${attributes.dilations[1]};\n if (xWidth < 0 || xWidth >= ${xShape[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${processBias}\n ${applyActivation}\n ${glsl.output} = vec4(value, .0, .0, .0);\n }\n`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource,\n hasMain: true,\n };\n };\n\nexport const createUnpackedGroupedConvProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvAttributes):\n ProgramInfoLoader => {\n const metadata = createUnpackedGroupedConvProgramMetadata(inputs.length > 2, attributes.cacheKey);\n return {\n ...metadata,\n get: () => createUnpackedGroupedConvProgramInfo(inferenceHandler, inputs, metadata, attributes)\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {ConvAttributes} from './conv';\nimport {unpackFromChannel} from './packing-utils';\n\nconst createPackedIm2ColProgramMetadata = (cacheHint: string) => ({\n name: 'Im2Col (packed)',\n inputNames: ['A'],\n inputTypes: [TextureType.packed],\n cacheHint,\n});\n\nconst createPackedIm2ColProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, metadata: ProgramMetadata, x: Tensor, w: Tensor,\n outputShape: readonly number[], attributes: ConvAttributes): ProgramInfo => {\n const xshape = x.dims;\n const wshape = w.dims;\n const rowDim = 2;\n const colDim = 3;\n const rank = outputShape.length;\n const im2colShape = [wshape[1] * wshape[2] * wshape[3], outputShape[2] * outputShape[3]];\n const kernelSize = wshape[2] * wshape[3];\n const unpackChannel = unpackFromChannel();\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n let unrolled = '';\n\n for (let row = 0; row <= 1; row++) {\n for (let col = 0; col <= 1; col++) {\n unrolled += `\n blockIndex = rc.x + ${col};\n pos = rc.y + ${row};\n\n if(blockIndex < ${im2colShape[1]} && pos < ${im2colShape[0]}) {\n offsetY = int(blockIndex / (${outputShape[rank - 1]})) * ${attributes.strides[0]} -\n ${attributes.pads[0]};\n d0 = offsetY + ${attributes.dilations[0]} * (imod(pos, ${kernelSize}) / ${wshape[2]});\n\n if(d0 < ${xshape[rowDim]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${outputShape[rank - 1]}) * ${attributes.strides[1]} -\n ${attributes.pads[1]};\n d1 = offsetX + ${attributes.dilations[1]} * imod(imod(pos, ${kernelSize}), ${wshape[2]});\n\n if(d1 < ${xshape[colDim]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${kernelSize}.);\n innerDims = vec2(d0, d1);\n result[${row * 2 + col}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;\n }\n }\n\n const shaderSource = `\n ${unpackChannel}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${unrolled}\n ${glsl.output} = result;\n }\n `;\n return {\n ...metadata,\n output: {dims: im2colShape, type: x.type, textureType: TextureType.packed},\n shaderSource,\n hasMain: true\n };\n };\n\nexport const createPackedIm2ColProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, x: Tensor, w: Tensor, outputShape: readonly number[],\n attributes: ConvAttributes): ProgramInfoLoader => {\n const metadata = createPackedIm2ColProgramMetadata(attributes.cacheKey);\n return {\n ...metadata,\n get: () => createPackedIm2ColProgramInfo(inferenceHandler, metadata, x, w, outputShape, attributes)\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {BroadcastUtil, ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\nimport {getCoordsDataType, getGlChannels} from '../utils';\n\nimport {getActivationSnippet, InternalActivationAttributes, parseInternalActivationAttributes} from './fuse-utils';\nimport {createPackedMatmulProgramInfoLoader} from './matmul-pack';\n\nexport const matMul: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: InternalActivationAttributes): Tensor[] => {\n validateInputs(inputs);\n\n if (inferenceHandler.session.pack) {\n return [inferenceHandler.run(\n createPackedMatmulProgramInfoLoader(inferenceHandler, inputs, attributes), inputs)];\n } else {\n return [inferenceHandler.run(createMatmulProgramInfoLoader(inputs, attributes), inputs)];\n }\n };\n\nexport const parseMatMulAttributes: OperatorInitialization =\n (node: Graph.Node): InternalActivationAttributes => parseInternalActivationAttributes(node.attributes);\n\nconst createMatmulProgramMetadata = (hasBias: boolean, cacheHint: string) => ({\n name: 'MatMul',\n inputNames: hasBias ? ['A', 'B', 'Bias'] : ['A', 'B'],\n inputTypes: hasBias ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked] :\n [TextureType.unpacked, TextureType.unpacked],\n cacheHint\n});\n\nfunction createMatmulProgramInfo(\n metadata: ProgramMetadata, inputs: Tensor[], activationAttributes: InternalActivationAttributes): ProgramInfo {\n const aShape = inputs[0].dims;\n const bShape = inputs[1].dims;\n const outputShape = BroadcastUtil.calcShape(aShape, bShape, true);\n if (!outputShape) {\n throw new Error('Can\\'t use matmul on the given tensors');\n }\n const coordsDataType = getCoordsDataType(outputShape.length);\n const allGlChannels = getGlChannels();\n const {activationFunction, applyActivation} = getActivationSnippet(activationAttributes);\n\n const hasBias = inputs.length > 2;\n const processBias = hasBias ? 'value += getBiasForMatmul();' : '';\n const getBiasForMatmulSnippet =\n hasBias ? `${getBiasForMatmul(coordsDataType, allGlChannels, inputs[2].dims, outputShape, false)}` : '';\n\n const rank = outputShape.length;\n const arank = aShape.length;\n const brank = bShape.length;\n const sharedDim = aShape[aShape.length - 1];\n const shaderSource = `\n ${activationFunction}\n ${getBiasForMatmulSnippet}\n float process(int indices[${rank}]) {\n int a[${arank}];\n int b[${brank}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${sharedDim}; ++k) {\n a[${arank - 1}] = k;\n b[${brank - 2}] = k;\n value += _A(a) * _B(b);\n }\n ${processBias}\n ${applyActivation}\n return value;\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource,\n };\n}\n\nexport function createMatmulProgramInfoLoader(\n inputs: Tensor[], activationAttributes: InternalActivationAttributes): ProgramInfoLoader {\n const metadata = createMatmulProgramMetadata(inputs.length > 2, activationAttributes.activationCacheKey);\n return {...metadata, get: () => createMatmulProgramInfo(metadata, inputs, activationAttributes)};\n}\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('MatMul requires 2 inputs.');\n }\n\n if (inputs[0].dims[inputs[0].dims.length - 1] !== inputs[1].dims[inputs[1].dims.length - 2]) {\n throw new Error('shared dimension does not match.');\n }\n\n if ((inputs[0].type !== 'float32' && inputs[0].type !== 'float64') ||\n (inputs[1].type !== 'float32' && inputs[1].type !== 'float64')) {\n throw new Error('inputs should be float type');\n }\n\n if (inputs[0].type !== inputs[1].type) {\n throw new Error('inputs types should match');\n }\n};\n\nexport function getBiasForMatmul(\n coordsDataType: string, allGlChannels: readonly string[], inShape: readonly number[], outShape: readonly number[],\n isPacked: boolean): string {\n let unpackedCoordsSnippet = '';\n const inRank = inShape.length;\n const outRank = outShape.length;\n const rankDiff = outRank - inRank;\n if (outRank < 2 && inRank > 0) {\n unpackedCoordsSnippet = 'coords';\n } else {\n unpackedCoordsSnippet = inShape.map((_s, i) => `coords.${allGlChannels[i + rankDiff]}`).join(', ');\n }\n const broadcastDims = BroadcastUtil.getBroadcastDims(inShape, outShape);\n const coordsSnippet = broadcastDims.map(d => `coords.${allGlChannels[d + rankDiff]} = 0;`).join('\\n');\n const inSize = ShapeUtil.size(inShape);\n const isInputScalar = inSize === 1;\n let output = 'vec4(outputValue.xx, outputValue.yy)';\n if (isInputScalar) {\n output = 'vec4(outputValue.x)';\n }\n const getBiasForMatmulSource = isPacked ? `\nvec4 getBiasForMatmul() {\n ${coordsDataType} coords = getOutputCoords();\n ${coordsSnippet}\n vec4 outputValue = getBias(${unpackedCoordsSnippet});\n return ${output};\n}` :\n `\nfloat getBiasForMatmul() {\n ${coordsDataType} coords = getOutputCoords();\n ${coordsSnippet}\n return getBias(coords.x);\n}`;\n\n return getBiasForMatmulSource;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {BroadcastUtil, ShapeUtil} from '../../../util';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\nimport {getCoordsDataType, getGlChannels} from '../utils';\n\nimport {getActivationSnippet, InternalActivationAttributes} from './fuse-utils';\nimport {getBiasForMatmul} from './matmul';\n\nconst createPackedMatmulProgramMetadata = (hasBias: boolean, cacheHint: string) => ({\n name: 'MatMul (packed)',\n inputNames: hasBias ? ['A', 'B', 'Bias'] : ['A', 'B'],\n inputTypes: hasBias ? [TextureType.packed, TextureType.packed, TextureType.packed] :\n [TextureType.packed, TextureType.packed],\n cacheHint\n});\n\nconst createPackedMatmulProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, metadata: ProgramMetadata, inputs: Tensor[],\n activationAttributes: InternalActivationAttributes): ProgramInfo => {\n const hasBias = inputs.length > 2;\n const processBias = hasBias ? 'value += getBiasForMatmul();' : '';\n const aShape = inputs[0].dims;\n const bShape = inputs[1].dims;\n const outputShape = BroadcastUtil.calcShape(aShape, bShape, true);\n const isBroadcast = !ShapeUtil.areEqual(inputs[0].dims, inputs[1].dims);\n\n if (!outputShape) {\n throw new Error('Can\\'t use matmul on the given tensors');\n }\n const sharedDim = aShape[aShape.length - 1];\n const sharedDimIndex = Math.ceil(sharedDim / 2);\n const aRank = aShape.length;\n const bRank = bShape.length;\n\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const coordsDataType = getCoordsDataType(outputShape.length);\n const outRank = outputShape.length;\n const allGlChannels = getGlChannels();\n const {activationFunction, applyActivation} = getActivationSnippet(activationAttributes);\n\n const getBiasForMatmulSnippet =\n hasBias ? `${getBiasForMatmul(coordsDataType, allGlChannels, inputs[2].dims, outputShape, true)}` : '';\n\n const getBcastedSamplerForMatmulSnippet =\n isBroadcast ? `${getBcastSamplerForMatmul(coordsDataType, allGlChannels, inputs, outputShape)}` : '';\n\n const getSamplerAInLoopSnippet = isBroadcast ? 'getAAtOutCoordsMatmul(i)' : `getA(${getA(allGlChannels, aRank)})`;\n const getSamplerBInLoopSnippet = isBroadcast ? 'getBAtOutCoordsMatmul(i)' : `getB(${getB(allGlChannels, bRank)})`;\n const getOutputCoordsSnippet = isBroadcast ? '' : `${coordsDataType} rc =\n getOutputCoords(); int lastDim = rc.${allGlChannels[outRank - 1]}; rc.${allGlChannels[outRank - 1]} =\n rc.${allGlChannels[outRank - 2]}; rc.${allGlChannels[outRank - 2]} = lastDim;\n `;\n const shaderSource = `\n ${getBcastedSamplerForMatmulSnippet}\n ${getBiasForMatmulSnippet}\n ${activationFunction}\n void main() {\n ${getOutputCoordsSnippet}\n\n vec4 value = vec4(0);\n for (int i = 0; i < ${sharedDimIndex}; i++) {\n vec4 a = ${getSamplerAInLoopSnippet};\n vec4 b = ${getSamplerBInLoopSnippet};\n\n value += (a.rrbb * b.rgrg);\n value += (a.ggaa * b.baba);\n }\n ${processBias}\n ${applyActivation}\n ${glsl.output} = value;\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.packed},\n shaderSource,\n hasMain: true\n };\n };\n\nexport const createPackedMatmulProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[],\n activationAttributes: InternalActivationAttributes): ProgramInfoLoader => {\n const metadata = createPackedMatmulProgramMetadata(inputs.length > 2, activationAttributes.activationCacheKey);\n return {\n ...metadata,\n get: () => createPackedMatmulProgramInfo(inferenceHandler, metadata, inputs, activationAttributes)\n };\n };\n\nfunction getBcastSamplerForMatmul(\n coordsDataType: string, allGlChannels: readonly string[], inputs: Tensor[], outShape: readonly number[]): string {\n let unpackedACoordsSnippet = [];\n let unpackedBCoordsSnippet = [];\n\n const inAShape = inputs[0].dims;\n const inBShape = inputs[1].dims;\n\n const inARank = inAShape.length;\n const inBRank = inBShape.length;\n\n const outRank = outShape.length;\n const rankADiff = outRank - inARank;\n const rankBDiff = outRank - inBRank;\n\n unpackedACoordsSnippet = inAShape.map((_s, i) => `coords.${allGlChannels[i + rankADiff]}`);\n unpackedACoordsSnippet[inARank - 1] = 'i*2';\n unpackedACoordsSnippet.join(', ');\n unpackedBCoordsSnippet = inBShape.map((_s, i) => `coords.${allGlChannels[i + rankBDiff]}`);\n unpackedBCoordsSnippet[inBRank - 2] = 'i*2';\n unpackedBCoordsSnippet.join(', ');\n\n const broadcastADims = BroadcastUtil.getBroadcastDims(inAShape, outShape);\n const broadcastBDims = BroadcastUtil.getBroadcastDims(inBShape, outShape);\n\n const coordsASnippet = broadcastADims.map(d => `coords.${allGlChannels[d + rankADiff]} = 0;`).join('\\n');\n const coordsBSnippet = broadcastBDims.map(d => `coords.${allGlChannels[d + rankBDiff]} = 0;`).join('\\n');\n const swapDimSnippet = `int lastDim = coords.${allGlChannels[outRank - 1]};\n coords.${allGlChannels[outRank - 1]} = coords.${allGlChannels[outRank - 2]};\n coords.${allGlChannels[outRank - 2]} = lastDim;`;\n\n const getBcastSamplerMatmulSource = `\nvec4 getAAtOutCoordsMatmul(int i) {\n ${coordsDataType} coords = getOutputCoords();\n ${swapDimSnippet}\n ${coordsASnippet}\n vec4 outputValue = getA(${unpackedACoordsSnippet});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${coordsDataType} coords = getOutputCoords();\n ${swapDimSnippet}\n ${coordsBSnippet}\n vec4 outputValue = getB(${unpackedBCoordsSnippet});\n return outputValue;\n}`;\n\n return getBcastSamplerMatmulSource;\n}\n\nfunction getA(allGlChannels: string[], rank: number): string {\n let res = '';\n for (let i = 0; i < rank - 2; i++) {\n res += `rc.${allGlChannels[i]}, `;\n }\n res += `rc.${allGlChannels[rank - 2]}, ` +\n 'i*2';\n return res;\n}\n\nfunction getB(allGlChannels: string[], rank: number): string {\n let res = '';\n for (let i = 0; i < rank - 2; i++) {\n res += `rc.${allGlChannels[i]}, `;\n }\n res += 'i*2, ' +\n `rc.${allGlChannels[rank - 1]}`;\n return res;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nimport {calculateOutputShape, ConvAttributes} from './conv';\nimport {createPackedIm2ColProgramInfoLoader} from './im2col-pack';\nimport {createPackedMatmulProgramInfoLoader} from './matmul-pack';\n\nexport const conv2DPackedPointwise =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvAttributes): Tensor => {\n const xshape = inputs[0].dims;\n const kshape = inputs[1].dims;\n const outputShape =\n calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n const reshapedX = inferenceHandler.reshapePacked(inputs[0], [xshape[1], xshape[2] * xshape[3]]);\n const reshapedK = inferenceHandler.reshapePacked(inputs[1], [kshape[0], kshape[1]]);\n\n const matmulInputs = inputs.length > 2 ? [reshapedK, reshapedX, inputs[2]] : [reshapedK, reshapedX];\n const matmulOutput = inferenceHandler.run(\n createPackedMatmulProgramInfoLoader(inferenceHandler, matmulInputs, attributes), matmulInputs);\n return inferenceHandler.reshapePacked(matmulOutput, outputShape);\n };\n\nexport const conv2DPacked =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvAttributes): Tensor => {\n const xshape = inputs[0].dims;\n const kshape = inputs[1].dims;\n const outputShape =\n calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n\n // run im2col\n const im2colOutput = inferenceHandler.run(\n createPackedIm2ColProgramInfoLoader(inferenceHandler, inputs[0], inputs[1], outputShape, attributes),\n [inputs[0]]);\n\n // reshape kernel\n const kernelReshaped = inferenceHandler.reshapePacked(inputs[1], [kshape[0], kshape[1] * kshape[2] * kshape[3]]);\n\n // run matmul\n const matmulInputs =\n (inputs.length === 3) ? [kernelReshaped, im2colOutput, inputs[2]] : [kernelReshaped, im2colOutput];\n const matmulOutput = inferenceHandler.run(\n createPackedMatmulProgramInfoLoader(inferenceHandler, matmulInputs, attributes), matmulInputs);\n\n // reshape output\n const outputReshaped = inferenceHandler.reshapePacked(matmulOutput, outputShape);\n return outputReshaped;\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {ConvAttributes} from './conv';\n\nconst createIm2ColProgramMetadata = (cacheHint: string) => ({\n name: 'Im2Col',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked],\n cacheHint,\n});\n\nconst createIm2ColProgramInfo =\n (_inferenceHandler: WebGLInferenceHandler, metadata: ProgramMetadata, x: Tensor, w: Tensor,\n outputShape: readonly number[], attributes: ConvAttributes): ProgramInfo => {\n const xshape = x.dims;\n const wshape = w.dims;\n\n const rank = outputShape.length;\n const im2colDims = calculateIm2ColDims(xshape, wshape, outputShape, 4);\n\n const shaderSource = `\n const int XC = ${xshape[1]};\n const int XH = ${xshape[2]};\n const int XW = ${xshape[3]};\n const int KH = ${attributes.kernelShape[0]};\n const int KW = ${attributes.kernelShape[1]};\n const int dilationH = ${attributes.dilations[0]};\n const int dilationW = ${attributes.dilations[1]};\n const int strideH = ${attributes.strides[0]};\n const int strideW = ${attributes.strides[1]};\n const int padH = ${attributes.pads[0]};\n const int padW = ${attributes.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${rank}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${xshape.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;\n return {\n ...metadata,\n output: {dims: im2colDims, type: x.type, textureType: TextureType.packedLastDimension},\n shaderSource\n };\n };\n\nexport const createIm2ColProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, x: Tensor, w: Tensor, outputShape: readonly number[],\n attributes: ConvAttributes): ProgramInfoLoader => {\n const metadata = createIm2ColProgramMetadata(attributes.cacheKey);\n return {\n ...metadata,\n get: () => createIm2ColProgramInfo(inferenceHandler, metadata, x, w, outputShape, attributes)\n };\n };\n\n\nexport const calculateIm2ColDims =\n (inputShape: readonly number[], kernelShape: readonly number[], outputShape: readonly number[], channels = 4):\n number[] =>\n [outputShape[0], outputShape[2], outputShape[3],\n Math.ceil(inputShape[1] * kernelShape[2] * kernelShape[3] / channels)];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {getActivationSnippet, InternalActivationAttributes} from './fuse-utils';\nimport {calculateIm2ColDims} from './im2col';\n\nconst createDotProductProgramMetadata = (hasBias: boolean, attributes: InternalActivationAttributes) => ({\n name: 'ConvDotProduct',\n inputNames: hasBias ? ['Im2Col', 'K', 'B'] : ['Im2Col', 'K'],\n inputTypes: hasBias ? [TextureType.unpacked, TextureType.packedLastDimension, TextureType.unpacked] :\n [TextureType.unpacked, TextureType.packedLastDimension],\n cacheKey: attributes.activationCacheKey\n});\n\nconst createDotProductProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, metadata: ProgramMetadata, inputs: readonly Tensor[],\n outputShape: number[], attributes: InternalActivationAttributes): ProgramInfo => {\n const xshape = inputs[0].dims;\n const kshape = inputs[1].dims;\n const adjustedKernelShape = [kshape[0], Math.ceil((xshape[1] * kshape[2] * kshape[3]) / 4)];\n const im2colShape = calculateIm2ColDims(xshape, kshape, outputShape);\n const [kWidth, kHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(adjustedKernelShape, TextureType.packedLastDimension);\n\n const im2colStrides = ShapeUtil.computeStrides(im2colShape);\n const [im2colWidth, im2colHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(im2colShape, TextureType.packedLastDimension);\n const rank = outputShape.length;\n\n const initValue = (inputs.length < 3) ? '0.0' : '_B(b)';\n const sharedDim = Math.ceil(xshape[1] * kshape[2] * kshape[3] / 4);\n const {activationFunction, applyActivation} = getActivationSnippet(attributes);\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const shaderSource = `\n${activationFunction}\nfloat process(int indices[${rank}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${im2colStrides[0]} + im2col[1] * ${im2colStrides[1]} + im2col[2] * ${\n im2colStrides[2]};\n int kernelOffset = indices[1] * ${adjustedKernelShape[1]};\n float value = ${initValue};\n for (int i = 0; i < ${sharedDim}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${im2colWidth}, ${im2colHeight});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${kWidth}, ${kHeight});\n value += dot(${glsl.texture2D}(Im2Col, im2colCoords), ${glsl.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${applyActivation}\n return value;\n}`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nexport const createDotProductProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], outputShape: number[],\n attributes: InternalActivationAttributes): ProgramInfoLoader => {\n const metadata = createDotProductProgramMetadata(inputs.length > 2, attributes);\n return {\n ...metadata,\n get: () => createDotProductProgramInfo(inferenceHandler, metadata, inputs, outputShape, attributes)\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {InferenceHandler} from '../../../backend';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {PoolConvUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nimport {createUnpackedGroupedConvProgramInfoLoader} from './conv-grouped';\nimport {conv2DPacked} from './conv-pack';\nimport {createDotProductProgramInfoLoader} from './dot-product';\nimport {InternalActivationAttributes, parseInternalActivationAttributes} from './fuse-utils';\nimport {createIm2ColProgramInfoLoader} from './im2col';\nimport {createMatmulProgramInfoLoader} from './matmul';\n\n\nexport const calculateOutputShape =\n (inputShape: readonly number[], kernelShape: readonly number[], dilations: readonly number[],\n adjustPads: readonly number[], strides: readonly number[]): number[] => {\n const batchSize = inputShape[0];\n const inputSpatialShape = inputShape.slice(2);\n const spatialRank = inputSpatialShape.length;\n const outChannels = kernelShape[0];\n const kernelSpatialShape = kernelShape.slice(2);\n const dilatedKernelShape = kernelSpatialShape.map((v, i) => v + (v - 1) * (dilations[i] - 1));\n const inputSpatialShapeWithPad = inputSpatialShape.map((v, i) => v + adjustPads[i] + adjustPads[i + spatialRank]);\n const outputSpatialShape =\n inputSpatialShapeWithPad.map((v, i) => Math.floor((v - dilatedKernelShape[i] + strides[i]) / strides[i]));\n const outputShape = [batchSize, outChannels].concat(...outputSpatialShape);\n return outputShape;\n };\n\nexport interface ConvAttributes extends InternalActivationAttributes, AttributeWithCacheKey {\n readonly autoPad: string;\n readonly dilations: readonly number[];\n readonly group: number;\n readonly kernelShape: readonly number[];\n readonly pads: readonly number[];\n readonly strides: readonly number[];\n}\n\nexport const conv: OperatorImplementation =\n (inferenceHandler: InferenceHandler, inputs: Tensor[], attributes: ConvAttributes): Tensor[] => {\n validateInputs(inputs, attributes); // currently will fail if not conv2D\n return conv2d(inferenceHandler, inputs, attributes);\n };\n\nconst conv2d: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ConvAttributes): Tensor[] => {\n const adjustedAttributes = getAdjustedConvAttributes(attributes, inputs);\n const packMode = inferenceHandler.session.pack;\n const isPointwise = adjustedAttributes.kernelShape[0] === 1 && adjustedAttributes.kernelShape[1] === 1;\n if (adjustedAttributes.group > 1) {\n const result = inferenceHandler.run(\n createUnpackedGroupedConvProgramInfoLoader(inferenceHandler, inputs, adjustedAttributes), inputs);\n return [result];\n } else if (isPointwise && packMode) {\n return [conv2DUnpackedPointwise(inferenceHandler, inputs, adjustedAttributes)];\n } else if (packMode && inputs[0].dims.length === 4 && inputs[0].dims[0] === 1 && !isPointwise) {\n return [conv2DPacked(inferenceHandler, inputs, adjustedAttributes)];\n } else {\n return [conv2DUnpacked(inferenceHandler, inputs, adjustedAttributes)];\n }\n };\n\nconst conv2DUnpackedPointwise =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvAttributes): Tensor => {\n const xshape = inputs[0].dims;\n const kshape = inputs[1].dims;\n const outputShape =\n calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n const reshapedX = inferenceHandler.reshapeUnpacked(inputs[0], [xshape[1], xshape[2] * xshape[3]]);\n const reshapedK = inferenceHandler.reshapeUnpacked(inputs[1], [kshape[0], kshape[1]]);\n\n const matmulInputs = inputs.length > 2 ? [reshapedK, reshapedX, inputs[2]] : [reshapedK, reshapedX];\n const matmulOutput = inferenceHandler.run(createMatmulProgramInfoLoader(matmulInputs, attributes), matmulInputs);\n return inferenceHandler.reshapeUnpacked(matmulOutput, outputShape);\n };\n\nconst conv2DUnpacked =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvAttributes): Tensor => {\n const xshape = inputs[0].dims;\n const kshape = inputs[1].dims;\n const outputShape =\n calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n const xIm2Col = inferenceHandler.run(\n createIm2ColProgramInfoLoader(inferenceHandler, inputs[0], inputs[1], outputShape, attributes), [inputs[0]]);\n\n const dotProductInputs = inputs.length === 3 ? [xIm2Col, inputs[1], inputs[2]] : [xIm2Col, inputs[1]];\n const output = inferenceHandler.run(\n createDotProductProgramInfoLoader(inferenceHandler, inputs, outputShape, attributes), dotProductInputs);\n return output;\n };\n\nconst getAdjustedConvAttributes = (attributes: T, inputs: Tensor[]): T => {\n const kernelShape = attributes.kernelShape.slice();\n // if kernelShape is not specified in the attributes of this op, infer it from the weight tensor dims\n if (attributes.kernelShape.length === 0) {\n for (let i = 2; i < inputs[1].dims.length; ++i) {\n kernelShape.push(inputs[1].dims[i]);\n }\n }\n const pads = attributes.pads.slice();\n PoolConvUtil.adjustPadsBasedOnAutoPad(\n inputs[0].dims, attributes.strides, attributes.dilations, kernelShape, pads, attributes.autoPad);\n\n // always return a new object so does not modify the original attributes\n const newAttributes: T = Object.assign({}, attributes);\n Object.assign(newAttributes, {kernelShape, pads, cacheKey: attributes.cacheKey});\n return newAttributes;\n};\n\nexport const parseConvAttributes: OperatorInitialization = (node: Graph.Node): ConvAttributes => {\n const attributes = node.attributes;\n const activationAttributes = parseInternalActivationAttributes(attributes);\n // TODO : Make this generic enough to compute default attributes for multi-dimensional conv\n const autoPad = attributes.getString('auto_pad', 'NOTSET');\n const dilations = attributes.getInts('dilations', [1, 1]);\n const group = attributes.getInt('group', 1);\n const kernelShape = attributes.getInts('kernel_shape', []);\n const pads = attributes.getInts('pads', [0, 0, 0, 0]);\n const strides = attributes.getInts('strides', [1, 1]);\n\n return createAttributeWithCacheKey({autoPad, dilations, group, kernelShape, pads, strides, ...activationAttributes});\n};\n\nconst validateInputs = (inputs: Tensor[], attributes: ConvAttributes): void => {\n // Refer to the below link for all input checks\n // https://github.com/onnx/onnx/blob/main/docs/Operators.md#Conv\n if (!inputs || (inputs.length !== 2 && inputs.length !== 3)) {\n throw new Error('Conv requires 2 or 3 inputs');\n }\n\n // TODO : Need to add support for multi-dimensional conv\n if (inputs[0].dims.length !== 4 || inputs[1].dims.length !== 4) {\n throw new Error('currently only support 2-dimensional conv');\n }\n\n // FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\n const dataChannel = inputs[0].dims[1];\n const filterInChannel = inputs[1].dims[1] * attributes.group;\n if (dataChannel !== filterInChannel) {\n throw new Error('FILTER_IN_CHANNEL should be equal to DATA_CHANNEL');\n }\n\n // if bias is provided it should be 1D and the number of elements should be equal to the number of feature maps\n if (inputs.length === 3 && (inputs[2].dims.length !== 1 || inputs[1].dims[0] !== inputs[2].dims[0])) {\n throw new Error('invalid bias');\n }\n\n const spatialRank = inputs[0].dims.length - 2;\n // wrong dilations dimension\n if (attributes.dilations.length !== spatialRank) {\n throw new Error(`dilations should be ${spatialRank}D`);\n }\n\n // Wrong strides dimension\n if (attributes.strides.length !== spatialRank) {\n throw new Error(`strides should be ${spatialRank}D`);\n }\n\n // Wrong pads dimension\n if (attributes.pads.length !== spatialRank * 2) {\n throw new Error(`pads should be ${spatialRank * 2}D`);\n }\n\n // if kernelShape is specified, it's data length must be 2 less than dims length of the weights tensor\n // (the first 2 dims are batch_size and channels)\n if (attributes.kernelShape.length !== 0 && attributes.kernelShape.length !== inputs[1].dims.length - 2) {\n throw new Error('invalid kernel shape');\n }\n\n // TODO : Need to add support for float64\n if (inputs[0].type !== 'float32' || inputs[1].type !== 'float32') {\n throw new Error('Conv input(X,W) should be float tensor');\n }\n\n if (inputs.length === 3 && inputs[2].type !== 'float32') {\n throw new Error('Conv input(bias) should be float tensor');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {InferenceHandler} from '../../../backend';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nimport {ConvAttributes} from './conv';\nimport {getActivationSnippet, parseInternalActivationAttributes} from './fuse-utils';\n\nconst computeTotalPad =\n (inDim: number, stride: number, adj: number, kernel: number, dilation: number, outSize: number) =>\n (inDim - 1) * stride + adj + (kernel - 1) * dilation + 1 - outSize;\n\nconst distributePadding = (totalPad: number, autoPad: string, pads: number[], head: number, tail: number) => {\n const smallPad = Math.floor(totalPad / 2);\n if (autoPad === 'SAME_UPPER') {\n pads[head] = smallPad;\n pads[tail] = totalPad - smallPad;\n } else if (autoPad === 'SAME_LOWER') {\n pads[head] = totalPad - smallPad;\n pads[tail] = smallPad;\n }\n};\n\nconst calculateOutputShapeAndPads =\n (inputShape: readonly number[], kernelShape: readonly number[], dilations: readonly number[], autoPad: string,\n pads: number[], strides: readonly number[], outputPadding: readonly number[], outputShape: number[]) => {\n const spatialRank = inputShape.length - 2;\n const updateShape = outputShape.length === 0;\n for (let i = 0; i < spatialRank; ++i) {\n const outSize = updateShape ? inputShape[i + 2] * strides[i] : outputShape[i];\n const totalPad = computeTotalPad(inputShape[i + 2], strides[i], pads[i], kernelShape[i], dilations[i], outSize);\n distributePadding(totalPad, autoPad, pads, i, i + spatialRank);\n if (updateShape) {\n outputShape.push(\n strides[i] * (inputShape[i + 2] - 1) + outputPadding[i] + (kernelShape[i] - 1) * dilations[i] + 1 -\n pads[i] - pads[i + spatialRank]);\n }\n }\n };\n\nexport interface ConvTransposeAttributes extends ConvAttributes {\n readonly outputPadding: readonly number[];\n readonly outputShape: readonly number[];\n}\n\nexport const convTranspose: OperatorImplementation =\n (inferenceHandler: InferenceHandler, inputs: Tensor[], attributes: ConvTransposeAttributes): Tensor[] => {\n validateInputs(inputs, attributes); // currently will fail if not convTranspose2D\n return convTranspose2d(inferenceHandler, inputs, attributes);\n };\n\nconst convTranspose2d: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ConvTransposeAttributes): Tensor[] => {\n const adjustedAttributes = getAdjustedConvTransposeAttributes(attributes, inputs);\n return [convTranspose2DUnpacked(inferenceHandler, inputs, adjustedAttributes)];\n };\n\nconst createConvTransposeProgramMetadata = (hasBias: boolean, cacheHint: string) => ({\n name: 'ConvTranspose',\n inputNames: hasBias ? ['X', 'W', 'B'] : ['X', 'W'],\n inputTypes: hasBias ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked] :\n [TextureType.unpacked, TextureType.unpacked],\n cacheHint\n});\n\nconst createUnpackedConvTransposeProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], metadata: ProgramMetadata,\n attributes: ConvTransposeAttributes): ProgramInfo => {\n const hasBias = inputs.length > 2;\n const valueInit = hasBias ? 'getB(output_channel)' : '0.0';\n const xShape = inputs[0].dims;\n const wShape = inputs[1].dims;\n const outputChannelsPerGroup = wShape[1];\n const inputChannelsPerGroup = wShape[0] / attributes.group;\n const outputShape = [inputs[0].dims[0], inputs[1].dims[1] * attributes.group, ...attributes.outputShape];\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const {activationFunction, applyActivation} = getActivationSnippet(attributes);\n\n const shaderSource = `\n const ivec2 strides = ivec2(${attributes.strides[0]}, ${attributes.strides[1]});\n const ivec2 pads = ivec2(${attributes.pads[0]}, ${attributes.pads[1]});\n ${activationFunction}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${outputChannelsPerGroup};\n int wOutChannel = output_channel - group_id * ${outputChannelsPerGroup};\n\n float value = ${valueInit};\n for (int inChannelOffset = 0; inChannelOffset < ${inputChannelsPerGroup}; inChannelOffset++) {\n int input_channel = group_id * ${inputChannelsPerGroup} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${wShape[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${wShape[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${attributes.dilations[0]}, wHOff * ${attributes.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${xShape[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${xShape[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${applyActivation}\n ${glsl.output} = vec4(value, .0, .0, .0);\n }\n`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource,\n hasMain: true,\n };\n };\n\nconst createUnpackedConvTransposeProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvTransposeAttributes):\n ProgramInfoLoader => {\n const metadata = createConvTransposeProgramMetadata(inputs.length > 2, attributes.cacheKey);\n return {\n ...metadata,\n get: () => createUnpackedConvTransposeProgramInfo(inferenceHandler, inputs, metadata, attributes)\n };\n };\n\n\nconst convTranspose2DUnpacked =\n (inferenceHandler: WebGLInferenceHandler, inputs: readonly Tensor[], attributes: ConvTransposeAttributes):\n Tensor => {\n const result = inferenceHandler.run(\n createUnpackedConvTransposeProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n return result;\n };\n\nconst getAdjustedConvTransposeAttributes = (attributes: T, inputs: Tensor[]): T => {\n const kernelShape = attributes.kernelShape.slice();\n // if kernelShape is not specified in the attributes of this op, infer it from the weight tensor dims\n if (attributes.kernelShape.length === 0) {\n for (let i = 2; i < inputs[1].dims.length; ++i) {\n kernelShape.push(inputs[1].dims[i]);\n }\n }\n\n const pads = attributes.pads.slice();\n const outputShape = attributes.outputShape.slice();\n const inputShape = inputs[0].dims;\n // If outputShape is not specified in the attributes of this op, infer it from the parameters\n // Similarly, automatically infer pads if not specified\n calculateOutputShapeAndPads(\n inputShape, kernelShape, attributes.dilations, attributes.autoPad, pads, attributes.strides,\n attributes.outputPadding, outputShape);\n\n // always return a new object so does not modify the original attributes\n const newAttributes: T = Object.assign({}, attributes);\n Object.assign(newAttributes, {kernelShape, pads, outputShape, cacheKey: attributes.cacheKey});\n return newAttributes;\n};\n\nexport const parseConvTransposeAttributes: OperatorInitialization =\n (node: Graph.Node): ConvTransposeAttributes => {\n const attributes = node.attributes;\n const activationAttributes = parseInternalActivationAttributes(attributes);\n // TODO : Make this generic enough to compute default attributes for multi-dimensional conv\n const autoPad = attributes.getString('auto_pad', 'NOTSET');\n const dilations = attributes.getInts('dilations', [1, 1]);\n const group = attributes.getInt('group', 1);\n const kernelShape = attributes.getInts('kernel_shape', []);\n const outputPadding = attributes.getInts('output_padding', [0, 0]);\n const outputShape = attributes.getInts('output_shape', []);\n const pads = attributes.getInts('pads', [0, 0, 0, 0]);\n const strides = attributes.getInts('strides', [1, 1]);\n\n return createAttributeWithCacheKey(\n {autoPad, dilations, group, kernelShape, outputPadding, outputShape, pads, strides, ...activationAttributes});\n };\n\nconst validateInputs = (inputs: Tensor[], attributes: ConvTransposeAttributes): void => {\n // Refer to the below link for all input checks\n // https://github.com/onnx/onnx/blob/main/docs/Operators.md#Conv\n if (!inputs || (inputs.length !== 2 && inputs.length !== 3)) {\n throw new Error('Conv requires 2 or 3 inputs');\n }\n\n // TODO : Need to add support for multi-dimensional conv\n if (inputs[0].dims.length !== 4 || inputs[1].dims.length !== 4) {\n throw new Error('currently only support 2-dimensional conv');\n }\n\n // FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\n const dataChannel = inputs[0].dims[1];\n const filterInChannel = inputs[1].dims[0];\n if (dataChannel !== filterInChannel) {\n throw new Error('FILTER_IN_CHANNEL should be equal to DATA_CHANNEL');\n }\n\n const featureMaps = inputs[1].dims[1] * attributes.group;\n\n // if bias is provided it should be 1D and the number of elements should be equal to the number of feature maps\n if (inputs.length === 3 && (inputs[2].dims.length !== 1 || inputs[2].dims[0] !== featureMaps)) {\n throw new Error('invalid bias');\n }\n\n const spatialRank = inputs[0].dims.length - 2;\n // wrong dilations dimension\n if (attributes.dilations.length !== spatialRank) {\n throw new Error(`dilations should be ${spatialRank}D`);\n }\n\n // Wrong strides dimension\n if (attributes.strides.length !== spatialRank) {\n throw new Error(`strides should be ${spatialRank}D`);\n }\n\n // Wrong pads dimension\n if (attributes.pads.length !== spatialRank * 2) {\n throw new Error(`pads should be ${spatialRank * 2}D`);\n }\n\n // Wrong output padding dimension\n if (attributes.outputPadding.length !== spatialRank) {\n throw new Error(`output_padding should be ${spatialRank}D`);\n }\n\n // if kernelShape is specified, it's data length must be 2 less than dims length of the weights tensor\n // (the first 2 dims are batch_size and channels)\n if (attributes.kernelShape.length !== 0 && attributes.kernelShape.length !== inputs[1].dims.length - 2) {\n throw new Error('invalid kernel shape');\n }\n\n // as with kernelShape, must have same number of spatial dims as input\n if (attributes.outputShape.length !== 0 && attributes.outputShape.length !== inputs[0].dims.length - 2) {\n throw new Error('invalid output shape');\n }\n\n // TODO : Need to add support for float64\n if (inputs[0].type !== 'float32' || inputs[1].type !== 'float32') {\n throw new Error('ConvTranspose input(X,W) should be float tensor');\n }\n\n if (inputs.length === 3 && inputs[2].type !== 'float32') {\n throw new Error('ConvTranspose input(bias) should be float tensor');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nexport interface TransposeAttributes extends AttributeWithCacheKey {\n readonly perm: number[];\n}\n\nconst transposeProgramMetadata = {\n name: 'Transpose',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked]\n};\n\nexport const transpose: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: TransposeAttributes): Tensor[] => {\n validateInputs(inputs);\n const output = inferenceHandler.run(\n {\n ...transposeProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createTransposeProgramInfo(inferenceHandler, inputs[0], attributes.perm)\n },\n inputs);\n return [output];\n };\n\nexport const parseTransposeAttributes: OperatorInitialization =\n (node: Graph.Node): TransposeAttributes => createAttributeWithCacheKey({perm: node.attributes.getInts('perm', [])});\n\nconst createTransposeProgramInfo =\n (_inferenceHandler: WebGLInferenceHandler, input: Tensor, perm: number[]): ProgramInfo => {\n const inputShape = input.dims;\n perm = getAdjustedPerm(inputShape, perm);\n const unpackedOutputShape = getOutputShape(inputShape, perm);\n const rank = inputShape.length;\n // A dims=[${inputs[0].dims.toString()}]\n // out Dims=[${unpackedOutputShape.toString()}]\n // based on perm=[${perm.toString()}]\n const shaderSource = `\n ${getPermFunctionBody('perm', perm, rank)}\n float process(int indices[${rank}]) {\n int a[${rank}];\n perm(a, indices);\n return _A(a);\n }`;\n return {\n ...transposeProgramMetadata,\n output: {dims: unpackedOutputShape, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst getAdjustedPerm = (inputShape: readonly number[], perm: number[]): number[] => {\n if (perm && perm.length !== inputShape.length) {\n perm = [...(inputShape.keys())].reverse();\n }\n return perm;\n};\n\nconst getOutputShape = (inputShape: readonly number[], perm: number[]): readonly number[] => {\n perm = getAdjustedPerm(inputShape, perm);\n return ShapeUtil.sortBasedOnPerm(inputShape, perm);\n};\n\nconst getPermFunctionBody = (name: string, perm: number[], rank: number): string => {\n const reverseFunc = [];\n reverseFunc.push(`void ${name}(out int a[${rank}], int src[${rank}]) {`);\n for (let i = 0; i < rank; ++i) {\n reverseFunc.push(`\\ta[${perm[i]}]=src[${i}];`);\n }\n reverseFunc.push('\\t}');\n return reverseFunc.join('\\n');\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Transpose requires 1 input.');\n }\n\n if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n throw new Error('input should be float tensor');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nimport {transpose, TransposeAttributes} from './transpose';\n\nexport interface DepthToSpaceAttributes {\n mode: 'DCR'|'CRD';\n blocksize: number;\n}\n\nexport const depthToSpace: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: DepthToSpaceAttributes): Tensor[] => {\n validateInputs(inputs);\n const blocksize = attributes.blocksize;\n const blocksizeSqr = blocksize * blocksize;\n const transposePerm = attributes.mode === 'DCR' ? [0, 3, 4, 1, 5, 2] : [0, 1, 4, 2, 5, 3];\n const firstReshapeShape = attributes.mode === 'DCR' ?\n [\n inputs[0].dims[0], blocksize, blocksize, inputs[0].dims[1] / blocksizeSqr, inputs[0].dims[2],\n inputs[0].dims[3]\n ] :\n [\n inputs[0].dims[0], inputs[0].dims[1] / blocksizeSqr, blocksize, blocksize, inputs[0].dims[2],\n inputs[0].dims[3]\n ];\n\n // const transpose = new WebGLTranspose();\n // const attributes = new Attribute(undefined);\n // attributes.set('perm', 'ints', transposePerm);\n // transpose.initialize(attributes);\n\n // First reshape\n const firstReshapedTensor = inferenceHandler.reshapeUnpacked(inputs[0], firstReshapeShape);\n\n // transpose\n const transposeAttributes: TransposeAttributes = {perm: transposePerm, cacheKey: `${transposePerm}`};\n const [transposeOutput] = transpose(inferenceHandler, [firstReshapedTensor], transposeAttributes);\n\n // Second reshape\n const secondReshapeShape = [\n inputs[0].dims[0], inputs[0].dims[1] / blocksizeSqr, inputs[0].dims[2] * blocksize,\n inputs[0].dims[3] * blocksize\n ];\n const result = inferenceHandler.reshapeUnpacked(transposeOutput, secondReshapeShape);\n return [result];\n };\n\nexport const parseDepthToSpaceAttributes: OperatorInitialization =\n (node: Graph.Node): DepthToSpaceAttributes => {\n // processing node attributes\n const blocksize = node.attributes.getInt('blocksize');\n if (blocksize < 1) {\n throw new Error(`blocksize must be >= 1, but got : ${blocksize} for DepthToSpace`);\n }\n const mode = node.attributes.getString('mode', 'DCR');\n if (mode !== 'DCR' && mode !== 'CRD') {\n throw new Error(`unrecognized mode: ${mode} for DepthToSpace`);\n }\n return {mode, blocksize};\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (inputs.length !== 1) {\n throw new Error(`DepthToSpace expect 1 inputs, but got ${inputs.length}`);\n }\n\n // Input has to be a 4-D tensor\n // TODO: Support string depth-to-space.\n if (inputs[0].type === 'string' || inputs[0].dims.length !== 4) {\n throw new TypeError('DepthToSpace input should be a 4-D numeric tensor');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nexport const flatten: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], axis: number): Tensor[] => {\n validateInputs(inputs, axis);\n\n const outputDims = ShapeUtil.flattenShape(inputs[0].dims, axis);\n return [inferenceHandler.reshapeUnpacked(inputs[0], outputDims)];\n };\n\nexport const parseFlattenAttributes: OperatorInitialization = (node: Graph.Node): number =>\n node.attributes.getInt('axis', 1); // default axis is 1\n\nconst validateInputs = (inputs: Tensor[], axis: number): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Flatten requires 1 input.');\n }\n\n const r = inputs[0].dims.length;\n if (r === 0) {\n throw new Error('scalar tensor is not supported.');\n }\n\n if (axis < -r || axis > r) {\n throw new Error('Invalid axis');\n }\n\n // TODO: Support string type\n if (inputs[0].type === 'string') {\n throw new Error('string tensor is not supported.');\n }\n};", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceHandler} from './backend';\nimport {Graph} from './graph';\nimport {Tensor} from './tensor';\n\nexport type OperatorImplementation = (inferenceHandler: InferenceHandler, inputs: Tensor[], context: T) => Tensor[];\nexport type OperatorInitialization = (node: Graph.Node, graph: Graph) => T;\n\nexport interface Operator {\n readonly impl: OperatorImplementation;\n readonly context: Graph.Node|unknown;\n}\n\nexport const NUMBER_TYPES: readonly Tensor.DataType[] =\n ['float32', 'float64', 'int32', 'int16', 'int8', 'uint16', 'uint32', 'uint8'];\nexport const INT_TYPES: readonly Tensor.DataType[] = ['int32', 'int16', 'int8', 'uint16', 'uint32', 'uint8'];\nexport const FLOAT_TYPES: readonly Tensor.DataType[] = ['float32', 'float64'];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {NUMBER_TYPES, OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\ninterface GatherAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n}\n\nexport const gather: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: GatherAttributes): Tensor[] => {\n validateInputs(inputs, attributes.axis);\n const output = inferenceHandler.run(createGatherProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n return [output];\n };\n\nexport const parseGatherAttributes: OperatorInitialization = (node: Graph.Node): GatherAttributes =>\n createAttributeWithCacheKey({axis: node.attributes.getInt('axis', 0)});\n\nconst gatherProgramMetadata = {\n name: 'Gather',\n inputNames: ['A', 'B'],\n inputTypes: [TextureType.unpacked, TextureType.unpacked],\n};\n\nconst createGatherProgramInfo =\n (_handler: WebGLInferenceHandler, metadata: ProgramMetadata, inputs: Tensor[], axis: number): ProgramInfo => {\n const inputShape = inputs[0].dims.slice();\n const indexDataShape = inputs[1].dims.slice();\n const outputShape = new Array(inputShape.length + indexDataShape.length - 1);\n\n axis = ShapeUtil.normalizeAxis(axis, inputShape.length);\n const indexCopyOps: string[] = [];\n for (let i = 0; i < outputShape.length; i++) {\n // outputShape is divided into three parts: A, B, C\n // |0 axis| axis + indexDataShape.length | end|\n // | A | B | C |\n //\n // inputIdx: [A, inputs[1][B], C]\n if (i < axis) { // A\n outputShape[i] = inputShape[i];\n indexCopyOps.push(`inputIdx[${i}] = outputIdx[${i}];`);\n } else {\n if (i < axis + indexDataShape.length) { // B\n outputShape[i] = indexDataShape[i - axis];\n indexCopyOps.push(`indexDataIdx[${i - axis}] = outputIdx[${i}];`);\n } else { // C\n outputShape[i] = inputShape[i - indexDataShape.length + 1]; // skip 1 for axis\n indexCopyOps.push(`inputIdx[${i - indexDataShape.length + 1}] = outputIdx[${i}];`);\n }\n }\n }\n\n const orank = outputShape.length || 1;\n const irank = inputShape.length;\n const iDrank = indexDataShape.length || 1;\n const shaderSource = `\n float process(int outputIdx[${orank}]) {\n int inputIdx[${irank}];\n int indexDataIdx[${iDrank}];\n indexDataIdx[0] = 0;\n ${indexCopyOps.join('\\n ')}\n int idx = int(_B(indexDataIdx));\n inputIdx[${axis}] = idx < 0 ? idx + ${inputShape[axis]} : idx;\n return _A(inputIdx);\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst createGatherProgramInfoLoader =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: GatherAttributes): ProgramInfoLoader => {\n const metadata = {...gatherProgramMetadata, cacheHint: attributes.cacheKey};\n return {...metadata, get: () => createGatherProgramInfo(handler, metadata, inputs, attributes.axis)};\n };\n\nconst validateInputs = (inputs: Tensor[], axis: number): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Gather requires 2 inputs.');\n }\n const tensorRank = inputs[0].dims.length;\n if (tensorRank < 1) {\n throw new Error('Invalid input shape.');\n }\n if (axis < -tensorRank || axis > tensorRank - 1) {\n throw new Error('Invalid axis.');\n }\n if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n throw new Error('Invaid input type.');\n }\n if (inputs[1].type !== 'int32' && inputs[1].type !== 'int16') {\n throw new Error('Invaid input type.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {GemmUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nexport interface GemmAttributes extends AttributeWithCacheKey {\n transA: boolean;\n transB: boolean;\n alpha: number;\n beta: number;\n isOptionalC: boolean; // in opset 11, C becomes optional\n}\n\nexport const gemm: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: GemmAttributes): Tensor[] => {\n validateInputs(inputs, attributes);\n const output = inferenceHandler.run(createGemmProgramInfoLoader(inputs, attributes), inputs);\n return [output];\n };\n\nconst parseGemmAttributes = (node: Graph.Node, isOptionalC: boolean): GemmAttributes => {\n const transA = node.attributes.getInt('transA', 0) !== 0;\n const transB = node.attributes.getInt('transB', 0) !== 0;\n const alpha = node.attributes.getFloat('alpha', 1.0);\n const beta = node.attributes.getFloat('beta', 1.0);\n return createAttributeWithCacheKey({transA, transB, alpha, beta, isOptionalC});\n};\n\nexport const parseGemmAttributesV7: OperatorInitialization = (node: Graph.Node): GemmAttributes =>\n parseGemmAttributes(node, false);\n\nexport const parseGemmAttributesV11: OperatorInitialization = (node: Graph.Node): GemmAttributes =>\n parseGemmAttributes(node, true);\n\nconst createGemmProgramInfoLoader = (inputs: Tensor[], attributes: GemmAttributes): ProgramInfoLoader => {\n const metadata = {\n name: 'Gemm',\n inputNames: inputs.length === 3 ? ['A', 'B', 'C'] : ['A', 'B'],\n inputTypes: inputs.length === 3 ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked] :\n [TextureType.unpacked, TextureType.unpacked],\n key: attributes.cacheKey\n };\n\n return {...metadata, get: () => createGemmProgramInfo(metadata, inputs, attributes)};\n};\n\nconst createGemmProgramInfo =\n (metadata: ProgramMetadata, inputs: Tensor[], attributes: GemmAttributes): ProgramInfo => {\n const aShape = inputs[0].dims.slice();\n const bShape = inputs[1].dims.slice();\n const [M, N] = GemmUtil.getShapeOfGemmResult(\n aShape, attributes.transA, bShape, attributes.transB, inputs.length === 3 ? inputs[2].dims : undefined);\n const outputShape = [M, N];\n if (!outputShape) {\n throw new Error('Can\\'t use gemm on the given tensors');\n }\n let sharedDim = aShape[aShape.length - 1];\n let line = '';\n if (attributes.transA) {\n sharedDim = aShape[0];\n }\n if (attributes.transA && attributes.transB) {\n line = 'value += _A_T(a) * _B_T(b);';\n } else if (attributes.transA && !attributes.transB) {\n line = 'value += _A_T(a) * _B(b);';\n } else if (!attributes.transA && attributes.transB) {\n line = 'value += _A(a) * _B_T(b);';\n } else if (!attributes.transA && !attributes.transB) {\n line = 'value += _A(a) * _B(b);';\n }\n const rank = outputShape.length;\n const declareC = inputs.length === 3 ? `int c[${inputs[2].dims.length}];` : '';\n const broadcastC = inputs.length === 3 ? 'bcastIndices_C(indices, c);' : '';\n const calculateC = inputs.length === 3 ? 'value += beta * _C(c);' : '';\n const shaderSource = `\n float process(int indices[${rank}]) {\n int a[${rank}];\n int b[${rank}];\n ${declareC}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${broadcastC}\n\n float value = 0.0;\n for (int k=0; k<${sharedDim}; ++k) {\n a[${rank - 1}] = k;\n b[${rank - 2}] = k;\n ${line}\n }\n\n value = value * alpha;\n ${calculateC}\n return value;\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n variables: [\n {name: 'alpha', type: 'float', data: attributes.alpha}, {name: 'beta', type: 'float', data: attributes.beta}\n ],\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[], attributes: GemmAttributes): void => {\n if (!inputs) {\n throw new Error('Input is missing');\n }\n if (attributes.isOptionalC && (inputs.length < 2 || inputs.length > 3)) {\n throw new Error('Invaid input shape.');\n }\n if (!attributes.isOptionalC && inputs.length !== 3) {\n throw new Error('Gemm requires 3 inputs');\n }\n\n // 'C' can be of dimensionality 1 or 2 only\n if (inputs.length === 3 && inputs[2].dims.length !== 1 && inputs[2].dims.length !== 2) {\n throw new Error('Invalid input shape of C');\n }\n\n if ((inputs[0].type !== 'float32' && inputs[0].type !== 'float64') ||\n (inputs[1].type !== 'float32' && inputs[1].type !== 'float64') ||\n (inputs.length === 3 && inputs[2].type !== 'float32' && inputs[2].type !== 'float64')) {\n throw new Error('Invalid input type.');\n }\n\n if ((inputs[0].type !== inputs[1].type) || (inputs.length === 3 && inputs[0].type !== inputs[2].type)) {\n throw new Error('Input types are mismatched');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nexport interface ImageScalerAttributes extends AttributeWithCacheKey {\n scale: number;\n bias: number[];\n}\n\nexport const imageScaler: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ImageScalerAttributes): Tensor[] => {\n validateInputs(inputs);\n const output =\n inferenceHandler.run(createImageScalerProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n return [output];\n };\n\nexport const parseImageScalerAttributes: OperatorInitialization =\n (node: Graph.Node): ImageScalerAttributes => {\n const scale = node.attributes.getFloat('scale');\n const bias = node.attributes.getFloats('bias');\n return createAttributeWithCacheKey({scale, bias});\n };\n\nconst imageScalerProgramMetadata = {\n name: 'ImageScaler',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked],\n};\n\nconst createImageScalerProgramInfo =\n (_handler: WebGLInferenceHandler, metadata: ProgramMetadata, inputs: Tensor[], attributes: ImageScalerAttributes):\n ProgramInfo => {\n const outputShape = inputs[0].dims.slice();\n const rank = outputShape.length;\n const getBiasMethod = createGetBiasMethod(attributes.bias.length);\n const shaderSource = `\n ${getBiasMethod}\n float process(int indices[${rank}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n variables: [\n {name: 'bias', type: 'float', arrayLength: attributes.bias.length, data: attributes.bias},\n {name: 'scale', type: 'float', data: attributes.scale}\n ],\n shaderSource\n };\n };\n\nconst createImageScalerProgramInfoLoader =\n (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: ImageScalerAttributes): ProgramInfoLoader => {\n const metadata = {...imageScalerProgramMetadata, cacheHint: attributes.cacheKey};\n return {...metadata, get: () => createImageScalerProgramInfo(handler, metadata, inputs, attributes)};\n };\n\nconst createGetBiasMethod = (numChannels: number): string => {\n const codeLines: string[] = [`float getBias(float bias[${numChannels}], int channel) {`];\n for (let i = 0; i < numChannels; ++i) {\n if (i === 0) {\n codeLines.push(\n '\\t' +\n `if (channel == ${i}) { return bias[${i}]; }`);\n } else if (i === numChannels - 1) {\n codeLines.push(\n '\\t' +\n `else { return bias[${i}]; }`);\n } else {\n codeLines.push(\n '\\t' +\n `else if (channel == ${i}) { return bias[${i}]; }`);\n }\n }\n codeLines.push(\n '\\t' +\n '}');\n return codeLines.join('\\n');\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('ImageScaler requires 1 input.');\n }\n if (inputs[0].dims.length !== 4) {\n throw new Error('Invalid input shape.');\n }\n if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n throw new Error('Invalid input type.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType} from '../types';\n\nexport const instanceNormalization: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], epsilon: number): Tensor[] => {\n validateInputs(inputs);\n\n const meanAndVariance = inferenceHandler.run(createMeanAndVarianceProgramInfoLoader(inputs[0]), inputs);\n const output = inferenceHandler.run(\n createComputeOutputProgramInfoLoader(inferenceHandler, inputs[0], epsilon, meanAndVariance.dims),\n [inputs[0], meanAndVariance, inputs[1], inputs[2]]);\n return [output];\n };\n\nexport const parseInstanceNormalizationAttributes: OperatorInitialization = (node: Graph.Node): number =>\n node.attributes.getFloat('epsilon', 1e-5);\n\nconst meanAndVarianceProgramMetadata = {\n name: 'InstanceNormalization_MeanAndVariance',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked],\n};\n\nconst createMeanAndVarianceProgramInfo = (metadata: ProgramMetadata, input: Tensor): ProgramInfo => {\n const xDims = input.dims.slice();\n const channel = xDims[1];\n const channelSize = xDims[2] * xDims[3];\n const outputShape = [xDims[0], channel];\n\n const shaderSource = `\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${xDims[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${xDims[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${channelSize});\n temp = 0.0;\n for(int a2=0; a2<${xDims[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${xDims[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${channelSize});\n\n return v;\n }`;\n return {\n ...metadata,\n output: {dims: outputShape, type: input.type, textureType: TextureType.packedLastDimension},\n shaderSource\n };\n};\n\nconst createMeanAndVarianceProgramInfoLoader = (input: Tensor): ProgramInfoLoader => ({\n ...meanAndVarianceProgramMetadata,\n get: () => createMeanAndVarianceProgramInfo(meanAndVarianceProgramMetadata, input)\n});\n\nconst computeOutputProgramMetadata = {\n name: 'InstanceNormalization_ComputeOutput',\n inputNames: ['X', 'MeanAndVariance', 'Scale', 'B'],\n inputTypes: [TextureType.unpacked, TextureType.packedLastDimension, TextureType.unpacked, TextureType.unpacked],\n};\n\nconst createComputeOutputProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, metadata: ProgramMetadata, input: Tensor, epsilon: number,\n meanAndVarianceShape: readonly number[]): ProgramInfo => {\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const [textureWidth, textureHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(meanAndVarianceShape, TextureType.packedLastDimension);\n const [meanAndVarianceWidth, meanAndVarianceHeight] = [textureWidth / 4, textureHeight];\n const shaderSource = `\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${meanAndVarianceWidth}, ${meanAndVarianceHeight});\n return ${glsl.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;\n return {\n ...metadata,\n output: {dims: input.dims, type: input.type, textureType: TextureType.unpacked},\n variables: [{name: 'epsilon', type: 'float', data: epsilon}],\n shaderSource\n };\n };\n\nconst createComputeOutputProgramInfoLoader =\n (inferenceHandler: WebGLInferenceHandler, input: Tensor, epsilon: number, meanAndVarianceShape: readonly number[]):\n ProgramInfoLoader => {\n const metadata = {...computeOutputProgramMetadata, cacheHint: `${epsilon}`};\n return {\n ...metadata,\n get: () => createComputeOutputProgramInfo(inferenceHandler, metadata, input, epsilon, meanAndVarianceShape)\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 3) {\n throw new Error('InstanceNormalization requires 3 inputs.');\n }\n\n const X = inputs[0];\n const scale = inputs[1];\n const B = inputs[2];\n\n // input should at least have three dimensions - N,C,dim1,...,dimn\n // other inputs can have only one dimensions\n if (X.dims.length < 3 || scale.dims.length !== 1 || B.dims.length !== 1) {\n throw new Error('Invalid input shape.');\n }\n if (scale.dims[0] !== X.dims[1] || B.dims[0] !== X.dims[1]) {\n throw new Error('Input shapes are mismatched.');\n }\n if ((X.type !== 'float32' && X.type !== 'float64') || (scale.type !== 'float32' && scale.type !== 'float64') ||\n (B.type !== 'float32' && B.type !== 'float64')) {\n throw new Error('Invalid input type.');\n }\n if (inputs[0].dims.length !== 4) {\n throw new Error('Only support 4-D input shape.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramInfoLoader, TextureType} from '../types';\n\nexport interface LrnAttributes extends AttributeWithCacheKey {\n alpha: number;\n beta: number;\n bias: number;\n size: number;\n}\n\nexport const lrn: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: LrnAttributes): Tensor[] => {\n validateInputs(inputs);\n\n // if (inferenceHandler.session.pack) {\n // return [inferenceHandler.run(createPackedLrnProgramInfoLoader(inferenceHandler, inputs, attributes),\n // inputs)];\n // } else {\n return [inferenceHandler.run(createLrnProgramInfoLoader(inputs, attributes), inputs)];\n //}\n };\n\nexport const parseLrnAttributes: OperatorInitialization = (node: Graph.Node): LrnAttributes => {\n const alpha = node.attributes.getFloat('alpha', 0.0001);\n const beta = node.attributes.getFloat('beta', 0.75);\n const bias = node.attributes.getFloat('bias', 1.0);\n const size = node.attributes.getInt('size');\n\n return createAttributeWithCacheKey({alpha, beta, bias, size});\n};\n\nconst lrnProgramMetadata = {\n name: 'LRN',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked]\n};\n\nfunction createLrnProgramInfo(inputs: Tensor[], attributes: LrnAttributes): ProgramInfo {\n const C = inputs[0].dims[1];\n const rank = inputs[0].dims.length;\n const from = -Math.floor((attributes.size - 1) / 2);\n const to = Math.ceil((attributes.size - 1) / 2);\n const alpha = `float(${attributes.alpha}) / float(${attributes.size})`;\n const bias = `float(${attributes.bias})`;\n const beta = `float(${attributes.beta})`;\n\n const shaderSource = `\n float process(int indices[${rank}]) {\n int c = indices[1];\n float x = _X(indices);\n float square_sum = 0.0;\n\n for (int i = ${from}; i <= ${to}; i++) {\n int idx = c + i;\n if (c >= 0 && c < ${C}) {\n indices[1] = idx;\n float j = _X(indices);\n square_sum += j * j;\n }\n }\n return x / pow(${bias} + ${alpha} * square_sum, ${beta});\n }`;\n return {\n ...lrnProgramMetadata,\n cacheHint: attributes.cacheKey,\n output: {dims: inputs[0].dims, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource,\n };\n}\n\nexport function createLrnProgramInfoLoader(inputs: Tensor[], attributes: LrnAttributes): ProgramInfoLoader {\n return {...lrnProgramMetadata, cacheHint: attributes.cacheKey, get: () => createLrnProgramInfo(inputs, attributes)};\n}\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('LRN requires 1 input.');\n }\n if (inputs[0].dims.length !== 4) {\n throw new Error('currently only support LRN for input with \"NCHW\" format');\n }\n if (inputs[0].type !== 'float32') {\n throw new Error('input should be float type');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {getGlsl, Glsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nexport interface PadAttributes extends AttributeWithCacheKey {\n readonly mode: string;\n readonly pads: number[];\n readonly value: number;\n}\n\nconst padProgramMetadata = {\n name: 'Pad',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked],\n};\n\nexport const padV2: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: PadAttributes): Tensor[] => {\n validateInputsV2(inputs);\n const output = inferenceHandler.run(\n {\n ...padProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createPadProgramInfo(inferenceHandler, inputs[0], attributes)\n },\n inputs);\n return [output];\n };\n\nexport const parsePadAttributesV2: OperatorInitialization = (node: Graph.Node): PadAttributes => {\n const mode = node.attributes.getString('mode', 'constant');\n const value = node.attributes.getFloat('value', 0.0);\n const pads = node.attributes.getInts('pads');\n return createAttributeWithCacheKey({mode, value, pads});\n};\n\nexport const padV11: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], mode: string): Tensor[] => {\n validateInputsV11(inputs);\n const attrubutes = generatePadAttributesFromInputs(inferenceHandler, inputs, mode);\n return padV2(inferenceHandler, [inputs[0]], attrubutes);\n };\n\nexport const parsePadAttributesV11: OperatorInitialization = (node: Graph.Node): string =>\n node.attributes.getString('mode', 'constant');\n\nconst generatePadAttributesFromInputs =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], mode: string): PadAttributes => {\n if (!inferenceHandler.session.isInitializer(inputs[1].dataId) ||\n (inputs.length >= 3 && !inferenceHandler.session.isInitializer(inputs[2].dataId))) {\n throw new Error('dynamic pad attributes are not allowed');\n }\n\n const pads = Array.from(inputs[1].integerData);\n const value = (inputs.length >= 3) ? inputs[2].floatData[0] : 0.0;\n\n return createAttributeWithCacheKey({mode, pads, value});\n };\n\nconst createPadProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, input: Tensor, attributes: PadAttributes): ProgramInfo => {\n const outputShape = ShapeUtil.padShape(input.dims.slice(), attributes.pads);\n const rank = outputShape.length;\n const padFunction = getPadFunction(inferenceHandler, input, attributes);\n const shaderSource = `\n ${padFunction}\n float process(int[${rank}] indices) {\n return padA(indices);\n }`;\n return {\n name: 'Pad',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked],\n output: {dims: outputShape, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputsV2 = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Pad requires 1 input');\n }\n if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n throw new Error('Invalid input type.');\n }\n};\n\nconst validateInputsV11 = (inputs: Tensor[]): void => {\n if (!inputs || (inputs.length !== 2 && inputs.length !== 3)) {\n throw new Error('Pad requires 2 or 3 inputs');\n }\n if (inputs[1].type !== 'int32') {\n throw new Error('Invalid input type.');\n }\n if (inputs.length >= 3 && inputs[2].type === 'string') {\n throw new Error('Invalid input type.');\n }\n};\n\nconst getPadFunction = (inferenceHandler: WebGLInferenceHandler, input: Tensor, attributes: PadAttributes): string => {\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const [width, height] = inferenceHandler.calculateTextureWidthAndHeight(input.dims, TextureType.unpacked);\n const strides = ShapeUtil.computeStrides(input.dims);\n\n switch (attributes.mode) {\n case 'constant':\n return getPadConstant(glsl, input.dims, strides, width, height, attributes.pads, attributes.value);\n case 'reflect':\n return getPadReflect(glsl, input.dims, strides, width, height, attributes.pads);\n case 'edge':\n return getPadEdge(glsl, input.dims, strides, width, height, attributes.pads);\n default:\n throw new Error('Invalid mode');\n }\n};\n\nconst getPadConstant =\n (glsl: Glsl, shape: readonly number[], strides: readonly number[], width: number, height: number, pads: number[],\n value: number): string => {\n const rank = shape.length;\n let block = '';\n for (let i = rank - 1; i >= 0; --i) {\n block += `\n k = m[${i}] - ${pads[i]};\n if (k < 0) return constant;\n if (k >= ${shape[i]}) return constant;\n offset += k * ${strides[i]};\n `;\n }\n return `\n float padA(int m[${rank}]) {\n const float constant = float(${value});\n int offset = 0;\n int k = 0;\n ${block}\n vec2 coords = offsetToCoords(offset, ${width}, ${height});\n float value = getColorAsFloat(${glsl.texture2D}(A, coords));\n return value;\n }\n `;\n };\n\nconst getPadReflect =\n (glsl: Glsl, shape: readonly number[], strides: readonly number[], width: number, height: number, pads: number[]):\n string => {\n const rank = shape.length;\n\n let block = '';\n for (let i = rank - 1; i >= 0; --i) {\n block += `\n k = m[${i}] - ${pads[i]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2 * (shape[i] - 1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${shape[i]}) { k = _2n_1 - k; }\n }\n offset += k * ${strides[i]};\n `;\n }\n return `\n float padA(int m[${rank}]) {\n int offset = 0;\n int k = 0;\n ${block}\n vec2 coords = offsetToCoords(offset, ${width}, ${height});\n float value = getColorAsFloat(${glsl.texture2D}(A, coords));\n return value;\n }\n `;\n };\n\nconst getPadEdge =\n (glsl: Glsl, shape: readonly number[], strides: readonly number[], width: number, height: number, pads: number[]):\n string => {\n const rank = shape.length;\n\n let block = '';\n for (let i = rank - 1; i >= 0; --i) {\n block += `\n k = m[${i}] - ${pads[i]};\n if (k < 0) k = 0;\n if (k >= ${shape[i]}) k = ${shape[i] - 1};\n offset += k * ${strides[i]};\n `;\n }\n return `\n float padA(int m[${rank}]) {\n int offset = 0;\n int k = 0;\n ${block}\n vec2 coords = offsetToCoords(offset, ${width}, ${height});\n float value = getColorAsFloat(${glsl.texture2D}(A, coords));\n return value;\n }\n `;\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {PoolConvUtil, ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramMetadata, TextureType} from '../types';\n\nexport interface AveragePoolAttributes extends AttributeWithCacheKey {\n readonly autoPad: string;\n readonly ceilMode: number;\n readonly countIncludePad: boolean;\n readonly kernelShape: readonly number[];\n readonly strides: readonly number[];\n readonly pads: readonly number[];\n}\n\nexport const averagePool: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: AveragePoolAttributes): Tensor[] => {\n validateInputs(inputs);\n const metadata =\n {name: 'AveragePool', inputNames: ['X'], inputTypes: [TextureType.unpacked], cacheHint: attributes.cacheKey};\n const output = inferenceHandler.run(\n {...metadata, get: () => createAveragePoolProgramInfo(inputs, metadata, false, attributes)}, inputs);\n return [output];\n };\n\nexport const parseAveragePoolAttributes: OperatorInitialization =\n (node: Graph.Node): AveragePoolAttributes => {\n const autoPad = node.attributes.getString('auto_pad', 'NOTSET');\n const ceilMode = node.attributes.getInt('ceil_mode', 0);\n const countIncludePad = (node.attributes.getInt('count_include_pad', 0) === 0 ? false : true);\n const kernelShape = node.attributes.getInts('kernel_shape');\n const strides = node.attributes.getInts('strides', []);\n const pads = node.attributes.getInts('pads', []);\n\n // TODO: support attribute 'ceil_mode'\n if (ceilMode !== 0) {\n throw new Error('using ceil() in shape computation is not yet supported for AveragePool');\n }\n\n return createAttributeWithCacheKey({autoPad, ceilMode, countIncludePad, kernelShape, strides, pads});\n };\n\nconst createAveragePoolProgramInfo =\n (inputs: Tensor[], metadata: ProgramMetadata, isGlobalOperator: boolean, attributes: AveragePoolAttributes):\n ProgramInfo => {\n const [adjustedAttributes, outputShape] =\n getAdjustedPoolAttributesAndOutputShape(inputs, attributes, isGlobalOperator);\n const kernelSize = ShapeUtil.size(adjustedAttributes.kernelShape);\n const op1 = 'value += _X(x);';\n let op2 = '';\n if (adjustedAttributes.countIncludePad) {\n op2 += `value /= float(${kernelSize});`;\n } else {\n op2 += `value /= float(${kernelSize} - pad);`;\n }\n const poolingCode = generatePoolingCode(inputs[0].dims, adjustedAttributes, op1, op2, '0.0');\n const shaderSource = `\n ${poolingCode}\n `;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nexport const globalAveragePool: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: AveragePoolAttributes): Tensor[] => {\n validateInputs(inputs);\n const metadata = {\n name: 'GlobalAveragePool',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked],\n cacheHint: `${attributes.countIncludePad}`\n };\n const output = inferenceHandler.run(\n {...metadata, get: () => createAveragePoolProgramInfo(inputs, metadata, true, attributes)}, inputs);\n return [output];\n };\n\nexport const parseGlobalAveragePoolAttributes: OperatorInitialization =\n (node: Graph.Node): AveragePoolAttributes => {\n const countIncludePad = (node.attributes.getInt('count_include_pad', 0) === 0 ? false : true);\n return createAttributeWithCacheKey(\n {autoPad: '', ceilMode: 0, countIncludePad, kernelShape: [], strides: [], pads: []});\n };\n\nexport interface MaxPoolAttributes extends AveragePoolAttributes {\n readonly storageOrder: number;\n readonly dilations: number[];\n}\n\nexport const maxPool: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: MaxPoolAttributes): Tensor[] => {\n validateInputs(inputs);\n const metadata =\n {name: 'MaxPool', inputNames: ['X'], inputTypes: [TextureType.unpacked], cacheHint: attributes.cacheKey};\n const output = inferenceHandler.run(\n {...metadata, get: () => createMaxPoolProgramInfo(inputs, metadata, false, attributes)}, inputs);\n return [output];\n };\n\nexport const parseMaxPoolAttributes: OperatorInitialization =\n (node: Graph.Node): MaxPoolAttributes => {\n const autoPad = node.attributes.getString('auto_pad', 'NOTSET');\n const ceilMode = node.attributes.getInt('ceil_mode', 0);\n const kernelShape = node.attributes.getInts('kernel_shape');\n const strides = node.attributes.getInts('strides', []);\n const pads = node.attributes.getInts('pads', []);\n const storageOrder = node.attributes.getInt('storage_order', 0);\n const dilations = node.attributes.getInts('dilations', []);\n\n // TODO: support attribute 'ceil_mode' and 'storage_order'\n if (storageOrder !== 0) {\n throw new Error('column major storage order is not yet supported for MaxPool');\n }\n if (ceilMode !== 0) {\n throw new Error('using ceil() in shape computation is not yet supported for MaxPool');\n }\n\n return createAttributeWithCacheKey(\n {autoPad, ceilMode, countIncludePad: false, kernelShape, strides, pads, storageOrder, dilations});\n };\n\nconst createMaxPoolProgramInfo =\n (inputs: Tensor[], metadata: ProgramMetadata, isGlobalOperator: boolean, attributes: MaxPoolAttributes):\n ProgramInfo => {\n const [adjustedAttributes, outputShape] =\n getAdjustedPoolAttributesAndOutputShape(inputs, attributes, isGlobalOperator);\n const op1 = `\n value = max(_X(x), value);\n `;\n const op2 = '';\n const poolingCode = generatePoolingCode(inputs[0].dims, adjustedAttributes, op1, op2, '-1e5');\n const shaderSource = `\n ${poolingCode}\n `;\n return {\n ...metadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst getAdjustedPoolAttributesAndOutputShape =\n (inputs: Tensor[], attributes: AveragePoolAttributes|MaxPoolAttributes, isGlobalOperator: boolean):\n [AveragePoolAttributes|MaxPoolAttributes, number[]] => {\n const inputShape = inputs[0].dims.slice();\n const hasDilations = Object.hasOwnProperty.call(attributes, 'dilations');\n const kernelShape = attributes.kernelShape.slice();\n const strides = attributes.strides.slice();\n const dilations: number[] = hasDilations ? (attributes as MaxPoolAttributes).dilations.slice() : [];\n const pads = attributes.pads.slice();\n PoolConvUtil.adjustPoolAttributes(isGlobalOperator, inputShape, kernelShape, strides, dilations, pads);\n\n const outputShape = PoolConvUtil.computePoolOutputShape(\n isGlobalOperator, inputShape, strides, dilations, kernelShape, pads, attributes.autoPad);\n\n const newAttributes = Object.assign({}, attributes);\n if (hasDilations) {\n Object.assign(newAttributes, {kernelShape, strides, pads, dilations, cacheKey: attributes.cacheKey});\n } else {\n Object.assign(newAttributes, {kernelShape, strides, pads, cacheKey: attributes.cacheKey});\n }\n return [newAttributes, outputShape];\n };\n\nconst globalMaxPoolAttributes = {\n autoPad: '',\n ceilMode: 0,\n countIncludePad: false,\n kernelShape: [],\n strides: [],\n pads: [],\n storageOrder: 0,\n dilations: [],\n cacheKey: ''\n};\n\nconst globalMaxPoolMetadata = {\n name: 'GlobalMaxPool',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked]\n};\n\nexport const globalMaxPool = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputs(inputs);\n const output = inferenceHandler.run(\n {\n ...globalMaxPoolMetadata,\n get: () => createMaxPoolProgramInfo(inputs, globalMaxPoolMetadata, true, globalMaxPoolAttributes)\n },\n inputs);\n return [output];\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Pool ops requires 1 input.');\n }\n if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n throw new Error('Invalid input type.');\n }\n};\n\nconst generatePoolingCode =\n (inputDims: readonly number[], attributes: AveragePoolAttributes, op1: string, op2: string, start: string):\n string => {\n const rank = inputDims.length;\n if (attributes.kernelShape.length <= 2) {\n const kw = attributes.kernelShape[attributes.kernelShape.length - 1];\n const sw = attributes.strides[attributes.strides.length - 1];\n const pwStart = attributes.pads[attributes.pads.length / 2 - 1];\n const pwEnd = attributes.pads[attributes.pads.length - 1];\n const dimW = inputDims[rank - 1];\n let codeW = '';\n let codeH = '';\n let codeHEnd = '';\n if (pwStart + pwEnd !== 0) {\n codeW = `\n for (int i = 0; i < ${kw}; i++) {\n x[${rank} - 1] = indices[${rank} - 1] * ${sw} - ${pwStart} + i;\n if (x[${rank} - 1] < 0 || x[${rank} - 1] >= ${dimW}) {\n pad++;\n continue;\n }\n ${op1}\n }`;\n } else {\n codeW = `\n for (int i = 0; i < ${kw}; i++) {\n x[${rank} - 1] = indices[${rank} - 1] * ${sw} - ${pwStart} + i;\n ${op1}\n }`;\n }\n\n if (attributes.kernelShape.length === 2) {\n const kh = attributes.kernelShape[attributes.kernelShape.length - 2];\n const sh = attributes.strides[attributes.strides.length - 2];\n const phStart = attributes.pads[attributes.pads.length / 2 - 2];\n const phEnd = attributes.pads[attributes.pads.length - 2];\n const dimH = inputDims[rank - 2];\n if (phStart + phEnd !== 0) {\n codeH = `\n for (int j = 0; j < ${kh}; j++) {\n x[${rank} - 2] = indices[${rank} - 2] * ${sh} - ${phStart} + j;\n if (x[${rank} - 2] < 0 || x[${rank} - 2] >= ${dimH}) {\n pad+= ${kw};\n continue;\n }\n `;\n } else {\n codeH = `\n for (int j = 0; j < ${kh}; j++) {\n x[${rank} - 2] = indices[${rank} - 2] * ${sh} - ${phStart} + j;\n `;\n }\n codeHEnd = `\n }\n `;\n }\n\n const poolingCode = `\n float process(int indices[${rank}]) {\n int x[${rank}];\n copyVec(indices, x);\n\n float value = ${start};\n int pad = 0;\n ${codeH}\n ${codeW}\n ${codeHEnd}\n ${op2}\n return value;\n }\n `;\n return poolingCode;\n } else {\n const kernelSize = ShapeUtil.size(attributes.kernelShape);\n const kernelStrides = ShapeUtil.computeStrides(attributes.kernelShape);\n const stridesRank = kernelStrides.length;\n const padsRank = attributes.pads.length;\n const offsetToIndicesFunction = offsetToIndices(stridesRank);\n const copyInputDims = copyArray(inputDims, 'inputDims');\n const copyPads = copyArray(attributes.pads, 'pads');\n const copyKernelStrides = copyArray(kernelStrides, 'kernelStrides');\n const copyStrides = copyArray(attributes.strides, 'strides');\n const hasPads = attributes.pads.reduce((sum, cur) => sum + cur);\n let padCode = '';\n if (hasPads) {\n padCode = `\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${op1}\n }`;\n } else {\n padCode = `\n }\n ${op1}\n `;\n }\n const poolingCode = `\n ${offsetToIndicesFunction}\n float process(int indices[${rank}]) {\n int x[${rank}];\n copyVec(indices, x);\n int offset[${stridesRank}];\n int pads[${padsRank}];\n int inputDims[${rank}];\n int kernelStrides[${stridesRank}];\n int strides[${stridesRank}];\n ${copyPads}\n ${copyInputDims}\n ${copyStrides}\n ${copyKernelStrides}\n\n float value = ${start};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${kernelSize}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${rank} - ${stridesRank}; j < ${rank}; j++) {\n x[j] = indices[j] * strides[j - ${rank} + ${stridesRank}]\n + offset[j - ${rank} + ${stridesRank}] - pads[j - 2];\n ${padCode}\n }\n ${op2}\n\n return value;\n }\n `;\n return poolingCode;\n }\n };\n\nconst copyArray = (array: readonly number[], arrayName: string): string => {\n let block = '';\n for (let i = 0; i < array.length; i++) {\n block += `\n ${arrayName}[${i}] = ${array[i]};\n `;\n }\n return block;\n};\n\nconst offsetToIndices = (rank: number): string => `\n void offsetToIndices(int offset, int[${rank}] strides, out int[${rank}] indices) {\n if (${rank} == 0) {\n return;\n }\n for (int i = 0; i < ${rank} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${rank} - 1] = offset;\n }`;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {NUMBER_TYPES, OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramMetadata, TextureType} from '../types';\n\nexport interface ReduceAttributes extends AttributeWithCacheKey {\n readonly axes: number[];\n readonly keepDims: boolean;\n}\n\n// return [init ops, reduce ops, final ops]\ntype ReduceOp = (inputs: Tensor[], axes: number[]) => string[];\n\nconst reduce =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes, name: string,\n reduceOp: ReduceOp): Tensor[] => {\n validateInputs(inputs);\n\n const reduceProgramMetadata = {\n name,\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked],\n };\n\n const output = inferenceHandler.run(\n {\n ...reduceProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () =>\n createReduceProgramInfo(inferenceHandler, inputs, attributes, name, reduceOp, reduceProgramMetadata)\n },\n inputs);\n return [output];\n };\n\nexport const parseReduceAttributes: OperatorInitialization = (node: Graph.Node): ReduceAttributes => {\n const axes = node.attributes.getInts('axes', []);\n const keepDims = node.attributes.getInt('keepdims', 1) === 1;\n return createAttributeWithCacheKey({axes, keepDims});\n};\n\nconst createReduceProgramInfo =\n (_handler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes, _name: string, reduceOp: ReduceOp,\n reduceProgramMetadata: ProgramMetadata): ProgramInfo => {\n const outputShape: number[] = [];\n const iRank = inputs[0].dims.length || 1;\n\n const idxCopy = []; // copy output indexes to input indexes\n\n const axes = ShapeUtil.normalizeAxes(attributes.axes, inputs[0].dims.length);\n const ops = reduceOp(inputs, axes);\n let reduceOps = ops[1];\n\n for (let k = 0; k < inputs[0].dims.length; k++) {\n // if this axis is reduced\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n if (attributes.keepDims) {\n outputShape.push(1);\n } // else { remove the axis from outputShape; }\n\n // loop over the d-th axis\n reduceOps = `\n for(int j${k} = 0; j${k} < ${inputs[0].dims[k]}; j${k}++) {\n inputIdx[${k}] = j${k};\n ${reduceOps}\n }`;\n } else {\n idxCopy.push(`inputIdx[${k}] = outputIdx[${outputShape.length}];`);\n\n outputShape.push(inputs[0].dims[k]);\n }\n }\n\n const oRank = outputShape.length || 1;\n\n const shaderSource = `\n float process(int outputIdx[${oRank}]) {\n float value; // final result\n int inputIdx[${iRank}]; // addressing input data\n ${idxCopy.join('\\n')}\n ${ops[0]} // init ops for reduce max/min\n ${reduceOps}\n ${ops[2]} // final computation for reduce mean\n return value;\n }`;\n\n return {\n ...reduceProgramMetadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n // TODO: support Reduce* operators with 2 inputs.\n if (!inputs || inputs.length !== 1) {\n throw new Error('Reduce op requires 1 input.');\n }\n\n if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n throw new Error('Invalid input type.');\n }\n};\n\nexport const reduceSum: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (): string[] => ['value = 0.0;', 'value += _A(inputIdx);', ''];\n return reduce(inferenceHandler, inputs, attributes, 'ReduceSum', reduceOp);\n };\n\nexport const reduceMean: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (inputs: Tensor[], axes: number[]): string[] => {\n let size = 1.0;\n for (let k = 0; k < inputs[0].dims.length; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n size *= inputs[0].dims[k];\n }\n }\n\n return ['value = 0.0;', 'value += _A(inputIdx);', `value /= ${size}.;`]; // ensure real number with `.`\n };\n return reduce(inferenceHandler, inputs, attributes, 'ReduceMean', reduceOp);\n };\n\nexport const reduceMax: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (inputs: Tensor[], axes: number[]): string[] => {\n const idxZero = [];\n for (let k = 0; k < inputs[0].dims.length; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n idxZero.push(`inputIdx[${k}] = 0;`); // first element\n }\n }\n\n return [`${idxZero.join('\\n')}\\nvalue = _A(inputIdx);`, 'value = max(value, _A(inputIdx));', ''];\n };\n return reduce(inferenceHandler, inputs, attributes, 'ReduceMax', reduceOp);\n };\n\nexport const reduceMin: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (inputs: Tensor[], axes: number[]): string[] => {\n const idxZero = [];\n for (let k = 0; k < inputs[0].dims.length; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n idxZero.push(`inputIdx[${k}] = 0;`); // first element\n }\n }\n\n return [`${idxZero.join('\\n')}\\nvalue = _A(inputIdx);`, 'value = min(value, _A(inputIdx));', ''];\n };\n return reduce(inferenceHandler, inputs, attributes, 'ReduceMin', reduceOp);\n };\n\nexport const reduceProd: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (): string[] => ['value = 1.0;', 'value *= _A(inputIdx);', ''];\n return reduce(inferenceHandler, inputs, attributes, 'ReduceProd', reduceOp);\n };\n\nexport const reduceLogSum: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (): string[] => ['value = 0.0;', 'value += _A(inputIdx);', 'value = log(value);'];\n return reduce(inferenceHandler, inputs, attributes, 'ReduceLogSum', reduceOp);\n };\n\nexport const reduceLogSumSquare: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: ReduceAttributes): Tensor[] => {\n const reduceOp: ReduceOp = (): string[] => ['float t; value = 0.0;', 't = _A(inputIdx); value += t * t;', ''];\n return reduce(inferenceHandler, inputs, attributes, 'ReduceLogSumSquare', reduceOp);\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nexport const reshape = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n const reshapedDims = ShapeUtil.calculateReshapedDims(inputs[0].dims, inputs[1].integerData);\n if (handler.session.pack) {\n return [handler.reshapePacked(inputs[0], reshapedDims)];\n } else {\n return [handler.reshapeUnpacked(inputs[0], reshapedDims)];\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nexport interface UpsampleAttributes extends AttributeWithCacheKey {\n readonly opset: number;\n readonly isResize: boolean;\n readonly mode: string;\n readonly scales: number[];\n readonly extrapolationValue: number;\n readonly coordinateTransformMode: string;\n readonly useExtrapolation: boolean;\n readonly needRoiInput: boolean;\n readonly nearestMode: string;\n readonly cubicCoefficientA: number;\n readonly excludeOutside: boolean;\n readonly useNearest2xOptimization: boolean;\n readonly roiInputIdx: number;\n readonly scalesInputIdx: number;\n readonly sizesInputIdx: number;\n}\n\nconst upsampleProgramMetadata = {\n name: 'Upsample',\n inputNames: ['X'],\n inputTypes: [TextureType.unpacked],\n};\n\nexport const upsample: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: UpsampleAttributes): Tensor[] => {\n validateInputs(inputs, attributes);\n const output = inferenceHandler.run(\n {\n ...upsampleProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createUpsampleProgramInfo(inferenceHandler, inputs, attributes)\n },\n inputs);\n return [output];\n };\n\nexport const parseUpsampleAttributesV7: OperatorInitialization =\n (node: Graph.Node): UpsampleAttributes => parseUpsampleAttributes(node, 7);\n\nexport const parseUpsampleAttributesV9: OperatorInitialization =\n (node: Graph.Node): UpsampleAttributes => parseUpsampleAttributes(node, 9);\n\nexport const parseUpsampleAttributes = (node: Graph.Node, opset: number): UpsampleAttributes => {\n const isResize = (opset >= 10);\n\n // processing node attributes\n const mode = node.attributes.getString('mode', 'nearest');\n if (mode !== 'nearest' && mode !== 'linear' && (opset < 11 || mode !== 'cubic')) {\n throw new Error(`unrecognized mode: ${mode}`);\n }\n\n let scales: number[] = [];\n if (opset < 9) {\n scales = node.attributes.getFloats('scales');\n scalesValidation(scales, mode, isResize);\n }\n\n const extrapolationValue = node.attributes.getFloat('extrapolation_value', 0.0);\n\n const coordinateTransformMode =\n opset > 10 ? node.attributes.getString('coordinate_transformation_mode', 'half_pixel') : 'asymmetric';\n if ([\n 'asymmetric', 'pytorch_half_pixel', 'tf_half_pixel_for_nn', 'align_corners', 'tf_crop_and_resize', 'half_pixel'\n ].indexOf(coordinateTransformMode) === -1) {\n throw new Error(`coordinate_transform_mode '${coordinateTransformMode}' is not supported`);\n }\n const needRoiInput = (coordinateTransformMode === 'tf_crop_and_resize');\n const useExtrapolation = needRoiInput;\n\n const nearestMode =\n (mode === 'nearest' && opset >= 11) ? node.attributes.getString('nearest_mode', 'round_prefer_floor') : '';\n if (['round_prefer_floor', 'round_prefer_ceil', 'floor', 'ceil', ''].indexOf(nearestMode) === -1) {\n throw new Error(`nearest_mode '${nearestMode}' is not supported`);\n }\n\n const cubicCoefficientA = node.attributes.getFloat('cubic_coeff_a', -0.75);\n const excludeOutside = node.attributes.getInt('exclude_outside', 0) !== 0;\n if (excludeOutside && mode !== 'cubic') {\n throw new Error('exclude_outside can be set to 1 only when mode is CUBIC.');\n }\n\n const useNearest2xOptimization =\n (opset < 11) ? true : (mode === 'nearest' && coordinateTransformMode === 'asymmetric' && nearestMode === 'floor');\n\n let roiInputIdx = 0;\n let scalesInputIdx = 0;\n let sizesInputIdx = 0;\n\n if (opset > 10) {\n // handle when roiInput is not given\n if (node.inputs.length > 2) {\n roiInputIdx = 1;\n scalesInputIdx = 2;\n sizesInputIdx = 3;\n } else {\n scalesInputIdx = 1;\n sizesInputIdx = 2;\n }\n } else if (opset === 9) {\n scalesInputIdx = 1;\n }\n\n return createAttributeWithCacheKey({\n opset,\n isResize,\n mode,\n scales,\n extrapolationValue,\n coordinateTransformMode,\n useExtrapolation,\n needRoiInput,\n nearestMode,\n cubicCoefficientA,\n excludeOutside,\n useNearest2xOptimization,\n roiInputIdx,\n scalesInputIdx,\n sizesInputIdx\n });\n};\n\nconst createUpsampleProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: UpsampleAttributes): ProgramInfo => {\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const [inputWidth, inputHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(inputs[0].dims, TextureType.unpacked);\n\n const outputShape = inputs[0].dims.map((dim, i) => Math.floor(dim * attributes.scales[i]));\n const [outputWidth, outputHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(outputShape, TextureType.unpacked);\n const dim = outputShape.length;\n\n const outputPitches = new Array(dim);\n const inputPitches = new Array(dim);\n let precalculatedPitches = `\n int output_pitches[${dim}];\n int input_pitches[${dim}];\n `;\n for (let d = dim - 1; d >= 0; d--) {\n outputPitches[d] = (d === dim - 1) ? 1 : outputPitches[d + 1] * outputShape[d + 1];\n inputPitches[d] = (d === dim - 1) ? 1 : inputPitches[d + 1] * inputs[0].dims[d + 1];\n\n precalculatedPitches += `\n output_pitches[${d}] = ${outputPitches[d]};\n input_pitches[${d}] = ${inputPitches[d]};\n `;\n }\n const getInputFloatFunction = `\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${inputWidth}, ${inputHeight});\n float value = getColorAsFloat(${glsl.texture2D}(X, coords));\n return value;\n }\n `;\n\n const shaderSource = attributes.mode === 'nearest' ?\n // nearest\n `\n ${getInputFloatFunction}\n float process(int indices[${dim}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${outputWidth}, ${outputHeight});\n\n ${precalculatedPitches}\n\n int d, m;\n for (int dim = 0; dim < ${dim}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }` :\n dim === 4 ?\n // bilinear 4D\n `\n ${getInputFloatFunction}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${outputWidth}, ${outputHeight});\n\n ${precalculatedPitches}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${inputs[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }` :\n // bilinear 2D\n `\n ${getInputFloatFunction}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${outputWidth}, ${outputHeight});\n\n ${precalculatedPitches}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${inputs[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;\n return {\n ...upsampleProgramMetadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource,\n variables: [{\n name: 'scales',\n type: 'int',\n arrayLength: attributes.scales.length,\n data: attributes.scales.map(x => Math.ceil(x))\n }]\n };\n };\n\nexport const validateInputs = (inputs: Tensor[], attribute: UpsampleAttributes): void => {\n if (!inputs || (attribute.opset < 9 && inputs.length !== 1) ||\n (attribute.opset >= 9 && attribute.opset < 11 && inputs.length !== 2) ||\n (attribute.opset >= 11 && inputs.length < 2)) {\n throw new Error('invalid inputs.');\n }\n\n if (attribute.scales.length > 0 && inputs[0].dims.length !== attribute.scales.length) {\n throw new Error('Invalid input shape.');\n }\n\n if (inputs[0].type === 'string') {\n throw new Error('Invalid input tensor types.');\n }\n};\n\nexport const scalesValidation = (scales: number[], mode: string, isResize: boolean): void => {\n if (!isResize) {\n for (const scale of scales) {\n if (scale < 1) {\n throw new Error('Scale value should be greater than or equal to 1.');\n }\n }\n } else {\n for (const scale of scales) {\n if (scale <= 0) {\n throw new Error('Scale value should be greater than 0.');\n }\n }\n }\n if (mode === 'linear' || mode === 'cubic') {\n if (scales.length !== 2 && (scales.length !== 4 || scales[0] !== 1 || scales[1] !== 1)) {\n throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') \\\n or 4-D inputs with the corresponding outermost 2 scale values being 1 \\\n in the ${isResize ? 'Resize' : 'Upsample'} opeartor.`);\n }\n }\n};", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\nimport {getCoordsDataType} from '../utils';\n\nimport {unpackFromChannel} from './packing-utils';\nimport {parseUpsampleAttributes, scalesValidation, UpsampleAttributes, validateInputs} from './upsample';\n\nconst resizeProgramMetadata = {\n name: 'Resize',\n inputNames: ['A'],\n inputTypes: [TextureType.packed]\n};\n\nexport const resize: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: UpsampleAttributes): Tensor[] => {\n validateInputs(inputs, attributes);\n const output = inferenceHandler.run(\n {\n ...resizeProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createPackedResizeProgramInfo(inferenceHandler, inputs, attributes)\n },\n inputs);\n return [output];\n };\n\nexport const parseResizeAttributesV10: OperatorInitialization =\n (node: Graph.Node): UpsampleAttributes => parseUpsampleAttributes(node, 10);\n\nexport const parseResizeAttributesV11: OperatorInitialization =\n (node: Graph.Node): UpsampleAttributes => parseUpsampleAttributes(node, 11);\n\nconst createPackedResizeProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: UpsampleAttributes): ProgramInfo => {\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const [scales, outputShape] = prepareInputs(inputs, attributes);\n\n const isSame =\n scales.every((s: number) => s === 1) && attributes.coordinateTransformMode !== 'tf_crop_and_resize';\n if (isSame) {\n return {\n ...resizeProgramMetadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.packed},\n hasMain: true,\n shaderSource: `void main() {\n vec4 v = ${glsl.texture2D}(X, TexCoords);\n ${glsl.output} = v;\n }`\n };\n }\n\n const dim = outputShape.length;\n if (dim < 2) {\n throw new Error(`output dimension should be at least 2, but got ${dim}`);\n }\n\n const outputHeight = outputShape[dim - 2];\n const outputWidth = outputShape[dim - 1];\n\n const inputShape = inputs[0].dims;\n if (dim !== inputShape.length) {\n throw new Error(`output dimension should match input ${inputShape.length}, but got ${dim}`);\n }\n const inputHeight = inputShape[dim - 2];\n const inputWidth = inputShape[dim - 1];\n\n const scalesHeight = scales[dim - 2];\n const scalesWidth = scales[dim - 1];\n\n let getSourceFracIndex = '';\n\n if (attributes.mode !== 'linear') {\n // TODO: support other modes\n throw new Error(`resize (packed) does not support mode: '${attributes.mode}'`);\n }\n switch (attributes.coordinateTransformMode) {\n case 'asymmetric':\n getSourceFracIndex = `\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n `;\n break;\n case 'half_pixel':\n getSourceFracIndex = `\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n `;\n break;\n case 'pytorch_half_pixel':\n getSourceFracIndex = `\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${outputWidth}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${outputHeight}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${outputWidth}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${outputHeight}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;\n break;\n case 'align_corners':\n getSourceFracIndex = `\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${outputWidth}.0 - 1.0, ${outputHeight}.0 - 1.0, ${outputWidth}.0 - 1.0,\n ${outputHeight}.0 - 1.0);\n vec4 original = vec4(${inputWidth}.0 - 1.0, ${inputHeight}.0 - 1.0, ${inputWidth}.0 - 1.0,\n ${inputHeight}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;\n break;\n default:\n // TODO:supporting other coordinateTransformModes\n throw new Error(`resize (packed) does not support coordinateTransformMode: \\\n '${attributes.coordinateTransformMode}'`);\n }\n\n const coordsDataType = getCoordsDataType(dim);\n const unpackChannel = unpackFromChannel();\n const shaderSource = `\n const vec2 inputWH = vec2(${inputHeight}.0, ${inputWidth}.0);\n const vec4 scaleWHWH = vec4(float(${scalesHeight}), float(${scalesWidth}), float(${scalesHeight}), float(${\n scalesWidth}));\n ${unpackChannel}\n ${getSourceFracIndex}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${coordsDataType} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${outputHeight - 1};\n bool hasNextCol = rc.z < ${outputWidth - 1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${glsl.output} = vec4(newValue);\n }\n `;\n return {\n ...resizeProgramMetadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.packed},\n hasMain: true,\n shaderSource\n };\n };\n\n\nconst prepareInputs = (inputs: Tensor[], attributes: UpsampleAttributes): [readonly number[], readonly number[]] => {\n const x = inputs[0];\n const xDims = x.dims;\n\n let scales = attributes.scales;\n let outputSizes: number[]|undefined;\n if (scales.length === 0) {\n const scalesTensor = inputs[attributes.scalesInputIdx];\n if (scalesTensor && scalesTensor.size !== 0) {\n if (inputs[attributes.sizesInputIdx]) {\n throw new Error('Only one of scales or sizes must be provided as input.');\n }\n scales = parseScalesData(scalesTensor, attributes.mode, attributes.isResize);\n } else {\n const sizesTensor = inputs[attributes.sizesInputIdx];\n if (!sizesTensor || sizesTensor.size === 0) {\n throw new Error('Either scales or sizes MUST be provided as input.');\n }\n\n outputSizes = Array.from(sizesTensor.integerData);\n scales = parseScalesDataFromOutputSize(outputSizes, xDims, attributes.mode, attributes.isResize);\n }\n } else {\n if (inputs[attributes.sizesInputIdx]) {\n throw new Error('Only one of scales or sizes must be provided as input.');\n }\n }\n\n const yDims = outputSizes || (xDims.map((dim, i) => Math.floor(dim * scales[i])));\n\n return [scales, yDims];\n};\n\nconst parseScalesData = (scale: Tensor, mode: string, isResize: boolean): number[] => {\n const scales = Array.from(scale.floatData);\n scalesValidation(scales, mode, isResize);\n return scales;\n};\n\nconst parseScalesDataFromOutputSize =\n (yDims: readonly number[], xDims: readonly number[], mode: string, isResize: boolean): number[] => {\n const length = xDims.length;\n const scales = new Array(length);\n\n for (let i = 0, end = length; i < end; i++) {\n if (xDims[i] === 0) {\n if (yDims[i] !== 0) {\n throw new Error('Input dim is zero but required output dim is non-zero.');\n }\n scales[i] = 1;\n } else {\n scales[i] = yDims[i] / xDims[i];\n }\n }\n scalesValidation(scales, mode, isResize);\n return scales;\n };\n\n// roi data is not used yet. but leave here for future usage.\n// const getRoi = (inputs: Tensor[], attributes: UpsampleAttributes) : number[] => {\n// let roi: number[] = [];\n// if (attributes.needRoiInput) {\n// if (attributes.roiInputIdx <= 0) {\n// throw new Error('Invalid roi input index.');\n// }\n// const roiTensor = inputs[attributes.roiInputIdx];\n// roi = roiTensor.size > 0 ? Array.from(roiTensor.floatData) : [];\n// } else {\n// roi = new Array(inputs[0].dims.length * 2).fill(0);\n// }\n// return roi;\n// };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nexport const shape = (_inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputs(inputs);\n return [new Tensor([inputs[0].dims.length], 'int32', undefined, undefined, new Int32Array(inputs[0].dims))];\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Shape requires 1 input.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {NUMBER_TYPES, OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nexport interface SliceAttributes extends AttributeWithCacheKey {\n readonly axes: number[];\n readonly ends: number[];\n readonly starts: number[];\n}\n\nconst sliceProgramMetadata = {\n name: 'Slice',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked]\n};\n\nexport const slice: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: SliceAttributes): Tensor[] => {\n validateInputs(inputs);\n const output = inferenceHandler.run(\n {\n ...sliceProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createSliceProgramInfo(inferenceHandler, inputs[0], attributes)\n },\n inputs);\n return [output];\n };\n\nexport const parseSliceAttributes: OperatorInitialization = (node: Graph.Node): SliceAttributes => {\n const starts = node.attributes.getInts('starts');\n const ends = node.attributes.getInts('ends');\n const axes = node.attributes.getInts('axes', []);\n return createAttributeWithCacheKey({starts, ends, axes});\n};\n\nconst createSliceProgramInfo =\n (_inferenceHandler: WebGLInferenceHandler, input: Tensor, attributes: SliceAttributes): ProgramInfo => {\n const axes = (attributes.axes.length === 0) ? input.dims.slice(0).map((_val, i) => i) : attributes.axes;\n const normalizedAxes = ShapeUtil.normalizeAxes(axes, input.dims.length);\n const starts = attributes.starts.map((start, i) => {\n if (start > input.dims[normalizedAxes[i]] - 1) {\n return input.dims[normalizedAxes[i]];\n }\n return ShapeUtil.normalizeAxis(start, input.dims[normalizedAxes[i]]);\n });\n const ends = attributes.ends.map((end, i) => {\n if (end > input.dims[normalizedAxes[i]] - 1) {\n return input.dims[normalizedAxes[i]];\n }\n return ShapeUtil.normalizeAxis(end, input.dims[normalizedAxes[i]]);\n });\n\n const outputShape = input.dims.slice();\n\n const sliceOps: string[] = [];\n for (let i = 0; i < normalizedAxes.length; i++) {\n outputShape[normalizedAxes[i]] = ends[i] - starts[i];\n if (starts[i] > 0) {\n sliceOps.push(`outputIdx[${normalizedAxes[i]}] += ${starts[i]};`);\n } // else { sliceOps.push(`outputIdx[${normalizedAxes[i]}] += 0;`); }\n }\n\n const rank = outputShape.length;\n const shaderSource = `\n float process(int outputIdx[${rank}]) {\n ${sliceOps.join('\\n ')}\n return _A(outputIdx);\n }`;\n return {\n ...sliceProgramMetadata,\n output: {dims: outputShape, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Slice requires 1 input.');\n }\n if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n throw new Error('Invalid input type.');\n }\n};\n\nexport const sliceV10 = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputsV10(inputs);\n const attributes = generateSliceAttributesFromInputs(inferenceHandler, inputs);\n const output = inferenceHandler.run(\n {\n ...sliceProgramMetadata,\n cacheHint: attributes.cacheKey,\n get: () => createSliceProgramInfo(inferenceHandler, inputs[0], attributes)\n },\n [inputs[0]]);\n return [output];\n};\n\nconst generateSliceAttributesFromInputs =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): SliceAttributes => {\n if (!inferenceHandler.session.isInitializer(inputs[1].dataId) ||\n !inferenceHandler.session.isInitializer(inputs[2].dataId) ||\n (inputs.length >= 4 && !inferenceHandler.session.isInitializer(inputs[3].dataId)) ||\n (inputs.length >= 5 && !inferenceHandler.session.isInitializer(inputs[4].dataId))) {\n throw new Error('dynamic slice attributes are not allowed');\n }\n\n if (inputs.length >= 5 && inputs[4].integerData.some((i: number) => i !== 1)) {\n throw new Error('currently non-1 steps is not supported for Slice');\n }\n\n const starts = Array.from(inputs[1].integerData);\n const ends = Array.from(inputs[2].integerData);\n const axes = inputs.length >= 4 ? Array.from(inputs[3].integerData) : [];\n const cacheKey = `${axes};${starts};${ends}`;\n return {starts, ends, axes, cacheKey};\n };\n\nconst validateInputsV10 = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length < 3 || inputs.length > 5) {\n throw new Error('Invalid input number.');\n }\n if (inputs[1].type !== 'int32' || inputs[1].dims.length !== 1) {\n throw new Error('Invalid input type.');\n }\n if (inputs[2].type !== 'int32' || inputs[2].dims.length !== 1) {\n throw new Error('Invalid input type.');\n }\n if (inputs.length >= 4 && (inputs[3].type !== 'int32' || inputs[3].dims.length !== 1)) {\n throw new Error('Invalid input type.');\n }\n if (inputs.length >= 5 && (inputs[4].type !== 'int32' || inputs[4].dims.length !== 1)) {\n throw new Error('Invalid input type.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nimport {transpose, TransposeAttributes} from './transpose';\n\nexport interface SoftmaxAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n}\n\nconst softmaxComputeMaxProgramMetadata = {\n name: 'SoftmaxComputeMax',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked],\n};\n\nconst softmaxComputeScaleProgramMetadata = {\n name: 'SoftmaxComputeScale',\n inputNames: ['A', 'Max'],\n inputTypes: [TextureType.unpacked, TextureType.unpacked],\n};\n\nconst softmaxProgramMetadata = {\n name: 'SoftMax',\n inputNames: ['A', 'Max', 'Norm'],\n inputTypes: [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked],\n};\n\nexport const softmax: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: SoftmaxAttributes): Tensor[] => {\n validateInputs(inputs);\n\n const inputShape = inputs[0].dims.slice();\n const axis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);\n const logicalRowCount = ShapeUtil.sizeToDimension(inputShape, axis);\n const featureCount = ShapeUtil.sizeFromDimension(inputShape, axis);\n\n const output = computeSoftmax(inferenceHandler, inputs, attributes, logicalRowCount, featureCount);\n return output;\n };\n\nexport const parseSoftmaxAttributes: OperatorInitialization =\n (node: Graph.Node): SoftmaxAttributes => createAttributeWithCacheKey({axis: node.attributes.getInt('axis', 1)});\n\nexport const parseSoftmaxAttributesV13: OperatorInitialization =\n (node: Graph.Node): SoftmaxAttributes => createAttributeWithCacheKey({axis: node.attributes.getInt('axis', -1)});\n\n// The \"semantic\" meaning of axis has changed in opset-13.\n// Please compare: https://github.com/onnx/onnx/blob/main/docs/Operators.md#Softmax\n// with https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Softmax-11 for detailed explanations\n// To account for the opset-13 behavior, our plan will be to transpose the \"axis\" dim to the innermost dim\n// and perform softmax and then reverse the transpose. We can skip the transposing aspect if the axis is already\n// the innermost dim\nexport const softmaxV13: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: SoftmaxAttributes): Tensor[] => {\n validateInputs(inputs);\n\n const inputShape = inputs[0].dims.slice();\n const axis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);\n const rank = inputShape.length;\n\n const isTransposeRequired = (axis !== rank - 1) ? true : false;\n const transposedInputShape: number[] = [];\n let perm: number[] = [];\n let transposedInputs: Tensor[] = [];\n let transposeAttribute: TransposeAttributes;\n\n if (isTransposeRequired) {\n perm = Array.from({length: rank}).map((_, i) => i);\n\n // swap the innermost dim with the dim corresponding to axis\n perm[axis] = rank - 1;\n perm[rank - 1] = axis;\n\n perm.map(p => transposedInputShape.push(inputShape[p]));\n\n transposeAttribute = createAttributeWithCacheKey({perm});\n transposedInputs = transpose(inferenceHandler, inputs, transposeAttribute);\n }\n\n const logicalRowCount = isTransposeRequired ? ShapeUtil.sizeToDimension(transposedInputShape, rank - 1) :\n ShapeUtil.sizeToDimension(inputShape, rank - 1);\n const featureCount = isTransposeRequired ? ShapeUtil.sizeFromDimension(transposedInputShape, rank - 1) :\n ShapeUtil.sizeFromDimension(inputShape, rank - 1);\n\n const output = computeSoftmax(\n inferenceHandler, isTransposeRequired ? transposedInputs : inputs, attributes, logicalRowCount, featureCount);\n\n if (isTransposeRequired) {\n const reversedOutput = transpose(inferenceHandler, output, transposeAttribute!);\n return reversedOutput;\n } else {\n return output;\n }\n };\n\nconst computeSoftmax =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: SoftmaxAttributes, logicalRowCount: number,\n featureCount: number): Tensor[] => {\n const computeMaxProgramInfo =\n createComputeMaxProgramInfo(inferenceHandler, inputs[0], logicalRowCount, featureCount, [logicalRowCount]);\n const max = inferenceHandler.run(\n {...softmaxComputeMaxProgramMetadata, cacheHint: attributes.cacheKey, get: () => computeMaxProgramInfo},\n inputs);\n\n const computeScaleProgramInfo = createComputScaleProgramInfo(\n inferenceHandler, inputs[0], logicalRowCount, featureCount, computeMaxProgramInfo.output.dims,\n [logicalRowCount]);\n const scale = inferenceHandler.run(\n {...softmaxComputeScaleProgramMetadata, cacheHint: attributes.cacheKey, get: () => computeScaleProgramInfo},\n [inputs[0], max]);\n\n const softMaxProgramInfo = createSoftMaxProgramInfo(\n inferenceHandler, inputs[0], logicalRowCount, featureCount, computeMaxProgramInfo.output.dims,\n computeScaleProgramInfo.output.dims);\n const output = inferenceHandler.run(\n {...softmaxProgramMetadata, cacheHint: attributes.cacheKey, get: () => softMaxProgramInfo},\n [inputs[0], max, scale]);\n return [output];\n };\n\n/**\n * Create a texture that contains the maximum value of each of the 'N' rows\n */\nconst createComputeMaxProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, input: Tensor, logicalRowCount: number, featureCount: number,\n outputShape: number[]): ProgramInfo => {\n const [textureWidth, textureHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(input.dims, TextureType.unpacked);\n const rank = outputShape.length;\n\n if (logicalRowCount < 1 || featureCount < 1) {\n throw new Error('Logical row count N and feature count D must be greater than or equal to 1');\n }\n\n if (outputShape.length !== 1) {\n throw new Error('Dimensionality of the output should be 1');\n }\n\n if (outputShape[0] !== logicalRowCount) {\n throw new Error('Shape of the output should be equal to logical row count');\n }\n\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const shaderSource = `\n float process(int[${rank}] indices) {\n int logical_row_start_offset = indices[0] * ${featureCount};\n\n float max = getColorAsFloat(${glsl.texture2D}(A, offsetToCoords(logical_row_start_offset, ${textureWidth},\n ${textureHeight} )));\n for(int i=1; i<${featureCount}; ++i)\n {\n float current = getColorAsFloat(${glsl.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${textureWidth}, ${textureHeight})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;\n return {\n ...softmaxComputeMaxProgramMetadata,\n output: {dims: outputShape, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\n/**\n * Create a texture that contains the normalization factor for each of the 'N' rows\n */\nconst createComputScaleProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, input: Tensor, logicalRowCount: number, featureCount: number,\n maxElementPerLogicalRow: readonly number[], outputShape: number[]): ProgramInfo => {\n const [textureWidth, textureHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(input.dims, TextureType.unpacked);\n const rank = outputShape.length;\n\n if (logicalRowCount < 1 || featureCount < 1) {\n throw new Error('Logical row count N and feature count D must be greater than or equal to 1');\n }\n\n if (outputShape.length !== 1) {\n throw new Error('Dimensionality of the output should be 1');\n }\n\n if (outputShape[0] !== logicalRowCount) {\n throw new Error('Shape of the output should be equal to logical row count');\n }\n\n if (maxElementPerLogicalRow.length !== 1) {\n throw new Error('Dimensionality of the intermediate results should be 1');\n }\n\n if (maxElementPerLogicalRow[0] !== logicalRowCount) {\n throw new Error('Shape of the intermediate results should be equal to logical row count');\n }\n\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const shaderSource = `\n float process(int[${rank}] indices) {\n int logical_row_start_offset = indices[0] * ${featureCount};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${featureCount}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${glsl.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${textureWidth}, ${textureHeight}))) - max);\n }\n\n return norm_factor;\n }`;\n return {\n ...softmaxComputeScaleProgramMetadata,\n output: {dims: outputShape, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst createSoftMaxProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, input: Tensor, logicalRowCount: number, featureCount: number,\n maxElementPerLogicalRow: readonly number[], normalizationPerLogicalRow: readonly number[]): ProgramInfo => {\n const [textureWidth, textureHeight] =\n inferenceHandler.calculateTextureWidthAndHeight(input.dims, TextureType.unpacked);\n const rank = input.dims.length;\n\n if (logicalRowCount < 1 || featureCount < 1) {\n throw new Error('Logical row count N and feature count D must be greater than or equal to 1');\n }\n\n if (maxElementPerLogicalRow.length !== 1 || normalizationPerLogicalRow.length !== 1) {\n throw new Error('Dimensionality of the intermediate results should be 1');\n }\n\n if (maxElementPerLogicalRow[0] !== logicalRowCount || normalizationPerLogicalRow[0] !== logicalRowCount) {\n throw new Error('Shape of the intermediate results should be equal to logical row count');\n }\n\n const shaderSource = `\n float process(int[${rank}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${textureWidth}, ${textureHeight});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${featureCount};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;\n return {\n ...softmaxProgramMetadata,\n output: {dims: input.dims, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Softmax requires 1 input.');\n }\n\n if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n throw new Error('Invalid input type');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../../../attribute-with-cache-key';\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil, SplitUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, TextureType} from '../types';\n\nexport interface SplitAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n readonly split: number[];\n readonly numOutputs: number;\n}\n\nconst splitProgramMetadata = {\n name: 'Split',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked],\n};\n\nexport const split: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], attributes: SplitAttributes): Tensor[] => {\n validateInputs(inputs);\n\n const axis = ShapeUtil.normalizeAxis(attributes.axis, inputs[0].dims.length);\n const count = getProgramCount(inferenceHandler, inputs, axis, attributes);\n const output: Tensor[] = [];\n for (let i = 0; i < count; ++i) {\n output.push(inferenceHandler.run(\n {\n ...splitProgramMetadata,\n cacheHint: `${attributes.cacheKey};${i}`,\n get: () => createSplitProgramInfo(inferenceHandler, inputs[0], attributes, axis, i)\n },\n inputs));\n }\n\n return output;\n };\n\nexport const parseSplitAttributes: OperatorInitialization = (node: Graph.Node): SplitAttributes => {\n const axis = node.attributes.getInt('axis', 0);\n const split = node.attributes.getInts('split', []);\n const numOutputs = node.outputs.length;\n return createAttributeWithCacheKey({axis, split, numOutputs});\n};\n\nconst getProgramCount =\n (_inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], axis: number, attributes: SplitAttributes): number => {\n const [, offsets] = SplitUtil.splitShape(inputs[0].dims, axis, attributes.split, attributes.numOutputs);\n return offsets.length;\n };\n\nconst createSplitProgramInfo =\n (_inferenceHandler: WebGLInferenceHandler, input: Tensor, attributes: SplitAttributes, axis: number, index: number):\n ProgramInfo => {\n const [shapes, offsets] = SplitUtil.splitShape(input.dims, axis, attributes.split, attributes.numOutputs);\n const offset = offsets[index];\n const outputShape = shapes[index];\n const rank = outputShape.length;\n const shaderSource = `\n float process(int indices[${rank}]) {\n indices[${axis}] += ${offset};\n return _A(indices);\n }\n `;\n return {\n ...splitProgramMetadata,\n cacheHint: `${attributes.cacheKey}:${index}`,\n output: {dims: outputShape, type: input.type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Split requires one input.');\n }\n\n if (inputs[0].type !== 'int8' && inputs[0].type !== 'uint8' && inputs[0].type !== 'int16' &&\n inputs[0].type !== 'uint16' && inputs[0].type !== 'int32' && inputs[0].type !== 'uint32' &&\n inputs[0].type !== 'float32' && inputs[0].type !== 'float64' && inputs[0].type !== 'bool') {\n throw new Error('Invalid input type.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nexport const squeeze: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], axes: number[]): Tensor[] => {\n validateInputs(inputs);\n const outputShape = ShapeUtil.squeezeShape(inputs[0].dims, axes);\n const output = inferenceHandler.reshapeUnpacked(inputs[0], outputShape);\n return [output];\n };\n\nexport const squeezeV13 = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputsV13(inputs);\n return squeeze(inferenceHandler, [inputs[0]], Array.from(inputs[1].integerData));\n};\n\nexport const parseSqueezeAttributes: OperatorInitialization = (node: Graph.Node): number[] =>\n node.attributes.getInts('axes');\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Squeeze requires 1 input.');\n }\n\n if (inputs[0].type === 'string') {\n throw new Error('invalid input tensor types.');\n }\n};\n\nconst validateInputsV13 = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Squeeze requires 2 inputs.');\n }\n\n if (inputs[1].type !== 'int32') {\n throw new Error('Invalid input type.');\n }\n};", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from '../../../tensor';\nimport {getGlsl} from '../glsl-source';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramMetadata, TextureType} from '../types';\n\nexport const sum = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputs(inputs);\n\n const sumProgramMetadata = {\n name: 'Sum',\n inputNames: inputs.map((_v, i) => `X${i}`),\n inputTypes: new Array(inputs.length).fill(TextureType.unpacked)\n };\n\n const output = inferenceHandler.run(\n {...sumProgramMetadata, get: () => createSumProgramInfo(inferenceHandler, inputs, sumProgramMetadata)}, inputs);\n return [output];\n};\n\nconst createSumProgramInfo =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], sumProgramMetadata: ProgramMetadata): ProgramInfo => {\n const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n const outputShape = inputs[0].dims.slice();\n const sumLine = inputs.map((_v, i) => `${glsl.texture2D}(X${i},TexCoords)`).join(' + ');\n const shaderSource = `\n void main() {\n vec4 result = ${sumLine};\n ${glsl.output} = result;\n }\n `;\n return {\n ...sumProgramMetadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n hasMain: true,\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length === 0) {\n throw new Error('Sum requires inputs.');\n }\n\n const length = inputs[0].dims.length;\n for (let i = 1; i < inputs.length; i++) {\n if (length !== inputs[i].dims.length) {\n throw new Error('Input shapes are mismatched.');\n }\n\n for (let j = 0; j < length; j++) {\n if (inputs[0].dims[j] !== inputs[i].dims[j]) {\n throw new Error('Input shapes are not matched.');\n }\n }\n }\n\n if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n throw new Error('Invalid input type.');\n }\n for (let i = 1; i < inputs.length; i++) {\n if (inputs[0].type !== inputs[i].type) {\n throw new Error('Input types are not matched.');\n }\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {NUMBER_TYPES} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {WebGLInferenceHandler} from '../inference-handler';\nimport {ProgramInfo, ProgramMetadata, TextureType} from '../types';\n\nexport const tile = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputs(inputs);\n\n const tileProgramMetadata = {\n name: 'Tile',\n inputNames: ['A'],\n inputTypes: [TextureType.unpacked],\n };\n\n const output = inferenceHandler.run(\n {...tileProgramMetadata, get: () => createTileProgramInfo(inferenceHandler, inputs, tileProgramMetadata)},\n inputs);\n return [output];\n};\n\nconst createTileProgramInfo =\n (_handler: WebGLInferenceHandler, inputs: Tensor[], tileProgramMetadata: ProgramMetadata): ProgramInfo => {\n const inputShape = inputs[0].dims.slice();\n const outputShape = new Array(inputShape.length);\n\n const tileOps: string[] = [];\n for (let i = 0; i < inputShape.length; i++) {\n outputShape[i] = inputShape[i] * inputs[1].numberData[i];\n tileOps.push(`inputIdx[${i}] = int(mod(float(outputIdx[${i}]), ${inputShape[i]}.));`);\n }\n\n const rank = outputShape.length;\n const shaderSource = `\n float process(int outputIdx[${rank}]) {\n int inputIdx[${rank}];\n ${tileOps.join('\\n')}\n return _A(inputIdx);\n }\n `;\n return {\n ...tileProgramMetadata,\n output: {dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked},\n shaderSource\n };\n };\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Tile requires 2 input.');\n }\n if (inputs[1].dims.length !== 1) {\n throw new Error('The second input shape must 1 dimension.');\n }\n if (inputs[1].dims[0] !== inputs[0].dims.length) {\n throw new Error('Invalid input shape.');\n }\n if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n throw new Error('Invalid input type.');\n }\n if (inputs[1].type !== 'int32' && inputs[1].type !== 'int16') {\n throw new Error('Invalid repeat type.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Graph} from '../../../graph';\nimport {OperatorImplementation, OperatorInitialization} from '../../../operators';\nimport {Tensor} from '../../../tensor';\nimport {ShapeUtil} from '../../../util';\nimport {WebGLInferenceHandler} from '../inference-handler';\n\nexport const unsqueeze: OperatorImplementation =\n (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[], axes: number[]): Tensor[] => {\n validateInputs(inputs);\n const outputShape = ShapeUtil.unsqueezeShape(inputs[0].dims, axes);\n const output = inferenceHandler.reshapeUnpacked(inputs[0], outputShape);\n return [output];\n };\n\nexport const unsqueezeV13 = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n validateInputsV13(inputs);\n return unsqueeze(inferenceHandler, [inputs[0]], Array.from(inputs[1].integerData));\n};\n\nexport const parseUnsqueezeAttributes: OperatorInitialization = (node: Graph.Node): number[] =>\n node.attributes.getInts('axes');\n\nconst validateInputs = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Unsqueeze requires 1 input.');\n }\n\n if (inputs[0].type === 'string') {\n throw new Error('invalid input tensor types.');\n }\n};\n\nconst validateInputsV13 = (inputs: Tensor[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Unsqueeze requires 2 inputs.');\n }\n\n if (inputs[1].type !== 'int32') {\n throw new Error('Invalid input type.');\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {OpSet} from '../../opset';\n\nimport {batchNormalization, parseBatchNormalizationAttributes} from './ops/batch-normalization';\nimport * as binaryOps from './ops/binary-op';\nimport {cast, parseCastAttributes} from './ops/cast';\nimport {concat, parseConcatAttributes} from './ops/concat';\nimport {conv, parseConvAttributes} from './ops/conv';\nimport {convTranspose, parseConvTransposeAttributes} from './ops/conv-transpose';\nimport {depthToSpace, parseDepthToSpaceAttributes} from './ops/depth-to-space';\nimport {flatten, parseFlattenAttributes} from './ops/flatten';\nimport {gather, parseGatherAttributes} from './ops/gather';\nimport {gemm, parseGemmAttributesV11, parseGemmAttributesV7} from './ops/gemm';\nimport {imageScaler, parseImageScalerAttributes} from './ops/image-scaler';\nimport {instanceNormalization, parseInstanceNormalizationAttributes} from './ops/instance-normalization';\nimport {lrn, parseLrnAttributes} from './ops/lrn';\nimport {matMul, parseMatMulAttributes} from './ops/matmul';\nimport {padV11, padV2, parsePadAttributesV11, parsePadAttributesV2} from './ops/pad';\nimport {averagePool, globalAveragePool, globalMaxPool, maxPool, parseAveragePoolAttributes, parseGlobalAveragePoolAttributes, parseMaxPoolAttributes} from './ops/pool';\nimport {parseReduceAttributes, reduceLogSum, reduceLogSumSquare, reduceMax, reduceMean, reduceMin, reduceProd, reduceSum} from './ops/reduce';\nimport {reshape} from './ops/reshape';\nimport {parseResizeAttributesV10, parseResizeAttributesV11, resize} from './ops/resize-packed';\nimport {shape} from './ops/shape';\nimport {parseSliceAttributes, slice, sliceV10} from './ops/slice';\nimport {parseSoftmaxAttributes, parseSoftmaxAttributesV13, softmax, softmaxV13} from './ops/softmax';\nimport {parseSplitAttributes, split} from './ops/split';\nimport {parseSqueezeAttributes, squeeze, squeezeV13} from './ops/squeeze';\nimport {sum} from './ops/sum';\nimport {tile} from './ops/tile';\nimport {parseTransposeAttributes, transpose} from './ops/transpose';\nimport * as unaryOps from './ops/unary-op';\nimport {parseUnsqueezeAttributes, unsqueeze, unsqueezeV13} from './ops/unsqueeze';\nimport {parseUpsampleAttributesV7, parseUpsampleAttributesV9, upsample} from './ops/upsample';\n\nexport const WEBGL_OP_RESOLVE_RULES: readonly OpSet.ResolveRule[] = [\n ['Abs', '', '6+', unaryOps.abs],\n ['Acos', '', '7+', unaryOps.acos],\n ['Add', '', '7+', binaryOps.add],\n ['And', '', '7+', binaryOps.and],\n ['Asin', '', '7+', unaryOps.asin],\n ['Atan', '', '7+', unaryOps.atan],\n // TODO: support new attributes for AveragePool-10\n ['AveragePool', '', '7+', averagePool, parseAveragePoolAttributes],\n ['BatchNormalization', '', '7+', batchNormalization, parseBatchNormalizationAttributes],\n ['Cast', '', '6+', cast, parseCastAttributes],\n ['Ceil', '', '6+', unaryOps.ceil],\n ['Clip', '', '6-10', unaryOps.clip, unaryOps.parseClipAttributes],\n ['Clip', '', '11+', unaryOps.clipV11],\n ['Concat', '', '4+', concat, parseConcatAttributes],\n ['Conv', '', '1+', conv, parseConvAttributes],\n ['ConvTranspose', '', '1+', convTranspose, parseConvTransposeAttributes],\n ['Cos', '', '7+', unaryOps.cos],\n ['Div', '', '7+', binaryOps.div],\n ['Dropout', '', '7+', unaryOps.identity],\n ['DepthToSpace', '', '1+', depthToSpace, parseDepthToSpaceAttributes],\n ['Equal', '', '7+', binaryOps.equal],\n ['Elu', '', '6+', unaryOps.elu, unaryOps.parseEluAttributes],\n ['Exp', '', '6+', unaryOps.exp],\n ['Flatten', '', '1+', flatten, parseFlattenAttributes],\n ['Floor', '', '6+', unaryOps.floor],\n ['FusedConv', 'com.microsoft', '1+', conv, parseConvAttributes],\n ['Gather', '', '1+', gather, parseGatherAttributes],\n ['Gemm', '', '7-10', gemm, parseGemmAttributesV7],\n ['Gemm', '', '11+', gemm, parseGemmAttributesV11],\n ['GlobalAveragePool', '', '1+', globalAveragePool, parseGlobalAveragePoolAttributes],\n ['GlobalMaxPool', '', '1+', globalMaxPool],\n ['Greater', '', '7+', binaryOps.greater],\n ['Identity', '', '1+', unaryOps.identity],\n ['ImageScaler', '', '1+', imageScaler, parseImageScalerAttributes],\n ['InstanceNormalization', '', '6+', instanceNormalization, parseInstanceNormalizationAttributes],\n ['LeakyRelu', '', '6+', unaryOps.leakyRelu, unaryOps.parseLeakyReluAttributes],\n ['Less', '', '7+', binaryOps.less],\n ['LRN', '', '1+', lrn, parseLrnAttributes],\n ['Log', '', '6+', unaryOps.log],\n ['MatMul', '', '1+', matMul, parseMatMulAttributes],\n // TODO: support new attributes for MaxPool-8 and MaxPool-10\n ['MaxPool', '', '1+', maxPool, parseMaxPoolAttributes],\n ['Mul', '', '7+', binaryOps.mul],\n ['Neg', '', '6+', unaryOps.neg],\n ['Not', '', '1+', unaryOps.not],\n ['Or', '', '7+', binaryOps.or],\n ['Pad', '', '2-10', padV2, parsePadAttributesV2],\n ['Pad', '', '11+', padV11, parsePadAttributesV11],\n ['Pow', '', '7+', binaryOps.pow],\n ['PRelu', '', '7+', binaryOps.pRelu],\n ['ReduceLogSum', '', '1+', reduceLogSum, parseReduceAttributes],\n ['ReduceMax', '', '1+', reduceMax, parseReduceAttributes],\n ['ReduceMean', '', '1+', reduceMean, parseReduceAttributes],\n ['ReduceMin', '', '1+', reduceMin, parseReduceAttributes],\n ['ReduceProd', '', '1+', reduceProd, parseReduceAttributes],\n ['ReduceSum', '', '1-12', reduceSum, parseReduceAttributes],\n ['ReduceSumSquare', '', '1+', reduceLogSumSquare, parseReduceAttributes],\n ['Relu', '', '6+', unaryOps.relu],\n ['Reshape', '', '5+', reshape],\n ['Resize', '', '10', resize, parseResizeAttributesV10],\n ['Resize', '', '11+', resize, parseResizeAttributesV11],\n ['Shape', '', '1+', shape],\n ['Sigmoid', '', '6+', unaryOps.sigmoid],\n ['Sin', '', '7+', unaryOps.sin],\n ['Slice', '', '10+', sliceV10], // TODO: support 'steps' for Slice-10\n ['Slice', '', '1-9', slice, parseSliceAttributes],\n // The \"semantic\" meaning of axis has changed in opset-13.\n ['Softmax', '', '1-12', softmax, parseSoftmaxAttributes],\n ['Softmax', '', '13+', softmaxV13, parseSoftmaxAttributesV13],\n // 'Split' operator has an optional attribute 'split'\n // this attribute determines how the specified axis of input data is split.\n // When the attribute is missing, we need the count of number of outputs\n // so that we can determine the 'split' attribute from the runtime input to the Operator\n ['Split', '', '2-12', split, parseSplitAttributes],\n ['Sqrt', '', '6+', unaryOps.sqrt],\n ['Squeeze', '', '1-12', squeeze, parseSqueezeAttributes],\n ['Squeeze', '', '13+', squeezeV13],\n ['Sub', '', '7+', binaryOps.sub],\n ['Sum', '', '6+', sum],\n ['Tan', '', '7+', unaryOps.tan],\n ['Tanh', '', '6+', unaryOps.tanh],\n ['Tile', '', '6+', tile],\n ['Transpose', '', '1+', transpose, parseTransposeAttributes],\n ['Upsample', '', '7-8', upsample, parseUpsampleAttributesV7],\n ['Upsample', '', '9', upsample, parseUpsampleAttributesV9],\n ['Unsqueeze', '', '1-12', unsqueeze, parseUnsqueezeAttributes],\n ['Unsqueeze', '', '13+', unsqueezeV13],\n ['Xor', '', '7+', binaryOps.xor],\n];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nconst INLINE_FUNC_DEF_REGEX = /@inline[\\s\\n\\r]+(\\w+)[\\s\\n\\r]+([0-9a-zA-Z_]+)\\s*\\(([^)]*)\\)\\s*{(([^}]|[\\n\\r])*)}/gm;\nconst FUNC_CALL_REGEX = '(\\\\w+)?\\\\s+([_0-9a-zA-Z]+)\\\\s+=\\\\s+__FUNC__\\\\((.*)\\\\)\\\\s*;';\n/**\n * GLSL preprocessor responsible for resolving @inline directives\n */\nexport function replaceInlines(script: string): string {\n const inlineDefs: {[name: string]: {params: Array<{type: string; name: string}|null>; body: string}} = {};\n let match;\n while ((match = INLINE_FUNC_DEF_REGEX.exec(script)) !== null) {\n const params = match[3]\n .split(',')\n .map(s => {\n const tokens = s.trim().split(' ');\n if (tokens && tokens.length === 2) {\n return {type: tokens[0], name: tokens[1]};\n }\n return null;\n })\n .filter(v => v !== null);\n inlineDefs[match[2]] = {params, body: match[4]};\n }\n for (const name in inlineDefs) {\n const regexString = FUNC_CALL_REGEX.replace('__FUNC__', name);\n const regex = new RegExp(regexString, 'gm');\n while ((match = regex.exec(script)) !== null) {\n const type = match[1];\n const variable = match[2];\n const params = match[3].split(',');\n const declLine = (type) ? `${type} ${variable};` : '';\n let newBody: string = inlineDefs[name].body;\n let paramRedecLine = '';\n inlineDefs[name].params.forEach((v, i) => {\n if (v) {\n paramRedecLine += `${v.type} ${v.name} = ${params[i]};\\n`;\n }\n });\n newBody = `${paramRedecLine}\\n ${newBody}`;\n newBody = newBody.replace('return', `${variable} = `);\n const replacement = `\n ${declLine}\n {\n ${newBody}\n }\n `;\n script = script.replace(match[0], replacement);\n }\n }\n script = script.replace(INLINE_FUNC_DEF_REGEX, '');\n return script;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Logger} from '../../instrument';\nimport {assert} from '../../util';\n\n/** Layout preferences */\nexport interface WidthHeightPrefs {\n breakAxis?: number;\n isPacked?: boolean;\n reverseWH?: boolean;\n}\n/**\n * TextureLayoutStrategy is an abstraction for different plans\n * for mapping n-dimensional arrays to 2D textures (and back)\n */\nexport interface TextureLayoutStrategy {\n computeTextureWH(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number];\n}\n\n/**\n * This strategy try to find the minimal max(W,H) that fulfills (W * H == totalSize)\n */\nexport class AlwaysKeepOriginalSizeStrategy implements TextureLayoutStrategy {\n constructor(public maxTextureSize: number) {}\n computeTextureWH(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number] {\n // scalar tensor\n if (shape.length === 0) {\n return [1, 1];\n }\n const maxTextureSize = this.maxTextureSize;\n if (prefs && prefs.breakAxis !== undefined) {\n // check to see if dims fit\n const wsize = prefs.breakAxis >= shape.length ? 1 : shape.slice(prefs.breakAxis).reduce((a, b) => a * b);\n const hsize = prefs.breakAxis <= 0 ? 1 : shape.slice(0, prefs.breakAxis).reduce((a, b) => a * b);\n if (wsize > maxTextureSize || hsize > maxTextureSize) {\n // ignore preferences\n // continue with default layout\n Logger.verbose(\n 'TextureLayout',\n `Given width/height preferences were unattainable: shape:${shape}, breakAxis:${prefs.breakAxis}`);\n } else {\n return [wsize, hsize];\n }\n }\n const totalSize = shape.reduce((a, b) => a * b);\n\n let width = Math.floor(Math.sqrt(totalSize));\n\n for (; width < maxTextureSize && width < totalSize; width++) {\n if (totalSize % width === 0) {\n break;\n }\n }\n\n if (width >= maxTextureSize || totalSize % width !== 0) {\n throw new Error(`The given dimensions are outside this GPU's boundaries: ${shape}`);\n }\n return [width, totalSize / width];\n }\n}\n\nexport class PreferLogicalStrategy implements TextureLayoutStrategy {\n constructor(public maxTextureSize: number) {}\n computeTextureWH(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number] {\n const wh = this.computeTexture(shape, prefs);\n if (prefs && prefs.isPacked) {\n wh[0] /= 2;\n wh[1] /= 2;\n }\n if (prefs && prefs.reverseWH) {\n return [wh[1], wh[0]];\n }\n return wh;\n }\n\n computeTexture(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number] {\n const isPacked = prefs && prefs.isPacked;\n // scalar tensor\n if (shape.length === 0) {\n return isPacked ? [2, 2] : [1, 1];\n }\n let maxTextureSize = this.maxTextureSize;\n if (prefs && prefs.breakAxis !== undefined) {\n // check to see if dims fit\n const wsize = prefs.breakAxis >= shape.length ? 1 : shape.slice(prefs.breakAxis).reduce((a, b) => a * b);\n const hsize = prefs.breakAxis <= 0 ? 1 : shape.slice(0, prefs.breakAxis).reduce((a, b) => a * b);\n if (wsize > maxTextureSize || hsize > maxTextureSize) {\n // ignore preferences\n // continue with default layout\n Logger.verbose(\n 'TextureLayout',\n `Given width/height preferences were unattainable: shape:${shape}, breakAxis:${prefs.breakAxis}`);\n } else {\n return [wsize, hsize];\n }\n }\n let logShape = shape.slice(0);\n if (isPacked) {\n maxTextureSize = maxTextureSize * 2;\n\n // This logic ensures we accurately count the number of packed texels needed\n // to accommodate the tensor. We can only pack values in the same texel if\n // they are from adjacent pairs of rows/cols within the same batch. So if a\n // tensor has 3 rows, we pretend it has 4 rows in order to account for the\n // fact that the texels containing the third row are half empty.\n logShape = logShape.map(\n (_d, i) => i >= logShape.length - 2 ? (logShape[i] % 2 === 0 ? logShape[i] : logShape[i] + 1) : logShape[i]);\n\n // Packed texture height is at least 2 (the channel height of a single\n // texel).\n if (logShape.length === 1) {\n logShape = [2, logShape[0]];\n }\n }\n\n // If logical shape is 2, we don't squeeze, since we want to match physical.\n if (logShape.length !== 2) {\n const squeezeResult = squeezeShape(logShape);\n logShape = squeezeResult.newShape;\n }\n\n const size = sizeFromShape(logShape);\n if (logShape.length <= 1 && size <= maxTextureSize) {\n return [1, size];\n } else if (logShape.length === 2 && logShape[0] <= maxTextureSize && logShape[1] <= maxTextureSize) {\n return logShape as [number, number];\n } else if (logShape.length === 3 && logShape[0] * logShape[1] <= maxTextureSize && logShape[2] <= maxTextureSize) {\n return [logShape[0] * logShape[1], logShape[2]];\n } else if (logShape.length === 3 && logShape[0] <= maxTextureSize && logShape[1] * logShape[2] <= maxTextureSize) {\n return [logShape[0], logShape[1] * logShape[2]];\n } else if (\n logShape.length === 4 && logShape[0] * logShape[1] * logShape[2] <= maxTextureSize &&\n logShape[3] <= maxTextureSize) {\n return [logShape[0] * logShape[1] * logShape[2], logShape[3]];\n } else if (\n logShape.length === 4 && logShape[0] <= maxTextureSize &&\n logShape[1] * logShape[2] * logShape[3] <= maxTextureSize) {\n return [logShape[0], logShape[1] * logShape[2] * logShape[3]];\n } else {\n if (isPacked) {\n // For packed textures size equals the number of channels required to\n // accommodate the texture data. However in order to squarify such that\n // inner dimensions stay even, we rewrite size to equal the number of\n // texels. Then in the return statement we rehydrate the squarified\n // dimensions to channel units.\n return sizeToSquarishShape(size / 4).map(d => d * 2) as [number, number];\n }\n return sizeToSquarishShape(size);\n }\n }\n}\n\nexport function squeezeShape(shape: number[], axis?: number[]): {newShape: number[]; keptDims: number[]} {\n const newShape: number[] = [];\n const keptDims: number[] = [];\n const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n const axes = (axis == null || isEmptyArray) ? null : parseAxisParam(axis, shape).sort();\n let j = 0;\n for (let i = 0; i < shape.length; ++i) {\n if (axes != null) {\n if (axes[j] === i && shape[i] !== 1) {\n throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n }\n if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n if (axes[j] <= i) {\n j++;\n }\n }\n if (shape[i] !== 1) {\n newShape.push(shape[i]);\n keptDims.push(i);\n }\n }\n return {newShape, keptDims};\n}\n\nexport function parseAxisParam(axis: number|number[], shape: number[]): number[] {\n const rank = shape.length;\n\n // Normalize input\n axis = axis == null ? shape.map((_s, i) => i) : ([] as number[]).concat(axis);\n\n // Check for valid range\n assert(\n axis.every(ax => ax >= -rank && ax < rank),\n () => `All values in axis param must be in range [-${rank}, ${rank}) but ` +\n `got axis ${axis}`);\n\n // Check for only integers\n assert(\n axis.every(isInt),\n () => 'All values in axis param must be integers but ' +\n `got axis ${axis}`);\n\n // Handle negative axis.\n return axis.map(a => a < 0 ? rank + a : a);\n}\nexport function isInt(a: number): boolean {\n return a % 1 === 0;\n}\nexport function sizeFromShape(shape: number[]): number {\n if (shape.length === 0) {\n // Scalar.\n return 1;\n }\n let size = shape[0];\n for (let i = 1; i < shape.length; i++) {\n size *= shape[i];\n }\n return size;\n}\nexport function getRowsCols(shape: number[]): [number, number] {\n if (shape.length === 0) {\n throw Error('Cannot get rows and columns of an empty shape array.');\n }\n\n return [shape.length > 1 ? shape[shape.length - 2] : 1, shape[shape.length - 1]];\n}\nexport function sizeToSquarishShape(size: number): [number, number] {\n const width = Math.ceil(Math.sqrt(size));\n return [width, Math.ceil(size / width)];\n}\nexport function getBatchDim(shape: number[], dimsToSkip = 2): number {\n return sizeFromShape(shape.slice(0, shape.length - dimsToSkip));\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {ArrayUtil, BroadcastUtil, ShapeUtil} from '../../util';\n\nimport {GlslContext, GlslLib, GlslLibRoutine} from './glsl-definitions';\nimport {getGlsl} from './glsl-source';\nimport {squeezeShape} from './texture-layout-strategy';\nimport {TextureLayout} from './types';\nimport {generateShaderFuncNameFromInputSamplerName, generateShaderFuncNameFromInputSamplerNameAtOutCoords, getCoordsDataType, getGlChannels, getSqueezedParams, squeezeInputShape} from './utils';\n\n/**\n * GLSL Library responsible for data types and routines for manipulating\n * coordinates and mapping to/from tensor indices\n */\nexport class CoordsGlslLib extends GlslLib {\n returnType: string;\n\n constructor(context: GlslContext) {\n super(context);\n }\n getFunctions(): {[name: string]: GlslLibRoutine} {\n return {\n ...this.offsetToCoords(),\n ...this.coordsToOffset(),\n ...this.toVec(),\n ...this.valueFrom(),\n // TODO return these only when packing is enabled.\n ...this.getCommonUtilFuncs(),\n ...this.getInputsSamplingSnippets(),\n ...this.getOutputSamplingSnippet()\n };\n }\n getCustomTypes() {\n return {};\n }\n /**\n * Produces a function that can map from\n * 2D normalzied coordinates (s,t) to a flat offset\n */\n protected offsetToCoords(): {[name: string]: GlslLibRoutine} {\n const funcName = 'offsetToCoords';\n return {\n offsetToCoords: new GlslLibRoutine(`\n vec2 ${funcName}(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n `)\n };\n }\n\n /**\n * Produces a function that can map from\n * 2D normalzied coordinates (s,t) to a flat offset\n */\n protected coordsToOffset(): {[name: string]: GlslLibRoutine} {\n const funcName = 'coordsToOffset';\n return {\n coordsToOffset: new GlslLibRoutine(`\n int ${funcName}(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n `)\n };\n }\n\n /**\n * Generates code for output sampler.\n */\n\n protected getOutputSamplingSnippet(): {[name: string]: GlslLibRoutine} {\n const outputLayout = this.context.outputTextureLayout;\n if (outputLayout.isPacked) {\n return this.getPackedOutputSamplingSnippet(outputLayout);\n } else {\n return this.getUnpackedOutputSamplingSnippet(outputLayout);\n }\n }\n\n /**\n * Generates code for packed output sampler.\n */\n protected getPackedOutputSamplingSnippet(outputLayout: TextureLayout): {[name: string]: GlslLibRoutine} {\n const outShape = outputLayout.unpackedShape;\n const outTexShape = [outputLayout.width, outputLayout.height];\n const result: {[name: string]: GlslLibRoutine} = {};\n const funcName = 'getOutputCoords';\n switch (outShape.length) {\n case 0:\n result[funcName] = this.getOutputScalarCoords();\n break;\n case 1:\n result[funcName] = this.getOutputPacked1DCoords(outShape as [number], outTexShape as [number, number]);\n break;\n case 2:\n result[funcName] = this.getOutputPacked2DCoords(outShape as [number, number], outTexShape as [number, number]);\n break;\n case 3:\n result[funcName] =\n this.getOutputPacked3DCoords(outShape as [number, number, number], outTexShape as [number, number]);\n break;\n default:\n result[funcName] = this.getOutputPackedNDCoords(outShape, outTexShape as [number, number]);\n }\n const glsl = getGlsl(this.context.glContext.version);\n // TODO we need this to properly return a packed vec4 from kernels.\n // Replace all '{glsl.output} = result' with 'setOutput(result)' in all kernels.\n const floatTextureSetRGBASource = `\n void setOutput(vec4 val) {\n ${glsl.output} = val;\n }\n `;\n const floatTextureSetRGBAFuncName = 'floatTextureSetRGBA';\n result[floatTextureSetRGBAFuncName] = new GlslLibRoutine(floatTextureSetRGBASource);\n return result;\n }\n\n /**\n * Generates code for unpacked output sampler.\n */\n protected getUnpackedOutputSamplingSnippet(outputLayout: TextureLayout): {[name: string]: GlslLibRoutine} {\n const outShape = outputLayout.unpackedShape;\n const outTexShape = [outputLayout.width, outputLayout.height];\n const result: {[name: string]: GlslLibRoutine} = {};\n const funcName = 'getOutputCoords';\n switch (outShape.length) {\n case 0:\n result[funcName] = this.getOutputScalarCoords();\n break;\n case 1:\n result[funcName] = this.getOutputUnpacked1DCoords(outShape as [number], outTexShape as [number, number]);\n break;\n case 2:\n result[funcName] =\n this.getOutputUnpacked2DCoords(outShape as [number, number], outTexShape as [number, number]);\n break;\n case 3:\n result[funcName] =\n this.getOutputUnpacked3DCoords(outShape as [number, number, number], outTexShape as [number, number]);\n break;\n case 4:\n result[funcName] = this.getOutputUnpacked4DCoords(\n outShape as [number, number, number, number], outTexShape as [number, number]);\n break;\n case 5:\n result[funcName] = this.getOutputUnpacked5DCoords(\n outShape as [number, number, number, number, number], outTexShape as [number, number]);\n break;\n case 6:\n result[funcName] = this.getOutputUnpacked6DCoords(\n outShape as [number, number, number, number, number, number], outTexShape as [number, number]);\n break;\n default:\n throw new Error(`Unsupported output dimensionality: ${outShape.length}`);\n }\n const glsl = getGlsl(this.context.glContext.version);\n // TODO we need this to properly return a packed vec4 from kernels.\n // Replace all '{glsl.output} = result' with 'setOutput(result)' in all kernels.\n const floatTextureSetRSource = `\n void setOutput(float val) {\n ${glsl.output} = vec4(val, 0, 0, 0);\n }\n `;\n const floatTextureSetRFuncName = 'floatTextureSetR';\n result[floatTextureSetRFuncName] = new GlslLibRoutine(floatTextureSetRSource);\n return result;\n }\n\n /**\n * Scalar output coordinates.\n */\n protected getOutputScalarCoords(): GlslLibRoutine {\n return new GlslLibRoutine(`\n int getOutputCoords() {\n return 0;\n }\n `);\n }\n\n /**\n * 1D packed output coordinates.\n */\n protected getOutputPacked1DCoords(_shape: [number], texShape: [number, number]): GlslLibRoutine {\n const packedTexShape = texShape;\n let source = '';\n if (packedTexShape[0] === 1) {\n source = `\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${packedTexShape[1]}.0);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n if (packedTexShape[1] === 1) {\n source = `\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${packedTexShape[0]}.0);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n source = `\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n return 2 * (resTexRC.y * ${packedTexShape[0]} + resTexRC.x);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * 2D packed output coordinates.\n */\n protected getOutputPacked2DCoords(shape: [number, number], texShape: [number, number]): GlslLibRoutine {\n let source = '';\n if (ArrayUtil.arraysEqual(shape, texShape)) {\n source = `\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${texShape[0]}, ${texShape[1]}));\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n const packedTexShape = texShape;\n // texels needed to accommodate a logical row\n const texelsInLogicalRow = Math.ceil(shape[1] / 2);\n\n /**\n * getOutputCoords\n *\n * resTexRC: The rows and columns of the texels. If you move over one\n * texel to the right in the packed texture, you are moving over one column\n * (not two).\n *\n * index: The texel index\n */\n source = `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n\n int index = resTexRC.y * ${packedTexShape[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${texelsInLogicalRow}) * 2;\n int c = 2 * (index / ${texelsInLogicalRow});\n\n return ivec2(r, c);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * 3D packed output coordinates.\n */\n protected getOutputPacked3DCoords(shape: [number, number, number], texShape: [number, number]): GlslLibRoutine {\n const packedTexShape = [texShape[0], texShape[1]];\n const texelsInLogicalRow = Math.ceil(shape[2] / 2);\n const texelsInBatch = texelsInLogicalRow * Math.ceil(shape[1] / 2);\n const source = `\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n int index = resTexRC.y * ${packedTexShape[0]} + resTexRC.x;\n\n int b = index / ${texelsInBatch};\n index -= b * ${texelsInBatch};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${texelsInLogicalRow}) * 2;\n int c = 2 * (index / ${texelsInLogicalRow});\n\n return ivec3(b, r, c);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * ND packed output coordinates.\n */\n protected getOutputPackedNDCoords(shape: readonly number[], texShape: [number, number]): GlslLibRoutine {\n const packedTexShape = [texShape[0], texShape[1]];\n\n const texelsInLogicalRow = Math.ceil(shape[shape.length - 1] / 2);\n const texelsInBatch = texelsInLogicalRow * Math.ceil(shape[shape.length - 2] / 2);\n let texelsInBatchN = texelsInBatch;\n let batches = '';\n let coords = 'b, r, c';\n\n for (let b = 2; b < shape.length - 1; b++) {\n texelsInBatchN *= shape[shape.length - b - 1];\n batches = `\n int b${b} = index / ${texelsInBatchN};\n index -= b${b} * ${texelsInBatchN};\n ` + batches;\n coords = `b${b}, ` + coords;\n }\n const source = `\n ivec${shape.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n int index = resTexRC.y * ${packedTexShape[0]} + resTexRC.x;\n\n ${batches}\n\n int b = index / ${texelsInBatch};\n index -= b * ${texelsInBatch};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${texelsInLogicalRow}) * 2;\n int c = 2 * (index / ${texelsInLogicalRow});\n\n return ivec${shape.length}(${coords});\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked 1D output coordinates.\n */\n protected getOutputUnpacked1DCoords(_shape: [number], texShape: [number, number]): GlslLibRoutine {\n const source = `\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${texShape[0]}, ${texShape[1]}));\n return resTexRC.y * ${texShape[0]} + resTexRC.x;\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked 2D output coordinates.\n */\n protected getOutputUnpacked2DCoords(shape: [number, number], texShape: [number, number]): GlslLibRoutine {\n const source = `\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n int r = index / ${shape[1]};\n int c = index - r * ${shape[1]};\n return ivec2(r, c);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked 3D output coordinates.\n */\n protected getOutputUnpacked3DCoords(shape: [number, number, number], texShape: [number, number]): GlslLibRoutine {\n let source = '';\n const rank = shape.length;\n\n let strides = null;\n if (rank < 2) {\n strides = [];\n }\n\n strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n const coordsToCompute = ['r', 'c', 'd'];\n const coordsFromIndexSnippet =\n strides\n .map((stride, i) => {\n const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n const line2 = i === strides.length - 1 ?\n `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}` :\n `index -= ${coordsToCompute[i]} * ${stride}`;\n return `${line1}; ${line2};`;\n })\n .join('');\n\n source = `\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n ${coordsFromIndexSnippet}\n return ivec3(r, c, d);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked 4D output coordinates.\n */\n protected getOutputUnpacked4DCoords(shape: [number, number, number, number], texShape: [number, number]):\n GlslLibRoutine {\n let source = '';\n const rank = shape.length;\n\n let strides = null;\n if (rank < 2) {\n strides = [];\n }\n\n strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n const coordsToCompute = ['r', 'c', 'd', 'd2'];\n const coordsFromIndexSnippet =\n strides\n .map((stride, i) => {\n const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n const line2 = i === strides.length - 1 ?\n `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}` :\n `index -= ${coordsToCompute[i]} * ${stride}`;\n return `${line1}; ${line2};`;\n })\n .join('');\n\n source = `\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n ${coordsFromIndexSnippet}\n return ivec4(r, c, d, d2);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked 5D output coordinates.\n */\n protected getOutputUnpacked5DCoords(shape: [number, number, number, number, number], texShape: [number, number]):\n GlslLibRoutine {\n let source = '';\n const rank = shape.length;\n\n let strides = null;\n if (rank < 2) {\n strides = [];\n }\n\n strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n const coordsToCompute = ['r', 'c', 'd', 'd2', 'd3'];\n const coordsFromIndexSnippet =\n strides\n .map((stride, i) => {\n const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n const line2 = i === strides.length - 1 ?\n `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}` :\n `index -= ${coordsToCompute[i]} * ${stride}`;\n return `${line1}; ${line2};`;\n })\n .join('');\n\n source = `\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n ${coordsFromIndexSnippet}\n return ivec5(r, c, d, d2, d3);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked 6D output coordinates.\n */\n protected getOutputUnpacked6DCoords(shape: [number, number, number, number, number, number], texShape: [\n number, number\n ]): GlslLibRoutine {\n let source = '';\n const rank = shape.length;\n\n let strides = null;\n if (rank < 2) {\n strides = [];\n }\n\n strides = new Array(rank - 1);\n strides[rank - 2] = shape[rank - 1];\n for (let i = rank - 3; i >= 0; --i) {\n strides[i] = strides[i + 1] * shape[i + 1];\n }\n const coordsToCompute = ['r', 'c', 'd', 'd2', 'd3', 'd4'];\n const coordsFromIndexSnippet =\n strides\n .map((stride, i) => {\n const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n const line2 = i === strides.length - 1 ?\n `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}` :\n `index -= ${coordsToCompute[i]} * ${stride}`;\n return `${line1}; ${line2};`;\n })\n .join('');\n\n source = `\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${texShape[0]}, ${texShape[1]}));\n int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n ${coordsFromIndexSnippet}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Generates code for common UV coords computation utility functions.\n */\n protected getCommonUtilFuncs(): {[name: string]: GlslLibRoutine} {\n const result: {[name: string]: GlslLibRoutine} = {};\n let funcName = 'uvFromFlat';\n result[funcName] = new GlslLibRoutine(`\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n `);\n funcName = 'packedUVfrom1D';\n result[funcName] = new GlslLibRoutine(`\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n `);\n funcName = 'packedUVfrom2D';\n result[funcName] = new GlslLibRoutine(`\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n `);\n funcName = 'packedUVfrom3D';\n result[funcName] = new GlslLibRoutine(`\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n `);\n funcName = 'sampleTexture';\n const glsl = getGlsl(this.context.glContext.version);\n result[funcName] = new GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${glsl.texture2D}(textureSampler, uv).r;\n }`);\n return result;\n }\n\n /**\n * Constructing snippets for inputs\n */\n protected getInputsSamplingSnippets(): {[name: string]: GlslLibRoutine} {\n const result: {[name: string]: GlslLibRoutine} = {};\n const outputLayout = this.context.outputTextureLayout;\n this.context.programInfo.inputNames.forEach((samplerName, i) => {\n const inputLayout = this.context.inputTextureLayouts[i];\n const funcName = generateShaderFuncNameFromInputSamplerName(samplerName);\n if (inputLayout.isPacked) {\n result[funcName] = this.getPackedSamplerFromInput(funcName, samplerName, inputLayout);\n } else {\n result[funcName] = this.getUnpackedSamplerFromInput(funcName, samplerName, inputLayout);\n }\n\n const outCoordFuncName = generateShaderFuncNameFromInputSamplerNameAtOutCoords(samplerName);\n if (inputLayout.unpackedShape.length <= outputLayout.unpackedShape.length) {\n if (inputLayout.isPacked) {\n result[outCoordFuncName] =\n this.getPackedSamplerAtOutputCoords(outCoordFuncName, inputLayout, outputLayout, samplerName);\n } else {\n result[outCoordFuncName] =\n this.getUnpackedSamplerAtOutputCoords(outCoordFuncName, inputLayout, outputLayout, samplerName);\n }\n }\n });\n\n return result;\n }\n\n /**\n * Constructing snippets for output coordinates of samplers\n */\n protected getPackedSamplerAtOutputCoords(\n funcName: string, inputLayout: TextureLayout, outputLayout: TextureLayout, name: string): GlslLibRoutine {\n const inShape = inputLayout.unpackedShape;\n const outShape = outputLayout.unpackedShape;\n const texName = name;\n const texFuncSnippet = generateShaderFuncNameFromInputSamplerName(texName);\n\n const inRank = inShape.length;\n const outRank = outShape.length;\n\n const broadcastDims = BroadcastUtil.getBroadcastDims(inShape, outShape);\n\n const type = getCoordsDataType(outRank);\n const rankDiff = outRank - inRank;\n let coordsSnippet: string;\n const fields = getGlChannels();\n\n if (inRank === 0) {\n coordsSnippet = '';\n } else if (outRank < 2 && broadcastDims.length >= 1) {\n coordsSnippet = 'coords = 0;';\n } else {\n coordsSnippet = broadcastDims.map(d => `coords.${fields[d + rankDiff]} = 0;`).join('\\n');\n }\n let unpackedCoordsSnippet = '';\n if (outRank < 2 && inRank > 0) {\n unpackedCoordsSnippet = 'coords';\n } else {\n unpackedCoordsSnippet = inShape.map((_s, i) => `coords.${fields[i + rankDiff]}`).join(', ');\n }\n\n let output = 'return outputValue;';\n const inSize = ShapeUtil.size(inShape);\n const isInputScalar = inSize === 1;\n const outSize = ShapeUtil.size(outShape);\n const isOutputScalar = outSize === 1;\n\n if (inRank === 1 && !isInputScalar && !isOutputScalar) {\n output = `\n return vec4(outputValue.xy, outputValue.xy);\n `;\n } else if (isInputScalar && !isOutputScalar) {\n if (outRank === 1) {\n output = `\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n `;\n } else {\n output = `\n return vec4(outputValue.x);\n `;\n }\n } else if (broadcastDims.length) {\n const rows = inRank - 2;\n const cols = inRank - 1;\n\n if (broadcastDims.indexOf(rows) > -1 && broadcastDims.indexOf(cols) > -1) {\n output = 'return vec4(outputValue.x);';\n } else if (broadcastDims.indexOf(rows) > -1) {\n output = 'return vec4(outputValue.x, outputValue.y, ' +\n 'outputValue.x, outputValue.y);';\n } else if (broadcastDims.indexOf(cols) > -1) {\n output = 'return vec4(outputValue.xx, outputValue.zz);';\n }\n }\n\n const swapLastDimsSnippet = `\n int lastDim = coords.${fields[outRank - 1]};\n coords.${fields[outRank - 1]} = coords.${fields[outRank - 2]};\n coords.${fields[outRank - 2]} = lastDim;\n `;\n const source = `\n vec4 ${funcName}() {\n ${type} coords = getOutputCoords();\n ${swapLastDimsSnippet}\n ${coordsSnippet}\n vec4 outputValue = ${texFuncSnippet}(${unpackedCoordsSnippet});\n ${output}\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.getOutputCoords']);\n }\n\n /**\n * Constructing snippets for unpacked output coordinates of samplers\n */\n protected getUnpackedSamplerAtOutputCoords(\n funcName: string, inputLayout: TextureLayout, outputLayout: TextureLayout, name: string): GlslLibRoutine {\n const outTexShape = [outputLayout.width, outputLayout.height];\n const inTexShape = [inputLayout.width, inputLayout.height];\n const inRank = inputLayout.unpackedShape.length;\n const outRank = outputLayout.unpackedShape.length;\n const inShape = inputLayout.unpackedShape;\n const outShape = outputLayout.unpackedShape;\n const texFuncSnippet = generateShaderFuncNameFromInputSamplerName(name);\n\n if (inRank === outRank && ArrayUtil.arraysEqual(inTexShape, outTexShape)) {\n const source = `\n float ${funcName}() {\n return sampleTexture(${name}, TexCoords);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n\n const type = getCoordsDataType(outRank);\n const broadcastDims = BroadcastUtil.getBroadcastDims(inShape, outShape);\n const rankDiff = outRank - inRank;\n let coordsSnippet: string;\n const fields = getGlChannels();\n\n if (inRank === 0) {\n coordsSnippet = '';\n } else if (outRank < 2 && broadcastDims.length >= 1) {\n coordsSnippet = 'coords = 0;';\n } else {\n coordsSnippet = broadcastDims.map(d => `coords.${fields[d + rankDiff]} = 0;`).join('\\n');\n }\n let unpackedCoordsSnippet = '';\n if (outRank < 2 && inRank > 0) {\n unpackedCoordsSnippet = 'coords';\n } else {\n unpackedCoordsSnippet = inputLayout.unpackedShape.map((_s, i) => `coords.${fields[i + rankDiff]}`).join(', ');\n }\n const source = `\n float ${funcName}() {\n ${type} coords = getOutputCoords();\n ${coordsSnippet}\n return ${texFuncSnippet}(${unpackedCoordsSnippet});\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.getOutputCoords']);\n }\n\n /**\n * Constructing snippets for packed operations.\n */\n protected getPackedSamplerFromInput(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n switch (inputLayout.unpackedShape.length) {\n case 0:\n return this.getPackedSamplerScalar(funcName, name);\n case 1:\n return this.getPackedSampler1D(funcName, name, inputLayout);\n case 2:\n return this.getPackedSampler2D(funcName, name, inputLayout);\n case 3:\n return this.getPackedSampler3D(funcName, name, inputLayout);\n default:\n return this.getPackedSamplerND(funcName, name, inputLayout);\n }\n }\n\n /**\n * Constructing snippets for unpacked operations.\n */\n protected getUnpackedSamplerFromInput(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n switch (shape.length) {\n case 0:\n return this.getUnpackedSamplerScalar(funcName, name, inputLayout);\n case 1:\n return this.getUnpackedSampler1D(funcName, name, inputLayout);\n case 2:\n return this.getUnpackedSampler2D(funcName, name, inputLayout);\n case 3:\n return this.getUnpackedSampler3D(funcName, name, inputLayout);\n case 4:\n return this.getUnpackedSampler4D(funcName, name, inputLayout);\n case 5:\n return this.getUnpackedSampler5D(funcName, name, inputLayout);\n case 6:\n return this.getUnpackedSampler6D(funcName, name, inputLayout);\n default:\n // TODO support more dimensionalities\n throw new Error(`Unsupported dimension ${shape.length}-D`);\n }\n }\n\n /**\n * Packed scalar snippet.\n */\n protected getPackedSamplerScalar(funcName: string, name: string): GlslLibRoutine {\n const glsl = getGlsl(this.context.glContext.version);\n const source = `\n vec4 ${funcName}() {\n return ${glsl.texture2D}(${name}, halfCR);\n }\n `;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Packed 1D snippet.\n */\n protected getPackedSampler1D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const texShape = [inputLayout.width, inputLayout.height];\n const packedTexShape = [texShape[1], texShape[0]];\n const glsl = getGlsl(this.context.glContext.version);\n\n const packedSampler = `vec4 ${funcName}(int index) {\n vec2 uv = packedUVfrom1D(\n ${packedTexShape[0]}, ${packedTexShape[1]}, index);\n return ${glsl.texture2D}(${name}, uv);\n }`;\n const source = packedSampler;\n return new GlslLibRoutine(source, ['coordinates.packedUVfrom1D']);\n }\n\n /**\n * Packed 2D snippet.\n */\n protected getPackedSampler2D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const texShape = [inputLayout.width, inputLayout.height];\n const glsl = getGlsl(this.context.glContext.version);\n const texNumR = texShape[0];\n const texNumC = texShape[1];\n\n if (texShape != null && ArrayUtil.arraysEqual(shape, texShape)) {\n const packedSampler = `vec4 ${funcName}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n return ${glsl.texture2D}(${name}, uv);\n }`;\n\n return new GlslLibRoutine(packedSampler);\n }\n const packedTexShape = texShape;\n const valuesPerRow = Math.ceil(shape[1] / 2);\n const packedSampler = `vec4 ${funcName}(int row, int col) {\n vec2 uv = packedUVfrom2D(${packedTexShape[1]}, ${packedTexShape[0]}, ${valuesPerRow}, row, col);\n return ${glsl.texture2D}(${name}, uv);\n }`;\n const source = packedSampler;\n return new GlslLibRoutine(source, ['coordinates.packedUVfrom2D']);\n }\n\n /**\n * Packed 3D snippet.\n */\n protected getPackedSampler3D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const texShape = [inputLayout.width, inputLayout.height];\n const packedTexShape = [texShape[0], texShape[1]];\n const glsl = getGlsl(this.context.glContext.version);\n\n if (shape[0] === 1) {\n const squeezedShape = shape.slice(1);\n const keptDims = [1, 2];\n const newInputShape = squeezeInputShape(shape, squeezedShape);\n const params = ['b', 'row', 'col'];\n // Deep copy of input texture layout.\n const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n newInputLayout.unpackedShape = newInputShape;\n const samplerRoutine = this.getPackedSamplerFromInput(funcName, name, newInputLayout);\n const packedSampler = `${samplerRoutine.routineBody}\n vec4 ${funcName}(int b, int row, int col) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n } `;\n const source = packedSampler;\n return new GlslLibRoutine(source, samplerRoutine.dependencies);\n }\n const texNumR = packedTexShape[0];\n const texNumC = packedTexShape[1];\n\n const valuesPerRow = Math.ceil(shape[2] / 2);\n const texelsInBatch = valuesPerRow * Math.ceil(shape[1] / 2);\n\n const packedSampler = `vec4 ${funcName}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${texNumC}, ${texNumR}, ${texelsInBatch}, ${valuesPerRow}, b, row, col);\n return ${glsl.texture2D}(${name}, uv);}`;\n const source = packedSampler;\n return new GlslLibRoutine(source, ['coordinates.packedUVfrom3D']);\n }\n /*\n * Packed ND snippet.\n */\n protected getPackedSamplerND(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const rank = shape.length;\n const texShape = [inputLayout.width, inputLayout.height];\n const glsl = getGlsl(this.context.glContext.version);\n\n const packedTexShape = [texShape[0], texShape[1]];\n const texNumR = packedTexShape[1];\n const texNumC = packedTexShape[0];\n const valuesPerRow = Math.ceil(shape[rank - 1] / 2);\n let texelsInBatch = valuesPerRow * Math.ceil(shape[rank - 2] / 2);\n let params = 'int b, int row, int col';\n let index = `b * ${texelsInBatch} + (row / 2) * ${valuesPerRow} + (col / 2)`;\n for (let b = 2; b < rank - 1; b++) {\n params = `int b${b}, ` + params;\n texelsInBatch *= shape[rank - b - 1];\n index = `b${b} * ${texelsInBatch} + ` + index;\n }\n const packedSampler = `vec4 ${funcName}(${params}) {\n int index = ${index};\n int texR = index / ${texNumC};\n int texC = index - texR * ${texNumC};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}, ${texNumR});\n return ${glsl.texture2D}(${name}, uv);\n }`;\n const source = packedSampler;\n return new GlslLibRoutine(source);\n }\n\n /**\n * Unpacked scalar snippet.\n */\n protected getUnpackedSamplerScalar(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const [texNumR, texNumC] = [inputLayout.width, inputLayout.height];\n if (texNumR === 1 && texNumC === 1) {\n const source = `\n float ${funcName}() {\n return sampleTexture(${name}, halfCR);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n\n const source = `\n float ${funcName}() {\n int offset_${name} = coordsToOffset(TexCoords, ${texNumR}, ${texNumC});\n vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, offset_${name});\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(\n source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n }\n\n /**\n * Unpacked 1D snippet.\n */\n protected getUnpackedSampler1D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const tNumR = inputLayout.width;\n const tNumC = inputLayout.height;\n\n if (tNumC === 1 && tNumR === 1) {\n const source = `\n float ${funcName}(int index) {\n return sampleTexture(${name}, halfCR);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n\n if (tNumC === 1) {\n const source = `\n float ${funcName}(int index) {\n vec2 uv = vec2((float(index) + 0.5) / ${tNumR}.0, 0.5);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n if (tNumR === 1) {\n const source = `\n float ${funcName}(int index) {\n vec2 uv = vec2(0.5, (float(index) + 0.5) / ${tNumC}.0);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n const source = `\n float ${funcName}(int index) {\n vec2 uv = uvFromFlat(${tNumR}, ${tNumC}, index);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture']);\n }\n\n /**\n * Unpacked 2D snippet.\n */\n\n protected getUnpackedSampler2D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n\n // TODO: modify row/col order for other dimensions.\n const texShape = [inputLayout.height, inputLayout.width];\n\n if (texShape != null && ArrayUtil.arraysEqual(shape, texShape)) {\n const texNumR = texShape[1];\n const texNumC = texShape[0];\n const source = `\n float ${funcName}(int row, int col) {\n vec2 uv = (vec2(row, col) + halfCR) / vec2(${texNumR}.0, ${texNumC}.0);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n\n const {newShape, keptDims} = squeezeShape(shape as number[]);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputShape = squeezeInputShape(shape, squeezedShape);\n // Deep copy of input texture layout.\n const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n newInputLayout.unpackedShape = newInputShape;\n\n const params = ['col', 'row'];\n const source = `\n ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n float ${funcName}(int row, int col) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n }\n\n const texNumR = texShape[1];\n const texNumC = texShape[0];\n if (texNumC === 1) {\n const source = `\n float ${funcName}(int row, int col) {\n int offset_${name} = coordsToOffset(TexCoords, ${texNumR}, ${texNumC});\n float index = dot(vec3(row, col, offset_${name}), vec3(${shape[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${texNumR}.0);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n }\n\n if (texNumR === 1) {\n const source = `\n float ${funcName}(int row, int col) {\n int offset_${name} = coordsToOffset(TexCoords, ${texNumR}, ${texNumC});\n float index = dot(vec3(row, col, offset_${name}), vec3(${shape[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${texNumC}.0, 0.5);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n }\n\n const source = `\n float ${funcName}(int row, int col) {\n int index = col * ${shape[1]} + row;\n vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(\n source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n }\n\n /**\n * Unpacked 3D snippet.\n */\n\n protected getUnpackedSampler3D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const stride0 = shape[1] * shape[2];\n const stride1 = shape[2];\n\n const {newShape, keptDims} = squeezeShape(shape as number[]);\n const squeezedShape = newShape;\n if (squeezedShape.length < shape.length) {\n const newInputShape = squeezeInputShape(shape, squeezedShape);\n const params = ['batch', 'col', 'row'];\n // Deep copy of input texture layout.\n const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n newInputLayout.unpackedShape = newInputShape;\n const routine = this.getUnpackedSamplerFromInput(funcName, name, newInputLayout);\n // TODO: revisit the logic here to make it simpler\n const revDims = keptDims.reverse();\n const source = `\n ${routine.routineBody}\n float ${funcName}(int batch, int row, int col) {\n return ${funcName}(${getSqueezedParams(params, revDims)});\n }\n `;\n return new GlslLibRoutine(source, routine.dependencies);\n }\n\n const texNumR = inputLayout.width;\n const texNumC = inputLayout.height;\n const source = `\n float ${funcName}(int depth, int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = depth * ${stride0} + col * ${stride1} + row;\n vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(\n source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n }\n\n /**\n * Unpacked 4D snippet.\n */\n\n protected getUnpackedSampler4D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const stride2 = shape[3];\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n //\n // TODO: re-enable this shortcut once the index calculation bug is fixed.\n //\n // const {newShape, keptDims} = squeezeShape(shape as number[]);\n // if (newShape.length < shape.length) {\n // const newInputShape = squeezeInputShape(shape, newShape);\n // const params = ['row', 'col', 'depth', 'depth2'];\n // // Deep copy of input texture layout.\n // const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n // newInputLayout.unpackedShape = newInputShape;\n // const source = `\n // ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n // float ${funcName}(int row, int col, int depth, int depth2) {\n // return ${funcName}(${getSqueezedParams(params, keptDims)});\n // }\n // `;\n // return new GlslLibRoutine(\n // source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n // }\n\n const texNumR = inputLayout.width;\n const texNumC = inputLayout.height;\n const source = `\n float ${funcName}(int row, int col, int depth, int depth2) {\n int index = row * ${stride0} + col * ${stride1} +\n depth2 * ${stride2} + depth;\n vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture']);\n }\n\n /**\n * Unpacked 5D snippet.\n */\n protected getUnpackedSampler5D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const stride3 = shape[4];\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = squeezeShape(shape as number[]);\n if (newShape.length < shape.length) {\n const newInputShape = squeezeInputShape(shape, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3'];\n // Deep copy of input texture layout.\n const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n newInputLayout.unpackedShape = newInputShape;\n\n const source = `\n ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.uvFromFlat']);\n }\n\n const texNumR = inputLayout.width;\n const texNumC = inputLayout.height;\n const source = `\n float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n int index = row * ${stride0} + col * ${stride1} + depth * ${stride2} +\n depth3 * ${stride3} + depth2;\n vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.uvFromFlat']);\n }\n\n /**\n * Unpacked 6D snippet.\n */\n protected getUnpackedSampler6D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n const shape = inputLayout.unpackedShape;\n const stride4 = shape[5];\n const stride3 = shape[4] * stride4;\n const stride2 = shape[3] * stride3;\n const stride1 = shape[2] * stride2;\n const stride0 = shape[1] * stride1;\n\n const {newShape, keptDims} = squeezeShape(shape as number[]);\n if (newShape.length < shape.length) {\n const newInputShape = squeezeInputShape(shape, newShape);\n const params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4'];\n // Deep copy of input texture layout.\n const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n newInputLayout.unpackedShape = newInputShape;\n\n const source = `\n ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${funcName}(${getSqueezedParams(params, keptDims)});\n }\n `;\n return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.uvFromFlat']);\n }\n\n const texNumR = inputLayout.width;\n const texNumC = inputLayout.height;\n const source = `\n float ${funcName}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = row * ${stride0} + col * ${stride1} + depth * ${stride2} +\n depth2 * ${stride3} + depth3 * ${stride4} + depth4;\n vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n return sampleTexture(${name}, uv);\n }\n `;\n return new GlslLibRoutine(\n source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n }\n\n /**\n * This is the main function to map from the given texture coordiantes (s,t)\n * to logical indices for the output\n * There will only be one single variation of this\n * Also see coordsToOffset and offsetToIndices for input-specific versions\n */\n protected toVec(): {[name: string]: GlslLibRoutine} {\n const output = this.context.outputTextureLayout;\n const rank = output.shape.length;\n const strides = output.strides;\n const xScale = output.width;\n const yScale = output.height;\n\n const stridesBlock = [];\n for (let i = 0; i < rank - 1; ++i) {\n stridesBlock.push(`\n c[${i}] = offset / ${strides[i]};`);\n stridesBlock.push(`\n offset -= c[${i}] * ${strides[i]};`);\n }\n stridesBlock.push(`\n c[${rank - 1}] = offset;`);\n const body = `\n void toVec(vec2 texCoords, out int c[${rank}]) {\n int offset = coordsToOffset(texCoords, ${xScale}, ${yScale});\n ${stridesBlock.join('')}\n }\n void toVec(int offset, out int c[${rank}]) {\n ${stridesBlock.join('')}\n }\n `;\n return {toVec: new GlslLibRoutine(body, ['coordinates.coordsToOffset'])};\n }\n /**\n * These are value getter functions generated for each input\n * Each function is hardwired to the name and dimensions of the input\n * An '_T' variation is also produced which accesses values as if the\n * input was transposed\n */\n protected valueFrom(): {[name: string]: GlslLibRoutine} {\n const result: {[name: string]: GlslLibRoutine} = {};\n this.context.programInfo.inputNames.forEach((name, i) => {\n const layout = this.context.inputTextureLayouts[i];\n const shape = layout.unpackedShape.length > 0 ? layout.unpackedShape : layout.shape;\n const rank = shape.length;\n let funcName = `_${name}`;\n result[funcName] = new GlslLibRoutine(\n this.getValueFromSingle(name, rank, layout.width, layout.height, false),\n [`shapeUtils.indicesToOffset${funcName}`, 'coordinates.offsetToCoords', 'fragcolor.getColorAsFloat']);\n funcName = funcName + '_T';\n result[funcName] = new GlslLibRoutine(\n this.getValueFromSingle(name, rank, layout.width, layout.height, true),\n [`shapeUtils.indicesToOffset${funcName}`, 'coordinates.offsetToCoords', 'fragcolor.getColorAsFloat']);\n });\n return result;\n }\n /**\n * Produces one value getter function for the name and rank given\n * If a transpose is set proper offsetToCoords mapping will be used\n * @param name name of the function\n * @param rank rank of the input\n * @param transpose whether or not should generate a transpose variation\n */\n protected getValueFromSingle(varName: string, rank: number, width: number, height: number, transpose: boolean):\n string {\n let name = `_${varName}`;\n if (transpose) {\n name = name + '_T';\n }\n const glsl = getGlsl(this.context.glContext.version);\n return `\n float ${name}(int m[${rank}]) {\n int offset = indicesToOffset${name}(m);\n vec2 coords = offsetToCoords(offset, ${width}, ${height});\n float value = getColorAsFloat(${glsl.texture2D}(${varName}, coords));\n return value;\n }\n `;\n }\n\n /**\n * Produces a packed value getter function for the name and rank given\n * If a transpose is set proper offsetToCoords mapping will be used\n * @param name name of the function\n * @param rank rank of the input\n * @param transpose whether or not should generate a transpose variation\n */\n protected getPackedValueFrom(varName: string, rank: number, width: number, height: number, transpose: boolean):\n string {\n let name = `_${varName}_Pack`;\n if (transpose) {\n name = name + '_T';\n }\n const glsl = getGlsl(this.context.glContext.version);\n return `\n vec4 ${name}(int m[${rank}]) {\n int offset = indicesToOffset_${varName}(m);\n vec2 coords = offsetToCoords(offset, ${width}, ${height});\n return ${glsl.texture2D}(${varName}, coords);\n }\n `;\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {GlslContext, GlslLib, GlslLibRoutine} from './glsl-definitions';\n\n/**\n * This GLSL library handles routines converting\n * float32 to/from Unsigned byte or float 16\n */\nexport class EncodingGlslLib extends GlslLib {\n constructor(context: GlslContext) {\n super(context);\n }\n getFunctions(): {[name: string]: GlslLibRoutine} {\n return {...this.encodeFloat32(), ...this.decodeFloat32()};\n }\n getCustomTypes(): {[name: string]: string} {\n return {};\n }\n protected encodeFloat32(): {[name: string]: GlslLibRoutine} {\n return {\n encode: new GlslLibRoutine(`highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n `)\n };\n }\n protected decodeFloat32(): {[name: string]: GlslLibRoutine} {\n return {\n decode: new GlslLibRoutine(`highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n `)\n };\n }\n /**\n * returns the routine to encode encode a 32bit float to a vec4 (of unsigned bytes)\n * @credit: https://stackoverflow.com/questions/7059962/how-do-i-convert-a-vec4-rgba-value-to-a-float\n */\n protected encodeUint8(): {[name: string]: GlslLibRoutine} {\n const endianness = EncodingGlslLib.isLittleEndian() ? 'rgba.rgba=rgba.abgr;' : '';\n return {\n encode: new GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${endianness}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)\n };\n }\n /**\n * returns the routine to encode a vec4 of unsigned bytes to float32\n * @credit: https://stackoverflow.com/questions/7059962/how-do-i-convert-a-vec4-rgba-value-to-a-float\n */\n protected decodeUint8(): {[name: string]: GlslLibRoutine} {\n const endianness = EncodingGlslLib.isLittleEndian() ? 'rgba.rgba=rgba.abgr;' : '';\n return {\n decode: new GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${endianness}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)\n };\n }\n /**\n * Determines if the machine is little endian or not\n * @credit: https://gist.github.com/TooTallNate/4750953\n */\n static isLittleEndian(): boolean {\n const b = new ArrayBuffer(4);\n const a = new Uint32Array(b);\n const c = new Uint8Array(b);\n a[0] = 0xdeadbeef;\n if (c[0] === 0xef) {\n return true;\n }\n if (c[0] === 0xde) {\n return false;\n }\n throw new Error('unknown endianness');\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {GlslContext, GlslLib, GlslLibRoutine} from './glsl-definitions';\nimport {getGlsl} from './glsl-source';\n\n/**\n * This GLSL library handles routines around reading a texlet and writing to it\n * Reading and writing could be more than just dealing with one channel\n * It may require encoding/decoding to/from 4 channels into one\n */\nexport class FragColorGlslLib extends GlslLib {\n constructor(context: GlslContext) {\n super(context);\n }\n getFunctions(): {[name: string]: GlslLibRoutine} {\n return {...this.setFragColor(), ...this.getColorAsFloat()};\n }\n getCustomTypes(): {[name: string]: string} {\n return {};\n }\n protected setFragColor(): {[name: string]: GlslLibRoutine} {\n const glsl = getGlsl(this.context.glContext.version);\n return {\n setFragColor: new GlslLibRoutine(\n `\n void setFragColor(float value) {\n ${glsl.output} = encode(value);\n }\n `,\n ['encoding.encode'])\n };\n }\n protected getColorAsFloat(): {[name: string]: GlslLibRoutine} {\n return {\n getColorAsFloat: new GlslLibRoutine(\n `\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n `,\n ['encoding.decode'])\n };\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {GlslContext, GlslLib, GlslLibRoutine} from './glsl-definitions';\n\n/**\n * GLSL Library responsible for data types and routines for manipulating\n * coordinates and mapping to/from tensor indices\n */\nexport class ShapeUtilsGlslLib extends GlslLib {\n constructor(context: GlslContext) {\n super(context);\n }\n getFunctions(): {[name: string]: GlslLibRoutine} {\n return {\n ...this.bcastIndex(),\n ...this.bcastMatmulIndex(),\n ...this.offsetToIndices(),\n ...this.indicesToOffset(),\n ...this.incrementIndices()\n };\n }\n getCustomTypes() {\n return {};\n }\n protected bcastIndex(): {[name: string]: GlslLibRoutine} {\n const outputRank = this.context.outputTextureLayout.shape.length;\n const result: {[name: string]: GlslLibRoutine} = {};\n this.context.programInfo.inputNames.forEach((name, i) => {\n const shape = this.context.inputTextureLayouts[i].unpackedShape;\n if (shape.length <= outputRank) {\n const rank = shape.length;\n const dimOffset = outputRank - rank;\n const funcName = `bcastIndices_${name}`;\n let block = '';\n for (let i = 0; i < rank; ++i) {\n block += `\n realIndices[${i}] = int( mod(float(bcastedIndices[${dimOffset + i}]), ${shape[i]}.0) );\n `;\n }\n const body = `\n void ${funcName} (int bcastedIndices[${outputRank}], out int realIndices[${rank}]) {\n ${block}\n }\n `;\n result[funcName] = new GlslLibRoutine(body);\n }\n });\n return result;\n }\n protected bcastMatmulIndex(): {[name: string]: GlslLibRoutine} {\n const outputRank = this.context.outputTextureLayout.shape.length;\n const result: {[name: string]: GlslLibRoutine} = {};\n this.context.programInfo.inputNames.forEach((name, i) => {\n const shape = this.context.inputTextureLayouts[i].shape;\n if (!(shape.length < 2 || shape.length > outputRank)) {\n const rank = shape.length;\n const dimOffset = outputRank - rank;\n const funcName = `bcastMatmulIndices_${name}`;\n let block = '';\n for (let i = 0; i < rank - 2; ++i) {\n block += `\n realIndices[${i}] = int( mod(float(bcastedIndices[${dimOffset + i}]), ${shape[i]}.0) );\n `;\n }\n const body = `\n void ${funcName}(int bcastedIndices[${outputRank}], out int realIndices[${rank}]) {\n ${block}\n realIndices[${rank - 1}] = bcastedIndices[${outputRank - 1}];\n realIndices[${rank - 2}] = bcastedIndices[${outputRank - 2}];\n }\n `;\n result[funcName] = new GlslLibRoutine(body);\n }\n });\n return result;\n }\n protected indicesToOffset(): {[name: string]: GlslLibRoutine} {\n const result: {[name: string]: GlslLibRoutine} = {};\n this.context.programInfo.inputNames.forEach((name, i) => {\n const shape = this.context.inputTextureLayouts[i].shape;\n const strides = this.context.inputTextureLayouts[i].strides;\n const rank = shape.length;\n let funcName = `indicesToOffset_${name}`;\n result[funcName] = new GlslLibRoutine(ShapeUtilsGlslLib.indexToOffsetSingle(funcName, rank, strides));\n funcName = `indicesToOffset_${name}_T`;\n result[funcName] =\n new GlslLibRoutine(ShapeUtilsGlslLib.indexToOffsetSingle(funcName, rank, strides.slice().reverse()));\n });\n return result;\n }\n static indexToOffsetSingle(name: string, rank: number, strides: readonly number[]): string {\n let block = '';\n for (let i = rank - 1; i >= 0; --i) {\n block += `\n offset += indices[${i}] * ${strides[i]};\n `;\n }\n return `\n int ${name}(int indices[${rank}]) {\n int offset = 0;\n ${block}\n return offset;\n }\n `;\n }\n protected offsetToIndices(): {[name: string]: GlslLibRoutine} {\n const result: {[name: string]: GlslLibRoutine} = {};\n this.context.programInfo.inputNames.forEach((name, i) => {\n const shape = this.context.inputTextureLayouts[i].shape;\n const strides = this.context.inputTextureLayouts[i].strides;\n const rank = shape.length;\n let funcName = `offsetToIndices_${name}`;\n result[funcName] = new GlslLibRoutine(ShapeUtilsGlslLib.offsetToIndicesSingle(funcName, rank, strides));\n funcName = `offsetToIndices_${name}_T`;\n result[funcName] =\n new GlslLibRoutine(ShapeUtilsGlslLib.offsetToIndicesSingle(funcName, rank, strides.slice().reverse()));\n });\n return result;\n }\n static offsetToIndicesSingle(name: string, rank: number, strides: readonly number[]): string {\n const stridesBlock = [];\n for (let i = 0; i < rank - 1; ++i) {\n stridesBlock.push(`\n indices[${i}] = offset / ${strides[i]};`);\n stridesBlock.push(`\n offset -= indices[${i}] * ${strides[i]};`);\n }\n stridesBlock.push(`\n indices[${rank - 1}] = offset;`);\n return `\n void ${name}(int offset, out int indices[${rank}]) {\n ${stridesBlock.join('')}\n }\n `;\n }\n protected incrementIndices(): {[name: string]: GlslLibRoutine} {\n const result: {[name: string]: GlslLibRoutine} = {};\n this.context.programInfo.inputNames.forEach((name, i) => {\n const shape = this.context.inputTextureLayouts[i].shape;\n const rank = shape.length;\n const funcName = `incrementIndices_${name}`;\n let shapeInit = '';\n for (let i = 0; i < rank; ++i) {\n shapeInit += `\n shape[${i}] = ${shape[i]};`;\n }\n const body = `\n void ${funcName}(int axis, out int indices[${rank}]) {\n int shape[${rank}];\n ${shapeInit};\n for(int i = ${rank} -1 ; i >= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;\n result[funcName] = new GlslLibRoutine(body);\n });\n return result;\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {GlslContext, GlslLib, GlslLibRoutine} from './glsl-definitions';\n\n/**\n * GLSL Library responsible for vec routines\n * Vec is an varible length int array. The length is fixed at the time of\n * generating the library functions from the dimensions of the output.\n */\nexport class VecGlslLib extends GlslLib {\n constructor(context: GlslContext) {\n super(context);\n }\n getCustomTypes(): {[name: string]: string} {\n return {};\n }\n getFunctions(): {[name: string]: GlslLibRoutine} {\n return {...this.binaryVecFunctions(), ...this.copyVec(), ...this.setVecItem(), ...this.getVecItem()};\n }\n protected binaryVecFunctions(): {[name: string]: GlslLibRoutine} {\n const outputLayout = this.context.outputTextureLayout;\n const rank = outputLayout.shape.length;\n const nameOp: {[name: string]: string} = {add: '+=', sub: '-=', mul: '*=', div: '/='};\n const result: {[name: string]: GlslLibRoutine} = {};\n for (const name in nameOp) {\n const fname = `${name}Vec`;\n let assignmentBlock = '';\n for (let i = 0; i < rank; ++i) {\n assignmentBlock += `\n dest[${i}] ${nameOp[name]} src[${i}];\n `;\n }\n const body = `\n void ${fname}(int src[${rank}], out int dest[${rank}]) {\n ${assignmentBlock}\n }\n `;\n result[fname] = new GlslLibRoutine(body);\n }\n\n return result;\n }\n protected copyVec(): {[name: string]: GlslLibRoutine} {\n const outputLayout = this.context.outputTextureLayout;\n const rank = outputLayout.shape.length;\n let assignmentBlock = '';\n for (let i = 0; i < rank; ++i) {\n assignmentBlock += `\n dest[${i}] = src[${i}];\n `;\n }\n const body = `\n void copyVec(int src[${rank}], out int dest[${rank}]) {\n ${assignmentBlock}\n }\n `;\n return {copyVec: new GlslLibRoutine(body)};\n }\n\n protected setVecItem(): {[name: string]: GlslLibRoutine} {\n const outputLayout = this.context.outputTextureLayout;\n const rank = outputLayout.shape.length;\n let block = `\n if(index < 0)\n index =${rank} + index;\n if (index == 0)\n m[0] = value;\n `;\n for (let i = 1; i < rank - 1; ++i) {\n block += `\n else if (index == ${i})\n m[${i}] = value;\n `;\n }\n block += `\n else\n m[${rank - 1}] = value;\n `;\n const body = `\n void setVecItem(out int m[${rank}], int index, int value) {\n ${block}\n }\n `;\n return {setVecItem: new GlslLibRoutine(body)};\n }\n protected getVecItem(): {[name: string]: GlslLibRoutine} {\n const outputLayout = this.context.outputTextureLayout;\n const rank = outputLayout.shape.length;\n let block = `\n if(index < 0)\n index = ${rank} + index;\n if (index == 0)\n return m[0];\n `;\n for (let i = 1; i < rank - 1; ++i) {\n block += `\n else if (index == ${i})\n return m[${i}];\n `;\n }\n block += `\n else\n return m[${rank - 1}];\n `;\n const body = `\n int getVecItem(int m[${rank}], int index) {\n ${block}\n }\n `;\n return {getVecItem: new GlslLibRoutine(body)};\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {CoordsGlslLib} from './glsl-coordinate-lib';\nimport {GlslContext, GlslLib} from './glsl-definitions';\nimport {EncodingGlslLib} from './glsl-encoding-lib';\nimport {FragColorGlslLib} from './glsl-fragcolor-lib';\nimport {ShapeUtilsGlslLib} from './glsl-shape-utils-lib';\nimport {VecGlslLib} from './glsl-vec-lib';\n\nexport const glslRegistry: {[name: string]: new (context: GlslContext) => GlslLib} = {\n 'encoding': EncodingGlslLib,\n 'fragcolor': FragColorGlslLib,\n 'vec': VecGlslLib,\n 'shapeUtils': ShapeUtilsGlslLib,\n 'coordinates': CoordsGlslLib,\n // 'arrays': ArrayGlslSLib\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {GlslContext, GlslLib, GlslLibRoutineNode, TopologicalSortGlslRoutines} from './glsl-definitions';\nimport {replaceInlines} from './glsl-function-inliner';\nimport {glslRegistry} from './glsl-registered-libs';\nimport {getDefaultFragShaderMain, getFragShaderPreamble} from './glsl-source';\nimport {ProgramInfo, TextureLayout, VariableInfo} from './types';\nimport {WebGLContext} from './webgl-context';\n\n/**\n * Preprocessor for the additions to the GLSL language\n * It deals with:\n * @include directives\n * @inline\n * Loop unrolling (not implemented)\n * Macro resolution (not implemented)\n */\nexport class GlslPreprocessor {\n readonly context: GlslContext;\n readonly libs: {[name: string]: GlslLib} = {};\n readonly glslLibRoutineDependencyGraph: {[routineName: string]: GlslLibRoutineNode} = {};\n\n constructor(\n glContext: WebGLContext, programInfo: ProgramInfo, inputTextureLayouts: TextureLayout[],\n outputTextureLayout: TextureLayout) {\n this.context = new GlslContext(glContext, programInfo, inputTextureLayouts, outputTextureLayout);\n\n // construct GlslLibs\n Object.keys(glslRegistry).forEach((name: string) => {\n const lib = new glslRegistry[name](this.context);\n this.libs[name] = lib;\n });\n\n // construct GlslRoutineDependencyGraph\n const map = this.glslLibRoutineDependencyGraph;\n for (const libName in this.libs) {\n const lib = this.libs[libName];\n const routinesInLib = lib.getFunctions();\n for (const routine in routinesInLib) {\n const key = libName + '.' + routine;\n let currentNode: GlslLibRoutineNode;\n if (map[key]) {\n currentNode = map[key];\n currentNode.routineBody = routinesInLib[routine].routineBody;\n } else {\n currentNode = new GlslLibRoutineNode(key, routinesInLib[routine].routineBody);\n map[key] = currentNode;\n }\n const dependencies = routinesInLib[routine].dependencies;\n if (dependencies) {\n for (let i = 0; i < dependencies.length; ++i) {\n if (!map[dependencies[i]]) {\n const node = new GlslLibRoutineNode(dependencies[i]);\n map[dependencies[i]] = node;\n currentNode.addDependency(node);\n } else {\n currentNode.addDependency(map[dependencies[i]]);\n }\n }\n }\n }\n }\n }\n\n preprocess(): string {\n const programInfo = this.context.programInfo;\n let source = programInfo.shaderSource;\n\n // append main() function\n if (!this.context.programInfo.hasMain) {\n source = `${source}\n ${getDefaultFragShaderMain(this.context.glContext.version, this.context.outputTextureLayout.shape.length)}`;\n }\n // replace inlines\n source = replaceInlines(source);\n\n // concat final source string\n return `${getFragShaderPreamble(this.context.glContext.version)}\n ${this.getUniforms(programInfo.inputNames, programInfo.variables)}\n ${this.getImports(source)}\n ${source}`;\n }\n\n protected getImports(script: string): string {\n const routinesIncluded = this.selectGlslLibRoutinesToBeIncluded(script);\n\n if (routinesIncluded.length === 0) {\n return '';\n }\n\n let routines = '';\n for (let i = 0; i < routinesIncluded.length; ++i) {\n if (routinesIncluded[i].routineBody) {\n routines += routinesIncluded[i].routineBody + '\\n';\n } else {\n throw new Error(`Missing body for the Glsl Library routine: ${routinesIncluded[i].name}`);\n }\n }\n\n return routines;\n }\n private selectGlslLibRoutinesToBeIncluded(script: string): GlslLibRoutineNode[] {\n const nodes: GlslLibRoutineNode[] = [];\n\n Object.keys(this.glslLibRoutineDependencyGraph).forEach(classAndRoutine => {\n const routine = classAndRoutine.split('.')[1];\n if (script.indexOf(routine) !== -1) {\n nodes.push(this.glslLibRoutineDependencyGraph[classAndRoutine]);\n }\n });\n\n return TopologicalSortGlslRoutines.returnOrderedNodes(nodes);\n }\n\n protected getUniforms(samplers?: string[], variables?: VariableInfo[]): string {\n const uniformLines: string[] = [];\n if (samplers) {\n for (const sampler of samplers) {\n uniformLines.push(`uniform sampler2D ${sampler};`);\n }\n }\n if (variables) {\n for (const variable of variables) {\n uniformLines.push(\n `uniform ${variable.type} ${variable.name}${variable.arrayLength ? `[${variable.arrayLength}]` : ''};`);\n }\n }\n return uniformLines.join('\\n');\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from 'onnxruntime-common';\n\nimport {Logger, Profiler} from '../../instrument';\n\nimport {GlslPreprocessor} from './glsl-preprocessor';\nimport {getVertexShaderSource} from './glsl-source';\nimport {TextureLayoutStrategy} from './texture-layout-strategy';\nimport {Artifact, ProgramInfo, ProgramVariable, TextureData, TextureLayout, VariableInfo} from './types';\nimport {WebGLContext} from './webgl-context';\n\n/**\n * ProgramManager is the main class behind running computations\n * It builds ProgramInfo's into Artifacts\n * It compiles given ProgramInfo's into WebGL Prorams (cached as Artifacts)\n * Uses the artifact to run the computation by calling Draw on\n * the WebGL drawing buffer\n * ProgramManager automatically maps (binds) input variables to their\n * corresponding Location's in the binary program\n */\nexport class ProgramManager {\n repo: Map; // this should be per-session object\n vertexShader: WebGLShader;\n attributesBound: boolean;\n\n constructor(\n public profiler: Readonly, public glContext: WebGLContext,\n public textureLayoutStrategy: TextureLayoutStrategy) {\n this.repo = new Map();\n this.attributesBound = false;\n }\n getArtifact(key: unknown): Artifact|undefined {\n return this.repo.get(key);\n }\n setArtifact(key: unknown, artifact: Artifact): void {\n this.repo.set(key, artifact);\n }\n run(buildArtifact: Artifact, inputs: TextureData[], output: TextureData): void {\n this.profiler.event('op', `ProgramManager.run ${buildArtifact.programInfo.name ?? 'unknown kernel'}`, () => {\n const gl = this.glContext.gl;\n const program = buildArtifact.program;\n gl.useProgram(program);\n try {\n this.bindOutput(output);\n if (!this.attributesBound) {\n this.bindAttributes(buildArtifact.attribLocations);\n }\n this.bindUniforms(buildArtifact.uniformLocations, buildArtifact.programInfo.variables ?? [], inputs);\n } catch (err) {\n Logger.error('ProgramManager', buildArtifact.programInfo.shaderSource);\n throw err;\n }\n this.profiler.event('backend', 'GlContext.draw()', () => {\n this.glContext.draw();\n });\n }, this.glContext);\n }\n dispose(): void {\n if (this.vertexShader) {\n this.glContext.deleteShader(this.vertexShader);\n }\n this.repo.forEach(a => this.glContext.deleteProgram(a.program));\n }\n build(programInfo: ProgramInfo, inputTextureLayouts: TextureLayout[], outputTextureLayout: TextureLayout): Artifact {\n return this.profiler.event('backend', 'ProgramManager.build', () => {\n const preprocessor = new GlslPreprocessor(this.glContext, programInfo, inputTextureLayouts, outputTextureLayout);\n const fragScript = preprocessor.preprocess();\n const program = this.compile(fragScript);\n const artifact = {\n programInfo,\n program,\n uniformLocations: this.getUniformLocations(\n program, preprocessor.context.programInfo.inputNames, preprocessor.context.programInfo.variables),\n attribLocations: this.getAttribLocations(program)\n };\n return artifact;\n });\n }\n protected compile(fragShaderScript: string): WebGLProgram {\n if (!this.vertexShader) {\n Logger.verbose('ProrgramManager', 'Compiling and caching Vertex shader for the first time');\n const vertexShaderScript = getVertexShaderSource(this.glContext.version);\n this.vertexShader = this.glContext.compileShader(vertexShaderScript, this.glContext.gl.VERTEX_SHADER);\n }\n if (env.debug) {\n Logger.verbose('ProrgramManager', `FragShader:\n${fragShaderScript}\n`);\n }\n const fragShader = this.glContext.compileShader(fragShaderScript, this.glContext.gl.FRAGMENT_SHADER);\n const program = this.glContext.createProgram(this.vertexShader, fragShader);\n this.glContext.deleteShader(fragShader);\n return program;\n }\n bindOutput(td: TextureData): void {\n const width = td.width;\n const height = td.height;\n Logger.verbose(\n 'ProrgramManager',\n `Binding output texture to Framebuffer: w/h=${width}/${height}, shape=${td.shape}, type=${td.tensor.type}`);\n this.glContext.attachFramebuffer(td.texture, width, height);\n }\n bindAttributes(attribLocations: Artifact.AttribLocations): void {\n const positionHandle = attribLocations.position;\n const textureCoordHandle = attribLocations.textureCoord;\n this.glContext.setVertexAttributes(positionHandle, textureCoordHandle);\n this.attributesBound = true;\n }\n bindUniforms(uniformLocations: Artifact.UniformLocations, variables: ProgramVariable[], textures: TextureData[]):\n void {\n const gl = this.glContext.gl;\n let texturePosition = 0;\n for (const {name, type, location, arrayLength} of uniformLocations) {\n const value = variables.find(v => v.name === name)?.data;\n if (type !== 'sampler2D' && !value) {\n throw new Error(`variable '${name}' does not have data defined in program info`);\n }\n switch (type) {\n case 'sampler2D':\n this.bindTexture(textures[texturePosition], location, texturePosition);\n texturePosition++;\n break;\n case 'float':\n if (arrayLength) {\n gl.uniform1fv(location, value as number[]);\n } else {\n gl.uniform1f(location, value as number);\n }\n break;\n case 'int':\n if (arrayLength) {\n gl.uniform1iv(location, value as number[]);\n } else {\n gl.uniform1i(location, value as number);\n }\n break;\n default:\n throw new Error(`Uniform not implemented: ${type}`);\n }\n }\n }\n bindTexture(td: TextureData, uniformHandle: WebGLUniformLocation, position: number): void {\n this.glContext.bindTextureToUniform(td.texture, position, uniformHandle);\n }\n getAttribLocations(program: WebGLProgram): Artifact.AttribLocations {\n return {\n position: this.getAttribLocation(program, 'position'),\n textureCoord: this.getAttribLocation(program, 'textureCoord')\n };\n }\n getUniformLocations(program: WebGLProgram, samplers?: string[], variables?: VariableInfo[]):\n Artifact.UniformLocations {\n const uniformLocations: Artifact.UniformLocations = [];\n if (samplers) {\n for (const sampler of samplers) {\n uniformLocations.push({name: sampler, type: 'sampler2D', location: this.getUniformLocation(program, sampler)});\n }\n }\n if (variables) {\n for (const variable of variables) {\n uniformLocations.push({...variable, location: this.getUniformLocation(program, variable.name)});\n }\n }\n return uniformLocations;\n }\n getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation {\n const gl = this.glContext.gl;\n const reference = gl.getUniformLocation(program, name);\n if (reference === null) {\n throw new Error(`Uniform ${name} not found.`);\n }\n return reference;\n }\n getAttribLocation(program: WebGLProgram, name: string): number {\n const gl = this.glContext.gl;\n const attributeLocation: number = gl.getAttribLocation(program, name);\n return attributeLocation;\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Logger, Profiler} from '../../instrument';\nimport {Tensor} from '../../tensor';\n\nimport {Encoder, EncoderUsage} from './texture-data-encoder';\nimport {TextureLayoutStrategy} from './texture-layout-strategy';\nimport {TextureData, TextureLayout} from './types';\nimport {WebGLContext} from './webgl-context';\n\nexport interface TextureManagerConfig {\n reuseTextures?: boolean;\n}\n\n/**\n * TextureManager is the mainly responsible for caching Textures\n * Textures are cached in 2 levels:\n * 1. the texures which are associated with a dataId (from Tensor)\n * Caching these is crucial to performance. These are In-use Textures\n * 2. textures which are not in use by any current ProgramInfo/Tensor\n * These are called Free Textures\n * TextureManager is also used to help creating textures. For this it\n * uses WebGLContext and TextureLayoutStrategy\n */\nexport class TextureManager {\n private readonly inUseTextures: Map;\n private readonly idleTextures: Map;\n private readonly textureLookup: Map;\n private readonly pendingRead: Map void>> = new Map();\n\n constructor(\n public glContext: WebGLContext, public layoutStrategy: TextureLayoutStrategy, public profiler: Readonly,\n private config: TextureManagerConfig) {\n if (config.reuseTextures) {\n this.inUseTextures = new Map();\n this.idleTextures = new Map();\n this.textureLookup = new Map();\n }\n }\n createTextureFromLayout(\n dataType: Tensor.DataType, layout: TextureLayout, data?: Tensor.NumberType, usage?: EncoderUsage) {\n const textureDataType = this.toEncoderType(dataType);\n\n const encoder = this.glContext.getEncoder(textureDataType, layout.channels || 1, usage);\n if (layout.isPacked && usage === EncoderUsage.UploadOnly) {\n throw new Error('not implemented');\n }\n const width = layout.width;\n const height = layout.height;\n\n let key: string|undefined;\n let inUseTextures: WebGLTexture[]|undefined;\n if (this.config.reuseTextures) {\n key = `${width}x${height}_${encoder.format}_${encoder.internalFormat}_${encoder.textureType}`;\n inUseTextures = this.inUseTextures.get(key);\n if (!inUseTextures) {\n inUseTextures = [];\n this.inUseTextures.set(key, inUseTextures);\n }\n\n const idleTextures = this.idleTextures.get(key);\n if (idleTextures && idleTextures.length > 0) {\n const texture = idleTextures.pop()!;\n inUseTextures.push(texture);\n if (usage === EncoderUsage.UploadOnly) {\n this.glContext.updateTexture(texture, width, height, encoder, this.toTextureData(dataType, data)!);\n }\n return texture;\n }\n }\n\n Logger.verbose('TextureManager', `Creating new texture of size ${layout.width}x${layout.height}`);\n const texture = this.glContext.allocateTexture(width, height, encoder, this.toTextureData(dataType, data));\n\n if (this.config.reuseTextures) {\n inUseTextures!.push(texture);\n this.textureLookup.set(texture, key!);\n }\n return texture;\n }\n readTexture(td: TextureData, dataType: Tensor.DataType, channels?: number): Tensor.NumberType {\n if (!channels) {\n channels = 1;\n }\n return this.profiler.event('backend', 'TextureManager.readTexture', () => {\n const dataSize = td.shape.reduce((a, b) => a * b) * channels!;\n const data = this.glContext.readTexture(\n td.texture, td.width, td.height, dataSize, this.toEncoderType(dataType), channels!);\n return this.toTensorData(dataType, data);\n });\n }\n async readTextureAsync(td: TextureData, dataType: Tensor.DataType, channels?: number): Promise {\n const dataId = td.tensor.dataId;\n if (!channels) {\n channels = 1;\n }\n if (this.pendingRead.has(dataId)) {\n const subscribers = this.pendingRead.get(dataId);\n return new Promise(resolve => subscribers?.push(resolve));\n }\n return this.profiler.event('backend', 'TextureManager.readTextureAsync', async () => {\n this.pendingRead.set(dataId, []);\n const dataSize = td.shape.reduce((a, b) => a * b) * channels!;\n // add a fence waiting for the data to be ready\n await this.glContext.createAndWaitForFence();\n const data = this.glContext.readTexture(\n td.texture, td.width, td.height, dataSize, this.toEncoderType(dataType), channels!);\n const tensorData = this.toTensorData(dataType, data);\n const subscribers = this.pendingRead.get(dataId);\n this.pendingRead.delete(dataId);\n subscribers?.forEach(resolve => resolve(tensorData));\n return tensorData;\n });\n }\n readUint8TextureAsFloat(td: TextureData): Float32Array {\n return this.profiler.event('backend', 'TextureManager.readUint8TextureAsFloat', () => {\n const dataSize = td.shape.reduce((a, b) => a * b);\n const data = this.glContext.readTexture(td.texture, td.width, td.height, dataSize * 4, 'byte', 4);\n return new Float32Array(data.buffer, data.byteOffset, dataSize);\n });\n }\n releaseTexture(textureData: TextureData, deleteTexture?: boolean): void {\n let key: string|undefined;\n if (this.config.reuseTextures) {\n key = this.textureLookup.get(textureData.texture);\n if (key) {\n if (deleteTexture) {\n this.textureLookup.delete(key);\n }\n const inUseTextures = this.inUseTextures.get(key);\n if (inUseTextures) {\n const index = inUseTextures.indexOf(textureData.texture);\n if (index !== -1) {\n inUseTextures.splice(index, 1);\n let idleTextures = this.idleTextures.get(key);\n if (!idleTextures) {\n idleTextures = [];\n this.idleTextures.set(key, idleTextures);\n }\n idleTextures.push(textureData.texture);\n }\n }\n }\n }\n\n if (!key || deleteTexture) {\n Logger.verbose('TextureManager', `Deleting texture of size ${textureData.width}x${textureData.height}`);\n this.glContext.deleteTexture(textureData.texture);\n }\n }\n toTensorData(dataType: Tensor.DataType, data: Encoder.DataArrayType): Tensor.NumberType {\n switch (dataType) {\n case 'int16':\n return data instanceof Int16Array ? data : Int16Array.from(data);\n case 'int32':\n return data instanceof Int32Array ? data : Int32Array.from(data);\n case 'int8':\n return data instanceof Int8Array ? data : Int8Array.from(data);\n case 'uint16':\n return data instanceof Uint16Array ? data : Uint16Array.from(data);\n case 'uint32':\n return data instanceof Uint32Array ? data : Uint32Array.from(data);\n case 'uint8':\n case 'bool':\n return data instanceof Uint8Array ? data : Uint8Array.from(data);\n case 'float32':\n return data instanceof Float32Array ? data : Float32Array.from(data);\n case 'float64':\n return data instanceof Float64Array ? data : Float64Array.from(data);\n default:\n throw new Error(`TensorData type ${dataType} is not supported`);\n }\n }\n toTextureData(_dataType: Tensor.DataType, data: Tensor.NumberType|undefined): Encoder.DataArrayType|undefined {\n if (!data) {\n return undefined;\n }\n return (data instanceof Float32Array) ? data : new Float32Array(data);\n /*\n switch (dataType) {\n case 'int16':\n case 'int32':\n case 'uint16':\n case 'uint32':\n return (data.constructor === Uint32Array) ? data as Uint32Array : new Uint32Array(data);\n case 'int8':\n case 'uint8':\n case 'bool':\n return (data.constructor === Uint8Array) ? data as Uint8Array : new Uint8Array(data);\n case 'float32':\n case 'float64':\n return (data.constructor === Float32Array) ? data as Float32Array : new Float32Array(data);\n default:\n throw new Error(`TensorData type ${dataType} is not supported`);\n }\n */\n }\n toEncoderType(_dataType: Tensor.DataType): Encoder.DataType {\n return 'float';\n // switch (dataType) {\n // case 'int16':\n // case 'int32':\n // case 'uint16':\n // case 'uint32':\n // return 'int';\n // case 'uint8':\n // case 'bool':\n // return 'byte';\n // case 'float32':\n // case 'float64':\n // return 'float';\n // default:\n // throw new Error(`TensorData type ${dataType} is not supported`);\n // }\n }\n clearActiveTextures(): void {\n this.glContext.clearActiveTextures();\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {SessionHandler} from '../../backend';\nimport {Graph} from '../../graph';\nimport {Logger} from '../../instrument';\nimport {Operator} from '../../operators';\nimport {OpSet, resolveOperator} from '../../opset';\nimport {Session} from '../../session';\nimport {Tensor} from '../../tensor';\nimport {WebGLBackend} from '../backend-webgl';\n\nimport {WebGLInferenceHandler} from './inference-handler';\nimport {WEBGL_OP_RESOLVE_RULES} from './op-resolve-rules';\nimport {ProgramManager} from './program-manager';\nimport {PreferLogicalStrategy, TextureLayoutStrategy} from './texture-layout-strategy';\nimport {TextureManager} from './texture-manager';\nimport {TextureData} from './types';\n\nexport class WebGLSessionHandler implements SessionHandler {\n programManager: ProgramManager;\n textureManager: TextureManager;\n layoutStrategy: TextureLayoutStrategy;\n packedTextureDataCache: Map;\n unpackedTextureDataCache: Map;\n pack2unpackMap: Map;\n unpack2packMap: Map;\n initializers: Set;\n pack?: boolean;\n\n constructor(public readonly backend: WebGLBackend, public readonly context: Session.Context) {\n this.layoutStrategy = new PreferLogicalStrategy(backend.glContext.maxTextureSize);\n this.programManager = new ProgramManager(this.context.profiler, backend.glContext, this.layoutStrategy);\n this.textureManager = new TextureManager(\n backend.glContext, this.layoutStrategy, this.context.profiler,\n {reuseTextures: backend.textureCacheMode === 'full'});\n this.packedTextureDataCache = new Map();\n this.unpackedTextureDataCache = new Map();\n this.pack = backend.pack;\n this.pack2unpackMap = new Map();\n this.unpack2packMap = new Map();\n }\n\n createInferenceHandler() {\n return new WebGLInferenceHandler(this);\n }\n onGraphInitialized(graph: Graph): void {\n const initializers = graph.getValues().filter(v => v.from === -1 && v.tensor).map(v => v.tensor!.dataId);\n this.initializers = new Set(initializers);\n }\n isInitializer(tensorId: Tensor.Id): boolean {\n return this.initializers ? this.initializers.has(tensorId) : false;\n }\n addInitializer(tensorId: Tensor.Id): void {\n this.initializers.add(tensorId);\n }\n getTextureData(tensorId: Tensor.Id, isPacked: boolean): TextureData|undefined {\n if (isPacked) {\n return this.packedTextureDataCache.get(tensorId);\n } else {\n return this.unpackedTextureDataCache.get(tensorId);\n }\n }\n setTextureData(tensorId: Tensor.Id, textureData: TextureData, isPacked = false): void {\n Logger.verbose('WebGLSessionHandler', 'Storing Texture data in cache');\n if (isPacked) {\n this.packedTextureDataCache.set(tensorId, textureData);\n } else {\n this.unpackedTextureDataCache.set(tensorId, textureData);\n }\n }\n dispose(): void {\n this.programManager.dispose();\n this.textureManager.clearActiveTextures();\n this.packedTextureDataCache.forEach(td => this.textureManager.releaseTexture(td, true));\n this.packedTextureDataCache = new Map();\n this.unpackedTextureDataCache.forEach(td => this.textureManager.releaseTexture(td, true));\n this.unpackedTextureDataCache = new Map();\n }\n resolve(node: Graph.Node, opsets: readonly OpSet[], graph: Graph): Operator {\n const op = resolveOperator(node, opsets, WEBGL_OP_RESOLVE_RULES);\n return {impl: op.opImpl, context: op.opInit ? op.opInit(node, graph) : node};\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from 'onnxruntime-common';\n\nimport * as DataEncoders from './texture-data-encoder';\nimport {DataEncoder, Encoder, EncoderUsage} from './texture-data-encoder';\nimport {repeatedTry} from './utils';\n\nexport interface FenceContext {\n query: WebGLSync|null;\n isFencePassed(): boolean;\n}\n\ntype PollItem = {\n isDoneFn: () => boolean; resolveFn: () => void;\n};\n\nexport function linearSearchLastTrue(arr: Array<() => boolean>): number {\n let i = 0;\n for (; i < arr.length; ++i) {\n const isDone = arr[i]();\n if (!isDone) {\n break;\n }\n }\n return i - 1;\n}\n\n/**\n * Abstraction and wrapper around WebGLRenderingContext and its operations\n */\nexport class WebGLContext {\n gl: WebGLRenderingContext;\n version: 1|2;\n\n private vertexbuffer: WebGLBuffer;\n private framebuffer: WebGLFramebuffer;\n\n // WebGL flags and vital parameters\n private isFloatTextureAttachableToFrameBuffer: boolean;\n isFloat32DownloadSupported: boolean;\n isRenderFloat32Supported: boolean;\n isBlendSupported: boolean;\n maxTextureSize: number;\n // private maxCombinedTextureImageUnits: number;\n private maxTextureImageUnits: number;\n // private maxCubeMapTextureSize: number;\n // private shadingLanguageVersion: string;\n // private webglVendor: string;\n // private webglVersion: string;\n\n // WebGL2 flags and vital parameters\n // private max3DTextureSize: number;\n // private maxArrayTextureLayers: number;\n // private maxColorAttachments: number;\n // private maxDrawBuffers: number;\n\n // WebGL extensions\n // eslint-disable-next-line camelcase\n textureFloatExtension: OES_texture_float|null;\n // eslint-disable-next-line camelcase\n textureHalfFloatExtension: OES_texture_half_float|null;\n\n // WebGL2 extensions\n colorBufferFloatExtension: unknown|null;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n disjointTimerQueryWebgl2Extension: {TIME_ELAPSED_EXT: GLenum; GPU_DISJOINT_EXT: GLenum}|null;\n\n private disposed: boolean;\n private frameBufferBound = false;\n\n constructor(gl: WebGLRenderingContext, version: 1|2) {\n this.gl = gl;\n this.version = version;\n\n this.getExtensions();\n this.vertexbuffer = this.createVertexbuffer();\n this.framebuffer = this.createFramebuffer();\n this.queryVitalParameters();\n }\n\n allocateTexture(width: number, height: number, encoder: DataEncoder, data?: Encoder.DataArrayType): WebGLTexture {\n const gl = this.gl;\n // create the texture\n const texture = gl.createTexture();\n // bind the texture so the following methods effect this texture.\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n const buffer = data ? encoder.encode(data, width * height) : null;\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0, // Level of detail.\n encoder.internalFormat, width, height,\n 0, // Always 0 in OpenGL ES.\n encoder.format, encoder.textureType, buffer);\n this.checkError();\n return texture as WebGLTexture;\n }\n updateTexture(\n texture: WebGLTexture, width: number, height: number, encoder: DataEncoder, data: Encoder.DataArrayType): void {\n const gl = this.gl;\n gl.bindTexture(gl.TEXTURE_2D, texture);\n const buffer = encoder.encode(data, width * height);\n gl.texSubImage2D(\n gl.TEXTURE_2D,\n 0, // level\n 0, // xoffset\n 0, // yoffset\n width, height, encoder.format, encoder.textureType, buffer);\n this.checkError();\n }\n attachFramebuffer(texture: WebGLTexture, width: number, height: number): void {\n const gl = this.gl;\n // Make it the target for framebuffer operations - including rendering.\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture,\n 0); // 0, we aren't using MIPMAPs\n this.checkError();\n gl.viewport(0, 0, width, height);\n gl.scissor(0, 0, width, height);\n }\n readTexture(\n texture: WebGLTexture, width: number, height: number, dataSize: number, dataType: Encoder.DataType,\n channels: number): Encoder.DataArrayType {\n const gl = this.gl;\n if (!channels) {\n channels = 1;\n }\n if (!this.frameBufferBound) {\n this.attachFramebuffer(texture, width, height);\n }\n const encoder = this.getEncoder(dataType, channels);\n const buffer = encoder.allocate(width * height);\n // bind texture to framebuffer\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture,\n 0); // 0, we aren't using MIPMAPs\n // TODO: Check if framebuffer is ready\n gl.readPixels(0, 0, width, height, gl.RGBA, encoder.textureType, buffer);\n this.checkError();\n // unbind FB\n return encoder.decode(buffer, dataSize);\n }\n\n isFramebufferReady(): boolean {\n // TODO: Implement logic to check if the framebuffer is ready\n return true;\n }\n getActiveTexture(): string {\n const gl = this.gl;\n const n = gl.getParameter(this.gl.ACTIVE_TEXTURE);\n return `TEXTURE${(n - gl.TEXTURE0)}`;\n }\n getTextureBinding(): WebGLTexture {\n return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D);\n }\n getFramebufferBinding(): WebGLFramebuffer {\n return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING);\n }\n setVertexAttributes(positionHandle: number, textureCoordHandle: number): void {\n const gl = this.gl;\n gl.vertexAttribPointer(positionHandle, 3, gl.FLOAT, false, 20, 0);\n gl.enableVertexAttribArray(positionHandle);\n if (textureCoordHandle !== -1) {\n gl.vertexAttribPointer(textureCoordHandle, 2, gl.FLOAT, false, 20, 12);\n gl.enableVertexAttribArray(textureCoordHandle);\n }\n this.checkError();\n }\n createProgram(\n vertexShader: WebGLShader,\n fragShader: WebGLShader,\n ): WebGLProgram {\n const gl = this.gl;\n const program = gl.createProgram()!;\n\n // the program consists of our shaders\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragShader);\n gl.linkProgram(program);\n return program;\n }\n compileShader(shaderSource: string, shaderType: number): WebGLShader {\n const gl = this.gl;\n const shader = gl.createShader(shaderType);\n if (!shader) {\n throw new Error(`createShader() returned null with type ${shaderType}`);\n }\n\n gl.shaderSource(shader, shaderSource);\n gl.compileShader(shader);\n if (gl.getShaderParameter(shader, gl.COMPILE_STATUS) === false) {\n throw new Error(`Failed to compile shader: ${gl.getShaderInfoLog(shader)}\nShader source:\n${shaderSource}`);\n }\n return shader;\n }\n deleteShader(shader: WebGLShader): void {\n this.gl.deleteShader(shader);\n }\n bindTextureToUniform(texture: WebGLTexture, position: number, uniformHandle: WebGLUniformLocation): void {\n const gl = this.gl;\n gl.activeTexture(gl.TEXTURE0 + position);\n this.checkError();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n this.checkError();\n gl.uniform1i(uniformHandle, position);\n this.checkError();\n }\n draw(): void {\n this.gl.drawArrays(this.gl.TRIANGLE_STRIP, 0, 4);\n this.checkError();\n }\n checkError(): void {\n if (env.debug) {\n const gl = this.gl;\n const error = gl.getError();\n let label = '';\n switch (error) {\n case (gl.NO_ERROR):\n return;\n case (gl.INVALID_ENUM):\n label = 'INVALID_ENUM';\n break;\n case (gl.INVALID_VALUE):\n label = 'INVALID_VALUE';\n break;\n case (gl.INVALID_OPERATION):\n label = 'INVALID_OPERATION';\n break;\n case (gl.INVALID_FRAMEBUFFER_OPERATION):\n label = 'INVALID_FRAMEBUFFER_OPERATION';\n break;\n case (gl.OUT_OF_MEMORY):\n label = 'OUT_OF_MEMORY';\n break;\n case (gl.CONTEXT_LOST_WEBGL):\n label = 'CONTEXT_LOST_WEBGL';\n break;\n default:\n label = `Unknown WebGL Error: ${error.toString(16)}`;\n }\n throw new Error(label);\n }\n }\n deleteTexture(texture: WebGLTexture): void {\n this.gl.deleteTexture(texture);\n }\n deleteProgram(program: WebGLProgram): void {\n this.gl.deleteProgram(program);\n }\n getEncoder(dataType: Encoder.DataType, channels: number, usage: EncoderUsage = EncoderUsage.Default): DataEncoder {\n if (this.version === 2) {\n return new DataEncoders.RedFloat32DataEncoder(this.gl as WebGL2RenderingContext, channels);\n }\n\n switch (dataType) {\n case 'float':\n if (usage === EncoderUsage.UploadOnly || this.isRenderFloat32Supported) {\n return new DataEncoders.RGBAFloatDataEncoder(this.gl, channels);\n } else {\n return new DataEncoders.RGBAFloatDataEncoder(\n this.gl, channels, this.textureHalfFloatExtension!.HALF_FLOAT_OES);\n }\n case 'int':\n throw new Error('not implemented');\n case 'byte':\n return new DataEncoders.Uint8DataEncoder(this.gl, channels);\n default:\n throw new Error(`Invalid dataType: ${dataType}`);\n }\n }\n clearActiveTextures(): void {\n const gl = this.gl;\n for (let unit = 0; unit < this.maxTextureImageUnits; ++unit) {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, null);\n }\n }\n dispose(): void {\n if (this.disposed) {\n return;\n }\n const gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(this.framebuffer);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.deleteBuffer(this.vertexbuffer);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n gl.finish();\n this.disposed = true;\n }\n\n private createDefaultGeometry(): Float32Array {\n // Sets of x,y,z(=0),s,t coordinates.\n return new Float32Array([\n -1.0, 1.0, 0.0, 0.0, 1.0, // upper left\n -1.0, -1.0, 0.0, 0.0, 0.0, // lower left\n 1.0, 1.0, 0.0, 1.0, 1.0, // upper right\n 1.0, -1.0, 0.0, 1.0, 0.0 // lower right\n ]);\n }\n private createVertexbuffer(): WebGLBuffer {\n const gl = this.gl;\n const buffer = gl.createBuffer();\n if (!buffer) {\n throw new Error('createBuffer() returned null');\n }\n const geometry = this.createDefaultGeometry();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry, gl.STATIC_DRAW);\n this.checkError();\n return buffer;\n }\n private createFramebuffer(): WebGLFramebuffer {\n const fb = this.gl.createFramebuffer();\n if (!fb) {\n throw new Error('createFramebuffer returned null');\n }\n return fb;\n }\n\n private queryVitalParameters(): void {\n const gl = this.gl;\n\n this.isFloatTextureAttachableToFrameBuffer = this.checkFloatTextureAttachableToFrameBuffer();\n this.isRenderFloat32Supported = this.checkRenderFloat32();\n this.isFloat32DownloadSupported = this.checkFloat32Download();\n\n if (this.version === 1 && !this.textureHalfFloatExtension && !this.isRenderFloat32Supported) {\n throw new Error('both float32 and float16 TextureType are not supported');\n }\n\n this.isBlendSupported = !this.isRenderFloat32Supported || this.checkFloat32Blend();\n\n // this.maxCombinedTextureImageUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n this.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n this.maxTextureImageUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // this.maxCubeMapTextureSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n // this.shadingLanguageVersion = gl.getParameter(gl.SHADING_LANGUAGE_VERSION);\n // this.webglVendor = gl.getParameter(gl.VENDOR);\n // this.webglVersion = gl.getParameter(gl.VERSION);\n\n if (this.version === 2) {\n // this.max3DTextureSize = gl.getParameter(WebGL2RenderingContext.MAX_3D_TEXTURE_SIZE);\n // this.maxArrayTextureLayers = gl.getParameter(WebGL2RenderingContext.MAX_ARRAY_TEXTURE_LAYERS);\n // this.maxColorAttachments = gl.getParameter(WebGL2RenderingContext.MAX_COLOR_ATTACHMENTS);\n // this.maxDrawBuffers = gl.getParameter(WebGL2RenderingContext.MAX_DRAW_BUFFERS);\n }\n }\n private getExtensions(): void {\n if (this.version === 2) {\n this.colorBufferFloatExtension = this.gl.getExtension('EXT_color_buffer_float');\n this.disjointTimerQueryWebgl2Extension = this.gl.getExtension('EXT_disjoint_timer_query_webgl2');\n } else {\n this.textureFloatExtension = this.gl.getExtension('OES_texture_float');\n this.textureHalfFloatExtension = this.gl.getExtension('OES_texture_half_float');\n }\n }\n\n private checkFloatTextureAttachableToFrameBuffer(): boolean {\n // test whether Float32 texture is supported:\n // STEP.1 create a float texture\n const gl = this.gl;\n const texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const internalFormat = this.version === 2 ? (gl as unknown as {RGBA32F: number}).RGBA32F : gl.RGBA;\n gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n // STEP.2 bind a frame buffer\n const frameBuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n // STEP.3 attach texture to framebuffer\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n // STEP.4 test whether framebuffer is complete\n const isComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteTexture(texture);\n gl.deleteFramebuffer(frameBuffer);\n return isComplete;\n }\n\n private checkRenderFloat32(): boolean {\n if (this.version === 2) {\n if (!this.colorBufferFloatExtension) {\n return false;\n }\n } else {\n if (!this.textureFloatExtension) {\n return false;\n }\n }\n return this.isFloatTextureAttachableToFrameBuffer;\n }\n\n private checkFloat32Download(): boolean {\n if (this.version === 2) {\n if (!this.colorBufferFloatExtension) {\n return false;\n }\n } else {\n if (!this.textureFloatExtension) {\n return false;\n }\n if (!this.gl.getExtension('WEBGL_color_buffer_float')) {\n return false;\n }\n }\n return this.isFloatTextureAttachableToFrameBuffer;\n }\n\n /**\n * Check whether GL_BLEND is supported\n */\n private checkFloat32Blend(): boolean {\n // it looks like currently (2019-05-08) there is no easy way to detect whether BLEND is supported\n // https://github.com/microsoft/onnxjs/issues/145\n\n const gl = this.gl;\n\n let texture: WebGLTexture|null|undefined;\n let frameBuffer: WebGLFramebuffer|null|undefined;\n let vertexShader: WebGLShader|null|undefined;\n let fragmentShader: WebGLShader|null|undefined;\n let program: WebGLProgram|null|undefined;\n\n try {\n texture = gl.createTexture();\n frameBuffer = gl.createFramebuffer();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const internalFormat = this.version === 2 ? (gl as unknown as {RGBA32F: number}).RGBA32F : gl.RGBA;\n gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n gl.enable(gl.BLEND);\n\n vertexShader = gl.createShader(gl.VERTEX_SHADER);\n if (!vertexShader) {\n return false;\n }\n gl.shaderSource(vertexShader, 'void main(){}');\n gl.compileShader(vertexShader);\n\n fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n if (!fragmentShader) {\n return false;\n }\n gl.shaderSource(fragmentShader, 'precision highp float;void main(){gl_FragColor=vec4(0.5);}');\n gl.compileShader(fragmentShader);\n\n program = gl.createProgram();\n if (!program) {\n return false;\n }\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n gl.useProgram(program);\n\n gl.drawArrays(gl.POINTS, 0, 1);\n return gl.getError() === gl.NO_ERROR;\n\n } finally {\n gl.disable(gl.BLEND);\n\n if (program) {\n gl.deleteProgram(program);\n }\n if (vertexShader) {\n gl.deleteShader(vertexShader);\n }\n if (fragmentShader) {\n gl.deleteShader(fragmentShader);\n }\n if (frameBuffer) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n }\n if (texture) {\n gl.bindTexture(gl.TEXTURE_2D, null);\n gl.deleteTexture(texture);\n }\n }\n }\n\n beginTimer(): WebGLQuery {\n if (this.version === 2 && this.disjointTimerQueryWebgl2Extension) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.disjointTimerQueryWebgl2Extension;\n\n const query = gl2.createQuery() as WebGLQuery;\n gl2.beginQuery(ext.TIME_ELAPSED_EXT, query);\n return query;\n } else {\n // TODO: add webgl 1 handling.\n throw new Error('WebGL1 profiling currently not supported.');\n }\n }\n\n endTimer() {\n if (this.version === 2 && this.disjointTimerQueryWebgl2Extension) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.disjointTimerQueryWebgl2Extension;\n gl2.endQuery(ext.TIME_ELAPSED_EXT);\n return;\n } else {\n // TODO: add webgl 1 handling.\n throw new Error('WebGL1 profiling currently not supported');\n }\n }\n\n isTimerResultAvailable(query: WebGLQuery): boolean {\n let available = false, disjoint = false;\n if (this.version === 2 && this.disjointTimerQueryWebgl2Extension) {\n const gl2 = this.gl as WebGL2RenderingContext;\n const ext = this.disjointTimerQueryWebgl2Extension;\n\n available = gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE);\n disjoint = gl2.getParameter(ext.GPU_DISJOINT_EXT);\n } else {\n // TODO: add webgl 1 handling.\n throw new Error('WebGL1 profiling currently not supported');\n }\n\n return available && !disjoint;\n }\n\n getTimerResult(query: WebGLQuery): number {\n let timeElapsed = 0;\n if (this.version === 2) {\n const gl2 = this.gl as WebGL2RenderingContext;\n timeElapsed = gl2.getQueryParameter(query, gl2.QUERY_RESULT);\n gl2.deleteQuery(query);\n } else {\n // TODO: add webgl 1 handling.\n throw new Error('WebGL1 profiling currently not supported');\n }\n // return miliseconds\n return timeElapsed / 1000000;\n }\n\n async waitForQueryAndGetTime(query: WebGLQuery): Promise {\n await repeatedTry(() => this.isTimerResultAvailable(query));\n return this.getTimerResult(query);\n }\n\n public async createAndWaitForFence(): Promise {\n const fenceContext = this.createFence(this.gl);\n return this.pollFence(fenceContext);\n }\n\n private createFence(gl: WebGLRenderingContext): FenceContext {\n let isFencePassed: () => boolean;\n const gl2 = gl as WebGL2RenderingContext;\n const query = gl2.fenceSync(gl2.SYNC_GPU_COMMANDS_COMPLETE, 0);\n gl.flush();\n if (query === null) {\n isFencePassed = () => true;\n } else {\n isFencePassed = () => {\n const status = gl2.clientWaitSync(query, 0, 0);\n return status === gl2.ALREADY_SIGNALED || status === gl2.CONDITION_SATISFIED;\n };\n }\n return {query, isFencePassed};\n }\n\n async pollFence(fenceContext: FenceContext) {\n return new Promise(resolve => {\n void this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve());\n });\n }\n\n private itemsToPoll: PollItem[] = [];\n\n pollItems(): void {\n // Find the last query that has finished.\n const index = linearSearchLastTrue(this.itemsToPoll.map(x => x.isDoneFn));\n for (let i = 0; i <= index; ++i) {\n const {resolveFn} = this.itemsToPoll[i];\n resolveFn();\n }\n this.itemsToPoll = this.itemsToPoll.slice(index + 1);\n }\n\n private async addItemToPoll(isDoneFn: () => boolean, resolveFn: () => void) {\n this.itemsToPoll.push({isDoneFn, resolveFn});\n if (this.itemsToPoll.length > 1) {\n // We already have a running loop that polls.\n return;\n }\n // Start a new loop that polls.\n await repeatedTry(() => {\n this.pollItems();\n // End the loop if no more items to poll.\n return this.itemsToPoll.length === 0;\n });\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Logger} from '../../instrument';\n\nimport {WebGLContext} from './webgl-context';\n\nconst cache: {[contextId: string]: WebGLContext} = {};\n\n/**\n * This factory function creates proper WebGLRenderingContext based on\n * the current browsers capabilities\n * The order is from higher/most recent versions to most basic\n */\nexport function createWebGLContext(contextId?: 'webgl'|'webgl2'): WebGLContext {\n let context: WebGLContext|undefined;\n if ((!contextId || contextId === 'webgl2') && 'webgl2' in cache) {\n context = cache.webgl2;\n } else if ((!contextId || contextId === 'webgl') && 'webgl' in cache) {\n context = cache.webgl;\n }\n\n if (!context) {\n try {\n // try to create webgl context from an offscreen canvas\n const offscreenCanvas = createOffscreenCanvas();\n context = createNewWebGLContext(offscreenCanvas, contextId);\n } catch (e) {\n // if failed, fallback to try to use a normal canvas element\n const canvas = createCanvas();\n context = createNewWebGLContext(canvas, contextId);\n }\n }\n\n contextId = contextId || context.version === 1 ? 'webgl' : 'webgl2';\n const gl = context.gl;\n\n cache[contextId] = context;\n\n if (gl.isContextLost()) {\n delete cache[contextId];\n return createWebGLContext(contextId);\n }\n\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.STENCIL_TEST);\n gl.disable(gl.BLEND);\n gl.disable(gl.DITHER);\n gl.disable(gl.POLYGON_OFFSET_FILL);\n gl.disable(gl.SAMPLE_COVERAGE);\n gl.enable(gl.SCISSOR_TEST);\n gl.enable(gl.CULL_FACE);\n gl.cullFace(gl.BACK);\n\n return context;\n}\n\nexport function createNewWebGLContext(canvas: HTMLCanvasElement, contextId?: 'webgl'|'webgl2'): WebGLContext {\n const contextAttributes: WebGLContextAttributes = {\n alpha: false,\n depth: false,\n antialias: false,\n stencil: false,\n preserveDrawingBuffer: false,\n premultipliedAlpha: false,\n failIfMajorPerformanceCaveat: false\n };\n let gl: WebGLRenderingContext|null;\n const ca = contextAttributes;\n if (!contextId || contextId === 'webgl2') {\n gl = canvas.getContext('webgl2', ca);\n if (gl) {\n try {\n return new WebGLContext(gl, 2);\n } catch (err) {\n Logger.warning('GlContextFactory', `failed to create WebGLContext using contextId 'webgl2'. Error: ${err}`);\n }\n }\n }\n if (!contextId || contextId === 'webgl') {\n gl = canvas.getContext('webgl', ca) || canvas.getContext('experimental-webgl', ca) as WebGLRenderingContext;\n if (gl) {\n try {\n return new WebGLContext(gl, 1);\n } catch (err) {\n Logger.warning(\n 'GlContextFactory',\n `failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${err}`);\n }\n }\n }\n\n throw new Error('WebGL is not supported');\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare let OffscreenCanvas: {new (width: number, height: number): HTMLCanvasElement};\n\nfunction createCanvas(): HTMLCanvasElement {\n if (typeof document === 'undefined') {\n throw new TypeError('failed to create canvas: document is not supported');\n }\n const canvas: HTMLCanvasElement = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return canvas;\n}\n\nfunction createOffscreenCanvas(): HTMLCanvasElement {\n if (typeof OffscreenCanvas === 'undefined') {\n throw new TypeError('failed to create offscreen canvas: OffscreenCanvas is not supported');\n }\n return new OffscreenCanvas(1, 1);\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from 'onnxruntime-common';\n\nimport {Backend, SessionHandler} from '../backend';\nimport {Logger} from '../instrument';\nimport {Session} from '../session';\n\nimport {WebGLSessionHandler} from './webgl/session-handler';\nimport {WebGLContext} from './webgl/webgl-context';\nimport {createWebGLContext} from './webgl/webgl-context-factory';\n\n/**\n * WebGLBackend is the entry point for all WebGL opeartions\n * When it starts it created the WebGLRenderingContext\n * and other main framework components such as Program and Texture Managers\n */\nexport class WebGLBackend implements Backend {\n glContext: WebGLContext;\n\n get contextId(): 'webgl'|'webgl2'|undefined {\n return env.webgl.contextId;\n }\n set contextId(value: 'webgl'|'webgl2'|undefined) {\n env.webgl.contextId = value;\n }\n\n get matmulMaxBatchSize(): number|undefined {\n return env.webgl.matmulMaxBatchSize;\n }\n set matmulMaxBatchSize(value: number|undefined) {\n env.webgl.matmulMaxBatchSize = value;\n }\n\n get textureCacheMode(): 'initializerOnly'|'full'|undefined {\n return env.webgl.textureCacheMode;\n }\n set textureCacheMode(value: 'initializerOnly'|'full'|undefined) {\n env.webgl.textureCacheMode = value;\n }\n\n get pack(): boolean|undefined {\n return env.webgl.pack;\n }\n set pack(value: boolean|undefined) {\n env.webgl.pack = value;\n }\n\n get async(): boolean|undefined {\n return env.webgl.async;\n }\n set async(value: boolean|undefined) {\n env.webgl.async = value;\n }\n\n initialize(): boolean {\n try {\n this.glContext = createWebGLContext(this.contextId);\n if (typeof this.matmulMaxBatchSize !== 'number') {\n this.matmulMaxBatchSize = 16;\n }\n if (typeof this.textureCacheMode !== 'string') {\n this.textureCacheMode = 'full';\n }\n if (typeof this.pack !== 'boolean') {\n this.pack = false;\n }\n if (typeof this.async !== 'boolean') {\n this.async = false;\n }\n\n Logger.setWithEnv(env);\n\n if (!env.webgl.context) {\n Object.defineProperty(env.webgl, 'context', {value: this.glContext.gl});\n }\n\n Logger.verbose(\n 'WebGLBackend',\n `Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${\n this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${\n this.async}.`);\n return true;\n } catch (e) {\n Logger.warning('WebGLBackend', `Unable to initialize WebGLBackend. ${e}`);\n return false;\n }\n }\n createSessionHandler(context: Session.Context): SessionHandler {\n return new WebGLSessionHandler(this, context);\n }\n dispose(): void {\n this.glContext.dispose();\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {WebGLBackend} from './backends/backend-webgl';\nimport {Graph} from './graph';\nimport {Operator} from './operators';\nimport {OpSet} from './opset';\nimport {Session} from './session';\n\nexport interface InferenceHandler {\n /**\n * dispose the inference handler. it will be called as the last step in Session.run()\n */\n dispose(): void;\n}\n\nexport interface SessionHandler {\n /**\n * transform the graph at initialization time\n * @param graphTransformer the graph transformer to manipulate the model graph\n */\n transformGraph?(graphTransformer: Graph.Transformer): void;\n\n /**\n * create an instance of InferenceHandler to use in a Session.run() call\n */\n createInferenceHandler(): InferenceHandler;\n\n /**\n * dispose the session handler. it will be called when a session is being disposed explicitly\n */\n dispose(): void;\n\n /**\n * Resolves the operator from the name and opset version; backend specific\n * @param node the node to resolve\n * @param opsets a list of opsets that exported from the model\n * @param graph the completely initialized graph\n */\n resolve(node: Graph.Node, opsets: readonly OpSet[], graph: Graph): Operator;\n\n /**\n * This method let's the sessionHandler know that the graph initialization is complete\n * @param graph the completely initialized graph\n */\n onGraphInitialized?(graph: Graph): void;\n\n /**\n * a reference to the corresponding backend\n */\n readonly backend: Backend;\n\n /**\n * a reference to the session context\n */\n readonly context: Session.Context;\n}\n\nexport interface Backend {\n /**\n * initialize the backend. will be called only once, when the first time the\n * backend it to be used\n */\n initialize(): boolean|Promise;\n\n /**\n * create an instance of SessionHandler to use in a Session object's lifecycle\n */\n createSessionHandler(context: Session.Context): SessionHandler;\n\n /**\n * dispose the backend. currently this will not be called\n */\n dispose(): void;\n}\n\n// caches all initialized backend instances\nconst backendsCache: Map = new Map();\n\nexport const backend: {[name: string]: Backend} = {\n webgl: new WebGLBackend()\n};\n\n/**\n * Resolve a reference to the backend. If a hint is specified, the corresponding\n * backend will be used.\n */\nexport async function resolveBackend(hint?: string|readonly string[]): Promise {\n if (!hint) {\n return resolveBackend(['webgl']);\n } else {\n const hints = typeof hint === 'string' ? [hint] : hint;\n\n for (const backendHint of hints) {\n const cache = backendsCache.get(backendHint);\n if (cache) {\n return cache;\n }\n\n const backend = await tryLoadBackend(backendHint);\n if (backend) {\n return backend;\n }\n }\n }\n\n throw new Error('no available backend to use');\n}\n\nasync function tryLoadBackend(backendHint: string): Promise {\n const backendObj = backend;\n\n if (typeof backendObj[backendHint] !== 'undefined' && isBackend(backendObj[backendHint])) {\n const backend = backendObj[backendHint];\n let init = backend.initialize();\n if (typeof init === 'object' && 'then' in init) {\n init = await init;\n }\n if (init) {\n backendsCache.set(backendHint, backend);\n return backend;\n }\n }\n\n return undefined;\n}\n\nfunction isBackend(obj: unknown) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const o = obj as any;\n\n // check if an object is a Backend instance\n if (\n 'initialize' in o && typeof o.initialize === 'function' && // initialize()\n 'createSessionHandler' in o && typeof o.createSessionHandler === 'function' && // createSessionHandler()\n 'dispose' in o && typeof o.dispose === 'function' // dispose()\n ) {\n return true;\n }\n\n return false;\n}\n\nexport type BackendType = Backend;\nexport type SessionHandlerType = ReturnType;\nexport type InferenceHandlerType = ReturnType;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {SessionHandler} from './backend';\nimport {Graph} from './graph';\nimport {Logger, Profiler} from './instrument';\nimport {Operator} from './operators';\nimport {Tensor} from './tensor';\n\nclass KernelOp {\n constructor(public op: Operator, public node: Graph.Node) {}\n}\n\nexport class ExecutionPlan {\n constructor(private graph: Graph, ops: Operator[], private profiler: Readonly) {\n this.initialize(ops);\n }\n\n initialize(ops: Operator[]) {\n this.profiler.event('session', 'ExecutionPlan.initialize', () => {\n const graphNodes = this.graph.getNodes();\n if (graphNodes.length !== ops.length) {\n throw new Error('The size of nodes and OPs do not match.');\n }\n\n this._ops = ops.map((op, i) => new KernelOp(op, graphNodes[i]));\n this.reset();\n\n // look for starter node(s)\n this._starter = [];\n this._ops.forEach((op, i) => {\n let resolved = true;\n for (const input of op.node.inputs) {\n if (\n !this._values[input] // not an initialized input\n && this.graph.getInputIndices().indexOf(input) === -1 // not model input\n ) {\n resolved = false;\n break;\n }\n }\n if (resolved) {\n this._starter.push(i);\n }\n });\n });\n }\n\n reset() {\n this._values = this.graph.getValues().map(i => i.tensor);\n }\n\n async execute(sessionHandler: SessionHandler, modelInputs: Tensor[]): Promise {\n return this.profiler.event('session', 'ExecutionPlan.execute', async () => {\n // reset mediem result\n this.reset();\n\n // create inference handler\n const inferenceHandler = sessionHandler.createInferenceHandler();\n\n // populate inputs value\n const graphInputs = this.graph.getInputIndices();\n if (modelInputs.length !== graphInputs.length) {\n throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${\n modelInputs.length} expected: ${graphInputs.length}`);\n }\n\n modelInputs.forEach((input, i) => {\n const index = graphInputs[i];\n this._values[index] = input;\n });\n\n // prepare running sequence\n const sequence: number[] = this._starter.slice(0);\n\n // execution iterations\n const graphValues = this.graph.getValues();\n const graphNodes = this.graph.getNodes();\n\n let rear = 0;\n while (rear < sequence.length) {\n const thisOpIndex = sequence[rear++];\n const thisOp = this._ops[thisOpIndex];\n\n // check input\n const inputList = thisOp.node.inputs.map(i => this._values[i]);\n if (inputList.indexOf(undefined) !== -1) {\n throw new Error(`unresolved input detected: op: ${thisOp.node}`);\n }\n\n // run\n const inputTensors = inputList as Tensor[];\n Logger.verbose(\n 'ExecPlan',\n `Runing op:${thisOp.node.name} (${\n inputTensors.map((t, i) => `'${thisOp.node.inputs[i]}': ${t.type}[${t.dims.join(',')}]`).join(', ')})`);\n\n const outputList = await this.profiler.event(\n 'node', thisOp.node.name, async () => thisOp.op.impl(inferenceHandler, inputTensors, thisOp.op.context));\n\n // check output\n if (outputList.length !== thisOp.node.outputs.length) {\n throw new Error('the size of output does not match model definition.');\n }\n\n // fill value\n outputList.forEach((output, i) => {\n const j = thisOp.node.outputs[i];\n if (this._values[j]) {\n throw new Error(`output [${j}] already has value: op:${thisOp.node.name}`);\n }\n this._values[j] = output;\n });\n\n // resolve downstream nodes\n const downstreamNodes = new Set();\n outputList.forEach((_output, i) => {\n const j = thisOp.node.outputs[i];\n for (const currentDownstreamNodeIndex of graphValues[j].to) {\n const currentDownstreamNode = graphNodes[currentDownstreamNodeIndex];\n let resolved = true;\n for (const k of currentDownstreamNode.inputs) {\n if (!this._values[k]) {\n resolved = false;\n break;\n }\n }\n if (resolved) {\n downstreamNodes.add(currentDownstreamNodeIndex);\n }\n }\n });\n sequence.push(...downstreamNodes);\n }\n\n const output: Tensor[] = [];\n for (let i = 0; i < this.graph.getOutputIndices().length; i++) {\n const outputIndex = this.graph.getOutputIndices()[i];\n const outputTensor = this._values[outputIndex];\n if (outputTensor === undefined) {\n throw new Error(`required output [${outputIndex}] does not have value`);\n }\n if (outputIndex === 0) {\n await outputTensor.getData();\n } else {\n // eslint-disable-next-line no-unused-expressions\n outputTensor.data;\n }\n output.push(outputTensor);\n }\n Logger.verbose('ExecPlan', 'disposing of inferenceHandler');\n inferenceHandler.dispose();\n return output;\n });\n }\n\n _values: Array;\n _ops: KernelOp[];\n _starter: number[];\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport Long from 'long';\n\nimport {onnxruntime} from './ort-schema/flatbuffers/ort-generated';\nimport {onnx} from './ort-schema/protobuf/onnx';\nimport {Tensor} from './tensor';\nimport {decodeUtf8String, LongUtil} from './util';\n\nimport ortFbs = onnxruntime.experimental.fbs;\n\nexport declare namespace Attribute {\n export interface DataTypeMap {\n float: number;\n int: number;\n string: string;\n tensor: Tensor;\n floats: number[];\n ints: number[];\n strings: string[];\n tensors: Tensor[];\n }\n\n export type DataType = keyof DataTypeMap;\n}\n\ntype ValueTypes = Attribute.DataTypeMap[Attribute.DataType];\n\ntype Value = [ValueTypes, Attribute.DataType];\n\nexport class Attribute {\n constructor(attributes: onnx.IAttributeProto[]|ortFbs.Attribute[]|null|undefined) {\n this._attributes = new Map();\n if (attributes !== null && attributes !== undefined) {\n for (const attr of attributes) {\n if (attr instanceof onnx.AttributeProto) {\n this._attributes.set(attr.name, [Attribute.getValue(attr), Attribute.getType(attr)]);\n } else if (attr instanceof ortFbs.Attribute) {\n this._attributes.set(attr.name()!, [Attribute.getValue(attr), Attribute.getType(attr)]);\n }\n }\n if (this._attributes.size < attributes.length) {\n throw new Error('duplicated attribute names');\n }\n }\n }\n\n set(key: string, type: Attribute.DataType, value: ValueTypes): void {\n this._attributes.set(key, [value, type]);\n }\n delete(key: string): void {\n this._attributes.delete(key);\n }\n getFloat(key: string, defaultValue?: Attribute.DataTypeMap['float']) {\n return this.get(key, 'float', defaultValue);\n }\n\n getInt(key: string, defaultValue?: Attribute.DataTypeMap['int']) {\n return this.get(key, 'int', defaultValue);\n }\n\n getString(key: string, defaultValue?: Attribute.DataTypeMap['string']) {\n return this.get(key, 'string', defaultValue);\n }\n\n getTensor(key: string, defaultValue?: Attribute.DataTypeMap['tensor']) {\n return this.get(key, 'tensor', defaultValue);\n }\n\n getFloats(key: string, defaultValue?: Attribute.DataTypeMap['floats']) {\n return this.get(key, 'floats', defaultValue);\n }\n\n getInts(key: string, defaultValue?: Attribute.DataTypeMap['ints']) {\n return this.get(key, 'ints', defaultValue);\n }\n\n getStrings(key: string, defaultValue?: Attribute.DataTypeMap['strings']) {\n return this.get(key, 'strings', defaultValue);\n }\n\n getTensors(key: string, defaultValue?: Attribute.DataTypeMap['tensors']) {\n return this.get(key, 'tensors', defaultValue);\n }\n\n private get(\n key: string, type: Attribute.DataType, defaultValue?: V): V {\n const valueAndType = this._attributes.get(key);\n if (valueAndType === undefined) {\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n throw new Error(`required attribute not found: ${key}`);\n }\n if (valueAndType[1] !== type) {\n throw new Error(`type mismatch: expected ${type} but got ${valueAndType[1]}`);\n }\n return valueAndType[0] as V;\n }\n\n private static getType(attr: onnx.IAttributeProto|ortFbs.Attribute): Attribute.DataType {\n const type = attr instanceof onnx.AttributeProto ? (attr).type : (attr as ortFbs.Attribute).type();\n switch (type) {\n case onnx.AttributeProto.AttributeType.FLOAT:\n return 'float';\n case onnx.AttributeProto.AttributeType.INT:\n return 'int';\n case onnx.AttributeProto.AttributeType.STRING:\n return 'string';\n case onnx.AttributeProto.AttributeType.TENSOR:\n return 'tensor';\n case onnx.AttributeProto.AttributeType.FLOATS:\n return 'floats';\n case onnx.AttributeProto.AttributeType.INTS:\n return 'ints';\n case onnx.AttributeProto.AttributeType.STRINGS:\n return 'strings';\n case onnx.AttributeProto.AttributeType.TENSORS:\n return 'tensors';\n default:\n throw new Error(`attribute type is not supported yet: ${onnx.AttributeProto.AttributeType[type]}`);\n }\n }\n\n private static getValue(attr: onnx.IAttributeProto|ortFbs.Attribute) {\n const attrType = attr instanceof onnx.AttributeProto ? attr.type : (attr as ortFbs.Attribute).type();\n if (attrType === onnx.AttributeProto.AttributeType.GRAPH || attrType === onnx.AttributeProto.AttributeType.GRAPHS) {\n throw new Error('graph attribute is not supported yet');\n }\n\n const value = this.getValueNoCheck(attr);\n\n // cast LONG to number\n if (attrType === onnx.AttributeProto.AttributeType.INT && LongUtil.isLong(value)) {\n return LongUtil.longToNumber(value as Long | flatbuffers.Long);\n }\n\n // cast LONG[] to number[]\n if (attrType === onnx.AttributeProto.AttributeType.INTS) {\n const arr = (value as Array);\n const numberValue: number[] = new Array(arr.length);\n\n for (let i = 0; i < arr.length; i++) {\n const maybeLong = arr[i];\n numberValue[i] = LongUtil.longToNumber(maybeLong);\n }\n\n return numberValue;\n }\n\n // cast onnx.TensorProto to onnxjs.Tensor\n if (attrType === onnx.AttributeProto.AttributeType.TENSOR) {\n return attr instanceof onnx.AttributeProto ? Tensor.fromProto(value as onnx.ITensorProto) :\n Tensor.fromOrtTensor(value as ortFbs.Tensor);\n }\n\n // cast onnx.TensorProto[] to onnxjs.Tensor[]\n if (attrType === onnx.AttributeProto.AttributeType.TENSORS) {\n if (attr instanceof onnx.AttributeProto) {\n const tensorProtos = value as onnx.ITensorProto[];\n return tensorProtos.map(value => Tensor.fromProto(value));\n } else if (attr instanceof ortFbs.Attribute) {\n const tensorProtos = value as ortFbs.Tensor[];\n return tensorProtos.map(value => Tensor.fromOrtTensor(value));\n }\n }\n\n // cast Uint8Array to string\n if (attrType === onnx.AttributeProto.AttributeType.STRING) {\n // string in onnx attribute is of uint8array type, so we need to convert it to string below. While in ort format,\n // string attributes are returned as string, so no conversion is needed.\n if (attr instanceof onnx.AttributeProto) {\n const utf8String = value as Uint8Array;\n return decodeUtf8String(utf8String);\n }\n }\n\n // cast Uint8Array[] to string[]\n if (attrType === onnx.AttributeProto.AttributeType.STRINGS) {\n // strings in onnx attribute is returned as uint8array[], so we need to convert it to string[] below. While in ort\n // format strings attributes are returned as string[], so no conversion is needed.\n if (attr instanceof onnx.AttributeProto) {\n const utf8Strings = value as Uint8Array[];\n return utf8Strings.map(decodeUtf8String);\n }\n }\n\n return value as ValueTypes;\n }\n\n private static getValueNoCheck(attr: onnx.IAttributeProto|ortFbs.Attribute) {\n return attr instanceof (onnx.AttributeProto) ? this.getValueNoCheckFromOnnxFormat(attr) :\n this.getValueNoCheckFromOrtFormat(attr as ortFbs.Attribute);\n }\n\n private static getValueNoCheckFromOnnxFormat(attr: onnx.IAttributeProto) {\n switch (attr.type!) {\n case onnx.AttributeProto.AttributeType.FLOAT:\n return attr.f;\n case onnx.AttributeProto.AttributeType.INT:\n return attr.i;\n case onnx.AttributeProto.AttributeType.STRING:\n return attr.s;\n case onnx.AttributeProto.AttributeType.TENSOR:\n return attr.t;\n case onnx.AttributeProto.AttributeType.GRAPH:\n return attr.g;\n case onnx.AttributeProto.AttributeType.FLOATS:\n return attr.floats;\n case onnx.AttributeProto.AttributeType.INTS:\n return attr.ints;\n case onnx.AttributeProto.AttributeType.STRINGS:\n return attr.strings;\n case onnx.AttributeProto.AttributeType.TENSORS:\n return attr.tensors;\n case onnx.AttributeProto.AttributeType.GRAPHS:\n return attr.graphs;\n default:\n throw new Error(`unsupported attribute type: ${onnx.AttributeProto.AttributeType[attr.type!]}`);\n }\n }\n\n private static getValueNoCheckFromOrtFormat(attr: ortFbs.Attribute) {\n switch (attr.type()) {\n case ortFbs.AttributeType.FLOAT:\n return attr.f();\n case ortFbs.AttributeType.INT:\n return attr.i();\n case ortFbs.AttributeType.STRING:\n return attr.s();\n case ortFbs.AttributeType.TENSOR:\n return attr.t();\n case ortFbs.AttributeType.GRAPH:\n return attr.g();\n case ortFbs.AttributeType.FLOATS:\n return attr.floatsArray();\n case ortFbs.AttributeType.INTS: {\n const ints = [];\n for (let i = 0; i < attr.intsLength(); i++) {\n ints.push(attr.ints(i)!);\n }\n return ints;\n }\n case ortFbs.AttributeType.STRINGS: {\n const strings = [];\n for (let i = 0; i < attr.stringsLength(); i++) {\n strings.push(attr.strings(i));\n }\n return strings;\n }\n case ortFbs.AttributeType.TENSORS: {\n const tensors = [];\n for (let i = 0; i < attr.tensorsLength(); i++) {\n tensors.push(attr.tensors(i)!);\n }\n return tensors;\n }\n // case ortFbs.AttributeType.GRAPHS:\n // TODO: Subgraph not supported yet.\n // const graphs = [];\n // for (let i = 0; i < attr.graphsLength(); i++) {\n // graphs.push(attr.graphs(i)!);\n // }\n // return graphs;\n default:\n throw new Error(`unsupported attribute type: ${ortFbs.AttributeType[attr.type()]}`);\n }\n }\n\n protected _attributes: Map;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Attribute} from './attribute';\nimport {onnxruntime} from './ort-schema/flatbuffers/ort-generated';\nimport {onnx} from './ort-schema/protobuf/onnx';\nimport {Tensor} from './tensor';\nimport {LongUtil, MAX_CLIP, MIN_CLIP, ProtoUtil} from './util';\n\nimport ortFbs = onnxruntime.experimental.fbs;\n\nexport declare namespace Graph {\n export interface Shape {\n readonly dims: readonly number[];\n }\n export interface ValueType {\n readonly tensorType: Tensor.DataType;\n readonly shape: Shape;\n }\n export interface Value {\n // the tensor data. empty for non-initialized inputs\n readonly tensor?: Tensor;\n\n // index to the Node where the value comes from. -1 for initializer.\n readonly from: number;\n\n // indices to the Nodes where the values go to.\n readonly to: readonly number[];\n\n // value type specification. empty for non-input values.\n readonly type?: ValueType;\n }\n export interface Node {\n // name of the node\n readonly name: string;\n\n // the operator type\n readonly opType: string;\n\n // indices to the Values where the inputs come from.\n readonly inputs: readonly number[];\n\n // indices to the Values where the outpus go to.\n readonly outputs: readonly number[];\n\n // the attributes that used by the operator\n readonly attributes: Attribute;\n }\n\n /**\n * a Transformer is an instance that allows all possible transformation operations that applied to a graph\n */\n export interface Transformer {\n removeAllIdentityNodes(): void;\n removeAllDropoutNodes(): void;\n fuseConvActivationNodes(): void;\n // TODO: add generic functions to manipulate the graph\n }\n\n // an initializer can use transformer to transform the graph\n export interface Initializer {\n transformGraph(transformer: Transformer): void;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport interface Graph {\n getInputIndices(): readonly number[];\n getInputNames(): readonly string[];\n getOutputIndices(): readonly number[];\n getOutputNames(): readonly string[];\n getValues(): readonly Graph.Value[];\n getNodes(): readonly Graph.Node[];\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-redeclare\nexport const Graph = {\n /**\n * construct a graph from a graph protobuf type\n */\n from: (graphProto: onnx.IGraphProto|ortFbs.Graph, initializer?: Graph.Initializer) =>\n new GraphImpl(graphProto, initializer),\n};\n\nclass Value implements Graph.Value {\n constructor(valueInfo?: onnx.IValueInfoProto) {\n this._from = undefined;\n this._to = [];\n this.tensor = undefined;\n this.type = undefined;\n\n if (valueInfo) {\n this.type = ProtoUtil.tensorValueTypeFromProto(valueInfo.type!.tensorType!);\n }\n }\n\n _from?: number; // -1 represent from initializer\n get from() {\n return this._from!;\n }\n _to: number[];\n get to() {\n return this._to;\n }\n type?: Graph.ValueType;\n tensor?: Tensor;\n}\n\nclass Node implements Graph.Node {\n constructor(_nodeProto: onnx.INodeProto|ortFbs.Node, name?: string) {\n if (_nodeProto instanceof onnx.NodeProto) {\n this.name = _nodeProto.name;\n this.opType = _nodeProto.opType;\n this.attributes = new Attribute(_nodeProto.attribute);\n } else if (_nodeProto instanceof ortFbs.Node) {\n this.name = name ?? _nodeProto.name()!;\n this.opType = _nodeProto.opType()!;\n this.attributes = new Attribute(ProtoUtil.tensorAttributesFromORTFormat(_nodeProto));\n }\n\n this.inputs = [];\n this.outputs = [];\n this.executeNode = true;\n }\n\n name: string;\n opType: string;\n inputs: number[];\n outputs: number[];\n attributes: Attribute;\n executeNode: boolean;\n}\n\nclass GraphImpl implements Graph, Graph.Transformer {\n private _allData: Value[];\n\n private _allInputIndices: number[];\n private _allInputNames: string[];\n\n private _allOutputIndices: number[];\n private _allOutputNames: string[];\n\n private _nodes: Node[];\n\n constructor(graph: onnx.IGraphProto|ortFbs.Graph, graphInitializer?: Graph.Initializer) {\n if (!graph) {\n throw new TypeError('graph is empty');\n }\n\n // build the graph - will throw exceptions if something fatal is detected\n this.buildGraph(graph);\n\n // execute any transformation logic for the graph (if applicable)\n this.transformGraph(graphInitializer);\n\n // check for cycles and other inconsistencies - will throw exceptions if something fatal is detected\n this.checkIsAcyclic();\n }\n\n getInputIndices(): readonly number[] {\n return this._allInputIndices;\n }\n\n getInputNames(): readonly string[] {\n return this._allInputNames;\n }\n\n getOutputIndices(): readonly number[] {\n return this._allOutputIndices;\n }\n\n getOutputNames(): readonly string[] {\n return this._allOutputNames;\n }\n\n getValues(): readonly Graph.Value[] {\n return this._allData;\n }\n\n getNodes(): readonly Graph.Node[] {\n return this._nodes;\n }\n\n private buildGraph(graph: onnx.IGraphProto|ortFbs.Graph) {\n // build the graph - will throw exceptions if something fatal is detected\n if (graph instanceof onnx.GraphProto) {\n this.buildGraphFromOnnxFormat(graph);\n } else if (graph instanceof ortFbs.Graph) {\n this.buildGraphFromOrtFormat(graph);\n } else {\n throw new TypeError('Graph type is not supported.');\n }\n }\n private buildGraphFromOnnxFormat(graph: onnx.IGraphProto) {\n const dataIndices = new Map();\n this._allData = [];\n\n this._allInputIndices = [];\n this._allInputNames = [];\n\n this._allOutputIndices = [];\n this._allOutputNames = [];\n\n this._nodes = [];\n\n const nodesIndices = new Map();\n\n // scan all inputs\n if (!graph.input) {\n throw new Error('missing information in graph: input');\n }\n const inputValueNames = [];\n for (const i of graph.input) {\n if (dataIndices.has(i.name!)) {\n throw new Error(`duplicated input name: ${i.name}`);\n }\n const currentIndex = this._allData.push(new Value(i)) - 1;\n dataIndices.set(i.name!, currentIndex);\n inputValueNames.push(i.name!);\n }\n\n // scan all initializers\n if (!graph.initializer) {\n throw new Error('missing information in graph: initializer');\n }\n for (const i of graph.initializer) {\n let index = dataIndices.get(i.name!);\n if (index === undefined) {\n const value = new Value();\n value.type = {\n shape: {dims: ProtoUtil.tensorDimsFromProto(i.dims!)},\n tensorType: ProtoUtil.tensorDataTypeFromProto(i.dataType!)\n };\n index = this._allData.push(value) - 1;\n dataIndices.set(i.name!, index);\n }\n this._allData[index]._from = -1;\n this._allData[index].tensor = Tensor.fromProto(i);\n }\n\n // filter out input indices\n for (let i = 0; i < this._allData.length; i++) {\n if (!this._allData[i].tensor) {\n this._allInputIndices.push(i);\n this._allInputNames.push(inputValueNames[i]);\n }\n }\n\n // scan all outputs\n if (!graph.output) {\n throw new Error('missing information in graph: output');\n }\n for (const i of graph.output) {\n if (dataIndices.has(i.name!)) {\n throw new Error(`duplicated output name: ${i.name}`);\n }\n const currentIndex = this._allData.push(new Value(i)) - 1;\n dataIndices.set(i.name!, currentIndex);\n this._allOutputIndices.push(currentIndex);\n this._allOutputNames.push(i.name!);\n }\n\n // scan all nodes\n if (!graph.node) {\n throw new Error('missing information in graph: node');\n }\n for (const nodeProto of graph.node) {\n if (!nodeProto.name) {\n // assign a name to the node if it doesn't have one\n for (let pick = 0;; pick++) {\n const name = `unnamed_${nodeProto.opType}_${pick}`;\n if (!nodesIndices.has(name)) {\n nodeProto.name = name;\n break;\n }\n }\n }\n\n if (nodesIndices.has(nodeProto.name)) {\n throw new Error(`duplicated node name: ${nodeProto.name}`);\n }\n const currentIndex = this._nodes.push(new Node(nodeProto)) - 1;\n nodesIndices.set(nodeProto.name, currentIndex);\n }\n\n // scan node's outputs\n for (let i = 0; i < this._nodes.length; i++) {\n const node = this._nodes[i];\n const nodeProto = graph.node[i];\n if (!nodeProto.output) {\n throw new Error(`missing output for node: ${nodeProto.name}`);\n }\n for (const output of nodeProto.output) {\n let dataIndex = dataIndices.get(output);\n if (typeof dataIndex === 'undefined') {\n dataIndex = this._allData.push(new Value()) - 1;\n dataIndices.set(output, dataIndex);\n }\n node.outputs.push(dataIndex);\n\n if (this._allData[dataIndex]._from !== undefined) {\n throw new Error(`multiple nodes output to one data value: ${dataIndex}`);\n }\n this._allData[dataIndex]._from = i;\n\n // for the 'Constant' operator, just create a new edge in the graph corresponding to the 'output' of the\n // operator and ignore the node from the graph\n if (nodeProto.opType === 'Constant') {\n if (!nodeProto.attribute || nodeProto.attribute.length !== 1 || !nodeProto.attribute[0].t) {\n throw new Error('missing attributes or missing tensor value in attributes for this Constant operator');\n }\n if (!nodeProto.output || nodeProto.output.length !== 1) {\n throw new Error('missing output or incorrect number of outputs for this Constant operator');\n }\n node.outputs.pop();\n node.executeNode = false;\n\n this._allData[dataIndex]._from = -1;\n this._allData[dataIndex].tensor = Tensor.fromProto(nodeProto.attribute[0].t);\n }\n }\n }\n\n // scan node's inputs\n for (let i = 0; i < this._nodes.length; i++) {\n const node = this._nodes[i];\n const nodeProto = graph.node[i];\n\n if (!nodeProto.input) {\n throw new Error(`missing input for node: ${nodeProto.name}`);\n }\n for (const input of nodeProto.input) {\n const dataIndex = dataIndices.get(input);\n if (typeof dataIndex === 'undefined') {\n // handle exception when opset > 9 and roi / scales not given\n if (input === '' && (nodeProto.input.length === 3 || nodeProto.input.length === 4) &&\n nodeProto.opType === 'Resize') {\n continue;\n }\n throw new Error(`unrecognized input '${input}' for node: ${nodeProto.name}`);\n }\n node.inputs.push(dataIndex);\n\n this._allData[dataIndex]._to.push(i);\n }\n }\n\n return true;\n }\n\n private buildGraphFromOrtFormat(graph: ortFbs.Graph) {\n const dataIndices = new Map();\n this._allData = [];\n\n this._allInputIndices = [];\n this._allInputNames = [];\n\n this._allOutputIndices = [];\n this._allOutputNames = [];\n\n this._nodes = [];\n\n const nodesIndices = new Map();\n\n // scan all inputs\n const inputValueNames = [];\n for (let i = 0; i < graph.inputsLength(); i++) {\n const inputName = graph.inputs(i);\n if (dataIndices.has(inputName)) {\n throw new Error(`duplicated input name: ${inputName}`);\n }\n // Find the input typeInfo from nodeargs\n for (let j = 0; j < graph.nodeArgsLength(); j++) {\n if (graph.nodeArgs(j)?.name() === inputName) {\n const value = new Value();\n const valueType = graph.nodeArgs(j)?.type()?.valueType();\n if (valueType !== ortFbs.TypeInfoValue.tensor_type) {\n throw new Error('Unexpected value type for the nodeArg.');\n }\n const valueInfo = graph.nodeArgs(j)!.type()!.value(new ortFbs.TensorTypeAndShape())!;\n const type = ProtoUtil.tensorDataTypeFromProto(valueInfo.elemType());\n const shape = valueInfo.shape()!;\n const dims = [];\n for (let k = 0; k < shape.dimLength()!; k++) {\n dims.push(LongUtil.longToNumber(shape.dim(k)!.value()!.dimValue()!));\n }\n value.type = {shape: {dims}, tensorType: type};\n const currentIndex = this._allData.push(value) - 1;\n dataIndices.set(inputName, currentIndex);\n inputValueNames.push(inputName);\n }\n }\n }\n // check initializers\n for (let i = 0; i < graph.initializersLength(); i++) {\n const initializer = graph.initializers(i)!;\n let index = dataIndices.get(initializer.name()!);\n if (index === undefined) {\n const value = new Value();\n const dims = ProtoUtil.tensorDimsFromORTFormat(initializer);\n const type = ProtoUtil.tensorDataTypeFromProto(initializer.dataType());\n value.type = {shape: {dims}, tensorType: type};\n index = this._allData.push(value) - 1;\n dataIndices.set(initializer.name()!, index);\n }\n this._allData[index]._from = -1;\n this._allData[index].tensor = Tensor.fromOrtTensor(initializer);\n }\n\n // filter out input indices\n for (let i = 0; i < this._allData.length; i++) {\n if (!this._allData[i].tensor) {\n this._allInputIndices.push(i);\n this._allInputNames.push(inputValueNames[i]);\n }\n }\n\n // scan all outputs\n for (let i = 0; i < graph.outputsLength(); i++) {\n const outputName = graph.outputs(i);\n if (dataIndices.has(outputName)) {\n throw new Error(`duplicated output name: ${outputName}`);\n }\n const currentIndex = this._allData.push(new Value()) - 1;\n dataIndices.set(outputName, currentIndex);\n this._allOutputIndices.push(currentIndex);\n this._allOutputNames.push(outputName);\n }\n\n // scan all nodes\n if (!graph.nodes) {\n throw new Error('missing information in graph: node');\n }\n for (let i = 0; i < graph.nodesLength(); i++) {\n const nodeProto = graph.nodes(i);\n let name = nodeProto!.name();\n if (!name) {\n // assign a name to the node if it doesn't have one\n for (let pick = 0;; pick++) {\n name = `unnamed_${nodeProto!.opType()}_${pick}`;\n if (!nodesIndices.has(name)) {\n // an unique name is found. break.\n break;\n }\n }\n }\n\n if (nodesIndices.has(name)) {\n throw new Error(`duplicated node name: ${name}`);\n }\n const currentIndex = this._nodes.push(new Node(nodeProto!, name)) - 1;\n nodesIndices.set(name, currentIndex);\n }\n\n // scan node's outputs\n for (let i = 0; i < this._nodes.length; i++) {\n const node = this._nodes[i];\n const nodeProto = graph.nodes(i);\n if (nodeProto == null) {\n throw new Error(`No node exists at index ${i}`);\n }\n if (nodeProto?.outputsLength() === 0) {\n throw new Error(`missing output for node: ${nodeProto.name}`);\n }\n for (let j = 0; j < nodeProto?.outputsLength(); j++) {\n const output = nodeProto?.outputs(j);\n let dataIndex = dataIndices.get(output);\n if (typeof dataIndex === 'undefined') {\n dataIndex = this._allData.push(new Value()) - 1;\n dataIndices.set(output, dataIndex);\n }\n node.outputs.push(dataIndex);\n\n if (this._allData[dataIndex]._from !== undefined) {\n throw new Error(`multiple nodes output to one data value: ${dataIndex}`);\n }\n this._allData[dataIndex]._from = i;\n\n // for the 'Constant' operator, just create a new edge in the graph corresponding to the 'output' of the\n // operator and ignore the node from the graph\n if (nodeProto.opType() === 'Constant') {\n if (nodeProto.attributesLength() !== 1 || !nodeProto.attributes(0)!.t()) {\n throw new Error('missing attributes or missing tensor value in attributes for this Constant operator');\n }\n if (nodeProto.outputsLength() !== 1) {\n throw new Error('missing output or incorrect number of outputs for this Constant operator');\n }\n node.outputs.pop();\n node.executeNode = false;\n\n this._allData[dataIndex]._from = -1;\n this._allData[dataIndex].tensor = Tensor.fromOrtTensor(nodeProto.attributes(0)!.t()!);\n }\n }\n }\n\n // scan node's inputs\n for (let i = 0; i < this._nodes.length; i++) {\n const node = this._nodes[i];\n const nodeProto = graph.nodes(i)!;\n\n if (nodeProto.inputsLength() === 0) {\n throw new Error(`missing input for node: ${nodeProto.name}`);\n }\n for (let j = 0; j < nodeProto.inputsLength()!; j++) {\n const input = nodeProto.inputs(j)!;\n const dataIndex = dataIndices.get(input);\n if (typeof dataIndex === 'undefined') {\n throw new Error(`unrecognized input '${input}' for node: ${nodeProto!.name()}`);\n }\n node.inputs.push(dataIndex);\n\n this._allData[dataIndex]._to.push(i);\n }\n }\n }\n\n private checkIsAcyclic() {\n // go through the graph and check for cycles or other fatal inconsistencies\n const starters: Set = new Set();\n this._allInputIndices.forEach(i => {\n const data = this._allData[i];\n data._to.forEach(j => {\n starters.add(j);\n });\n });\n\n // Iterative DFS to check for cycles\n const nodesStack = Array.from(starters);\n const nodesState = new Array(this._nodes.length).fill('white');\n\n while (nodesStack.length > 0) {\n const nodeIndex = nodesStack.pop()!;\n // this node has now been processed completely. Mark this node 'black' to denote this.\n if (nodesState[nodeIndex] === 'gray') {\n nodesState[nodeIndex] = 'black';\n } else {\n // this node is under processing stage. mark this node 'gray' to denote this.\n nodesStack.push(nodeIndex);\n nodesState[nodeIndex] = 'gray';\n\n this._nodes[nodeIndex].outputs.forEach((outgoingEdgeIndex) => {\n const data = this._allData[outgoingEdgeIndex];\n if (typeof data.tensor !== 'undefined') {\n throw new Error('node outputs should not be initialized');\n }\n if (data._from !== nodeIndex) {\n throw new Error('from property of the Value object doesn\\'t match index of Node being processed');\n }\n data._to.forEach((downstreamNodeIndex) => {\n // back edge found - cyclic\n if (nodesState[downstreamNodeIndex] === 'gray') {\n throw new Error('model graph is cyclic');\n }\n // tree edge found - continue processing by adding it to stack\n else if (nodesState[downstreamNodeIndex] === 'white') {\n nodesStack.push(downstreamNodeIndex);\n }\n });\n });\n }\n }\n }\n\n private transformGraph(graphInitializer?: Graph.Initializer): void {\n // apply common transform\n this.removeAllIdentityNodes();\n this.removeAllDropoutNodes();\n this.fuseConvActivationNodes();\n // apply initializer specific transform\n if (graphInitializer) {\n graphInitializer.transformGraph(this);\n }\n\n // finalize graph\n this.finalizeGraph();\n }\n\n /**\n * finalize the graph.\n *\n * this function should be called after all the transformation completed.\n * this function removes all unnecessary nodes and values from the graph\n */\n finalizeGraph() {\n let offset = 0;\n // delete all nodes that are not being executed\n // The graph is represented using these two arrays\n // this._nodes - Array holding the kernels to execute - each entry is a kernel pointing to this._allData\n // this._allData - hold 2 fields - to [] & from - these feileds hold the graph map for inputs and outputs per node\n // newIndices - remapping the graph after reading the flag 'executeNode'\n const newIndices = new Array(this._nodes.length, 0);\n let nodePossition = 0;\n\n for (let i = 0; i < this._nodes.length; i++) {\n // giving new indexes to the nodes based on execution flag\n newIndices[i] = nodePossition;\n if (this._nodes[i].executeNode) {\n if (nodePossition !== i) {\n this._nodes[nodePossition] = this._nodes[i];\n }\n nodePossition++;\n\n } else {\n // delete all output values\n this._nodes[i].outputs.forEach(ind => {\n this._allData[ind]._from = -2;\n });\n }\n }\n\n // removing the unused nodes\n this._nodes.splice(nodePossition, this._nodes.length - nodePossition);\n\n // Updating this._allData according to the new this._nodes\n for (let i = 0; i < this._allData.length; i++) {\n const currentData = this._allData[i];\n if (currentData._from !== undefined && currentData._from !== -1 && currentData._from !== -2) {\n currentData._from = newIndices[currentData._from];\n }\n\n for (let j = 0; j < currentData._to.length; j++) {\n if (currentData._to[j] >= 0) {\n currentData._to[j] = newIndices[currentData._to[j]];\n } else {\n throw new Error('Trying to update a removed node');\n }\n }\n }\n\n offset = 0;\n // delete all values that are not being referenced\n for (let i = 0; i < this._allData.length; i++) {\n // if current value is neither linked to next node, nor an output value, remove it.\n if (this._allData[i].from === -2 && this._allOutputIndices.indexOf(i + offset) === -1) {\n offset++;\n this._allData.splice(i, 1);\n i--;\n continue;\n }\n if (offset > 0) {\n let ind = -1;\n // if current value is neither an input value nor an initializer, find the node it's\n // coming from and update the corresponding node output\n if (this._allData[i].from !== undefined && this._allData[i].from !== -1) {\n ind = this._nodes[this._allData[i].from].outputs.indexOf(i + offset);\n if (ind !== -1) {\n this._nodes[this._allData[i].from].outputs[ind] = i;\n }\n } else {\n // if current value is an input value, update its reference in inputIndices\n ind = this._allInputIndices.indexOf(i + offset);\n if (ind !== -1) {\n this._allInputIndices[ind] = i;\n }\n }\n\n // find the node that the current value is linking to and update its input reference\n this._allData[i].to.forEach(node => {\n ind = this._nodes[node].inputs.indexOf(i + offset);\n if (ind !== -1) {\n this._nodes[node].inputs[ind] = i;\n }\n });\n if (this._allData[i].to.length === 0) {\n // if current value is a graph output, update its reference in outputIndices\n ind = this._allOutputIndices.indexOf(i + offset);\n if (ind !== -1) {\n this._allOutputIndices[ind] = i;\n }\n }\n }\n }\n }\n\n /**\n * Delete the specifed node. Assume the node has one incoming input and the first output connected to other nodes.\n * An input validation must be done before calling this function.\n * @param nodeIndex The index of node to be deleted\n */\n private deleteNode(nodeIndex: number) {\n const node = this._nodes[nodeIndex];\n if (node.outputs.length > 1) {\n for (let i = 1; i < node.outputs.length; i++) {\n if (this._allData[node.outputs[i]].to.length > 0) {\n throw new Error('Node deletion with more than one output connected to other nodes is not supported. ');\n }\n }\n }\n\n // this node wil not be executed\n node.executeNode = false;\n const inputValueIndex = node.inputs[0];\n const outputValueIndex = node.outputs[0];\n const nodesConsumingOutput = this._allData[outputValueIndex].to;\n\n // remove this node from the to property of the input Value\n for (let i = 0; i < node.inputs.length; i++) {\n const delIndex = this._allData[node.inputs[i]].to.indexOf(nodeIndex);\n // should not happen\n if (delIndex === -1) {\n throw new Error('The Value object doesn\\'t have the current Node in it\\'s \\'to\\' property ');\n }\n this._allData[node.inputs[i]].to.splice(delIndex, 1);\n }\n\n // clear node indices consuming this output Value\n this._allData[outputValueIndex]._to = [];\n\n // if the output of this node is a graph output, adjust the index appropriately\n const index = this._allOutputIndices.indexOf(outputValueIndex);\n if (index !== -1) {\n this._allOutputIndices[index] = inputValueIndex;\n }\n\n // override the inputs for nodes consuming this node's output with the input to this node\n if (nodesConsumingOutput && nodesConsumingOutput.length > 0) {\n for (const nodeIndex of nodesConsumingOutput) {\n const replaceIndex = this._nodes[nodeIndex].inputs.indexOf(outputValueIndex);\n // should not happen\n if (replaceIndex === -1) {\n throw new Error('The Node object doesn\\'t have the output Value in it\\'s \\'inputs\\' property ');\n }\n this._nodes[nodeIndex].inputs[replaceIndex] = inputValueIndex;\n this._allData[inputValueIndex].to.push(nodeIndex);\n }\n }\n }\n\n removeAllDropoutNodes() {\n let nodeIndex = 0;\n for (const node of this._nodes) {\n // weed out 'Dropout' nodes so that no time is wasted in execution\n if (node.opType === 'Dropout') {\n // the node should have exactly 1 input and 1 or 2 outputs\n if (node.inputs.length !== 1) {\n throw new Error('Dropout nodes should only contain one input. ');\n }\n if (node.outputs.length !== 1 && node.outputs.length !== 2) {\n throw new Error('Dropout nodes should contain either 1 or 2 output(s)');\n }\n // the second output should not be referenced by any other node\n if (node.outputs.length === 2 && this._allData[node.outputs[1]]._to.length !== 0) {\n throw new Error('Dropout nodes\\'s second output should not be referenced by other nodes');\n }\n this.deleteNode(nodeIndex);\n }\n nodeIndex++;\n }\n }\n\n removeAllIdentityNodes() {\n let nodeIndex = 0;\n for (const node of this._nodes) {\n // weed out 'Identity' nodes so that no time is wasted in execution\n if (node.opType === 'Identity') {\n this.deleteNode(nodeIndex);\n }\n nodeIndex++;\n }\n }\n\n isActivation(n: Node): boolean {\n switch (n.opType) {\n // TODO: add other activation methods\n case 'Relu':\n case 'Sigmoid':\n case 'Clip':\n return true;\n default:\n return false;\n }\n }\n\n fuseConvActivationNodes() {\n for (const node of this._nodes) {\n if (node.opType === 'Conv') {\n const next = this._allData[node.outputs[0]]._to;\n if (next.length === 1 && this.isActivation(this._nodes[next[0]])) {\n const child = this._nodes[next[0]];\n if (child.opType === 'Clip') {\n if (child.inputs.length === 1) {\n try {\n node.attributes.set(\n 'activation_params', 'floats',\n [child.attributes.getFloat('min'), child.attributes.getFloat('max')]);\n } catch (e) {\n node.attributes.set('activation_params', 'floats', [MIN_CLIP, MAX_CLIP]);\n }\n } else if (\n child.inputs.length >= 3 && this._allData[child.inputs[1]].tensor !== undefined &&\n this._allData[child.inputs[2]].tensor !== undefined) {\n node.attributes.set('activation_params', 'floats', [\n this._allData[child.inputs[1]].tensor!.floatData[0], this._allData[child.inputs[2]].tensor!.floatData[0]\n ]);\n } else {\n // Skip fusion with clip node since clip min and clip max are not coming from initializer\n continue;\n }\n }\n node.attributes.set('activation', 'string', (child.opType));\n this.deleteNode(next[0]);\n }\n }\n }\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {flatbuffers} from 'flatbuffers';\n\nimport {Graph} from './graph';\nimport {OpSet} from './opset';\nimport {onnxruntime} from './ort-schema/flatbuffers/ort-generated';\nimport {onnx} from './ort-schema/protobuf/onnx';\nimport {LongUtil} from './util';\n\nimport ortFbs = onnxruntime.experimental.fbs;\n\nexport class Model {\n // empty model\n constructor() {}\n\n load(buf: Uint8Array, graphInitializer?: Graph.Initializer, isOrtFormat?: boolean): void {\n let onnxError: Error|undefined;\n if (!isOrtFormat) {\n // isOrtFormat === false || isOrtFormat === undefined\n try {\n this.loadFromOnnxFormat(buf, graphInitializer);\n return;\n } catch (e) {\n if (isOrtFormat !== undefined) {\n throw e;\n }\n onnxError = e;\n }\n }\n\n try {\n this.loadFromOrtFormat(buf, graphInitializer);\n } catch (e) {\n if (isOrtFormat !== undefined) {\n throw e;\n }\n // Tried both formats and failed (when isOrtFormat === undefined)\n throw new Error(`Failed to load model as ONNX format: ${onnxError}\\nas ORT format: ${e}`);\n }\n }\n\n private loadFromOnnxFormat(buf: Uint8Array, graphInitializer?: Graph.Initializer): void {\n const modelProto = onnx.ModelProto.decode(buf);\n const irVersion = LongUtil.longToNumber(modelProto.irVersion);\n if (irVersion < 3) {\n throw new Error('only support ONNX model with IR_VERSION>=3');\n }\n\n this._opsets =\n modelProto.opsetImport.map(i => ({domain: i.domain as string, version: LongUtil.longToNumber(i.version!)}));\n\n this._graph = Graph.from(modelProto.graph!, graphInitializer);\n }\n\n private loadFromOrtFormat(buf: Uint8Array, graphInitializer?: Graph.Initializer): void {\n const fb = new flatbuffers.ByteBuffer(buf);\n const ortModel = ortFbs.InferenceSession.getRootAsInferenceSession(fb).model()!;\n const irVersion = LongUtil.longToNumber(ortModel.irVersion());\n if (irVersion < 3) {\n throw new Error('only support ONNX model with IR_VERSION>=3');\n }\n this._opsets = [];\n for (let i = 0; i < ortModel.opsetImportLength(); i++) {\n const opsetId = ortModel.opsetImport(i)!;\n this._opsets.push({domain: opsetId?.domain() as string, version: LongUtil.longToNumber(opsetId.version()!)});\n }\n\n this._graph = Graph.from(ortModel.graph()!, graphInitializer);\n }\n\n private _graph: Graph;\n get graph(): Graph {\n return this._graph;\n }\n\n private _opsets: OpSet[];\n get opsets(): readonly OpSet[] {\n return this._opsets;\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {readFile} from 'node:fs/promises';\n\nimport {resolveBackend, SessionHandlerType} from './backend';\nimport {ExecutionPlan} from './execution-plan';\nimport {Graph} from './graph';\nimport {Profiler} from './instrument';\nimport {Model} from './model';\nimport {Operator} from './operators';\nimport {Tensor} from './tensor';\n\nexport declare namespace Session {\n export interface Config {\n backendHint?: string;\n profiler?: Profiler.Config;\n }\n\n export interface Context {\n profiler: Readonly;\n graphInputTypes?: Tensor.DataType[];\n graphInputDims?: Array;\n }\n}\n\nexport class Session {\n constructor(config: Session.Config = {}) {\n this._initialized = false;\n this.backendHint = config.backendHint;\n this.profiler = Profiler.create(config.profiler);\n this.context = {profiler: this.profiler, graphInputTypes: [], graphInputDims: []};\n }\n\n get inputNames(): readonly string[] {\n return this._model.graph.getInputNames();\n }\n get outputNames(): readonly string[] {\n return this._model.graph.getOutputNames();\n }\n\n startProfiling() {\n this.profiler.start();\n }\n\n endProfiling() {\n this.profiler.stop();\n }\n\n async loadModel(uri: string): Promise;\n async loadModel(buffer: ArrayBuffer, byteOffset?: number, length?: number): Promise;\n async loadModel(buffer: Uint8Array): Promise;\n async loadModel(arg: string|ArrayBuffer|Uint8Array, byteOffset?: number, length?: number): Promise {\n await this.profiler.event('session', 'Session.loadModel', async () => {\n // resolve backend and session handler\n const backend = await resolveBackend(this.backendHint);\n this.sessionHandler = backend.createSessionHandler(this.context);\n\n this._model = new Model();\n if (typeof arg === 'string') {\n const isOrtFormat = arg.endsWith('.ort');\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // node\n const buf = await readFile(arg);\n this.initialize(buf, isOrtFormat);\n } else {\n // browser\n const response = await fetch(arg);\n const buf = await response.arrayBuffer();\n this.initialize(new Uint8Array(buf), isOrtFormat);\n }\n } else if (!ArrayBuffer.isView(arg)) {\n // load model from ArrayBuffer\n const arr = new Uint8Array(arg, byteOffset || 0, length || arg.byteLength);\n this.initialize(arr);\n } else {\n // load model from Uint8array\n this.initialize(arg);\n }\n });\n }\n\n private initialize(modelProtoBlob: Uint8Array, isOrtFormat?: boolean): void {\n if (this._initialized) {\n throw new Error('already initialized');\n }\n\n this.profiler.event('session', 'Session.initialize', () => {\n // load graph\n const graphInitializer =\n this.sessionHandler.transformGraph ? this.sessionHandler as Graph.Initializer : undefined;\n this._model.load(modelProtoBlob, graphInitializer, isOrtFormat);\n\n // graph is completely initialzied at this stage , let the interested handlers know\n if (this.sessionHandler.onGraphInitialized) {\n this.sessionHandler.onGraphInitialized(this._model.graph);\n }\n // initialize each operator in the graph\n this.initializeOps(this._model.graph);\n\n // instantiate an ExecutionPlan object to be used by the Session object\n this._executionPlan = new ExecutionPlan(this._model.graph, this._ops, this.profiler);\n });\n\n this._initialized = true;\n }\n\n async run(inputs: Map|Tensor[]): Promise> {\n if (!this._initialized) {\n throw new Error('session not initialized yet');\n }\n\n return this.profiler.event('session', 'Session.run', async () => {\n const inputTensors = this.normalizeAndValidateInputs(inputs);\n\n const outputTensors = await this._executionPlan.execute(this.sessionHandler, inputTensors);\n\n return this.createOutput(outputTensors);\n });\n }\n\n private normalizeAndValidateInputs(inputs: Map|Tensor[]): Tensor[] {\n const modelInputNames = this._model.graph.getInputNames();\n\n // normalize inputs\n // inputs: Tensor[]\n if (Array.isArray(inputs)) {\n if (inputs.length !== modelInputNames.length) {\n throw new Error(`incorrect input array length: expected ${modelInputNames.length} but got ${inputs.length}`);\n }\n }\n // convert map to array\n // inputs: Map\n else {\n if (inputs.size !== modelInputNames.length) {\n throw new Error(`incorrect input map size: expected ${modelInputNames.length} but got ${inputs.size}`);\n }\n\n const sortedInputs = new Array(inputs.size);\n let sortedInputsIndex = 0;\n for (let i = 0; i < modelInputNames.length; ++i) {\n const tensor = inputs.get(modelInputNames[i]);\n if (!tensor) {\n throw new Error(`missing input tensor for: '${name}'`);\n }\n sortedInputs[sortedInputsIndex++] = tensor;\n }\n\n inputs = sortedInputs;\n }\n\n // validate dims requirements\n // First session run - graph input data is not cached for the session\n if (!this.context.graphInputTypes || this.context.graphInputTypes.length === 0 || !this.context.graphInputDims ||\n this.context.graphInputDims.length === 0) {\n const modelInputIndices = this._model.graph.getInputIndices();\n const modelValues = this._model.graph.getValues();\n\n const graphInputDims = new Array(modelInputIndices.length);\n\n for (let i = 0; i < modelInputIndices.length; ++i) {\n const graphInput = modelValues[modelInputIndices[i]];\n graphInputDims[i] = graphInput.type!.shape.dims;\n\n // cached for second and subsequent runs.\n // Some parts of the framework works on the assumption that the graph and types and shapes are static\n this.context.graphInputTypes!.push(graphInput.type!.tensorType);\n this.context.graphInputDims!.push(inputs[i].dims);\n }\n\n this.validateInputTensorDims(graphInputDims, inputs, true);\n }\n\n // Second and subsequent session runs - graph input data is cached for the session\n else {\n this.validateInputTensorDims(this.context.graphInputDims, inputs, false);\n }\n\n // validate types requirement\n this.validateInputTensorTypes(this.context.graphInputTypes!, inputs);\n\n return inputs;\n }\n\n private validateInputTensorTypes(graphInputTypes: Tensor.DataType[], givenInputs: Tensor[]) {\n for (let i = 0; i < givenInputs.length; i++) {\n const expectedType = graphInputTypes[i];\n const actualType = givenInputs[i].type;\n if (expectedType !== actualType) {\n throw new Error(`input tensor[${i}] check failed: expected type '${expectedType}' but got ${actualType}`);\n }\n }\n }\n\n private validateInputTensorDims(\n graphInputDims: Array, givenInputs: Tensor[], noneDimSupported: boolean) {\n for (let i = 0; i < givenInputs.length; i++) {\n const expectedDims = graphInputDims[i];\n const actualDims = givenInputs[i].dims;\n if (!this.compareTensorDims(expectedDims, actualDims, noneDimSupported)) {\n throw new Error(`input tensor[${i}] check failed: expected shape '[${expectedDims.join(',')}]' but got [${\n actualDims.join(',')}]`);\n }\n }\n }\n\n private compareTensorDims(expectedDims: readonly number[], actualDims: readonly number[], noneDimSupported: boolean):\n boolean {\n if (expectedDims.length !== actualDims.length) {\n return false;\n }\n\n for (let i = 0; i < expectedDims.length; ++i) {\n if (expectedDims[i] !== actualDims[i] && (!noneDimSupported || expectedDims[i] !== 0)) {\n // data shape mis-match AND not a 'None' dimension.\n return false;\n }\n }\n\n return true;\n }\n\n private createOutput(outputTensors: Tensor[]): Map {\n const modelOutputNames = this._model.graph.getOutputNames();\n if (outputTensors.length !== modelOutputNames.length) {\n throw new Error('expected number of outputs do not match number of generated outputs');\n }\n\n const output = new Map();\n for (let i = 0; i < modelOutputNames.length; ++i) {\n output.set(modelOutputNames[i], outputTensors[i]);\n }\n\n return output;\n }\n\n private initializeOps(graph: Graph): void {\n const nodes = graph.getNodes();\n this._ops = new Array(nodes.length);\n\n for (let i = 0; i < nodes.length; i++) {\n this._ops[i] = this.sessionHandler.resolve(nodes[i], this._model.opsets, graph);\n }\n }\n\n private _model: Model;\n private _initialized: boolean;\n\n private _ops: Operator[];\n private _executionPlan: ExecutionPlan;\n\n private backendHint?: string;\n\n private sessionHandler: SessionHandlerType;\n private context: Session.Context;\n private profiler: Readonly;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession, InferenceSessionHandler, SessionHandler, Tensor} from 'onnxruntime-common';\n\nimport {Session} from './session';\nimport {Tensor as OnnxjsTensor} from './tensor';\n\nexport class OnnxjsSessionHandler implements InferenceSessionHandler {\n constructor(private session: Session) {\n this.inputNames = this.session.inputNames;\n this.outputNames = this.session.outputNames;\n }\n\n async dispose(): Promise {}\n inputNames: readonly string[];\n outputNames: readonly string[];\n async run(\n feeds: SessionHandler.FeedsType, _fetches: SessionHandler.FetchesType,\n _options: InferenceSession.RunOptions): Promise {\n const inputMap = new Map();\n for (const name in feeds) {\n if (Object.hasOwnProperty.call(feeds, name)) {\n const feed = feeds[name];\n inputMap.set(\n name,\n new OnnxjsTensor(\n feed.dims, feed.type as OnnxjsTensor.DataType, undefined, undefined,\n feed.data as OnnxjsTensor.NumberType));\n }\n }\n const outputMap = await this.session.run(inputMap);\n const output: SessionHandler.ReturnType = {};\n outputMap.forEach((tensor, name) => {\n output[name] = new Tensor(tensor.type, tensor.data, tensor.dims);\n });\n return output;\n }\n startProfiling(): void {\n this.session.startProfiling();\n }\n endProfiling(): void {\n this.session.endProfiling();\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/* eslint-disable import/no-internal-modules */\nimport {Backend, InferenceSession, InferenceSessionHandler} from 'onnxruntime-common';\n\nimport {Session} from './onnxjs/session';\nimport {OnnxjsSessionHandler} from './onnxjs/session-handler-inference';\n\nclass OnnxjsBackend implements Backend {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n async init(): Promise {}\n\n async createInferenceSessionHandler(pathOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions):\n Promise {\n // NOTE: Session.Config(from onnx.js) is not compatible with InferenceSession.SessionOptions(from\n // onnxruntime-common).\n // In future we should remove Session.Config and use InferenceSession.SessionOptions.\n // Currently we allow this to happen to make test runner work.\n const session = new Session(options as unknown as Session.Config);\n\n // typescript cannot merge method override correctly (so far in 4.2.3). need if-else to call the method.\n if (typeof pathOrBuffer === 'string') {\n await session.loadModel(pathOrBuffer);\n } else {\n await session.loadModel(pathOrBuffer);\n }\n\n return new OnnxjsSessionHandler(session);\n }\n}\n\nexport const onnxjsBackend = new OnnxjsBackend();\n", "export const readFile = undefined;export const readFileSync = undefined;export const createReadStream = undefined;", "export const join = undefined;", "\nvar ortWasm = (() => {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(moduleArg = {}) {\n\nvar e=moduleArg,k,l;e.ready=new Promise((a,b)=>{k=a;l=b});var q=Object.assign({},e),v=\"./this.program\",aa=\"object\"==typeof window,x=\"function\"==typeof importScripts,ba=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,y=\"\",A,B,C;\nif(ba){var fs=require(\"fs\"),D=require(\"path\");y=x?D.dirname(y)+\"/\":__dirname+\"/\";A=(a,b)=>{a=a.startsWith(\"file://\")?new URL(a):D.normalize(a);return fs.readFileSync(a,b?void 0:\"utf8\")};C=a=>{a=A(a,!0);a.buffer||(a=new Uint8Array(a));return a};B=(a,b,c,f=!0)=>{a=a.startsWith(\"file://\")?new URL(a):D.normalize(a);fs.readFile(a,f?void 0:\"utf8\",(g,h)=>{g?c(g):b(f?h.buffer:h)})};!e.thisProgram&&1\"[Emscripten Module object]\"}else if(aa||\nx)x?y=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(y=document.currentScript.src),_scriptDir&&(y=_scriptDir),0!==y.indexOf(\"blob:\")?y=y.substr(0,y.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):y=\"\",A=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},x&&(C=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),B=(a,b,c)=>{var f=new XMLHttpRequest;f.open(\"GET\",a,!0);f.responseType=\n\"arraybuffer\";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):c()};f.onerror=c;f.send(null)};var ca=e.print||console.log.bind(console),E=e.printErr||console.error.bind(console);Object.assign(e,q);q=null;e.thisProgram&&(v=e.thisProgram);var F;e.wasmBinary&&(F=e.wasmBinary);var noExitRuntime=e.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&G(\"no native wasm support detected\");var H,I,da=!1,J,K,L,M;\nfunction ea(){var a=H.buffer;e.HEAP8=J=new Int8Array(a);e.HEAP16=new Int16Array(a);e.HEAP32=L=new Int32Array(a);e.HEAPU8=K=new Uint8Array(a);e.HEAPU16=new Uint16Array(a);e.HEAPU32=M=new Uint32Array(a);e.HEAPF32=new Float32Array(a);e.HEAPF64=new Float64Array(a)}var fa=[],ha=[],ia=[];function ja(){var a=e.preRun.shift();fa.unshift(a)}var N=0,O=null,P=null;\nfunction G(a){if(e.onAbort)e.onAbort(a);a=\"Aborted(\"+a+\")\";E(a);da=!0;a=new WebAssembly.RuntimeError(a+\". Build with -sASSERTIONS for more info.\");l(a);throw a;}function ka(a){return a.startsWith(\"data:application/octet-stream;base64,\")}var Q;Q=\"ort-wasm.wasm\";if(!ka(Q)){var la=Q;Q=e.locateFile?e.locateFile(la,y):y+la}function ma(a){if(a==Q&&F)return new Uint8Array(F);if(C)return C(a);throw\"both async and sync fetching of the wasm failed\";}\nfunction na(a){if(!F&&(aa||x)){if(\"function\"==typeof fetch&&!a.startsWith(\"file://\"))return fetch(a,{credentials:\"same-origin\"}).then(b=>{if(!b.ok)throw\"failed to load wasm binary file at '\"+a+\"'\";return b.arrayBuffer()}).catch(()=>ma(a));if(B)return new Promise((b,c)=>{B(a,f=>b(new Uint8Array(f)),c)})}return Promise.resolve().then(()=>ma(a))}function oa(a,b,c){return na(a).then(f=>WebAssembly.instantiate(f,b)).then(f=>f).then(c,f=>{E(\"failed to asynchronously prepare wasm: \"+f);G(f)})}\nfunction pa(a,b){var c=Q;return F||\"function\"!=typeof WebAssembly.instantiateStreaming||ka(c)||c.startsWith(\"file://\")||ba||\"function\"!=typeof fetch?oa(c,a,b):fetch(c,{credentials:\"same-origin\"}).then(f=>WebAssembly.instantiateStreaming(f,a).then(b,function(g){E(\"wasm streaming compile failed: \"+g);E(\"falling back to ArrayBuffer instantiation\");return oa(c,a,b)}))}var R,S=a=>{for(;0>2>>>0]=b};this.za=function(b){M[this.va+8>>2>>>0]=b};this.xa=function(b,c){this.ya();this.Ea(b);this.za(c)};this.ya=function(){M[this.va+16>>2>>>0]=0}}\nvar ra=0,sa=0,ta=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,ua=(a,b,c)=>{b>>>=0;var f=b+c;for(c=b;a[c]&&!(c>=f);)++c;if(16g?f+=String.fromCharCode(g):(g-=65536,f+=String.fromCharCode(55296|g>>10,56320|g&1023))}}else f+=String.fromCharCode(g)}return f},\nT=(a,b)=>(a>>>=0)?ua(K,a,b):\"\",U=a=>{for(var b=0,c=0;c=f?b++:2047>=f?b+=2:55296<=f&&57343>=f?(b+=4,++c):b+=3}return b},V=(a,b,c,f)=>{c>>>=0;if(!(0=m){var r=a.charCodeAt(++h);m=65536+((m&1023)<<10)|r&1023}if(127>=m){if(c>=f)break;b[c++>>>0]=m}else{if(2047>=m){if(c+1>=f)break;b[c++>>>0]=192|m>>6}else{if(65535>=m){if(c+2>=f)break;b[c++>>>0]=224|m>>12}else{if(c+3>=\nf)break;b[c++>>>0]=240|m>>18;b[c++>>>0]=128|m>>12&63}b[c++>>>0]=128|m>>6&63}b[c++>>>0]=128|m&63}}b[c>>>0]=0;return c-g},W=a=>0===a%4&&(0!==a%100||0===a%400),va=[0,31,60,91,121,152,182,213,244,274,305,335],wa=[0,31,59,90,120,151,181,212,243,273,304,334],Ba=a=>{var b=U(a)+1,c=Aa(b);c&&V(a,K,c,b);return c},X={},Ca=()=>{if(!Y){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\n\"_\")+\".UTF-8\",_:v||\"./this.program\"},b;for(b in X)void 0===X[b]?delete a[b]:a[b]=X[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Y=c}return Y},Y,Da=[null,[],[]],Ea=[31,29,31,30,31,30,31,31,30,31,30,31],Fa=[31,28,31,30,31,30,31,31,30,31,30,31];function Ga(a){var b=Array(U(a)+1);V(a,b,0,b.length);return b}\nfunction Ha(a,b,c,f){function g(d,n,p){for(d=\"number\"==typeof d?d.toString():d||\"\";d.lengthxa?-1:0z-d.getDate())n-=z-d.getDate()+1,d.setDate(1),11>p?d.setMonth(p+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else{d.setDate(d.getDate()+n);break}}p=new Date(d.getFullYear()+1,0,4);n=r(new Date(d.getFullYear(),\n0,4));p=r(p);return 0>=m(n,d)?0>=m(p,d)?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;f>>>=0;var t=L[f+40>>2>>>0];f={Ca:L[f>>2>>>0],Ba:L[f+4>>2>>>0],ta:L[f+8>>2>>>0],wa:L[f+12>>2>>>0],ua:L[f+16>>2>>>0],sa:L[f+20>>2>>>0],ma:L[f+24>>2>>>0],ra:L[f+28>>2>>>0],Fa:L[f+32>>2>>>0],Aa:L[f+36>>2>>>0],Da:t?T(t):\"\"};c=T(c);t={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\n\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var u in t)c=c.replace(new RegExp(u,\"g\"),t[u]);var ya=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),za=\"January February March April May June July August September October November December\".split(\" \");t={\"%a\":d=>ya[d.ma].substring(0,3),\"%A\":d=>ya[d.ma],\"%b\":d=>\nza[d.ua].substring(0,3),\"%B\":d=>za[d.ua],\"%C\":d=>h((d.sa+1900)/100|0,2),\"%d\":d=>h(d.wa,2),\"%e\":d=>g(d.wa,2,\" \"),\"%g\":d=>w(d).toString().substring(2),\"%G\":d=>w(d),\"%H\":d=>h(d.ta,2),\"%I\":d=>{d=d.ta;0==d?d=12:12{for(var n=0,p=0;p<=d.ua-1;n+=(W(d.sa+1900)?Ea:Fa)[p++]);return h(d.wa+n,3)},\"%m\":d=>h(d.ua+1,2),\"%M\":d=>h(d.Ba,2),\"%n\":()=>\"\\n\",\"%p\":d=>0<=d.ta&&12>d.ta?\"AM\":\"PM\",\"%S\":d=>h(d.Ca,2),\"%t\":()=>\"\\t\",\"%u\":d=>d.ma||7,\"%U\":d=>h(Math.floor((d.ra+7-d.ma)/7),2),\"%V\":d=>\n{var n=Math.floor((d.ra+7-(d.ma+6)%7)/7);2>=(d.ma+371-d.ra-2)%7&&n++;if(n)53==n&&(p=(d.ma+371-d.ra)%7,4==p||3==p&&W(d.sa)||(n=1));else{n=52;var p=(d.ma+7-d.ra-1)%7;(4==p||5==p&&W(d.sa%400-1))&&n++}return h(n,2)},\"%w\":d=>d.ma,\"%W\":d=>h(Math.floor((d.ra+7-(d.ma+6)%7)/7),2),\"%y\":d=>(d.sa+1900).toString().substring(2),\"%Y\":d=>d.sa+1900,\"%z\":d=>{d=d.Aa;var n=0<=d;d=Math.abs(d)/60;return(n?\"+\":\"-\")+String(\"0000\"+(d/60*100+d%60)).slice(-4)},\"%Z\":d=>d.Da,\"%%\":()=>\"%\"};c=c.replace(/%%/g,\"\\x00\\x00\");for(u in t)c.includes(u)&&\n(c=c.replace(new RegExp(u,\"g\"),t[u](f)));c=c.replace(/\\0\\0/g,\"%\");u=Ga(c);if(u.length>b)return 0;J.set(u,a>>>0);return u.length-1}\nvar Ja={a:function(a,b,c){a>>>=0;(new qa(a)).xa(b>>>0,c>>>0);ra=a;sa++;throw ra;},e:function(){return 0},H:function(){},x:function(){},z:function(){},k:function(){return 0},F:function(){},B:function(){},E:function(){},g:function(){},y:function(){},v:function(){},G:function(){},w:function(){},l:()=>!0,o:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);L[c>>2>>>0]=a.getUTCSeconds();L[c+4>>2>>>0]=a.getUTCMinutes();L[c+8>>2>>>0]=a.getUTCHours();L[c+12>>2>>>\n0]=a.getUTCDate();L[c+16>>2>>>0]=a.getUTCMonth();L[c+20>>2>>>0]=a.getUTCFullYear()-1900;L[c+24>>2>>>0]=a.getUTCDay();L[c+28>>2>>>0]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},p:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);L[c>>2>>>0]=a.getSeconds();L[c+4>>2>>>0]=a.getMinutes();L[c+8>>2>>>0]=a.getHours();L[c+12>>2>>>0]=a.getDate();L[c+16>>2>>>0]=a.getMonth();L[c+20>>2>>>0]=a.getFullYear()-1900;L[c+24>>2>>>0]=a.getDay();L[c+28>>2>>>\n0]=(W(a.getFullYear())?va:wa)[a.getMonth()]+a.getDate()-1|0;L[c+36>>2>>>0]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var f=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();L[c+32>>2>>>0]=(b!=f&&a.getTimezoneOffset()==Math.min(f,b))|0},q:function(a){a>>>=0;var b=new Date(L[a+20>>2>>>0]+1900,L[a+16>>2>>>0],L[a+12>>2>>>0],L[a+8>>2>>>0],L[a+4>>2>>>0],L[a>>2>>>0],0),c=L[a+32>>2>>>0],f=b.getTimezoneOffset(),g=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),\nh=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),m=Math.min(h,g);0>c?L[a+32>>2>>>0]=Number(g!=h&&m==f):0>2>>>0]=b.getDay();L[a+28>>2>>>0]=(W(b.getFullYear())?va:wa)[b.getMonth()]+b.getDate()-1|0;L[a>>2>>>0]=b.getSeconds();L[a+4>>2>>>0]=b.getMinutes();L[a+8>>2>>>0]=b.getHours();L[a+12>>2>>>0]=b.getDate();L[a+16>>2>>>0]=b.getMonth();L[a+20>>2>>>0]=b.getYear();a=b.getTime()/1E3;return Ia((R=a,1<=+Math.abs(R)?0>>0:~~+Math.ceil((R-+(~~R>>>0))/4294967296)>>>0:0)),a>>>0},m:function(){return-52},n:function(){},t:function(a,b,c){function f(w){return(w=w.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?w[1]:\"GMT\"}c>>>=0;var g=(new Date).getFullYear(),h=new Date(g,0,1),m=new Date(g,6,1);g=h.getTimezoneOffset();var r=m.getTimezoneOffset();M[a>>>0>>2>>>0]=60*Math.max(g,r);L[b>>>0>>2>>>0]=Number(g!=r);a=f(h);b=f(m);a=Ba(a);b=Ba(b);r>2>>>0]=a,M[c+4>>2>>>0]=b):(M[c>>2>>>0]=b,M[c+4>>2>>>0]=a)},d:()=>{G(\"\")},\nh:function(){return Date.now()},u:function(){return 4294901760},b:()=>performance.now(),I:function(a,b,c){b>>>=0;return K.copyWithin(a>>>0>>>0,b>>>0,b+(c>>>0)>>>0)},s:function(a){a>>>=0;var b=K.length;if(4294901760=c;c*=2){var f=b*(1+.2/c);f=Math.min(f,a+100663296);var g=Math;f=Math.max(a,f);a:{g=g.min.call(g,4294901760,f+(65536-f%65536)%65536)-H.buffer.byteLength+65535>>>16;try{H.grow(g);ea();var h=1;break a}catch(m){}h=void 0}if(h)return!0}return!1},C:function(a,b){a>>>=\n0;b>>>=0;var c=0;Ca().forEach(function(f,g){var h=b+c;g=M[a+4*g>>2>>>0]=h;for(h=0;h>0>>>0]=f.charCodeAt(h);J[g>>0>>>0]=0;c+=f.length+1});return 0},D:function(a,b){a>>>=0;b>>>=0;var c=Ca();M[a>>2>>>0]=c.length;var f=0;c.forEach(function(g){f+=g.length+1});M[b>>2>>>0]=f;return 0},f:()=>52,j:function(){return 52},r:function(){return 70},i:function(a,b,c,f){b>>>=0;c>>>=0;f>>>=0;for(var g=0,h=0;h>2>>>0],r=M[b+4>>2>>>0];b+=8;for(var w=0;w>>0],u=\nDa[a];0===t||10===t?((1===a?ca:E)(ua(u,0)),u.length=0):u.push(t)}g+=r}M[f>>2>>>0]=g;return 0},A:Ha,c:function(a,b,c,f){return Ha(a>>>0,b>>>0,c>>>0,f>>>0)}};\n(function(){function a(c){c=c.exports;I=c=Ka(c);H=I.J;ea();ha.unshift(I.K);N--;e.monitorRunDependencies&&e.monitorRunDependencies(N);if(0==N&&(null!==O&&(clearInterval(O),O=null),P)){var f=P;P=null;f()}return c}var b={a:Ja};N++;e.monitorRunDependencies&&e.monitorRunDependencies(N);if(e.instantiateWasm)try{return e.instantiateWasm(b,a)}catch(c){E(\"Module.instantiateWasm callback failed with error: \"+c),l(c)}pa(b,function(c){a(c.instance)}).catch(l);return{}})();\ne._OrtInit=(a,b)=>(e._OrtInit=I.L)(a,b);e._OrtGetLastError=(a,b)=>(e._OrtGetLastError=I.M)(a,b);e._OrtCreateSessionOptions=(a,b,c,f,g,h,m,r,w,t)=>(e._OrtCreateSessionOptions=I.N)(a,b,c,f,g,h,m,r,w,t);e._OrtAppendExecutionProvider=(a,b)=>(e._OrtAppendExecutionProvider=I.O)(a,b);e._OrtAddFreeDimensionOverride=(a,b,c)=>(e._OrtAddFreeDimensionOverride=I.P)(a,b,c);e._OrtAddSessionConfigEntry=(a,b,c)=>(e._OrtAddSessionConfigEntry=I.Q)(a,b,c);e._OrtReleaseSessionOptions=a=>(e._OrtReleaseSessionOptions=I.R)(a);\ne._OrtCreateSession=(a,b,c)=>(e._OrtCreateSession=I.S)(a,b,c);e._OrtReleaseSession=a=>(e._OrtReleaseSession=I.T)(a);e._OrtGetInputOutputCount=(a,b,c)=>(e._OrtGetInputOutputCount=I.U)(a,b,c);e._OrtGetInputName=(a,b)=>(e._OrtGetInputName=I.V)(a,b);e._OrtGetOutputName=(a,b)=>(e._OrtGetOutputName=I.W)(a,b);e._OrtFree=a=>(e._OrtFree=I.X)(a);e._OrtCreateTensor=(a,b,c,f,g,h)=>(e._OrtCreateTensor=I.Y)(a,b,c,f,g,h);e._OrtGetTensorData=(a,b,c,f,g)=>(e._OrtGetTensorData=I.Z)(a,b,c,f,g);\ne._OrtReleaseTensor=a=>(e._OrtReleaseTensor=I._)(a);e._OrtCreateRunOptions=(a,b,c,f)=>(e._OrtCreateRunOptions=I.$)(a,b,c,f);e._OrtAddRunConfigEntry=(a,b,c)=>(e._OrtAddRunConfigEntry=I.aa)(a,b,c);e._OrtReleaseRunOptions=a=>(e._OrtReleaseRunOptions=I.ba)(a);e._OrtCreateBinding=a=>(e._OrtCreateBinding=I.ca)(a);e._OrtBindInput=(a,b,c)=>(e._OrtBindInput=I.da)(a,b,c);e._OrtBindOutput=(a,b,c,f)=>(e._OrtBindOutput=I.ea)(a,b,c,f);e._OrtClearBoundOutputs=a=>(e._OrtClearBoundOutputs=I.fa)(a);\ne._OrtReleaseBinding=a=>(e._OrtReleaseBinding=I.ga)(a);e._OrtRunWithBinding=(a,b,c,f,g)=>(e._OrtRunWithBinding=I.ha)(a,b,c,f,g);e._OrtRun=(a,b,c,f,g,h,m,r)=>(e._OrtRun=I.ia)(a,b,c,f,g,h,m,r);e._OrtEndProfiling=a=>(e._OrtEndProfiling=I.ja)(a);var Aa=e._malloc=a=>(Aa=e._malloc=I.ka)(a);e._free=a=>(e._free=I.la)(a);var Ia=a=>(Ia=I.na)(a),La=()=>(La=I.oa)(),Ma=a=>(Ma=I.pa)(a),Na=a=>(Na=I.qa)(a);\nfunction Ka(a){a=Object.assign({},a);var b=f=>()=>f()>>>0,c=f=>g=>f(g)>>>0;a.__errno_location=b(a.__errno_location);a.malloc=c(a.malloc);a.stackSave=b(a.stackSave);a.stackAlloc=c(a.stackAlloc);return a}e.stackAlloc=Na;e.stackSave=La;e.stackRestore=Ma;e.UTF8ToString=T;e.stringToUTF8=(a,b,c)=>V(a,K,b,c);e.lengthBytesUTF8=U;var Z;P=function Oa(){Z||Pa();Z||(P=Oa)};\nfunction Pa(){function a(){if(!Z&&(Z=!0,e.calledRun=!0,!da)){S(ha);k(e);if(e.onRuntimeInitialized)e.onRuntimeInitialized();if(e.postRun)for(\"function\"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var b=e.postRun.shift();ia.unshift(b)}S(ia)}}if(!(0 ortWasm);\n", "", "", "export const cpus = undefined;", "\nvar ortWasmThreaded = (() => {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(moduleArg = {}) {\n\nfunction aa(){d.buffer!=l.buffer&&m();return l}function n(){d.buffer!=l.buffer&&m();return ba}function p(){d.buffer!=l.buffer&&m();return ca}function r(){d.buffer!=l.buffer&&m();return da}function ea(){d.buffer!=l.buffer&&m();return fa}var w=moduleArg,ha,x;w.ready=new Promise((a,b)=>{ha=a;x=b});\nvar ia=Object.assign({},w),ja=\"./this.program\",z=(a,b)=>{throw b;},ka=\"object\"==typeof window,A=\"function\"==typeof importScripts,B=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,D=w.ENVIRONMENT_IS_PTHREAD||!1,E=\"\";function la(a){return w.locateFile?w.locateFile(a,E):E+a}var ma,F,H;\nif(B){var fs=require(\"fs\"),na=require(\"path\");E=A?na.dirname(E)+\"/\":__dirname+\"/\";ma=(b,c)=>{b=b.startsWith(\"file://\")?new URL(b):na.normalize(b);return fs.readFileSync(b,c?void 0:\"utf8\")};H=b=>{b=ma(b,!0);b.buffer||(b=new Uint8Array(b));return b};F=(b,c,e,h=!0)=>{b=b.startsWith(\"file://\")?new URL(b):na.normalize(b);fs.readFile(b,h?void 0:\"utf8\",(g,k)=>{g?e(g):c(h?k.buffer:k)})};!w.thisProgram&&1{process.exitCode=\nb;throw c;};w.inspect=()=>\"[Emscripten Module object]\";let a;try{a=require(\"worker_threads\")}catch(b){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),b;}global.Worker=a.Worker}else if(ka||A)A?E=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(E=document.currentScript.src),(typeof _scriptDir !== \"undefined\" && _scriptDir)&&(E=_scriptDir),0!==E.indexOf(\"blob:\")?E=E.substr(0,E.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):E=\"\",B||(ma=a=>{var b=\nnew XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},A&&(H=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),F=(a,b,c)=>{var e=new XMLHttpRequest;e.open(\"GET\",a,!0);e.responseType=\"arraybuffer\";e.onload=()=>{200==e.status||0==e.status&&e.response?b(e.response):c()};e.onerror=c;e.send(null)});B&&\"undefined\"==typeof performance&&(global.performance=require(\"perf_hooks\").performance);\nvar oa=console.log.bind(console),pa=console.error.bind(console);B&&(oa=(...a)=>fs.writeSync(1,a.join(\" \")+\"\\n\"),pa=(...a)=>fs.writeSync(2,a.join(\" \")+\"\\n\"));var qa=w.print||oa,I=w.printErr||pa;Object.assign(w,ia);ia=null;w.thisProgram&&(ja=w.thisProgram);w.quit&&(z=w.quit);var J;w.wasmBinary&&(J=w.wasmBinary);var noExitRuntime=w.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&K(\"no native wasm support detected\");var d,L,ra,M=!1,N,l,ba,ca,da,fa;\nfunction m(){var a=d.buffer;w.HEAP8=l=new Int8Array(a);w.HEAP16=new Int16Array(a);w.HEAP32=ca=new Int32Array(a);w.HEAPU8=ba=new Uint8Array(a);w.HEAPU16=new Uint16Array(a);w.HEAPU32=da=new Uint32Array(a);w.HEAPF32=new Float32Array(a);w.HEAPF64=fa=new Float64Array(a)}var O=w.INITIAL_MEMORY||16777216;5242880<=O||K(\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+O+\"! (STACK_SIZE=5242880)\");\nif(D)d=w.wasmMemory;else if(w.wasmMemory)d=w.wasmMemory;else if(d=new WebAssembly.Memory({initial:O/65536,maximum:65536,shared:!0}),!(d.buffer instanceof SharedArrayBuffer))throw I(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),B&&I(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),\nError(\"bad memory\");m();O=d.buffer.byteLength;var sa,ta=[],ua=[],va=[],wa=0;function P(){return noExitRuntime||0{if(!b.ok)throw\"failed to load wasm binary file at '\"+a+\"'\";return b.arrayBuffer()}).catch(()=>Ba(a));if(F)return new Promise((b,c)=>{F(a,e=>b(new Uint8Array(e)),c)})}return Promise.resolve().then(()=>Ba(a))}function Da(a,b,c){return Ca(a).then(e=>WebAssembly.instantiate(e,b)).then(e=>e).then(c,e=>{I(\"failed to asynchronously prepare wasm: \"+e);K(e)})}\nfunction Ea(a,b){var c=S;return J||\"function\"!=typeof WebAssembly.instantiateStreaming||Aa(c)||c.startsWith(\"file://\")||B||\"function\"!=typeof fetch?Da(c,a,b):fetch(c,{credentials:\"same-origin\"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(h){I(\"wasm streaming compile failed: \"+h);I(\"falling back to ArrayBuffer instantiation\");return Da(c,a,b)}))}var T;function U(a){this.name=\"ExitStatus\";this.message=`Program terminated with exit(${a})`;this.status=a}\nfunction Fa(a){a.terminate();a.onmessage=()=>{}}function Ga(a){(a=V.La[a])||K();V.lb(a)}function Ha(a){var b=V.fb();if(!b)return 6;V.Oa.push(b);V.La[a.Na]=b;b.Na=a.Na;var c={cmd:\"run\",start_routine:a.mb,arg:a.eb,pthread_ptr:a.Na};B&&b.unref();b.postMessage(c,a.sb);return 0}\nvar Ia=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,Ja=(a,b,c)=>{b>>>=0;var e=b+c;for(c=b;a[c]&&!(c>=e);)++c;if(16h?e+=String.fromCharCode(h):(h-=65536,e+=String.fromCharCode(55296|h>>\n10,56320|h&1023))}}else e+=String.fromCharCode(h)}return e},Ka=(a,b)=>(a>>>=0)?Ja(n(),a,b):\"\";function La(a){if(D)return W(1,1,a);N=a;if(!P()){V.nb();if(w.onExit)w.onExit(a);M=!0}z(a,new U(a))}\nvar Na=a=>{N=a;if(D)throw Ma(a),\"unwind\";La(a)},V={Ra:[],Oa:[],Za:[],La:{},Va:function(){D?V.hb():V.gb()},gb:function(){ta.unshift(()=>{ya();V.ib(()=>za())})},hb:function(){V.receiveObjectTransfer=V.kb;V.threadInitTLS=V.Ya;V.setExitStatus=V.Xa;noExitRuntime=!1},Xa:function(a){N=a},xb:[\"$terminateWorker\"],nb:function(){for(var a of V.Oa)Fa(a);for(a of V.Ra)Fa(a);V.Ra=[];V.Oa=[];V.La=[]},lb:function(a){var b=a.Na;delete V.La[b];V.Ra.push(a);V.Oa.splice(V.Oa.indexOf(a),1);a.Na=0;Oa(b)},kb:function(){},\nYa:function(){V.Za.forEach(a=>a())},jb:a=>new Promise(b=>{a.onmessage=g=>{g=g.data;var k=g.cmd;if(g.targetThread&&g.targetThread!=X()){var t=V.La[g.wb];t?t.postMessage(g,g.transferList):I('Internal error! Worker sent a message \"'+k+'\" to target pthread '+g.targetThread+\", but that thread no longer exists!\")}else if(\"checkMailbox\"===k)Y();else if(\"spawnThread\"===k)Ha(g);else if(\"cleanupThread\"===k)Ga(g.thread);else if(\"killThread\"===k)g=g.thread,k=V.La[g],delete V.La[g],Fa(k),Oa(g),V.Oa.splice(V.Oa.indexOf(k),\n1),k.Na=0;else if(\"cancelThread\"===k)V.La[g.thread].postMessage({cmd:\"cancel\"});else if(\"loaded\"===k)a.loaded=!0,b(a);else if(\"alert\"===k)alert(\"Thread \"+g.threadId+\": \"+g.text);else if(\"setimmediate\"===g.target)a.postMessage(g);else if(\"callHandler\"===k)w[g.handler](...g.args);else k&&I(\"worker sent an unknown command \"+k)};a.onerror=g=>{I(\"worker sent an error! \"+g.filename+\":\"+g.lineno+\": \"+g.message);throw g;};B&&(a.on(\"message\",function(g){a.onmessage({data:g})}),a.on(\"error\",function(g){a.onerror(g)}));\nvar c=[],e=[\"onExit\",\"onAbort\",\"print\",\"printErr\"],h;for(h of e)w.hasOwnProperty(h)&&c.push(h);a.postMessage({cmd:\"load\",handlers:c,urlOrBlob:w.mainScriptUrlOrBlob||_scriptDir,wasmMemory:d,wasmModule:ra})}),ib:function(a){a()},cb:function(){var a=la(\"ort-wasm-threaded.worker.js\");a=new Worker(a);V.Ra.push(a)},fb:function(){0==V.Ra.length&&(V.cb(),V.jb(V.Ra[0]));return V.Ra.pop()}};w.PThread=V;var Pa=a=>{for(;0>2>>>0];a=p()[a+56>>2>>>0];Qa(b,b-a);Ra(b)};function Ma(a){if(D)return W(2,0,a);Na(a)}var Sa=[];w.invokeEntryPoint=function(a,b){var c=Sa[a];c||(a>=Sa.length&&(Sa.length=a+1),Sa[a]=c=sa.get(a));a=c(b);P()?V.Xa(a):Ta(a)};function Ua(a){this.Ua=a-24;this.bb=function(b){r()[this.Ua+4>>2>>>0]=b};this.ab=function(b){r()[this.Ua+8>>2>>>0]=b};this.Va=function(b,c){this.$a();this.bb(b);this.ab(c)};this.$a=function(){r()[this.Ua+16>>2>>>0]=0}}\nvar Va=0,Wa=0;function Xa(a,b,c,e){return D?W(3,1,a,b,c,e):Ya(a,b,c,e)}function Ya(a,b,c,e){a>>>=0;b>>>=0;c>>>=0;e>>>=0;if(\"undefined\"==typeof SharedArrayBuffer)return I(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var h=[];if(D&&0===h.length)return Xa(a,b,c,e);a={mb:c,Na:a,eb:e,sb:h};return D?(a.ub=\"spawnThread\",postMessage(a,h),0):Ha(a)}function Za(a,b,c){return D?W(4,1,a,b,c):0}function $a(a,b){if(D)return W(5,1,a,b)}\nvar ab=a=>{for(var b=0,c=0;c=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++c):b+=3}return b},bb=(a,b,c,e)=>{c>>>=0;if(!(0=k){var t=a.charCodeAt(++g);k=65536+((k&1023)<<10)|t&1023}if(127>=k){if(c>=e)break;b[c++>>>0]=k}else{if(2047>=k){if(c+1>=e)break;b[c++>>>0]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++>>>0]=224|k>>12}else{if(c+3>=e)break;b[c++>>>0]=240|k>>\n18;b[c++>>>0]=128|k>>12&63}b[c++>>>0]=128|k>>6&63}b[c++>>>0]=128|k&63}}b[c>>>0]=0;return c-h},cb=(a,b,c)=>bb(a,n(),b,c);function db(a,b){if(D)return W(6,1,a,b)}function eb(a,b,c){if(D)return W(7,1,a,b,c)}function fb(a,b,c){return D?W(8,1,a,b,c):0}function gb(a,b){if(D)return W(9,1,a,b)}function hb(a,b,c){if(D)return W(10,1,a,b,c)}function ib(a,b,c,e){if(D)return W(11,1,a,b,c,e)}function jb(a,b,c,e){if(D)return W(12,1,a,b,c,e)}function kb(a,b,c,e){if(D)return W(13,1,a,b,c,e)}\nfunction lb(a){if(D)return W(14,1,a)}function mb(a,b){if(D)return W(15,1,a,b)}function nb(a,b,c){if(D)return W(16,1,a,b,c)}var ob=a=>{if(!M)try{if(a(),!P())try{D?Ta(N):Na(N)}catch(b){b instanceof U||\"unwind\"==b||z(1,b)}}catch(b){b instanceof U||\"unwind\"==b||z(1,b)}};function pb(a){a>>>=0;\"function\"===typeof Atomics.tb&&(Atomics.tb(p(),a>>2,a).value.then(Y),a+=128,Atomics.store(p(),a>>2,1))}w.__emscripten_thread_mailbox_await=pb;function Y(){var a=X();a&&(pb(a),ob(()=>qb()))}w.checkMailbox=Y;\nvar Z=a=>0===a%4&&(0!==a%100||0===a%400),rb=[0,31,60,91,121,152,182,213,244,274,305,335],sb=[0,31,59,90,120,151,181,212,243,273,304,334];function tb(a,b,c,e,h,g,k,t){return D?W(17,1,a,b,c,e,h,g,k,t):-52}function ub(a,b,c,e,h,g,k){if(D)return W(18,1,a,b,c,e,h,g,k)}var wb=a=>{var b=ab(a)+1,c=vb(b);c&&cb(a,c,b);return c},yb=a=>{var b=xb();a=a();Ra(b);return a};\nfunction W(a,b){var c=arguments.length-2,e=arguments;return yb(()=>{for(var h=zb(8*c),g=h>>3,k=0;k>>0]=t}return Ab(a,c,h,b)})}\nvar Bb=[],Cb={},Eb=()=>{if(!Db){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:ja||\"./this.program\"},b;for(b in Cb)void 0===Cb[b]?delete a[b]:a[b]=Cb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Db=c}return Db},Db;\nfunction Fb(a,b){if(D)return W(19,1,a,b);a>>>=0;b>>>=0;var c=0;Eb().forEach(function(e,h){var g=b+c;h=r()[a+4*h>>2>>>0]=g;for(g=0;g>0>>>0]=e.charCodeAt(g);aa()[h>>0>>>0]=0;c+=e.length+1});return 0}function Gb(a,b){if(D)return W(20,1,a,b);a>>>=0;b>>>=0;var c=Eb();r()[a>>2>>>0]=c.length;var e=0;c.forEach(function(h){e+=h.length+1});r()[b>>2>>>0]=e;return 0}function Hb(a){return D?W(21,1,a):52}function Lb(a,b,c,e){return D?W(22,1,a,b,c,e):52}\nfunction Mb(a,b,c,e,h){return D?W(23,1,a,b,c,e,h):70}var Nb=[null,[],[]];function Ob(a,b,c,e){if(D)return W(24,1,a,b,c,e);b>>>=0;c>>>=0;e>>>=0;for(var h=0,g=0;g>2>>>0],t=r()[b+4>>2>>>0];b+=8;for(var C=0;C>>0],y=Nb[a];0===v||10===v?((1===a?qa:I)(Ja(y,0)),y.length=0):y.push(v)}h+=t}r()[e>>2>>>0]=h;return 0}var Pb=[31,29,31,30,31,30,31,31,30,31,30,31],Qb=[31,28,31,30,31,30,31,31,30,31,30,31];function Rb(a){var b=Array(ab(a)+1);bb(a,b,0,b.length);return b}\nvar Sb=(a,b)=>{aa().set(a,b>>>0)};\nfunction Tb(a,b,c,e){function h(f,q,u){for(f=\"number\"==typeof f?f.toString():f||\"\";f.lengthIb?-1:0G-f.getDate())q-=G-f.getDate()+1,f.setDate(1),11>u?f.setMonth(u+1):(f.setMonth(0),f.setFullYear(f.getFullYear()+1));else{f.setDate(f.getDate()+q);break}}u=new Date(f.getFullYear()+1,0,4);q=t(new Date(f.getFullYear(),\n0,4));u=t(u);return 0>=k(q,f)?0>=k(u,f)?f.getFullYear()+1:f.getFullYear():f.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;e>>>=0;var v=p()[e+40>>2>>>0];e={qb:p()[e>>2>>>0],pb:p()[e+4>>2>>>0],Sa:p()[e+8>>2>>>0],Wa:p()[e+12>>2>>>0],Ta:p()[e+16>>2>>>0],Qa:p()[e+20>>2>>>0],Ma:p()[e+24>>2>>>0],Pa:p()[e+28>>2>>>0],yb:p()[e+32>>2>>>0],ob:p()[e+36>>2>>>0],rb:v?Ka(v):\"\"};c=Ka(c);v={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\n\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var y in v)c=c.replace(new RegExp(y,\"g\"),v[y]);var Jb=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),Kb=\"January February March April May June July August September October November December\".split(\" \");v={\"%a\":f=>Jb[f.Ma].substring(0,3),\n\"%A\":f=>Jb[f.Ma],\"%b\":f=>Kb[f.Ta].substring(0,3),\"%B\":f=>Kb[f.Ta],\"%C\":f=>g((f.Qa+1900)/100|0,2),\"%d\":f=>g(f.Wa,2),\"%e\":f=>h(f.Wa,2,\" \"),\"%g\":f=>C(f).toString().substring(2),\"%G\":f=>C(f),\"%H\":f=>g(f.Sa,2),\"%I\":f=>{f=f.Sa;0==f?f=12:12{for(var q=0,u=0;u<=f.Ta-1;q+=(Z(f.Qa+1900)?Pb:Qb)[u++]);return g(f.Wa+q,3)},\"%m\":f=>g(f.Ta+1,2),\"%M\":f=>g(f.pb,2),\"%n\":()=>\"\\n\",\"%p\":f=>0<=f.Sa&&12>f.Sa?\"AM\":\"PM\",\"%S\":f=>g(f.qb,2),\"%t\":()=>\"\\t\",\"%u\":f=>f.Ma||7,\"%U\":f=>g(Math.floor((f.Pa+\n7-f.Ma)/7),2),\"%V\":f=>{var q=Math.floor((f.Pa+7-(f.Ma+6)%7)/7);2>=(f.Ma+371-f.Pa-2)%7&&q++;if(q)53==q&&(u=(f.Ma+371-f.Pa)%7,4==u||3==u&&Z(f.Qa)||(q=1));else{q=52;var u=(f.Ma+7-f.Pa-1)%7;(4==u||5==u&&Z(f.Qa%400-1))&&q++}return g(q,2)},\"%w\":f=>f.Ma,\"%W\":f=>g(Math.floor((f.Pa+7-(f.Ma+6)%7)/7),2),\"%y\":f=>(f.Qa+1900).toString().substring(2),\"%Y\":f=>f.Qa+1900,\"%z\":f=>{f=f.ob;var q=0<=f;f=Math.abs(f)/60;return(q?\"+\":\"-\")+String(\"0000\"+(f/60*100+f%60)).slice(-4)},\"%Z\":f=>f.rb,\"%%\":()=>\"%\"};c=c.replace(/%%/g,\n\"\\x00\\x00\");for(y in v)c.includes(y)&&(c=c.replace(new RegExp(y,\"g\"),v[y](e)));c=c.replace(/\\0\\0/g,\"%\");y=Rb(c);if(y.length>b)return 0;Sb(y,a);return y.length-1}V.Va();\nvar Ub=[null,La,Ma,Xa,Za,$a,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,tb,ub,Fb,Gb,Hb,Lb,Mb,Ob],Xb={b:function(a,b,c){a>>>=0;(new Ua(a)).Va(b>>>0,c>>>0);Va=a;Wa++;throw Va;},N:function(a){Vb(a>>>0,!A,1,!ka,131072,!1);V.Ya()},j:function(a){a>>>=0;D?postMessage({cmd:\"cleanupThread\",thread:a}):Ga(a)},I:Ya,h:Za,T:$a,D:db,F:eb,U:fb,R:gb,J:hb,Q:ib,n:jb,E:kb,B:lb,S:mb,C:nb,q:()=>!0,z:function(a,b){a>>>=0;a==b>>>0?setTimeout(()=>Y()):D?postMessage({targetThread:a,cmd:\"checkMailbox\"}):(a=V.La[a])&&a.postMessage({cmd:\"checkMailbox\"})},\nL:function(){return-1},M:pb,p:function(a){B&&V.La[a>>>0].ref()},t:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);p()[c>>2>>>0]=a.getUTCSeconds();p()[c+4>>2>>>0]=a.getUTCMinutes();p()[c+8>>2>>>0]=a.getUTCHours();p()[c+12>>2>>>0]=a.getUTCDate();p()[c+16>>2>>>0]=a.getUTCMonth();p()[c+20>>2>>>0]=a.getUTCFullYear()-1900;p()[c+24>>2>>>0]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;p()[c+28>>2>>>0]=a},u:function(a,b,c){a=b+\n2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);p()[c>>2>>>0]=a.getSeconds();p()[c+4>>2>>>0]=a.getMinutes();p()[c+8>>2>>>0]=a.getHours();p()[c+12>>2>>>0]=a.getDate();p()[c+16>>2>>>0]=a.getMonth();p()[c+20>>2>>>0]=a.getFullYear()-1900;p()[c+24>>2>>>0]=a.getDay();b=(Z(a.getFullYear())?rb:sb)[a.getMonth()]+a.getDate()-1|0;p()[c+28>>2>>>0]=b;p()[c+36>>2>>>0]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();\na=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0;p()[c+32>>2>>>0]=a},v:function(a){a>>>=0;var b=new Date(p()[a+20>>2>>>0]+1900,p()[a+16>>2>>>0],p()[a+12>>2>>>0],p()[a+8>>2>>>0],p()[a+4>>2>>>0],p()[a>>2>>>0],0),c=p()[a+32>>2>>>0],e=b.getTimezoneOffset(),h=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),g=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),k=Math.min(g,h);0>c?p()[a+32>>2>>>0]=Number(h!=g&&k==e):0>2>>>\n0]=b.getDay();c=(Z(b.getFullYear())?rb:sb)[b.getMonth()]+b.getDate()-1|0;p()[a+28>>2>>>0]=c;p()[a>>2>>>0]=b.getSeconds();p()[a+4>>2>>>0]=b.getMinutes();p()[a+8>>2>>>0]=b.getHours();p()[a+12>>2>>>0]=b.getDate();p()[a+16>>2>>>0]=b.getMonth();p()[a+20>>2>>>0]=b.getYear();a=b.getTime()/1E3;return Wb((T=a,1<=+Math.abs(T)?0>>0:~~+Math.ceil((T-+(~~T>>>0))/4294967296)>>>0:0)),a>>>0},r:tb,s:ub,y:function(a,b,c){function e(v){return(v=v.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?\nv[1]:\"GMT\"}a>>>=0;b>>>=0;c>>>=0;var h=(new Date).getFullYear(),g=new Date(h,0,1),k=new Date(h,6,1);h=g.getTimezoneOffset();var t=k.getTimezoneOffset(),C=Math.max(h,t);r()[a>>2>>>0]=60*C;p()[b>>2>>>0]=Number(h!=t);a=e(g);b=e(k);a=wb(a);b=wb(b);t>2>>>0]=a,r()[c+4>>2>>>0]=b):(r()[c>>2>>>0]=b,r()[c+4>>2>>>0]=a)},c:()=>{K(\"\")},k:function(){},i:function(){return Date.now()},o:()=>{wa+=1;throw\"unwind\";},A:function(){return 4294901760},e:()=>performance.timeOrigin+performance.now(),f:function(){return B?\nrequire(\"os\").cpus().length:navigator.hardwareConcurrency},K:function(a,b,c,e){V.vb=b>>>0;Bb.length=c;b=e>>>0>>3;for(e=0;e>>0];return Ub[a].apply(null,Bb)},x:function(a){a>>>=0;var b=n().length;if(a<=b||4294901760=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var h=Math;e=Math.max(a,e);a:{h=h.min.call(h,4294901760,e+(65536-e%65536)%65536)-d.buffer.byteLength+65535>>>16;try{d.grow(h);m();var g=1;break a}catch(k){}g=void 0}if(g)return!0}return!1},\nO:Fb,P:Gb,H:Na,g:Hb,m:Lb,w:Mb,l:Ob,a:d||w.wasmMemory,G:Tb,d:function(a,b,c,e){return Tb(a>>>0,b>>>0,c>>>0,e>>>0)}};(function(){function a(c,e){c=c.exports;L=c=Yb(c);V.Za.push(L.ya);sa=L.za;ua.unshift(L.V);ra=e;za();return c}var b={a:Xb};ya();if(w.instantiateWasm)try{return w.instantiateWasm(b,a)}catch(c){I(\"Module.instantiateWasm callback failed with error: \"+c),x(c)}Ea(b,function(c){a(c.instance,c.module)}).catch(x);return{}})();w._OrtInit=(a,b)=>(w._OrtInit=L.W)(a,b);\nw._OrtGetLastError=(a,b)=>(w._OrtGetLastError=L.X)(a,b);w._OrtCreateSessionOptions=(a,b,c,e,h,g,k,t,C,v)=>(w._OrtCreateSessionOptions=L.Y)(a,b,c,e,h,g,k,t,C,v);w._OrtAppendExecutionProvider=(a,b)=>(w._OrtAppendExecutionProvider=L.Z)(a,b);w._OrtAddFreeDimensionOverride=(a,b,c)=>(w._OrtAddFreeDimensionOverride=L._)(a,b,c);w._OrtAddSessionConfigEntry=(a,b,c)=>(w._OrtAddSessionConfigEntry=L.$)(a,b,c);w._OrtReleaseSessionOptions=a=>(w._OrtReleaseSessionOptions=L.aa)(a);\nw._OrtCreateSession=(a,b,c)=>(w._OrtCreateSession=L.ba)(a,b,c);w._OrtReleaseSession=a=>(w._OrtReleaseSession=L.ca)(a);w._OrtGetInputOutputCount=(a,b,c)=>(w._OrtGetInputOutputCount=L.da)(a,b,c);w._OrtGetInputName=(a,b)=>(w._OrtGetInputName=L.ea)(a,b);w._OrtGetOutputName=(a,b)=>(w._OrtGetOutputName=L.fa)(a,b);w._OrtFree=a=>(w._OrtFree=L.ga)(a);w._OrtCreateTensor=(a,b,c,e,h,g)=>(w._OrtCreateTensor=L.ha)(a,b,c,e,h,g);w._OrtGetTensorData=(a,b,c,e,h)=>(w._OrtGetTensorData=L.ia)(a,b,c,e,h);\nw._OrtReleaseTensor=a=>(w._OrtReleaseTensor=L.ja)(a);w._OrtCreateRunOptions=(a,b,c,e)=>(w._OrtCreateRunOptions=L.ka)(a,b,c,e);w._OrtAddRunConfigEntry=(a,b,c)=>(w._OrtAddRunConfigEntry=L.la)(a,b,c);w._OrtReleaseRunOptions=a=>(w._OrtReleaseRunOptions=L.ma)(a);w._OrtCreateBinding=a=>(w._OrtCreateBinding=L.na)(a);w._OrtBindInput=(a,b,c)=>(w._OrtBindInput=L.oa)(a,b,c);w._OrtBindOutput=(a,b,c,e)=>(w._OrtBindOutput=L.pa)(a,b,c,e);w._OrtClearBoundOutputs=a=>(w._OrtClearBoundOutputs=L.qa)(a);\nw._OrtReleaseBinding=a=>(w._OrtReleaseBinding=L.ra)(a);w._OrtRunWithBinding=(a,b,c,e,h)=>(w._OrtRunWithBinding=L.sa)(a,b,c,e,h);w._OrtRun=(a,b,c,e,h,g,k,t)=>(w._OrtRun=L.ta)(a,b,c,e,h,g,k,t);w._OrtEndProfiling=a=>(w._OrtEndProfiling=L.ua)(a);var X=w._pthread_self=()=>(X=w._pthread_self=L.va)(),vb=w._malloc=a=>(vb=w._malloc=L.wa)(a);w._free=a=>(w._free=L.xa)(a);w.__emscripten_tls_init=()=>(w.__emscripten_tls_init=L.ya)();\nvar Vb=w.__emscripten_thread_init=(a,b,c,e,h,g)=>(Vb=w.__emscripten_thread_init=L.Aa)(a,b,c,e,h,g);w.__emscripten_thread_crashed=()=>(w.__emscripten_thread_crashed=L.Ba)();var Ab=(a,b,c,e)=>(Ab=L.Ca)(a,b,c,e),Oa=a=>(Oa=L.Da)(a),Ta=w.__emscripten_thread_exit=a=>(Ta=w.__emscripten_thread_exit=L.Ea)(a),qb=w.__emscripten_check_mailbox=()=>(qb=w.__emscripten_check_mailbox=L.Fa)(),Wb=a=>(Wb=L.Ga)(a),Qa=(a,b)=>(Qa=L.Ha)(a,b),xb=()=>(xb=L.Ia)(),Ra=a=>(Ra=L.Ja)(a),zb=a=>(zb=L.Ka)(a);\nfunction Yb(a){a=Object.assign({},a);var b=e=>()=>e()>>>0,c=e=>h=>e(h)>>>0;a.__errno_location=b(a.__errno_location);a.pthread_self=b(a.pthread_self);a.malloc=c(a.malloc);a.stackSave=b(a.stackSave);a.stackAlloc=c(a.stackAlloc);return a}w.keepRuntimeAlive=P;w.wasmMemory=d;w.stackAlloc=zb;w.stackSave=xb;w.stackRestore=Ra;w.UTF8ToString=Ka;w.stringToUTF8=cb;w.lengthBytesUTF8=ab;w.ExitStatus=U;w.PThread=V;var Zb;R=function $b(){Zb||ac();Zb||(R=$b)};\nfunction ac(){function a(){if(!Zb&&(Zb=!0,w.calledRun=!0,!M)){D||Pa(ua);ha(w);if(w.onRuntimeInitialized)w.onRuntimeInitialized();if(!D){if(w.postRun)for(\"function\"==typeof w.postRun&&(w.postRun=[w.postRun]);w.postRun.length;){var b=w.postRun.shift();va.unshift(b)}Pa(va)}}}if(!(0 ortWasmThreaded);\n", "\"use strict\";var Module={},ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\"),parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",e=>onmessage({data:e}));var fs=require(\"fs\");Object.assign(global,{self:global,require,Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:e=>(0,eval)(fs.readFileSync(e,\"utf8\")+\"//# sourceURL=\"+e),postMessage:e=>parentPort.postMessage(e),performance:global.performance||{now:Date.now}})}var initializedJS=!1;function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,e+`\n`);return}console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:e,threadId:Module._pthread_self()})}var err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(e,t)=>{var a=Module.wasmModule;Module.wasmModule=null;var r=new WebAssembly.Instance(a,e);return t(r)},self.onunhandledrejection=e=>{throw e.reason??e};function handleMessage(e){try{if(e.data.cmd===\"load\"){let a=[];self.onmessage=r=>a.push(r),self.startWorker=r=>{Module=r,postMessage({cmd:\"loaded\"});for(let s of a)handleMessage(s);self.onmessage=handleMessage},Module.wasmModule=e.data.wasmModule;for(const r of e.data.handlers)Module[r]=(...s)=>{postMessage({cmd:\"callHandler\",handler:r,args:s})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,typeof e.data.urlOrBlob==\"string\")importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}ortWasmThreaded(Module)}else if(e.data.cmd===\"run\"){Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.__emscripten_thread_mailbox_await(e.data.pthread_ptr),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(a){if(a!=\"unwind\")throw a}}else e.data.cmd===\"cancel\"?Module._pthread_self()&&Module.__emscripten_thread_exit(-1):e.data.target===\"setimmediate\"||(e.data.cmd===\"checkMailbox\"?initializedJS&&Module.checkMailbox():e.data.cmd&&(err(\"worker.js received unknown command \"+e.data.cmd),err(e.data)))}catch(a){throw Module.__emscripten_thread_crashed&&Module.__emscripten_thread_crashed(),a}}self.onmessage=handleMessage;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport * as path from 'node:path';\nimport {Env} from 'onnxruntime-common';\n\nimport {OrtWasmModule} from './binding/ort-wasm';\nimport {OrtWasmThreadedModule} from './binding/ort-wasm-threaded';\n\n/* eslint-disable @typescript-eslint/no-require-imports */\nlet ortWasmFactory: EmscriptenModuleFactory;\n\nif (!BUILD_DEFS.DISABLE_TRAINING) {\n ortWasmFactory = require('./binding/ort-training-wasm-simd.js');\n} else {\n ortWasmFactory =\n BUILD_DEFS.DISABLE_WEBGPU ? require('./binding/ort-wasm.js') : require('./binding/ort-wasm-simd.jsep.js');\n}\n\nconst ortWasmFactoryThreaded: EmscriptenModuleFactory = !BUILD_DEFS.DISABLE_WASM_THREAD ?\n (BUILD_DEFS.DISABLE_WEBGPU ? require('./binding/ort-wasm-threaded.js') :\n require('./binding/ort-wasm-simd-threaded.jsep.js')) :\n ortWasmFactory;\n/* eslint-enable @typescript-eslint/no-require-imports */\n\nlet wasm: OrtWasmModule|undefined;\nlet initialized = false;\nlet initializing = false;\nlet aborted = false;\n\nconst isMultiThreadSupported = (numThreads: number): boolean => {\n // WebAssembly threads are set to 1 (single thread).\n if (numThreads === 1) {\n return false;\n }\n\n // If 'SharedArrayBuffer' is not available, WebAssembly threads will not work.\n if (typeof SharedArrayBuffer === 'undefined') {\n if (typeof self !== 'undefined' && !self.crossOriginIsolated) {\n // eslint-disable-next-line no-console\n console.warn(\n 'env.wasm.numThreads is set to ' + numThreads +\n ', but this will not work unless you enable crossOriginIsolated mode. ' +\n 'See https://web.dev/cross-origin-isolation-guide/ for more info.');\n }\n return false;\n }\n\n // onnxruntime-web does not support multi-threads in Node.js.\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // eslint-disable-next-line no-console\n console.warn(\n 'env.wasm.numThreads is set to ' + numThreads +\n ', however, currently onnxruntime-web does not support multi-threads in Node.js. ' +\n 'Please consider using onnxruntime-node for performance critical scenarios.');\n }\n\n try {\n // Test for transferability of SABs (for browsers. needed for Firefox)\n // https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ\n if (typeof MessageChannel !== 'undefined') {\n new MessageChannel().port1.postMessage(new SharedArrayBuffer(1));\n }\n\n // Test for WebAssembly threads capability (for both browsers and Node.js)\n // This typed array is a WebAssembly program containing threaded instructions.\n return WebAssembly.validate(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5,\n 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11\n ]));\n } catch (e) {\n return false;\n }\n};\n\nconst isSimdSupported = (): boolean => {\n try {\n // Test for WebAssembly SIMD capability (for both browsers and Node.js)\n // This typed array is a WebAssembly program containing SIMD instructions.\n\n // The binary data is generated from the following code by wat2wasm:\n //\n // (module\n // (type $t0 (func))\n // (func $f0 (type $t0)\n // (drop\n // (i32x4.dot_i16x8_s\n // (i8x16.splat\n // (i32.const 0))\n // (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)))))\n\n return WebAssembly.validate(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 30, 1, 28, 0, 65, 0,\n 253, 15, 253, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 186, 1, 26, 11\n ]));\n } catch (e) {\n return false;\n }\n};\n\nconst getWasmFileName = (useSimd: boolean, useThreads: boolean) => {\n if (useSimd) {\n if (!BUILD_DEFS.DISABLE_TRAINING) {\n return 'ort-training-wasm-simd.wasm';\n }\n return useThreads ? 'ort-wasm-simd-threaded.wasm' : 'ort-wasm-simd.wasm';\n } else {\n return useThreads ? 'ort-wasm-threaded.wasm' : 'ort-wasm.wasm';\n }\n};\n\nexport const initializeWebAssembly = async(flags: Env.WebAssemblyFlags): Promise => {\n if (initialized) {\n return Promise.resolve();\n }\n if (initializing) {\n throw new Error('multiple calls to \\'initializeWebAssembly()\\' detected.');\n }\n if (aborted) {\n throw new Error('previous call to \\'initializeWebAssembly()\\' failed.');\n }\n\n initializing = true;\n\n // wasm flags are already initialized\n const timeout = flags.initTimeout!;\n const numThreads = flags.numThreads!;\n const simd = flags.simd!;\n\n const useThreads = isMultiThreadSupported(numThreads);\n const useSimd = simd && isSimdSupported();\n\n const wasmPaths = flags.wasmPaths;\n const wasmPrefixOverride = typeof wasmPaths === 'string' ? wasmPaths : undefined;\n const wasmFileName = getWasmFileName(useSimd, useThreads);\n const wasmPathOverride = typeof wasmPaths === 'object' ? wasmPaths[wasmFileName] : undefined;\n\n let isTimeout = false;\n\n const tasks: Array> = [];\n\n // promise for timeout\n if (timeout > 0) {\n tasks.push(new Promise((resolve) => {\n setTimeout(() => {\n isTimeout = true;\n resolve();\n }, timeout);\n }));\n }\n\n // promise for module initialization\n tasks.push(new Promise((resolve, reject) => {\n const factory = useThreads ? ortWasmFactoryThreaded : ortWasmFactory;\n const config: Partial = {\n locateFile: (fileName: string, scriptDirectory: string) => {\n if (!BUILD_DEFS.DISABLE_WASM_THREAD && useThreads && fileName.endsWith('.worker.js') &&\n typeof Blob !== 'undefined') {\n return URL.createObjectURL(new Blob(\n [\n // This require() function is handled by esbuild plugin to load file content as string.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('./binding/ort-wasm-threaded.worker.js')\n ],\n {type: 'text/javascript'}));\n }\n\n if (fileName.endsWith('.wasm')) {\n if (wasmPathOverride) {\n return wasmPathOverride;\n }\n\n const prefix = wasmPrefixOverride ?? scriptDirectory;\n\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n if (wasmFileName === 'ort-wasm-simd.wasm') {\n return prefix + 'ort-wasm-simd.jsep.wasm';\n } else if (wasmFileName === 'ort-wasm-simd-threaded.wasm') {\n return prefix + 'ort-wasm-simd-threaded.jsep.wasm';\n }\n }\n\n return prefix + wasmFileName;\n }\n\n return scriptDirectory + fileName;\n }\n };\n\n if (!BUILD_DEFS.DISABLE_WASM_THREAD && useThreads) {\n config.numThreads = numThreads;\n if (typeof Blob === 'undefined') {\n config.mainScriptUrlOrBlob = path.join(__dirname, 'ort-wasm-threaded.js');\n } else {\n const scriptSourceCode = `var ortWasmThreaded=${factory.toString()};`;\n config.mainScriptUrlOrBlob = new Blob([scriptSourceCode], {type: 'text/javascript'});\n }\n }\n\n factory(config).then(\n // wasm module initialized successfully\n module => {\n initializing = false;\n initialized = true;\n wasm = module;\n resolve();\n },\n // wasm module failed to initialize\n (what) => {\n initializing = false;\n aborted = true;\n reject(what);\n });\n }));\n\n await Promise.race(tasks);\n\n if (isTimeout) {\n throw new Error(`WebAssembly backend initializing failed due to timeout: ${timeout}ms`);\n }\n};\n\nexport const getInstance = (): OrtWasmModule => {\n if (initialized && wasm) {\n return wasm;\n }\n\n throw new Error('WebAssembly is not initialized yet.');\n};\n\nexport const dispose = (): void => {\n if (initialized && !initializing && !aborted) {\n initializing = true;\n\n (wasm as OrtWasmThreadedModule).PThread?.terminateAllThreads();\n wasm = undefined;\n\n initializing = false;\n initialized = false;\n aborted = true;\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {getInstance} from './wasm-factory';\n\nexport const allocWasmString = (data: string, allocs: number[]): number => {\n const wasm = getInstance();\n\n const dataLength = wasm.lengthBytesUTF8(data) + 1;\n const dataOffset = wasm._malloc(dataLength);\n wasm.stringToUTF8(data, dataOffset, dataLength);\n allocs.push(dataOffset);\n\n return dataOffset;\n};\n\ninterface ExtraOptionsHandler {\n (name: string, value: string): void;\n}\n\nexport const iterateExtraOptions =\n (options: Record, prefix: string, seen: WeakSet>,\n handler: ExtraOptionsHandler): void => {\n if (typeof options == 'object' && options !== null) {\n if (seen.has(options)) {\n throw new Error('Circular reference in options');\n } else {\n seen.add(options);\n }\n }\n\n Object.entries(options).forEach(([key, value]) => {\n const name = (prefix) ? prefix + key : key;\n if (typeof value === 'object') {\n iterateExtraOptions(value as Record, name + '.', seen, handler);\n } else if (typeof value === 'string' || typeof value === 'number') {\n handler(name, value.toString());\n } else if (typeof value === 'boolean') {\n handler(name, (value) ? '1' : '0');\n } else {\n throw new Error(`Can't handle extra config type: ${typeof value}`);\n }\n });\n };\n\n/**\n * check web assembly API's last error and throw error if any error occurred.\n * @param message a message used when an error occurred.\n */\nexport const checkLastError = (message: string): void => {\n const wasm = getInstance();\n\n const stack = wasm.stackSave();\n try {\n const paramsOffset = wasm.stackAlloc(8);\n wasm._OrtGetLastError(paramsOffset, paramsOffset + 4);\n const errorCode = wasm.HEAP32[paramsOffset / 4];\n const errorMessagePointer = wasm.HEAPU32[paramsOffset / 4 + 1];\n const errorMessage = errorMessagePointer ? wasm.UTF8ToString(errorMessagePointer) : '';\n throw new Error(`${message} ERROR_CODE: ${errorCode}, ERROR_MESSAGE: ${errorMessage}`);\n } finally {\n wasm.stackRestore(stack);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession} from 'onnxruntime-common';\n\nimport {getInstance} from './wasm-factory';\nimport {allocWasmString, checkLastError, iterateExtraOptions} from './wasm-utils';\n\nexport const setRunOptions = (options: InferenceSession.RunOptions): [number, number[]] => {\n const wasm = getInstance();\n let runOptionsHandle = 0;\n const allocs: number[] = [];\n\n const runOptions: InferenceSession.RunOptions = options || {};\n\n try {\n if (options?.logSeverityLevel === undefined) {\n runOptions.logSeverityLevel = 2; // Default to warning\n } else if (\n typeof options.logSeverityLevel !== 'number' || !Number.isInteger(options.logSeverityLevel) ||\n options.logSeverityLevel < 0 || options.logSeverityLevel > 4) {\n throw new Error(`log serverity level is not valid: ${options.logSeverityLevel}`);\n }\n\n if (options?.logVerbosityLevel === undefined) {\n runOptions.logVerbosityLevel = 0; // Default to 0\n } else if (typeof options.logVerbosityLevel !== 'number' || !Number.isInteger(options.logVerbosityLevel)) {\n throw new Error(`log verbosity level is not valid: ${options.logVerbosityLevel}`);\n }\n\n if (options?.terminate === undefined) {\n runOptions.terminate = false;\n }\n\n let tagDataOffset = 0;\n if (options?.tag !== undefined) {\n tagDataOffset = allocWasmString(options.tag, allocs);\n }\n\n runOptionsHandle = wasm._OrtCreateRunOptions(\n runOptions.logSeverityLevel!, runOptions.logVerbosityLevel!, !!runOptions.terminate!, tagDataOffset);\n if (runOptionsHandle === 0) {\n checkLastError('Can\\'t create run options.');\n }\n\n if (options?.extra !== undefined) {\n iterateExtraOptions(options.extra, '', new WeakSet>(), (key, value) => {\n const keyDataOffset = allocWasmString(key, allocs);\n const valueDataOffset = allocWasmString(value, allocs);\n\n if (wasm._OrtAddRunConfigEntry(runOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n checkLastError(`Can't set a run config entry: ${key} - ${value}.`);\n }\n });\n }\n\n return [runOptionsHandle, allocs];\n } catch (e) {\n if (runOptionsHandle !== 0) {\n wasm._OrtReleaseRunOptions(runOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n throw e;\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession} from 'onnxruntime-common';\n\nimport {getInstance} from './wasm-factory';\nimport {allocWasmString, checkLastError, iterateExtraOptions} from './wasm-utils';\n\nconst getGraphOptimzationLevel = (graphOptimizationLevel: string|unknown): number => {\n switch (graphOptimizationLevel) {\n case 'disabled':\n return 0;\n case 'basic':\n return 1;\n case 'extended':\n return 2;\n case 'all':\n return 99;\n default:\n throw new Error(`unsupported graph optimization level: ${graphOptimizationLevel}`);\n }\n};\n\nconst getExecutionMode = (executionMode: 'sequential'|'parallel'): number => {\n switch (executionMode) {\n case 'sequential':\n return 0;\n case 'parallel':\n return 1;\n default:\n throw new Error(`unsupported execution mode: ${executionMode}`);\n }\n};\n\nconst appendDefaultOptions = (options: InferenceSession.SessionOptions): void => {\n if (!options.extra) {\n options.extra = {};\n }\n if (!options.extra.session) {\n options.extra.session = {};\n }\n const session = options.extra.session as Record;\n if (!session.use_ort_model_bytes_directly) {\n // eslint-disable-next-line camelcase\n session.use_ort_model_bytes_directly = '1';\n }\n\n // if using JSEP with WebGPU, always disable memory pattern\n if (options.executionProviders &&\n options.executionProviders.some(ep => (typeof ep === 'string' ? ep : ep.name) === 'webgpu')) {\n options.enableMemPattern = false;\n }\n};\n\nconst setExecutionProviders =\n (sessionOptionsHandle: number, executionProviders: readonly InferenceSession.ExecutionProviderConfig[],\n allocs: number[]): void => {\n for (const ep of executionProviders) {\n let epName = typeof ep === 'string' ? ep : ep.name;\n\n // check EP name\n switch (epName) {\n case 'webnn':\n epName = 'WEBNN';\n if (typeof ep !== 'string') {\n const webnnOptions = ep as InferenceSession.WebNNExecutionProviderOption;\n if (webnnOptions?.deviceType) {\n const keyDataOffset = allocWasmString('deviceType', allocs);\n const valueDataOffset = allocWasmString(webnnOptions.deviceType, allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(`Can't set a session config entry: 'deviceType' - ${webnnOptions.deviceType}.`);\n }\n }\n if (webnnOptions?.numThreads) {\n let numThreads = webnnOptions.numThreads;\n // Just ignore invalid webnnOptions.numThreads.\n if (typeof numThreads != 'number' || !Number.isInteger(numThreads) || numThreads < 0) {\n numThreads = 0;\n }\n const keyDataOffset = allocWasmString('numThreads', allocs);\n const valueDataOffset = allocWasmString(numThreads.toString(), allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(`Can't set a session config entry: 'numThreads' - ${webnnOptions.numThreads}.`);\n }\n }\n if (webnnOptions?.powerPreference) {\n const keyDataOffset = allocWasmString('powerPreference', allocs);\n const valueDataOffset = allocWasmString(webnnOptions.powerPreference, allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(\n `Can't set a session config entry: 'powerPreference' - ${webnnOptions.powerPreference}.`);\n }\n }\n }\n break;\n case 'webgpu':\n epName = 'JS';\n if (typeof ep !== 'string') {\n const webgpuOptions = ep as InferenceSession.WebGpuExecutionProviderOption;\n if (webgpuOptions?.preferredLayout) {\n if (webgpuOptions.preferredLayout !== 'NCHW' && webgpuOptions.preferredLayout !== 'NHWC') {\n throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${webgpuOptions.preferredLayout}`);\n }\n const keyDataOffset = allocWasmString('preferredLayout', allocs);\n const valueDataOffset = allocWasmString(webgpuOptions.preferredLayout, allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(\n `Can't set a session config entry: 'preferredLayout' - ${webgpuOptions.preferredLayout}.`);\n }\n }\n }\n break;\n case 'wasm':\n case 'cpu':\n continue;\n default:\n throw new Error(`not supported execution provider: ${epName}`);\n }\n\n const epNameDataOffset = allocWasmString(epName, allocs);\n if (getInstance()._OrtAppendExecutionProvider(sessionOptionsHandle, epNameDataOffset) !== 0) {\n checkLastError(`Can't append execution provider: ${epName}.`);\n }\n }\n };\n\nexport const setSessionOptions = (options?: InferenceSession.SessionOptions): [number, number[]] => {\n const wasm = getInstance();\n let sessionOptionsHandle = 0;\n const allocs: number[] = [];\n\n const sessionOptions: InferenceSession.SessionOptions = options || {};\n appendDefaultOptions(sessionOptions);\n\n try {\n const graphOptimizationLevel = getGraphOptimzationLevel(sessionOptions.graphOptimizationLevel ?? 'all');\n const executionMode = getExecutionMode(sessionOptions.executionMode ?? 'sequential');\n const logIdDataOffset =\n typeof sessionOptions.logId === 'string' ? allocWasmString(sessionOptions.logId, allocs) : 0;\n\n const logSeverityLevel = sessionOptions.logSeverityLevel ?? 2; // Default to 2 - warning\n if (!Number.isInteger(logSeverityLevel) || logSeverityLevel < 0 || logSeverityLevel > 4) {\n throw new Error(`log serverity level is not valid: ${logSeverityLevel}`);\n }\n\n const logVerbosityLevel = sessionOptions.logVerbosityLevel ?? 0; // Default to 0 - verbose\n if (!Number.isInteger(logVerbosityLevel) || logVerbosityLevel < 0 || logVerbosityLevel > 4) {\n throw new Error(`log verbosity level is not valid: ${logVerbosityLevel}`);\n }\n\n const optimizedModelFilePathOffset = typeof sessionOptions.optimizedModelFilePath === 'string' ?\n allocWasmString(sessionOptions.optimizedModelFilePath, allocs) :\n 0;\n\n sessionOptionsHandle = wasm._OrtCreateSessionOptions(\n graphOptimizationLevel, !!sessionOptions.enableCpuMemArena, !!sessionOptions.enableMemPattern, executionMode,\n !!sessionOptions.enableProfiling, 0, logIdDataOffset, logSeverityLevel, logVerbosityLevel,\n optimizedModelFilePathOffset);\n if (sessionOptionsHandle === 0) {\n checkLastError('Can\\'t create session options.');\n }\n\n if (sessionOptions.executionProviders) {\n setExecutionProviders(sessionOptionsHandle, sessionOptions.executionProviders, allocs);\n }\n\n if (sessionOptions.enableGraphCapture !== undefined) {\n if (typeof sessionOptions.enableGraphCapture !== 'boolean') {\n throw new Error(`enableGraphCapture must be a boolean value: ${sessionOptions.enableGraphCapture}`);\n }\n const keyDataOffset = allocWasmString('enableGraphCapture', allocs);\n const valueDataOffset = allocWasmString(sessionOptions.enableGraphCapture.toString(), allocs);\n if (wasm._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n checkLastError(\n `Can't set a session config entry: 'enableGraphCapture' - ${sessionOptions.enableGraphCapture}.`);\n }\n }\n\n if (sessionOptions.freeDimensionOverrides) {\n for (const [name, value] of Object.entries(sessionOptions.freeDimensionOverrides)) {\n if (typeof name !== 'string') {\n throw new Error(`free dimension override name must be a string: ${name}`);\n }\n if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) {\n throw new Error(`free dimension override value must be a non-negative integer: ${value}`);\n }\n const nameOffset = allocWasmString(name, allocs);\n if (wasm._OrtAddFreeDimensionOverride(sessionOptionsHandle, nameOffset, value) !== 0) {\n checkLastError(`Can't set a free dimension override: ${name} - ${value}.`);\n }\n }\n }\n\n if (sessionOptions.extra !== undefined) {\n iterateExtraOptions(sessionOptions.extra, '', new WeakSet>(), (key, value) => {\n const keyDataOffset = allocWasmString(key, allocs);\n const valueDataOffset = allocWasmString(value, allocs);\n\n if (wasm._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n checkLastError(`Can't set a session config entry: ${key} - ${value}.`);\n }\n });\n }\n\n return [sessionOptionsHandle, allocs];\n } catch (e) {\n if (sessionOptionsHandle !== 0) {\n wasm._OrtReleaseSessionOptions(sessionOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n throw e;\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from 'onnxruntime-common';\n\n// a dummy type declaration for Float16Array in case any polyfill is available.\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any\n const Float16Array: any;\n}\n\n// This file includes common definitions. They do NOT have dependency on the WebAssembly instance.\n\n/**\n * Copied from ONNX definition. Use this to drop dependency 'onnx_proto' to decrease compiled .js file size.\n */\nexport const enum DataType {\n undefined = 0,\n float = 1,\n uint8 = 2,\n int8 = 3,\n uint16 = 4,\n int16 = 5,\n int32 = 6,\n int64 = 7,\n string = 8,\n bool = 9,\n float16 = 10,\n double = 11,\n uint32 = 12,\n uint64 = 13,\n complex64 = 14,\n complex128 = 15,\n bfloat16 = 16\n}\n\n/**\n * Map string tensor data to enum value\n */\nexport const tensorDataTypeStringToEnum = (type: string): DataType => {\n switch (type) {\n case 'int8':\n return DataType.int8;\n case 'uint8':\n return DataType.uint8;\n case 'bool':\n return DataType.bool;\n case 'int16':\n return DataType.int16;\n case 'uint16':\n return DataType.uint16;\n case 'int32':\n return DataType.int32;\n case 'uint32':\n return DataType.uint32;\n case 'float16':\n return DataType.float16;\n case 'float32':\n return DataType.float;\n case 'float64':\n return DataType.double;\n case 'string':\n return DataType.string;\n case 'int64':\n return DataType.int64;\n case 'uint64':\n return DataType.uint64;\n\n default:\n throw new Error(`unsupported data type: ${type}`);\n }\n};\n\n/**\n * Map enum value to string tensor data\n */\nexport const tensorDataTypeEnumToString = (typeProto: DataType): Tensor.Type => {\n switch (typeProto) {\n case DataType.int8:\n return 'int8';\n case DataType.uint8:\n return 'uint8';\n case DataType.bool:\n return 'bool';\n case DataType.int16:\n return 'int16';\n case DataType.uint16:\n return 'uint16';\n case DataType.int32:\n return 'int32';\n case DataType.uint32:\n return 'uint32';\n case DataType.float16:\n return 'float16';\n case DataType.float:\n return 'float32';\n case DataType.double:\n return 'float64';\n case DataType.string:\n return 'string';\n case DataType.int64:\n return 'int64';\n case DataType.uint64:\n return 'uint64';\n\n default:\n throw new Error(`unsupported data type: ${typeProto}`);\n }\n};\n\n/**\n * get tensor element size in bytes by the given data type\n * @returns size in integer or undefined if the data type is not supported\n */\nexport const getTensorElementSize = (dateType: number): number|\n undefined => [undefined, 4, 1, 1, 2, 2, 4, 8, undefined, 1, 2, 8, 4, 8, undefined, undefined, undefined][dateType];\n\n/**\n * get typed array constructor by the given tensor type\n */\nexport const tensorTypeToTypedArrayConstructor = (type: Tensor.Type): Float32ArrayConstructor|Uint8ArrayConstructor|\n Int8ArrayConstructor|Uint16ArrayConstructor|Int16ArrayConstructor|Int32ArrayConstructor|BigInt64ArrayConstructor|\n Uint8ArrayConstructor|Float64ArrayConstructor|Uint32ArrayConstructor|BigUint64ArrayConstructor => {\n switch (type) {\n case 'float16':\n // allow Float16Array polyfill.\n return typeof Float16Array !== 'undefined' && Float16Array.from ? Float16Array : Uint16Array;\n case 'float32':\n return Float32Array;\n case 'uint8':\n return Uint8Array;\n case 'int8':\n return Int8Array;\n case 'uint16':\n return Uint16Array;\n case 'int16':\n return Int16Array;\n case 'int32':\n return Int32Array;\n case 'bool':\n return Uint8Array;\n case 'float64':\n return Float64Array;\n case 'uint32':\n return Uint32Array;\n case 'int64':\n return BigInt64Array;\n case 'uint64':\n return BigUint64Array;\n default:\n throw new Error(`unsupported type: ${type}`);\n }\n };\n\n/**\n * Map string log level to integer value\n */\nexport const logLevelStringToEnum = (logLevel?: 'verbose'|'info'|'warning'|'error'|'fatal'): number => {\n switch (logLevel) {\n case 'verbose':\n return 0;\n case 'info':\n return 1;\n case 'warning':\n return 2;\n case 'error':\n return 3;\n case 'fatal':\n return 4;\n default:\n throw new Error(`unsupported logging level: ${logLevel}`);\n }\n};\n\n/**\n * Check whether the given tensor type is supported by GPU buffer\n */\nexport const isGpuBufferSupportedType = (type: Tensor.Type): type is Tensor.GpuBufferDataTypes => type === 'float32' ||\n type === 'float16' || type === 'int32' || type === 'int64' || type === 'uint32' || type === 'uint8' ||\n type === 'bool';\n\n/**\n * Map string data location to integer value\n */\nexport const dataLocationStringToEnum = (location: Tensor.DataLocation): number => {\n switch (location) {\n case 'none':\n return 0;\n case 'cpu':\n return 1;\n case 'cpu-pinned':\n return 2;\n case 'texture':\n return 3;\n case 'gpu-buffer':\n return 4;\n default:\n throw new Error(`unsupported data location: ${location}`);\n }\n};\n\n/**\n * Map integer data location to string value\n */\nexport const dataLocationEnumToString = (location: number): Tensor.DataLocation|undefined =>\n (['none', 'cpu', 'cpu-pinned', 'texture', 'gpu-buffer'] as const)[location];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport * as fs from 'fs';\nimport {readFile} from 'node:fs/promises';\n\n/**\n * Load a file into a Uint8Array.\n *\n * @param file - the file to load. Can be a URL/path, a Blob, an ArrayBuffer, or a Uint8Array.\n * @returns a Uint8Array containing the file data.\n */\nexport const loadFile = async(file: string|Blob|ArrayBufferLike|Uint8Array): Promise => {\n if (typeof file === 'string') {\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // load file into ArrayBuffer in Node.js\n try {\n return new Uint8Array(await readFile(file));\n } catch (e) {\n if (e.code === 'ERR_FS_FILE_TOO_LARGE') {\n // file is too large, use fs.createReadStream instead\n const stream = fs.createReadStream(file);\n const chunks: Uint8Array[] = [];\n for await (const chunk of stream) {\n chunks.push(chunk);\n }\n return new Uint8Array(Buffer.concat(chunks));\n }\n throw e;\n }\n } else {\n // load file into ArrayBuffer in browsers\n const response = await fetch(file);\n if (!response.ok) {\n throw new Error(`failed to load external data file: ${file}`);\n }\n const contentLengthHeader = response.headers.get('Content-Length');\n const fileSize = contentLengthHeader ? parseInt(contentLengthHeader, 10) : 0;\n if (fileSize < 1073741824 /* 1GB */) {\n // when Content-Length header is not set, we cannot determine the file size. We assume it is small enough to\n // load into memory.\n return new Uint8Array(await response.arrayBuffer());\n } else {\n // file is too large, use stream instead\n if (!response.body) {\n throw new Error(`failed to load external data file: ${file}, no response body.`);\n }\n const reader = response.body.getReader();\n\n let buffer;\n try {\n // try to create ArrayBuffer directly\n buffer = new ArrayBuffer(fileSize);\n } catch (e) {\n if (e instanceof RangeError) {\n // use WebAssembly Memory to allocate larger ArrayBuffer\n const pages = Math.ceil(fileSize / 65536);\n buffer = new WebAssembly.Memory({initial: pages, maximum: pages}).buffer;\n } else {\n throw e;\n }\n }\n\n let offset = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n const chunkSize = value.byteLength;\n const chunk = new Uint8Array(buffer, offset, chunkSize);\n chunk.set(value);\n offset += chunkSize;\n }\n return new Uint8Array(buffer, 0, fileSize);\n }\n }\n\n } else if (file instanceof Blob) {\n return new Uint8Array(await file.arrayBuffer());\n } else if (file instanceof Uint8Array) {\n return file;\n } else {\n return new Uint8Array(file);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Env, InferenceSession, Tensor} from 'onnxruntime-common';\n\nimport {SerializableInternalBuffer, SerializableSessionMetadata, SerializableTensorMetadata, TensorMetadata} from './proxy-messages';\nimport {setRunOptions} from './run-options';\nimport {setSessionOptions} from './session-options';\nimport {dataLocationStringToEnum, getTensorElementSize, isGpuBufferSupportedType, logLevelStringToEnum, tensorDataTypeEnumToString, tensorDataTypeStringToEnum, tensorTypeToTypedArrayConstructor} from './wasm-common';\nimport {getInstance} from './wasm-factory';\nimport {allocWasmString, checkLastError} from './wasm-utils';\nimport {loadFile} from './wasm-utils-load-file';\n\n// #region Initializations\n\n/**\n * There are 4 different \"initialization\" steps for ORT. They happen in different places and different time.\n *\n * 1. JavaScript initialization for onnxruntime-common and onnxruntime-web.\n * This is the first initialization step. In this step, onnxruntime-web calls onnxruntime-common's registerBackend()\n * function multiple times to register all the available backends. The backend registration is very fast. It only\n * registers the backend name with the uninitialized backend object. No heavy initialization is done in this step.\n * Refer to web/lib/index.ts for the backend registration.\n *\n * 2. WebAssembly artifact initialization.\n * This happens when any registered wasm backend is used for the first time (ie. `ort.InferenceSession.create()` or\n * `ort.TrainingSession.create()` is called). In this step, onnxruntime-web does the followings:\n * - create a proxy worker and make sure the proxy worker is ready to receive messages, if proxy is enabled.\n * - perform feature detection, locate correct WebAssembly artifact path and call the Emscripten generated\n * JavaScript code to initialize the WebAssembly runtime.\n * - if proxy is enabled, this step happens in the proxy worker using message 'init-wasm'.\n * - downloading the 'ort-wasm{...}.wasm' file is done in this step.\n * - if multi-thread is enabled, one or more webworker will be created to initialize the PThread threadpool.\n *\n * 3. ORT environment initialization.\n * This happens after step 2. In this step, onnxruntime-web performs ONNX Runtime environment initialization.\n * Function `_OrtInit()` is called in this step.\n * - if proxy is enabled, this step happens in the proxy worker using message 'init-ort'.\n * - logging level (ort.env.logLevel) and thread number (ort.env.wasm.numThreads) are set in this step.\n *\n * 4. Session initialization.\n * This happens when `ort.InferenceSession.create()` or `ort.TrainingSession.create()` is called. Unlike the first 3\n * steps (they only called once), this step will be done for each session. In this step, onnxruntime-web does the\n * followings:\n * If the parameter is a URL:\n * - download the model data from the URL.\n * - copy the model data to the WASM heap. (proxy: 'copy-from')\n * - dereference the model buffer. This step allows the original ArrayBuffer to be garbage collected.\n * - call `_OrtCreateSession()` to create the session. (proxy: 'create')\n *\n * If the parameter is a Uint8Array object:\n * - copy the model data to the WASM heap. (proxy: 'copy-from')\n * - call `_OrtCreateSession()` to create the session. (proxy: 'create')\n *\n *\n */\n\n/**\n * initialize ORT environment.\n *\n * @param numThreads SetGlobalIntraOpNumThreads(numThreads)\n * @param loggingLevel CreateEnv(static_cast(logging_level))\n */\nconst initOrt = (numThreads: number, loggingLevel: number): void => {\n const errorCode = getInstance()._OrtInit(numThreads, loggingLevel);\n if (errorCode !== 0) {\n checkLastError('Can\\'t initialize onnxruntime.');\n }\n};\n\n/**\n * intialize runtime environment.\n * @param env passed in the environment config object.\n */\nexport const initRuntime = async(env: Env): Promise => {\n // init ORT\n initOrt(env.wasm.numThreads!, logLevelStringToEnum(env.logLevel));\n};\n\n/**\n * perform EP specific initialization.\n *\n * @param env\n * @param epName\n */\nexport const initEp = async(env: Env, epName: string): Promise => {\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const initJsep = require('./jsep/init').init;\n\n if (epName === 'webgpu') {\n // perform WebGPU availability check\n if (typeof navigator === 'undefined' || !navigator.gpu) {\n throw new Error('WebGPU is not supported in current environment');\n }\n\n let adapter = env.webgpu.adapter as GPUAdapter | null;\n if (!adapter) {\n // if adapter is not set, request a new adapter.\n const powerPreference = env.webgpu.powerPreference;\n if (powerPreference !== undefined && powerPreference !== 'low-power' &&\n powerPreference !== 'high-performance') {\n throw new Error(`Invalid powerPreference setting: \"${powerPreference}\"`);\n }\n const forceFallbackAdapter = env.webgpu.forceFallbackAdapter;\n if (forceFallbackAdapter !== undefined && typeof forceFallbackAdapter !== 'boolean') {\n throw new Error(`Invalid forceFallbackAdapter setting: \"${forceFallbackAdapter}\"`);\n }\n adapter = await navigator.gpu.requestAdapter({powerPreference, forceFallbackAdapter});\n if (!adapter) {\n throw new Error(\n 'Failed to get GPU adapter. ' +\n 'You may need to enable flag \"--enable-unsafe-webgpu\" if you are using Chrome.');\n }\n } else {\n // if adapter is set, validate it.\n if (typeof adapter.limits !== 'object' || typeof adapter.features !== 'object' ||\n typeof adapter.requestDevice !== 'function') {\n throw new Error('Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.');\n }\n }\n\n if (!env.wasm.simd) {\n throw new Error(\n 'Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using `webgpu` EP');\n }\n\n await initJsep('webgpu', getInstance(), env, adapter);\n }\n if (epName === 'webnn') {\n // perform WebNN availability check\n if (typeof navigator === 'undefined' || !(navigator as unknown as {ml: unknown}).ml) {\n throw new Error('WebNN is not supported in current environment');\n }\n\n await initJsep('webnn', getInstance(), env);\n }\n }\n};\n\n// #endregion Initializations\n\n/**\n * valid data locations for input/output tensors.\n */\ntype SupportedTensorDataLocationForInputOutput = 'cpu'|'cpu-pinned'|'gpu-buffer';\n\ntype IOBindingState = {\n /**\n * the handle of IO binding.\n */\n readonly handle: number;\n\n /**\n * the preferred location for each output tensor.\n *\n * value is one of 'cpu', 'cpu-pinned', 'gpu-buffer'.\n */\n readonly outputPreferredLocations: readonly SupportedTensorDataLocationForInputOutput[];\n\n /**\n * enum value of the preferred location for each output tensor.\n */\n readonly outputPreferredLocationsEncoded: readonly number[];\n};\n\n/**\n * tuple elements are: InferenceSession ID; inputNamesUTF8Encoded; outputNamesUTF8Encoded; bindingState\n */\ntype SessionMetadata = [\n inferenceSessionId: number, inputNamesUTF8Encoded: number[], outputNamesUTF8Encoded: number[],\n bindingState: IOBindingState|null, enableGraphCapture: boolean, inputOutputBound: boolean\n];\n\nconst activeSessions = new Map();\n\n/**\n * get the input/output count of the session.\n * @param sessionHandle the handle representing the session. should be non-zero.\n * @returns a tuple including 2 numbers, representing the input count and output count.\n */\nconst getSessionInputOutputCount = (sessionHandle: number): [number, number] => {\n const wasm = getInstance();\n const stack = wasm.stackSave();\n try {\n const dataOffset = wasm.stackAlloc(8);\n const errorCode = wasm._OrtGetInputOutputCount(sessionHandle, dataOffset, dataOffset + 4);\n if (errorCode !== 0) {\n checkLastError('Can\\'t get session input/output count.');\n }\n return [wasm.HEAP32[dataOffset / 4], wasm.HEAP32[dataOffset / 4 + 1]];\n } finally {\n wasm.stackRestore(stack);\n }\n};\n\n/**\n * allocate the memory and memcpy the external buffer.\n *\n * @param model - the external buffer containing the model data. Must not be the same buffer as the WASM heap.\n * @returns a 2-elements tuple - the pointer and size of the allocated buffer\n */\nexport const copyFromExternalBuffer = (model: Uint8Array): [number, number] => {\n const wasm = getInstance();\n const modelDataOffset = wasm._malloc(model.byteLength);\n if (modelDataOffset === 0) {\n throw new Error(`Can't create a session. failed to allocate a buffer of size ${model.byteLength}.`);\n }\n wasm.HEAPU8.set(model, modelDataOffset);\n return [modelDataOffset, model.byteLength];\n};\n\n/**\n * create an inference session from a model data buffer.\n *\n * @param modelData - either a Uint8Array object representing the model data, or a 2-elements tuple containing the\n * pointer and size of the model data buffer.\n * @param options an optional session options object.\n * @returns a 3-elements tuple containing [session handle, input names, output names]\n */\nexport const createSession = async(\n modelData: Uint8Array|SerializableInternalBuffer,\n options?: InferenceSession.SessionOptions): Promise => {\n let modelDataOffset: number, modelDataLength: number;\n const wasm = getInstance();\n\n if (Array.isArray(modelData)) {\n // if model data is an array, it must be a 2-elements tuple containing the pointer and size of the model data\n [modelDataOffset, modelDataLength] = modelData;\n } else if (modelData.buffer === wasm.HEAPU8.buffer) {\n // if model data uses the same buffer as the WASM heap, we don't need to copy it.\n [modelDataOffset, modelDataLength] = [modelData.byteOffset, modelData.byteLength];\n } else {\n // otherwise, copy the model data to the WASM heap.\n [modelDataOffset, modelDataLength] = copyFromExternalBuffer(modelData);\n }\n\n let sessionHandle = 0;\n let sessionOptionsHandle = 0;\n let ioBindingHandle = 0;\n let allocs: number[] = [];\n const inputNamesUTF8Encoded = [];\n const outputNamesUTF8Encoded = [];\n\n try {\n [sessionOptionsHandle, allocs] = setSessionOptions(options);\n\n if (options?.externalData && wasm.mountExternalData) {\n const loadingPromises = [];\n for (const file of options.externalData) {\n const path = typeof file === 'string' ? file : file.path;\n loadingPromises.push(loadFile(typeof file === 'string' ? file : file.data).then(data => {\n wasm.mountExternalData!(path, data);\n }));\n }\n\n // wait for all external data files to be loaded\n await Promise.all(loadingPromises);\n }\n\n sessionHandle = await wasm._OrtCreateSession(modelDataOffset, modelDataLength, sessionOptionsHandle);\n if (sessionHandle === 0) {\n checkLastError('Can\\'t create a session.');\n }\n\n const [inputCount, outputCount] = getSessionInputOutputCount(sessionHandle);\n\n const enableGraphCapture = !!options?.enableGraphCapture;\n\n const inputNames = [];\n const outputNames = [];\n const outputPreferredLocations: SupportedTensorDataLocationForInputOutput[] = [];\n for (let i = 0; i < inputCount; i++) {\n const name = wasm._OrtGetInputName(sessionHandle, i);\n if (name === 0) {\n checkLastError('Can\\'t get an input name.');\n }\n inputNamesUTF8Encoded.push(name);\n inputNames.push(wasm.UTF8ToString(name));\n }\n for (let i = 0; i < outputCount; i++) {\n const name = wasm._OrtGetOutputName(sessionHandle, i);\n if (name === 0) {\n checkLastError('Can\\'t get an output name.');\n }\n outputNamesUTF8Encoded.push(name);\n const nameString = wasm.UTF8ToString(name);\n outputNames.push(nameString);\n\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n if (enableGraphCapture && options?.preferredOutputLocation === undefined) {\n outputPreferredLocations.push('gpu-buffer');\n continue;\n }\n const location = typeof options?.preferredOutputLocation === 'string' ?\n options.preferredOutputLocation :\n options?.preferredOutputLocation?.[nameString] ?? 'cpu';\n if (location !== 'cpu' && location !== 'cpu-pinned' && location !== 'gpu-buffer') {\n throw new Error(`Not supported preferred output location: ${location}.`);\n }\n if (enableGraphCapture && location !== 'gpu-buffer') {\n throw new Error(`Not supported preferred output location: ${\n location}. Only 'gpu-buffer' location is supported when enableGraphCapture is true.`);\n }\n outputPreferredLocations.push(location);\n }\n }\n\n // use IO binding only when at least one output is preffered to be on GPU.\n let bindingState: IOBindingState|null = null;\n if (!BUILD_DEFS.DISABLE_WEBGPU && outputPreferredLocations.some(l => l === 'gpu-buffer')) {\n ioBindingHandle = wasm._OrtCreateBinding(sessionHandle);\n if (ioBindingHandle === 0) {\n checkLastError('Can\\'t create IO binding.');\n }\n\n bindingState = {\n handle: ioBindingHandle,\n outputPreferredLocations,\n outputPreferredLocationsEncoded: outputPreferredLocations.map(l => dataLocationStringToEnum(l)),\n };\n }\n\n activeSessions.set(\n sessionHandle,\n [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, bindingState, enableGraphCapture, false]);\n return [sessionHandle, inputNames, outputNames];\n } catch (e) {\n inputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n outputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n\n if (ioBindingHandle !== 0) {\n wasm._OrtReleaseBinding(ioBindingHandle);\n }\n\n if (sessionHandle !== 0) {\n wasm._OrtReleaseSession(sessionHandle);\n }\n throw e;\n } finally {\n wasm._free(modelDataOffset);\n if (sessionOptionsHandle !== 0) {\n wasm._OrtReleaseSessionOptions(sessionOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n\n // unmount external data if necessary\n wasm.unmountExternalData?.();\n }\n};\n\nexport const releaseSession = (sessionId: number): void => {\n const wasm = getInstance();\n const session = activeSessions.get(sessionId);\n if (!session) {\n throw new Error(`cannot release session. invalid session id: ${sessionId}`);\n }\n const [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture] = session;\n\n if (ioBindingState) {\n if (enableGraphCapture) {\n wasm._OrtClearBoundOutputs(ioBindingState.handle);\n }\n wasm._OrtReleaseBinding(ioBindingState.handle);\n }\n\n wasm.jsepOnReleaseSession?.(sessionId);\n\n inputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n outputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n wasm._OrtReleaseSession(sessionHandle);\n activeSessions.delete(sessionId);\n};\n\nexport const prepareInputOutputTensor =\n (tensor: TensorMetadata|null, tensorHandles: number[], allocs: number[], sessionId: number, index: number,\n enableGraphCapture = false): void => {\n if (!tensor) {\n tensorHandles.push(0);\n return;\n }\n\n const wasm = getInstance();\n\n const dataType = tensor[0];\n const dims = tensor[1];\n const location = tensor[3];\n\n let rawData: number;\n let dataByteLength: number;\n\n if (dataType === 'string' && location === 'gpu-buffer') {\n throw new Error('String tensor is not supported on GPU.');\n }\n\n if (enableGraphCapture && location !== 'gpu-buffer') {\n throw new Error(\n `External buffer must be provided for input/output index ${index} when enableGraphCapture is true.`);\n }\n\n if (location === 'gpu-buffer') {\n const gpuBuffer = tensor[2].gpuBuffer as GPUBuffer;\n const elementSizeInBytes = getTensorElementSize(tensorDataTypeStringToEnum(dataType))!;\n dataByteLength = dims.reduce((a, b) => a * b, 1) * elementSizeInBytes;\n\n const registerBuffer = wasm.jsepRegisterBuffer;\n if (!registerBuffer) {\n throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');\n }\n rawData = registerBuffer(sessionId, index, gpuBuffer, dataByteLength);\n } else {\n const data = tensor[2];\n\n if (Array.isArray(data)) {\n // string tensor\n dataByteLength = 4 * data.length;\n rawData = wasm._malloc(dataByteLength);\n allocs.push(rawData);\n let dataIndex = rawData / 4;\n for (let i = 0; i < data.length; i++) {\n if (typeof data[i] !== 'string') {\n throw new TypeError(`tensor data at index ${i} is not a string`);\n }\n wasm.HEAPU32[dataIndex++] = allocWasmString(data[i], allocs);\n }\n } else {\n dataByteLength = data.byteLength;\n rawData = wasm._malloc(dataByteLength);\n allocs.push(rawData);\n wasm.HEAPU8.set(new Uint8Array(data.buffer, data.byteOffset, dataByteLength), rawData);\n }\n }\n\n const stack = wasm.stackSave();\n const dimsOffset = wasm.stackAlloc(4 * dims.length);\n try {\n let dimIndex = dimsOffset / 4;\n dims.forEach(d => wasm.HEAP32[dimIndex++] = d);\n const tensor = wasm._OrtCreateTensor(\n tensorDataTypeStringToEnum(dataType), rawData, dataByteLength, dimsOffset, dims.length,\n dataLocationStringToEnum(location));\n if (tensor === 0) {\n checkLastError(`Can't create tensor for input/output. session=${sessionId}, index=${index}.`);\n }\n tensorHandles.push(tensor);\n } finally {\n wasm.stackRestore(stack);\n }\n };\n\n/**\n * perform inference run\n */\nexport const run = async(\n sessionId: number, inputIndices: number[], inputTensors: TensorMetadata[], outputIndices: number[],\n outputTensors: Array, options: InferenceSession.RunOptions): Promise => {\n const wasm = getInstance();\n const session = activeSessions.get(sessionId);\n if (!session) {\n throw new Error(`cannot run inference. invalid session id: ${sessionId}`);\n }\n const sessionHandle = session[0];\n const inputNamesUTF8Encoded = session[1];\n const outputNamesUTF8Encoded = session[2];\n const ioBindingState = session[3];\n const enableGraphCapture = session[4];\n const inputOutputBound = session[5];\n\n const inputCount = inputIndices.length;\n const outputCount = outputIndices.length;\n\n let runOptionsHandle = 0;\n let runOptionsAllocs: number[] = [];\n\n const inputTensorHandles: number[] = [];\n const outputTensorHandles: number[] = [];\n const inputOutputAllocs: number[] = [];\n\n const beforeRunStack = wasm.stackSave();\n const inputValuesOffset = wasm.stackAlloc(inputCount * 4);\n const inputNamesOffset = wasm.stackAlloc(inputCount * 4);\n const outputValuesOffset = wasm.stackAlloc(outputCount * 4);\n const outputNamesOffset = wasm.stackAlloc(outputCount * 4);\n\n try {\n [runOptionsHandle, runOptionsAllocs] = setRunOptions(options);\n\n // create input tensors\n for (let i = 0; i < inputCount; i++) {\n prepareInputOutputTensor(\n inputTensors[i], inputTensorHandles, inputOutputAllocs, sessionId, inputIndices[i], enableGraphCapture);\n }\n\n // create output tensors\n for (let i = 0; i < outputCount; i++) {\n prepareInputOutputTensor(\n outputTensors[i], outputTensorHandles, inputOutputAllocs, sessionId, inputCount + outputIndices[i],\n enableGraphCapture);\n }\n\n let inputValuesIndex = inputValuesOffset / 4;\n let inputNamesIndex = inputNamesOffset / 4;\n let outputValuesIndex = outputValuesOffset / 4;\n let outputNamesIndex = outputNamesOffset / 4;\n for (let i = 0; i < inputCount; i++) {\n wasm.HEAPU32[inputValuesIndex++] = inputTensorHandles[i];\n wasm.HEAPU32[inputNamesIndex++] = inputNamesUTF8Encoded[inputIndices[i]];\n }\n for (let i = 0; i < outputCount; i++) {\n wasm.HEAPU32[outputValuesIndex++] = outputTensorHandles[i];\n wasm.HEAPU32[outputNamesIndex++] = outputNamesUTF8Encoded[outputIndices[i]];\n }\n\n if (!BUILD_DEFS.DISABLE_WEBGPU && ioBindingState && !inputOutputBound) {\n const {handle, outputPreferredLocations, outputPreferredLocationsEncoded} = ioBindingState;\n\n if (inputNamesUTF8Encoded.length !== inputCount) {\n throw new Error(`input count from feeds (${\n inputCount}) is expected to be always equal to model's input count (${inputNamesUTF8Encoded.length}).`);\n }\n\n // process inputs\n for (let i = 0; i < inputCount; i++) {\n const index = inputIndices[i];\n const errorCode = await wasm._OrtBindInput(handle, inputNamesUTF8Encoded[index], inputTensorHandles[i]);\n if (errorCode !== 0) {\n checkLastError(`Can't bind input[${i}] for session=${sessionId}.`);\n }\n }\n\n // process pre-allocated outputs\n for (let i = 0; i < outputCount; i++) {\n const index = outputIndices[i];\n const location = outputTensors[i]?.[3]; // undefined means output is not pre-allocated.\n\n if (location) {\n // output is pre-allocated. bind the tensor.\n const errorCode = wasm._OrtBindOutput(handle, outputNamesUTF8Encoded[index], outputTensorHandles[i], 0);\n if (errorCode !== 0) {\n checkLastError(`Can't bind pre-allocated output[${i}] for session=${sessionId}.`);\n }\n } else {\n // output is not pre-allocated. reset preferred location.\n const errorCode =\n wasm._OrtBindOutput(handle, outputNamesUTF8Encoded[index], 0, outputPreferredLocationsEncoded[index]);\n if (errorCode !== 0) {\n checkLastError(`Can't bind output[${i}] to ${outputPreferredLocations[i]} for session=${sessionId}.`);\n }\n }\n }\n activeSessions.set(\n sessionId,\n [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture, true]);\n }\n\n wasm.jsepOnRunStart?.(sessionHandle);\n let errorCode: number;\n if (!BUILD_DEFS.DISABLE_WEBGPU && ioBindingState) {\n errorCode = await wasm._OrtRunWithBinding(\n sessionHandle, ioBindingState.handle, outputCount, outputValuesOffset, runOptionsHandle);\n } else {\n errorCode = await wasm._OrtRun(\n sessionHandle, inputNamesOffset, inputValuesOffset, inputCount, outputNamesOffset, outputCount,\n outputValuesOffset, runOptionsHandle);\n }\n\n if (errorCode !== 0) {\n checkLastError('failed to call OrtRun().');\n }\n\n const output: TensorMetadata[] = [];\n\n for (let i = 0; i < outputCount; i++) {\n const tensor = wasm.HEAPU32[outputValuesOffset / 4 + i];\n if (tensor === outputTensorHandles[i]) {\n // output tensor is pre-allocated. no need to copy data.\n output.push(outputTensors[i]!);\n continue;\n }\n\n const beforeGetTensorDataStack = wasm.stackSave();\n // stack allocate 4 pointer value\n const tensorDataOffset = wasm.stackAlloc(4 * 4);\n\n let keepOutputTensor = false;\n let type: Tensor.Type|undefined, dataOffset = 0;\n try {\n const errorCode = wasm._OrtGetTensorData(\n tensor, tensorDataOffset, tensorDataOffset + 4, tensorDataOffset + 8, tensorDataOffset + 12);\n if (errorCode !== 0) {\n checkLastError(`Can't access output tensor data on index ${i}.`);\n }\n let tensorDataIndex = tensorDataOffset / 4;\n const dataType = wasm.HEAPU32[tensorDataIndex++];\n dataOffset = wasm.HEAPU32[tensorDataIndex++];\n const dimsOffset = wasm.HEAPU32[tensorDataIndex++];\n const dimsLength = wasm.HEAPU32[tensorDataIndex++];\n const dims = [];\n for (let i = 0; i < dimsLength; i++) {\n dims.push(wasm.HEAPU32[dimsOffset / 4 + i]);\n }\n wasm._OrtFree(dimsOffset);\n\n const size = dims.reduce((a, b) => a * b, 1);\n type = tensorDataTypeEnumToString(dataType);\n\n const preferredLocation = ioBindingState?.outputPreferredLocations[outputIndices[i]];\n\n if (type === 'string') {\n if (preferredLocation === 'gpu-buffer') {\n throw new Error('String tensor is not supported on GPU.');\n }\n const stringData: string[] = [];\n let dataIndex = dataOffset / 4;\n for (let i = 0; i < size; i++) {\n const offset = wasm.HEAPU32[dataIndex++];\n const maxBytesToRead = i === size - 1 ? undefined : wasm.HEAPU32[dataIndex] - offset;\n stringData.push(wasm.UTF8ToString(offset, maxBytesToRead));\n }\n output.push([type, dims, stringData, 'cpu']);\n } else {\n // If a certain output's preferred location is GPU but the tensor is empty, we still need to create a CPU\n // tensor for it. There is no mapping GPU buffer for an empty tensor.\n if (preferredLocation === 'gpu-buffer' && size > 0) {\n const getBuffer = wasm.jsepGetBuffer;\n if (!getBuffer) {\n throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');\n }\n const gpuBuffer = getBuffer(dataOffset);\n const elementSize = getTensorElementSize(dataType);\n if (elementSize === undefined || !isGpuBufferSupportedType(type)) {\n throw new Error(`Unsupported data type: ${type}`);\n }\n\n // do not release the tensor right now. it will be released when user calls tensor.dispose().\n keepOutputTensor = true;\n\n output.push([\n type, dims, {\n gpuBuffer,\n download: wasm.jsepCreateDownloader!(gpuBuffer, size * elementSize, type),\n dispose: () => {\n wasm._OrtReleaseTensor(tensor);\n }\n },\n 'gpu-buffer'\n ]);\n } else {\n const typedArrayConstructor = tensorTypeToTypedArrayConstructor(type);\n const data = new typedArrayConstructor(size);\n new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n .set(wasm.HEAPU8.subarray(dataOffset, dataOffset + data.byteLength));\n output.push([type, dims, data, 'cpu']);\n }\n }\n } finally {\n wasm.stackRestore(beforeGetTensorDataStack);\n if (type === 'string' && dataOffset) {\n wasm._free(dataOffset);\n }\n if (!keepOutputTensor) {\n wasm._OrtReleaseTensor(tensor);\n }\n }\n }\n\n if (ioBindingState && !enableGraphCapture) {\n wasm._OrtClearBoundOutputs(ioBindingState.handle);\n activeSessions.set(\n sessionId,\n [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture, false]);\n }\n return output;\n } finally {\n wasm.stackRestore(beforeRunStack);\n\n inputTensorHandles.forEach(v => wasm._OrtReleaseTensor(v));\n outputTensorHandles.forEach(v => wasm._OrtReleaseTensor(v));\n inputOutputAllocs.forEach(p => wasm._free(p));\n\n if (runOptionsHandle !== 0) {\n wasm._OrtReleaseRunOptions(runOptionsHandle);\n }\n runOptionsAllocs.forEach(p => wasm._free(p));\n }\n};\n\n/**\n * end profiling\n */\nexport const endProfiling = (sessionId: number): void => {\n const wasm = getInstance();\n const session = activeSessions.get(sessionId);\n if (!session) {\n throw new Error('invalid session id');\n }\n const sessionHandle = session[0];\n\n // profile file name is not used yet, but it must be freed.\n const profileFileName = wasm._OrtEndProfiling(sessionHandle);\n if (profileFileName === 0) {\n checkLastError('Can\\'t get an profile file name.');\n }\n wasm._OrtFree(profileFileName);\n};\n\nexport const extractTransferableBuffers = (tensors: readonly SerializableTensorMetadata[]): ArrayBufferLike[] => {\n const buffers: ArrayBufferLike[] = [];\n for (const tensor of tensors) {\n const data = tensor[2];\n if (!Array.isArray(data) && 'buffer' in data) {\n buffers.push(data.buffer);\n }\n }\n return buffers;\n};\n", "/*!\n * ONNX Runtime Web v1.18.0\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\"use strict\";(()=>{var vt=Object.defineProperty;var Vr=Object.getOwnPropertyDescriptor;var Jr=Object.getOwnPropertyNames;var Xr=Object.prototype.hasOwnProperty;var _t=(s,c)=>()=>(s&&(c=s(s=0)),c);var nt=(s,c)=>()=>(c||s((c={exports:{}}).exports,c),c.exports),Et=(s,c)=>{for(var o in c)vt(s,o,{get:c[o],enumerable:!0})},Zr=(s,c,o,h)=>{if(c&&typeof c==\"object\"||typeof c==\"function\")for(let f of Jr(c))!Xr.call(s,f)&&f!==o&&vt(s,f,{get:()=>c[f],enumerable:!(h=Vr(c,f))||h.enumerable});return s};var ot=s=>Zr(vt({},\"__esModule\",{value:!0}),s);var St={};Et(St,{createReadStream:()=>fr,readFile:()=>Qr,readFileSync:()=>Kr});var Qr,Kr,fr,At=_t(()=>{Qr=void 0,Kr=void 0,fr=void 0});var Tt={};Et(Tt,{join:()=>en});var en,Mt=_t(()=>{en=void 0});var dr=nt((cr,Ct)=>{\"use strict\";var lr=(()=>{var s=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(s=s||__filename),function(c={}){var o=c,h,f;o.ready=new Promise((r,i)=>{h=r,f=i});var w=Object.assign({},o),g=\"./this.program\",a=typeof window==\"object\",E=typeof importScripts==\"function\",x=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",P=\"\",R,D,K;if(x){var I=(At(),ot(St)),L=(Mt(),ot(Tt));P=E?L.dirname(P)+\"/\":__dirname+\"/\",R=(r,i)=>(r=r.startsWith(\"file://\")?new URL(r):L.normalize(r),I.readFileSync(r,i?void 0:\"utf8\")),K=r=>(r=R(r,!0),r.buffer||(r=new Uint8Array(r)),r),D=(r,i,u,m=!0)=>{r=r.startsWith(\"file://\")?new URL(r):L.normalize(r),I.readFile(r,m?void 0:\"utf8\",(O,T)=>{O?u(O):i(m?T.buffer:T)})},!o.thisProgram&&1\"[Emscripten Module object]\"}else(a||E)&&(E?P=self.location.href:typeof document<\"u\"&&document.currentScript&&(P=document.currentScript.src),s&&(P=s),P.indexOf(\"blob:\")!==0?P=P.substr(0,P.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):P=\"\",R=r=>{var i=new XMLHttpRequest;return i.open(\"GET\",r,!1),i.send(null),i.responseText},E&&(K=r=>{var i=new XMLHttpRequest;return i.open(\"GET\",r,!1),i.responseType=\"arraybuffer\",i.send(null),new Uint8Array(i.response)}),D=(r,i,u)=>{var m=new XMLHttpRequest;m.open(\"GET\",r,!0),m.responseType=\"arraybuffer\",m.onload=()=>{m.status==200||m.status==0&&m.response?i(m.response):u()},m.onerror=u,m.send(null)});var v=o.print||console.log.bind(console),k=o.printErr||console.error.bind(console);Object.assign(o,w),w=null,o.thisProgram&&(g=o.thisProgram);var W;o.wasmBinary&&(W=o.wasmBinary);var j=o.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&te(\"no native wasm support detected\");var oe,C,ve=!1,Oe,ce,A,N;function ae(){var r=oe.buffer;o.HEAP8=Oe=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=A=new Int32Array(r),o.HEAPU8=ce=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=N=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=new Float64Array(r)}var _e=[],xe=[],V=[];function S(){var r=o.preRun.shift();_e.unshift(r)}var F=0,de=null,ue=null;function te(r){throw o.onAbort&&o.onAbort(r),r=\"Aborted(\"+r+\")\",k(r),ve=!0,r=new WebAssembly.RuntimeError(r+\". Build with -sASSERTIONS for more info.\"),f(r),r}function Ee(r){return r.startsWith(\"data:application/octet-stream;base64,\")}var J;if(J=\"ort-wasm.wasm\",!Ee(J)){var fe=J;J=o.locateFile?o.locateFile(fe,P):P+fe}function ke(r){if(r==J&&W)return new Uint8Array(W);if(K)return K(r);throw\"both async and sync fetching of the wasm failed\"}function pe(r){if(!W&&(a||E)){if(typeof fetch==\"function\"&&!r.startsWith(\"file://\"))return fetch(r,{credentials:\"same-origin\"}).then(i=>{if(!i.ok)throw\"failed to load wasm binary file at '\"+r+\"'\";return i.arrayBuffer()}).catch(()=>ke(r));if(D)return new Promise((i,u)=>{D(r,m=>i(new Uint8Array(m)),u)})}return Promise.resolve().then(()=>ke(r))}function Se(r,i,u){return pe(r).then(m=>WebAssembly.instantiate(m,i)).then(m=>m).then(u,m=>{k(\"failed to asynchronously prepare wasm: \"+m),te(m)})}function Pe(r,i){var u=J;return W||typeof WebAssembly.instantiateStreaming!=\"function\"||Ee(u)||u.startsWith(\"file://\")||x||typeof fetch!=\"function\"?Se(u,r,i):fetch(u,{credentials:\"same-origin\"}).then(m=>WebAssembly.instantiateStreaming(m,r).then(i,function(O){return k(\"wasm streaming compile failed: \"+O),k(\"falling back to ArrayBuffer instantiation\"),Se(u,r,i)}))}var ye,ge=r=>{for(;0>2>>>0]=i},this.za=function(i){N[this.va+8>>2>>>0]=i},this.xa=function(i,u){this.ya(),this.Ea(i),this.za(u)},this.ya=function(){N[this.va+16>>2>>>0]=0}}var Re=0,ee=0,Y=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,he=(r,i,u)=>{i>>>=0;var m=i+u;for(u=i;r[u]&&!(u>=m);)++u;if(16O?m+=String.fromCharCode(O):(O-=65536,m+=String.fromCharCode(55296|O>>10,56320|O&1023))}}else m+=String.fromCharCode(O)}return m},be=(r,i)=>(r>>>=0)?he(ce,r,i):\"\",De=r=>{for(var i=0,u=0;u=m?i++:2047>=m?i+=2:55296<=m&&57343>=m?(i+=4,++u):i+=3}return i},We=(r,i,u,m)=>{if(u>>>=0,!(0=U){var re=r.charCodeAt(++T);U=65536+((U&1023)<<10)|re&1023}if(127>=U){if(u>=m)break;i[u++>>>0]=U}else{if(2047>=U){if(u+1>=m)break;i[u++>>>0]=192|U>>6}else{if(65535>=U){if(u+2>=m)break;i[u++>>>0]=224|U>>12}else{if(u+3>=m)break;i[u++>>>0]=240|U>>18,i[u++>>>0]=128|U>>12&63}i[u++>>>0]=128|U>>6&63}i[u++>>>0]=128|U&63}}return i[u>>>0]=0,u-O},we=r=>r%4===0&&(r%100!==0||r%400===0),$e=[0,31,60,91,121,152,182,213,244,274,305,335],Ce=[0,31,59,90,120,151,181,212,243,273,304,334],qe=r=>{var i=De(r)+1,u=Qe(i);return u&&We(r,ce,u,i),u},Ve={},Je=()=>{if(!Xe){var r={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:g||\"./this.program\"},i;for(i in Ve)Ve[i]===void 0?delete r[i]:r[i]=Ve[i];var u=[];for(i in r)u.push(`${i}=${r[i]}`);Xe=u}return Xe},Xe,Fe=[null,[],[]],Ie=[31,29,31,30,31,30,31,31,30,31,30,31],Ne=[31,28,31,30,31,30,31,31,30,31,30,31];function it(r){var i=Array(De(r)+1);return We(r,i,0,i.length),i}function Ze(r,i,u,m){function O(d,B,G){for(d=typeof d==\"number\"?d.toString():d||\"\";d.lengthrt?-1:0Te-d.getDate())B-=Te-d.getDate()+1,d.setDate(1),11>G?d.setMonth(G+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else{d.setDate(d.getDate()+B);break}}return G=new Date(d.getFullYear()+1,0,4),B=re(new Date(d.getFullYear(),0,4)),G=re(G),0>=U(B,d)?0>=U(G,d)?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}r>>>=0,i>>>=0,u>>>=0,m>>>=0;var ie=A[m+40>>2>>>0];m={Ca:A[m>>2>>>0],Ba:A[m+4>>2>>>0],ta:A[m+8>>2>>>0],wa:A[m+12>>2>>>0],ua:A[m+16>>2>>>0],sa:A[m+20>>2>>>0],ma:A[m+24>>2>>>0],ra:A[m+28>>2>>>0],Fa:A[m+32>>2>>>0],Aa:A[m+36>>2>>>0],Da:ie?be(ie):\"\"},u=be(u),ie={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var se in ie)u=u.replace(new RegExp(se,\"g\"),ie[se]);var et=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),tt=\"January February March April May June July August September October November December\".split(\" \");ie={\"%a\":d=>et[d.ma].substring(0,3),\"%A\":d=>et[d.ma],\"%b\":d=>tt[d.ua].substring(0,3),\"%B\":d=>tt[d.ua],\"%C\":d=>T((d.sa+1900)/100|0,2),\"%d\":d=>T(d.wa,2),\"%e\":d=>O(d.wa,2,\" \"),\"%g\":d=>le(d).toString().substring(2),\"%G\":d=>le(d),\"%H\":d=>T(d.ta,2),\"%I\":d=>(d=d.ta,d==0?d=12:12{for(var B=0,G=0;G<=d.ua-1;B+=(we(d.sa+1900)?Ie:Ne)[G++]);return T(d.wa+B,3)},\"%m\":d=>T(d.ua+1,2),\"%M\":d=>T(d.Ba,2),\"%n\":()=>`\n`,\"%p\":d=>0<=d.ta&&12>d.ta?\"AM\":\"PM\",\"%S\":d=>T(d.Ca,2),\"%t\":()=>\"\t\",\"%u\":d=>d.ma||7,\"%U\":d=>T(Math.floor((d.ra+7-d.ma)/7),2),\"%V\":d=>{var B=Math.floor((d.ra+7-(d.ma+6)%7)/7);if(2>=(d.ma+371-d.ra-2)%7&&B++,B)B==53&&(G=(d.ma+371-d.ra)%7,G==4||G==3&&we(d.sa)||(B=1));else{B=52;var G=(d.ma+7-d.ra-1)%7;(G==4||G==5&&we(d.sa%400-1))&&B++}return T(B,2)},\"%w\":d=>d.ma,\"%W\":d=>T(Math.floor((d.ra+7-(d.ma+6)%7)/7),2),\"%y\":d=>(d.sa+1900).toString().substring(2),\"%Y\":d=>d.sa+1900,\"%z\":d=>{d=d.Aa;var B=0<=d;return d=Math.abs(d)/60,(B?\"+\":\"-\")+(\"0000\"+(d/60*100+d%60)).slice(-4)},\"%Z\":d=>d.Da,\"%%\":()=>\"%\"},u=u.replace(/%%/g,\"\\0\\0\");for(se in ie)u.includes(se)&&(u=u.replace(new RegExp(se,\"g\"),ie[se](m)));return u=u.replace(/\\0\\0/g,\"%\"),se=it(u),se.length>i?0:(Oe.set(se,r>>>0),se.length-1)}var st={a:function(r,i,u){throw r>>>=0,new Ae(r).xa(i>>>0,u>>>0),Re=r,ee++,Re},e:function(){return 0},H:function(){},x:function(){},z:function(){},k:function(){return 0},F:function(){},B:function(){},E:function(){},g:function(){},y:function(){},v:function(){},G:function(){},w:function(){},l:()=>!0,o:function(r,i,u){r=i+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*i:NaN,u>>>=0,r=new Date(1e3*r),A[u>>2>>>0]=r.getUTCSeconds(),A[u+4>>2>>>0]=r.getUTCMinutes(),A[u+8>>2>>>0]=r.getUTCHours(),A[u+12>>2>>>0]=r.getUTCDate(),A[u+16>>2>>>0]=r.getUTCMonth(),A[u+20>>2>>>0]=r.getUTCFullYear()-1900,A[u+24>>2>>>0]=r.getUTCDay(),A[u+28>>2>>>0]=(r.getTime()-Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},p:function(r,i,u){r=i+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*i:NaN,u>>>=0,r=new Date(1e3*r),A[u>>2>>>0]=r.getSeconds(),A[u+4>>2>>>0]=r.getMinutes(),A[u+8>>2>>>0]=r.getHours(),A[u+12>>2>>>0]=r.getDate(),A[u+16>>2>>>0]=r.getMonth(),A[u+20>>2>>>0]=r.getFullYear()-1900,A[u+24>>2>>>0]=r.getDay(),A[u+28>>2>>>0]=(we(r.getFullYear())?$e:Ce)[r.getMonth()]+r.getDate()-1|0,A[u+36>>2>>>0]=-(60*r.getTimezoneOffset()),i=new Date(r.getFullYear(),6,1).getTimezoneOffset();var m=new Date(r.getFullYear(),0,1).getTimezoneOffset();A[u+32>>2>>>0]=(i!=m&&r.getTimezoneOffset()==Math.min(m,i))|0},q:function(r){r>>>=0;var i=new Date(A[r+20>>2>>>0]+1900,A[r+16>>2>>>0],A[r+12>>2>>>0],A[r+8>>2>>>0],A[r+4>>2>>>0],A[r>>2>>>0],0),u=A[r+32>>2>>>0],m=i.getTimezoneOffset(),O=new Date(i.getFullYear(),6,1).getTimezoneOffset(),T=new Date(i.getFullYear(),0,1).getTimezoneOffset(),U=Math.min(T,O);return 0>u?A[r+32>>2>>>0]=+(O!=T&&U==m):0>2>>>0]=i.getDay(),A[r+28>>2>>>0]=(we(i.getFullYear())?$e:Ce)[i.getMonth()]+i.getDate()-1|0,A[r>>2>>>0]=i.getSeconds(),A[r+4>>2>>>0]=i.getMinutes(),A[r+8>>2>>>0]=i.getHours(),A[r+12>>2>>>0]=i.getDate(),A[r+16>>2>>>0]=i.getMonth(),A[r+20>>2>>>0]=i.getYear(),r=i.getTime()/1e3,He((ye=r,1<=+Math.abs(ye)?0>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)),r>>>0},m:function(){return-52},n:function(){},t:function(r,i,u){function m(le){return(le=le.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?le[1]:\"GMT\"}u>>>=0;var O=new Date().getFullYear(),T=new Date(O,0,1),U=new Date(O,6,1);O=T.getTimezoneOffset();var re=U.getTimezoneOffset();N[r>>>0>>2>>>0]=60*Math.max(O,re),A[i>>>0>>2>>>0]=+(O!=re),r=m(T),i=m(U),r=qe(r),i=qe(i),re>2>>>0]=r,N[u+4>>2>>>0]=i):(N[u>>2>>>0]=i,N[u+4>>2>>>0]=r)},d:()=>{te(\"\")},h:function(){return Date.now()},u:function(){return 4294901760},b:()=>performance.now(),I:function(r,i,u){return i>>>=0,ce.copyWithin(r>>>0>>>0,i>>>0,i+(u>>>0)>>>0)},s:function(r){r>>>=0;var i=ce.length;if(4294901760=u;u*=2){var m=i*(1+.2/u);m=Math.min(m,r+100663296);var O=Math;m=Math.max(r,m);e:{O=O.min.call(O,4294901760,m+(65536-m%65536)%65536)-oe.buffer.byteLength+65535>>>16;try{oe.grow(O),ae();var T=1;break e}catch{}T=void 0}if(T)return!0}return!1},C:function(r,i){r>>>=0,i>>>=0;var u=0;return Je().forEach(function(m,O){var T=i+u;for(O=N[r+4*O>>2>>>0]=T,T=0;T>0>>>0]=m.charCodeAt(T);Oe[O>>0>>>0]=0,u+=m.length+1}),0},D:function(r,i){r>>>=0,i>>>=0;var u=Je();N[r>>2>>>0]=u.length;var m=0;return u.forEach(function(O){m+=O.length+1}),N[i>>2>>>0]=m,0},f:()=>52,j:function(){return 52},r:function(){return 70},i:function(r,i,u,m){i>>>=0,u>>>=0,m>>>=0;for(var O=0,T=0;T>2>>>0],re=N[i+4>>2>>>0];i+=8;for(var le=0;le>>0],se=Fe[r];ie===0||ie===10?((r===1?v:k)(he(se,0)),se.length=0):se.push(ie)}O+=re}return N[m>>2>>>0]=O,0},A:Ze,c:function(r,i,u,m){return Ze(r>>>0,i>>>0,u>>>0,m>>>0)}};(function(){function r(u){if(u=u.exports,C=u=je(u),oe=C.J,ae(),xe.unshift(C.K),F--,o.monitorRunDependencies&&o.monitorRunDependencies(F),F==0&&(de!==null&&(clearInterval(de),de=null),ue)){var m=ue;ue=null,m()}return u}var i={a:st};if(F++,o.monitorRunDependencies&&o.monitorRunDependencies(F),o.instantiateWasm)try{return o.instantiateWasm(i,r)}catch(u){k(\"Module.instantiateWasm callback failed with error: \"+u),f(u)}return Pe(i,function(u){r(u.instance)}).catch(f),{}})(),o._OrtInit=(r,i)=>(o._OrtInit=C.L)(r,i),o._OrtGetLastError=(r,i)=>(o._OrtGetLastError=C.M)(r,i),o._OrtCreateSessionOptions=(r,i,u,m,O,T,U,re,le,ie)=>(o._OrtCreateSessionOptions=C.N)(r,i,u,m,O,T,U,re,le,ie),o._OrtAppendExecutionProvider=(r,i)=>(o._OrtAppendExecutionProvider=C.O)(r,i),o._OrtAddFreeDimensionOverride=(r,i,u)=>(o._OrtAddFreeDimensionOverride=C.P)(r,i,u),o._OrtAddSessionConfigEntry=(r,i,u)=>(o._OrtAddSessionConfigEntry=C.Q)(r,i,u),o._OrtReleaseSessionOptions=r=>(o._OrtReleaseSessionOptions=C.R)(r),o._OrtCreateSession=(r,i,u)=>(o._OrtCreateSession=C.S)(r,i,u),o._OrtReleaseSession=r=>(o._OrtReleaseSession=C.T)(r),o._OrtGetInputOutputCount=(r,i,u)=>(o._OrtGetInputOutputCount=C.U)(r,i,u),o._OrtGetInputName=(r,i)=>(o._OrtGetInputName=C.V)(r,i),o._OrtGetOutputName=(r,i)=>(o._OrtGetOutputName=C.W)(r,i),o._OrtFree=r=>(o._OrtFree=C.X)(r),o._OrtCreateTensor=(r,i,u,m,O,T)=>(o._OrtCreateTensor=C.Y)(r,i,u,m,O,T),o._OrtGetTensorData=(r,i,u,m,O)=>(o._OrtGetTensorData=C.Z)(r,i,u,m,O),o._OrtReleaseTensor=r=>(o._OrtReleaseTensor=C._)(r),o._OrtCreateRunOptions=(r,i,u,m)=>(o._OrtCreateRunOptions=C.$)(r,i,u,m),o._OrtAddRunConfigEntry=(r,i,u)=>(o._OrtAddRunConfigEntry=C.aa)(r,i,u),o._OrtReleaseRunOptions=r=>(o._OrtReleaseRunOptions=C.ba)(r),o._OrtCreateBinding=r=>(o._OrtCreateBinding=C.ca)(r),o._OrtBindInput=(r,i,u)=>(o._OrtBindInput=C.da)(r,i,u),o._OrtBindOutput=(r,i,u,m)=>(o._OrtBindOutput=C.ea)(r,i,u,m),o._OrtClearBoundOutputs=r=>(o._OrtClearBoundOutputs=C.fa)(r),o._OrtReleaseBinding=r=>(o._OrtReleaseBinding=C.ga)(r),o._OrtRunWithBinding=(r,i,u,m,O)=>(o._OrtRunWithBinding=C.ha)(r,i,u,m,O),o._OrtRun=(r,i,u,m,O,T,U,re)=>(o._OrtRun=C.ia)(r,i,u,m,O,T,U,re),o._OrtEndProfiling=r=>(o._OrtEndProfiling=C.ja)(r);var Qe=o._malloc=r=>(Qe=o._malloc=C.ka)(r);o._free=r=>(o._free=C.la)(r);var He=r=>(He=C.na)(r),Ke=()=>(Ke=C.oa)(),Ge=r=>(Ge=C.pa)(r),M=r=>(M=C.qa)(r);function je(r){r=Object.assign({},r);var i=m=>()=>m()>>>0,u=m=>O=>m(O)>>>0;return r.__errno_location=i(r.__errno_location),r.malloc=u(r.malloc),r.stackSave=i(r.stackSave),r.stackAlloc=u(r.stackAlloc),r}o.stackAlloc=M,o.stackSave=Ke,o.stackRestore=Ge,o.UTF8ToString=be,o.stringToUTF8=(r,i,u)=>We(r,ce,i,u),o.lengthBytesUTF8=De;var Ue;ue=function r(){Ue||Le(),Ue||(ue=r)};function Le(){function r(){if(!Ue&&(Ue=!0,o.calledRun=!0,!ve)){if(ge(xe),h(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),o.postRun)for(typeof o.postRun==\"function\"&&(o.postRun=[o.postRun]);o.postRun.length;){var i=o.postRun.shift();V.unshift(i)}ge(V)}}if(!(0lr)});var pr=nt(()=>{});var mr=nt(()=>{});var gr={};Et(gr,{cpus:()=>tn});var tn,hr=_t(()=>{tn=void 0});var wr=nt((br,Rt)=>{\"use strict\";var yr=(()=>{var s=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(s=s||__filename),function(c={}){function o(){return V.buffer!=te.buffer&&pe(),te}function h(){return V.buffer!=te.buffer&&pe(),Ee}function f(){return V.buffer!=te.buffer&&pe(),J}function w(){return V.buffer!=te.buffer&&pe(),fe}function g(){return V.buffer!=te.buffer&&pe(),ke}var a=c,E,x;a.ready=new Promise((e,t)=>{E=e,x=t});var P=Object.assign({},a),R=\"./this.program\",D=(e,t)=>{throw t},K=typeof window==\"object\",I=typeof importScripts==\"function\",L=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",v=a.ENVIRONMENT_IS_PTHREAD||!1,k=\"\";function W(e){return a.locateFile?a.locateFile(e,k):k+e}var j,oe,C;if(L){var ve=(At(),ot(St)),Oe=(Mt(),ot(Tt));k=I?Oe.dirname(k)+\"/\":__dirname+\"/\",j=(t,n)=>(t=t.startsWith(\"file://\")?new URL(t):Oe.normalize(t),ve.readFileSync(t,n?void 0:\"utf8\")),C=t=>(t=j(t,!0),t.buffer||(t=new Uint8Array(t)),t),oe=(t,n,l,b=!0)=>{t=t.startsWith(\"file://\")?new URL(t):Oe.normalize(t),ve.readFile(t,b?void 0:\"utf8\",(y,_)=>{y?l(y):n(b?_.buffer:_)})},!a.thisProgram&&1{throw process.exitCode=t,n},a.inspect=()=>\"[Emscripten Module object]\";let e;try{e=pr()}catch(t){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),t}global.Worker=e.Worker}else(K||I)&&(I?k=self.location.href:typeof document<\"u\"&&document.currentScript&&(k=document.currentScript.src),typeof s<\"u\"&&s&&(k=s),k.indexOf(\"blob:\")!==0?k=k.substr(0,k.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):k=\"\",L||(j=e=>{var t=new XMLHttpRequest;return t.open(\"GET\",e,!1),t.send(null),t.responseText},I&&(C=e=>{var t=new XMLHttpRequest;return t.open(\"GET\",e,!1),t.responseType=\"arraybuffer\",t.send(null),new Uint8Array(t.response)}),oe=(e,t,n)=>{var l=new XMLHttpRequest;l.open(\"GET\",e,!0),l.responseType=\"arraybuffer\",l.onload=()=>{l.status==200||l.status==0&&l.response?t(l.response):n()},l.onerror=n,l.send(null)}));L&&typeof performance>\"u\"&&(global.performance=mr().performance);var ce=console.log.bind(console),A=console.error.bind(console);L&&(ce=(...e)=>ve.writeSync(1,e.join(\" \")+`\n`),A=(...e)=>ve.writeSync(2,e.join(\" \")+`\n`));var N=a.print||ce,ae=a.printErr||A;Object.assign(a,P),P=null,a.thisProgram&&(R=a.thisProgram),a.quit&&(D=a.quit);var _e;a.wasmBinary&&(_e=a.wasmBinary);var xe=a.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&we(\"no native wasm support detected\");var V,S,F,de=!1,ue,te,Ee,J,fe,ke;function pe(){var e=V.buffer;a.HEAP8=te=new Int8Array(e),a.HEAP16=new Int16Array(e),a.HEAP32=J=new Int32Array(e),a.HEAPU8=Ee=new Uint8Array(e),a.HEAPU16=new Uint16Array(e),a.HEAPU32=fe=new Uint32Array(e),a.HEAPF32=new Float32Array(e),a.HEAPF64=ke=new Float64Array(e)}var Se=a.INITIAL_MEMORY||16777216;if(5242880<=Se||we(\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+Se+\"! (STACK_SIZE=5242880)\"),v)V=a.wasmMemory;else if(a.wasmMemory)V=a.wasmMemory;else if(V=new WebAssembly.Memory({initial:Se/65536,maximum:65536,shared:!0}),!(V.buffer instanceof SharedArrayBuffer))throw ae(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),L&&ae(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");pe(),Se=V.buffer.byteLength;var Pe,ye=[],ge=[],Ae=[],Re=0;function ee(){return xe||0{if(!t.ok)throw\"failed to load wasm binary file at '\"+e+\"'\";return t.arrayBuffer()}).catch(()=>qe(e));if(oe)return new Promise((t,n)=>{oe(e,l=>t(new Uint8Array(l)),n)})}return Promise.resolve().then(()=>qe(e))}function Je(e,t,n){return Ve(e).then(l=>WebAssembly.instantiate(l,t)).then(l=>l).then(n,l=>{ae(\"failed to asynchronously prepare wasm: \"+l),we(l)})}function Xe(e,t){var n=Ce;return _e||typeof WebAssembly.instantiateStreaming!=\"function\"||$e(n)||n.startsWith(\"file://\")||L||typeof fetch!=\"function\"?Je(n,e,t):fetch(n,{credentials:\"same-origin\"}).then(l=>WebAssembly.instantiateStreaming(l,e).then(t,function(b){return ae(\"wasm streaming compile failed: \"+b),ae(\"falling back to ArrayBuffer instantiation\"),Je(n,e,t)}))}var Fe;function Ie(e){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${e})`,this.status=e}function Ne(e){e.terminate(),e.onmessage=()=>{}}function it(e){(e=M.La[e])||we(),M.lb(e)}function Ze(e){var t=M.fb();if(!t)return 6;M.Oa.push(t),M.La[e.Na]=t,t.Na=e.Na;var n={cmd:\"run\",start_routine:e.mb,arg:e.eb,pthread_ptr:e.Na};return L&&t.unref(),t.postMessage(n,e.sb),0}var st=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,Qe=(e,t,n)=>{t>>>=0;var l=t+n;for(n=t;e[n]&&!(n>=l);)++n;if(16b?l+=String.fromCharCode(b):(b-=65536,l+=String.fromCharCode(55296|b>>10,56320|b&1023))}}else l+=String.fromCharCode(b)}return l},He=(e,t)=>(e>>>=0)?Qe(h(),e,t):\"\";function Ke(e){if(v)return z(1,1,e);ue=e,ee()||(M.nb(),a.onExit&&a.onExit(e),de=!0),D(e,new Ie(e))}var Ge=e=>{if(ue=e,v)throw Ue(e),\"unwind\";Ke(e)},M={Ra:[],Oa:[],Za:[],La:{},Va:function(){v?M.hb():M.gb()},gb:function(){ye.unshift(()=>{De(),M.ib(()=>We())})},hb:function(){M.receiveObjectTransfer=M.kb,M.threadInitTLS=M.Ya,M.setExitStatus=M.Xa,xe=!1},Xa:function(e){ue=e},xb:[\"$terminateWorker\"],nb:function(){for(var e of M.Oa)Ne(e);for(e of M.Ra)Ne(e);M.Ra=[],M.Oa=[],M.La=[]},lb:function(e){var t=e.Na;delete M.La[t],M.Ra.push(e),M.Oa.splice(M.Oa.indexOf(e),1),e.Na=0,yt(t)},kb:function(){},Ya:function(){M.Za.forEach(e=>e())},jb:e=>new Promise(t=>{e.onmessage=y=>{y=y.data;var _=y.cmd;if(y.targetThread&&y.targetThread!=ft()){var X=M.La[y.wb];X?X.postMessage(y,y.transferList):ae('Internal error! Worker sent a message \"'+_+'\" to target pthread '+y.targetThread+\", but that thread no longer exists!\")}else _===\"checkMailbox\"?ut():_===\"spawnThread\"?Ze(y):_===\"cleanupThread\"?it(y.thread):_===\"killThread\"?(y=y.thread,_=M.La[y],delete M.La[y],Ne(_),yt(y),M.Oa.splice(M.Oa.indexOf(_),1),_.Na=0):_===\"cancelThread\"?M.La[y.thread].postMessage({cmd:\"cancel\"}):_===\"loaded\"?(e.loaded=!0,t(e)):_===\"alert\"?alert(\"Thread \"+y.threadId+\": \"+y.text):y.target===\"setimmediate\"?e.postMessage(y):_===\"callHandler\"?a[y.handler](...y.args):_&&ae(\"worker sent an unknown command \"+_)},e.onerror=y=>{throw ae(\"worker sent an error! \"+y.filename+\":\"+y.lineno+\": \"+y.message),y},L&&(e.on(\"message\",function(y){e.onmessage({data:y})}),e.on(\"error\",function(y){e.onerror(y)}));var n=[],l=[\"onExit\",\"onAbort\",\"print\",\"printErr\"],b;for(b of l)a.hasOwnProperty(b)&&n.push(b);e.postMessage({cmd:\"load\",handlers:n,urlOrBlob:a.mainScriptUrlOrBlob||s,wasmMemory:V,wasmModule:F})}),ib:function(e){e()},cb:function(){var e=W(\"ort-wasm-threaded.worker.js\");e=new Worker(e),M.Ra.push(e)},fb:function(){return M.Ra.length==0&&(M.cb(),M.jb(M.Ra[0])),M.Ra.pop()}};a.PThread=M;var je=e=>{for(;0>2>>>0];e=f()[e+56>>2>>>0],or(t,t-e),lt(t)};function Ue(e){if(v)return z(2,0,e);Ge(e)}var Le=[];a.invokeEntryPoint=function(e,t){var n=Le[e];n||(e>=Le.length&&(Le.length=e+1),Le[e]=n=Pe.get(e)),e=n(t),ee()?M.Xa(e):bt(e)};function r(e){this.Ua=e-24,this.bb=function(t){w()[this.Ua+4>>2>>>0]=t},this.ab=function(t){w()[this.Ua+8>>2>>>0]=t},this.Va=function(t,n){this.$a(),this.bb(t),this.ab(n)},this.$a=function(){w()[this.Ua+16>>2>>>0]=0}}var i=0,u=0;function m(e,t,n,l){return v?z(3,1,e,t,n,l):O(e,t,n,l)}function O(e,t,n,l){if(e>>>=0,t>>>=0,n>>>=0,l>>>=0,typeof SharedArrayBuffer>\"u\")return ae(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var b=[];return v&&b.length===0?m(e,t,n,l):(e={mb:n,Na:e,eb:l,sb:b},v?(e.ub=\"spawnThread\",postMessage(e,b),0):Ze(e))}function T(e,t,n){return v?z(4,1,e,t,n):0}function U(e,t){if(v)return z(5,1,e,t)}var re=e=>{for(var t=0,n=0;n=l?t++:2047>=l?t+=2:55296<=l&&57343>=l?(t+=4,++n):t+=3}return t},le=(e,t,n,l)=>{if(n>>>=0,!(0=_){var X=e.charCodeAt(++y);_=65536+((_&1023)<<10)|X&1023}if(127>=_){if(n>=l)break;t[n++>>>0]=_}else{if(2047>=_){if(n+1>=l)break;t[n++>>>0]=192|_>>6}else{if(65535>=_){if(n+2>=l)break;t[n++>>>0]=224|_>>12}else{if(n+3>=l)break;t[n++>>>0]=240|_>>18,t[n++>>>0]=128|_>>12&63}t[n++>>>0]=128|_>>6&63}t[n++>>>0]=128|_&63}}return t[n>>>0]=0,n-b},ie=(e,t,n)=>le(e,h(),t,n);function se(e,t){if(v)return z(6,1,e,t)}function et(e,t,n){if(v)return z(7,1,e,t,n)}function tt(e,t,n){return v?z(8,1,e,t,n):0}function d(e,t){if(v)return z(9,1,e,t)}function B(e,t,n){if(v)return z(10,1,e,t,n)}function G(e,t,n,l){if(v)return z(11,1,e,t,n,l)}function Te(e,t,n,l){if(v)return z(12,1,e,t,n,l)}function rt(e,t,n,l){if(v)return z(13,1,e,t,n,l)}function Ut(e){if(v)return z(14,1,e)}function Lt(e,t){if(v)return z(15,1,e,t)}function Bt(e,t,n){if(v)return z(16,1,e,t,n)}var Nr=e=>{if(!de)try{if(e(),!ee())try{v?bt(ue):Ge(ue)}catch(t){t instanceof Ie||t==\"unwind\"||D(1,t)}}catch(t){t instanceof Ie||t==\"unwind\"||D(1,t)}};function pt(e){e>>>=0,typeof Atomics.tb==\"function\"&&(Atomics.tb(f(),e>>2,e).value.then(ut),e+=128,Atomics.store(f(),e>>2,1))}a.__emscripten_thread_mailbox_await=pt;function ut(){var e=ft();e&&(pt(e),Nr(()=>rr()))}a.checkMailbox=ut;var Ye=e=>e%4===0&&(e%100!==0||e%400===0),kt=[0,31,60,91,121,152,182,213,244,274,305,335],Wt=[0,31,59,90,120,151,181,212,243,273,304,334];function Nt(e,t,n,l,b,y,_,X){return v?z(17,1,e,t,n,l,b,y,_,X):-52}function Ht(e,t,n,l,b,y,_){if(v)return z(18,1,e,t,n,l,b,y,_)}var Gt=e=>{var t=re(e)+1,n=Kt(t);return n&&ie(e,n,t),n},Hr=e=>{var t=wt();return e=e(),lt(t),e};function z(e,t){var n=arguments.length-2,l=arguments;return Hr(()=>{for(var b=Ot(8*n),y=b>>3,_=0;_>>0]=X}return tr(e,n,b,t)})}var mt=[],gt={},jt=()=>{if(!ht){var e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:R||\"./this.program\"},t;for(t in gt)gt[t]===void 0?delete e[t]:e[t]=gt[t];var n=[];for(t in e)n.push(`${t}=${e[t]}`);ht=n}return ht},ht;function Yt(e,t){if(v)return z(19,1,e,t);e>>>=0,t>>>=0;var n=0;return jt().forEach(function(l,b){var y=t+n;for(b=w()[e+4*b>>2>>>0]=y,y=0;y>0>>>0]=l.charCodeAt(y);o()[b>>0>>>0]=0,n+=l.length+1}),0}function zt(e,t){if(v)return z(20,1,e,t);e>>>=0,t>>>=0;var n=jt();w()[e>>2>>>0]=n.length;var l=0;return n.forEach(function(b){l+=b.length+1}),w()[t>>2>>>0]=l,0}function $t(e){return v?z(21,1,e):52}function qt(e,t,n,l){return v?z(22,1,e,t,n,l):52}function Vt(e,t,n,l,b){return v?z(23,1,e,t,n,l,b):70}var Gr=[null,[],[]];function Jt(e,t,n,l){if(v)return z(24,1,e,t,n,l);t>>>=0,n>>>=0,l>>>=0;for(var b=0,y=0;y>2>>>0],X=w()[t+4>>2>>>0];t+=8;for(var Me=0;Me>>0],me=Gr[e];ne===0||ne===10?((e===1?N:ae)(Qe(me,0)),me.length=0):me.push(ne)}b+=X}return w()[l>>2>>>0]=b,0}var Xt=[31,29,31,30,31,30,31,31,30,31,30,31],Zt=[31,28,31,30,31,30,31,31,30,31,30,31];function jr(e){var t=Array(re(e)+1);return le(e,t,0,t.length),t}var Yr=(e,t)=>{o().set(e,t>>>0)};function Qt(e,t,n,l){function b(p,H,Z){for(p=typeof p==\"number\"?p.toString():p||\"\";p.lengthur?-1:0Be-p.getDate())H-=Be-p.getDate()+1,p.setDate(1),11>Z?p.setMonth(Z+1):(p.setMonth(0),p.setFullYear(p.getFullYear()+1));else{p.setDate(p.getDate()+H);break}}return Z=new Date(p.getFullYear()+1,0,4),H=X(new Date(p.getFullYear(),0,4)),Z=X(Z),0>=_(H,p)?0>=_(Z,p)?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}e>>>=0,t>>>=0,n>>>=0,l>>>=0;var ne=f()[l+40>>2>>>0];l={qb:f()[l>>2>>>0],pb:f()[l+4>>2>>>0],Sa:f()[l+8>>2>>>0],Wa:f()[l+12>>2>>>0],Ta:f()[l+16>>2>>>0],Qa:f()[l+20>>2>>>0],Ma:f()[l+24>>2>>>0],Pa:f()[l+28>>2>>>0],yb:f()[l+32>>2>>>0],ob:f()[l+36>>2>>>0],rb:ne?He(ne):\"\"},n=He(n),ne={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var me in ne)n=n.replace(new RegExp(me,\"g\"),ne[me]);var ir=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),sr=\"January February March April May June July August September October November December\".split(\" \");ne={\"%a\":p=>ir[p.Ma].substring(0,3),\"%A\":p=>ir[p.Ma],\"%b\":p=>sr[p.Ta].substring(0,3),\"%B\":p=>sr[p.Ta],\"%C\":p=>y((p.Qa+1900)/100|0,2),\"%d\":p=>y(p.Wa,2),\"%e\":p=>b(p.Wa,2,\" \"),\"%g\":p=>Me(p).toString().substring(2),\"%G\":p=>Me(p),\"%H\":p=>y(p.Sa,2),\"%I\":p=>(p=p.Sa,p==0?p=12:12{for(var H=0,Z=0;Z<=p.Ta-1;H+=(Ye(p.Qa+1900)?Xt:Zt)[Z++]);return y(p.Wa+H,3)},\"%m\":p=>y(p.Ta+1,2),\"%M\":p=>y(p.pb,2),\"%n\":()=>`\n`,\"%p\":p=>0<=p.Sa&&12>p.Sa?\"AM\":\"PM\",\"%S\":p=>y(p.qb,2),\"%t\":()=>\"\t\",\"%u\":p=>p.Ma||7,\"%U\":p=>y(Math.floor((p.Pa+7-p.Ma)/7),2),\"%V\":p=>{var H=Math.floor((p.Pa+7-(p.Ma+6)%7)/7);if(2>=(p.Ma+371-p.Pa-2)%7&&H++,H)H==53&&(Z=(p.Ma+371-p.Pa)%7,Z==4||Z==3&&Ye(p.Qa)||(H=1));else{H=52;var Z=(p.Ma+7-p.Pa-1)%7;(Z==4||Z==5&&Ye(p.Qa%400-1))&&H++}return y(H,2)},\"%w\":p=>p.Ma,\"%W\":p=>y(Math.floor((p.Pa+7-(p.Ma+6)%7)/7),2),\"%y\":p=>(p.Qa+1900).toString().substring(2),\"%Y\":p=>p.Qa+1900,\"%z\":p=>{p=p.ob;var H=0<=p;return p=Math.abs(p)/60,(H?\"+\":\"-\")+(\"0000\"+(p/60*100+p%60)).slice(-4)},\"%Z\":p=>p.rb,\"%%\":()=>\"%\"},n=n.replace(/%%/g,\"\\0\\0\");for(me in ne)n.includes(me)&&(n=n.replace(new RegExp(me,\"g\"),ne[me](l)));return n=n.replace(/\\0\\0/g,\"%\"),me=jr(n),me.length>t?0:(Yr(me,e),me.length-1)}M.Va();var zr=[null,Ke,Ue,m,T,U,se,et,tt,d,B,G,Te,rt,Ut,Lt,Bt,Nt,Ht,Yt,zt,$t,qt,Vt,Jt],$r={b:function(e,t,n){throw e>>>=0,new r(e).Va(t>>>0,n>>>0),i=e,u++,i},N:function(e){er(e>>>0,!I,1,!K,131072,!1),M.Ya()},j:function(e){e>>>=0,v?postMessage({cmd:\"cleanupThread\",thread:e}):it(e)},I:O,h:T,T:U,D:se,F:et,U:tt,R:d,J:B,Q:G,n:Te,E:rt,B:Ut,S:Lt,C:Bt,q:()=>!0,z:function(e,t){e>>>=0,e==t>>>0?setTimeout(()=>ut()):v?postMessage({targetThread:e,cmd:\"checkMailbox\"}):(e=M.La[e])&&e.postMessage({cmd:\"checkMailbox\"})},L:function(){return-1},M:pt,p:function(e){L&&M.La[e>>>0].ref()},t:function(e,t,n){e=t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,n>>>=0,e=new Date(1e3*e),f()[n>>2>>>0]=e.getUTCSeconds(),f()[n+4>>2>>>0]=e.getUTCMinutes(),f()[n+8>>2>>>0]=e.getUTCHours(),f()[n+12>>2>>>0]=e.getUTCDate(),f()[n+16>>2>>>0]=e.getUTCMonth(),f()[n+20>>2>>>0]=e.getUTCFullYear()-1900,f()[n+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,f()[n+28>>2>>>0]=e},u:function(e,t,n){e=t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,n>>>=0,e=new Date(1e3*e),f()[n>>2>>>0]=e.getSeconds(),f()[n+4>>2>>>0]=e.getMinutes(),f()[n+8>>2>>>0]=e.getHours(),f()[n+12>>2>>>0]=e.getDate(),f()[n+16>>2>>>0]=e.getMonth(),f()[n+20>>2>>>0]=e.getFullYear()-1900,f()[n+24>>2>>>0]=e.getDay(),t=(Ye(e.getFullYear())?kt:Wt)[e.getMonth()]+e.getDate()-1|0,f()[n+28>>2>>>0]=t,f()[n+36>>2>>>0]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var l=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=(t!=l&&e.getTimezoneOffset()==Math.min(l,t))|0,f()[n+32>>2>>>0]=e},v:function(e){e>>>=0;var t=new Date(f()[e+20>>2>>>0]+1900,f()[e+16>>2>>>0],f()[e+12>>2>>>0],f()[e+8>>2>>>0],f()[e+4>>2>>>0],f()[e>>2>>>0],0),n=f()[e+32>>2>>>0],l=t.getTimezoneOffset(),b=new Date(t.getFullYear(),6,1).getTimezoneOffset(),y=new Date(t.getFullYear(),0,1).getTimezoneOffset(),_=Math.min(y,b);return 0>n?f()[e+32>>2>>>0]=+(b!=y&&_==l):0>2>>>0]=t.getDay(),n=(Ye(t.getFullYear())?kt:Wt)[t.getMonth()]+t.getDate()-1|0,f()[e+28>>2>>>0]=n,f()[e>>2>>>0]=t.getSeconds(),f()[e+4>>2>>>0]=t.getMinutes(),f()[e+8>>2>>>0]=t.getHours(),f()[e+12>>2>>>0]=t.getDate(),f()[e+16>>2>>>0]=t.getMonth(),f()[e+20>>2>>>0]=t.getYear(),e=t.getTime()/1e3,nr((Fe=e,1<=+Math.abs(Fe)?0>>0:~~+Math.ceil((Fe-+(~~Fe>>>0))/4294967296)>>>0:0)),e>>>0},r:Nt,s:Ht,y:function(e,t,n){function l(ne){return(ne=ne.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?ne[1]:\"GMT\"}e>>>=0,t>>>=0,n>>>=0;var b=new Date().getFullYear(),y=new Date(b,0,1),_=new Date(b,6,1);b=y.getTimezoneOffset();var X=_.getTimezoneOffset(),Me=Math.max(b,X);w()[e>>2>>>0]=60*Me,f()[t>>2>>>0]=+(b!=X),e=l(y),t=l(_),e=Gt(e),t=Gt(t),X>2>>>0]=e,w()[n+4>>2>>>0]=t):(w()[n>>2>>>0]=t,w()[n+4>>2>>>0]=e)},c:()=>{we(\"\")},k:function(){},i:function(){return Date.now()},o:()=>{throw Re+=1,\"unwind\"},A:function(){return 4294901760},e:()=>performance.timeOrigin+performance.now(),f:function(){return L?(hr(),ot(gr)).cpus().length:navigator.hardwareConcurrency},K:function(e,t,n,l){for(M.vb=t>>>0,mt.length=n,t=l>>>0>>3,l=0;l>>0];return zr[e].apply(null,mt)},x:function(e){e>>>=0;var t=h().length;if(e<=t||4294901760=n;n*=2){var l=t*(1+.2/n);l=Math.min(l,e+100663296);var b=Math;l=Math.max(e,l);e:{b=b.min.call(b,4294901760,l+(65536-l%65536)%65536)-V.buffer.byteLength+65535>>>16;try{V.grow(b),pe();var y=1;break e}catch{}y=void 0}if(y)return!0}return!1},O:Yt,P:zt,H:Ge,g:$t,m:qt,w:Vt,l:Jt,a:V||a.wasmMemory,G:Qt,d:function(e,t,n,l){return Qt(e>>>0,t>>>0,n>>>0,l>>>0)}};(function(){function e(n,l){return n=n.exports,S=n=qr(n),M.Za.push(S.ya),Pe=S.za,ge.unshift(S.V),F=l,We(),n}var t={a:$r};if(De(),a.instantiateWasm)try{return a.instantiateWasm(t,e)}catch(n){ae(\"Module.instantiateWasm callback failed with error: \"+n),x(n)}return Xe(t,function(n){e(n.instance,n.module)}).catch(x),{}})(),a._OrtInit=(e,t)=>(a._OrtInit=S.W)(e,t),a._OrtGetLastError=(e,t)=>(a._OrtGetLastError=S.X)(e,t),a._OrtCreateSessionOptions=(e,t,n,l,b,y,_,X,Me,ne)=>(a._OrtCreateSessionOptions=S.Y)(e,t,n,l,b,y,_,X,Me,ne),a._OrtAppendExecutionProvider=(e,t)=>(a._OrtAppendExecutionProvider=S.Z)(e,t),a._OrtAddFreeDimensionOverride=(e,t,n)=>(a._OrtAddFreeDimensionOverride=S._)(e,t,n),a._OrtAddSessionConfigEntry=(e,t,n)=>(a._OrtAddSessionConfigEntry=S.$)(e,t,n),a._OrtReleaseSessionOptions=e=>(a._OrtReleaseSessionOptions=S.aa)(e),a._OrtCreateSession=(e,t,n)=>(a._OrtCreateSession=S.ba)(e,t,n),a._OrtReleaseSession=e=>(a._OrtReleaseSession=S.ca)(e),a._OrtGetInputOutputCount=(e,t,n)=>(a._OrtGetInputOutputCount=S.da)(e,t,n),a._OrtGetInputName=(e,t)=>(a._OrtGetInputName=S.ea)(e,t),a._OrtGetOutputName=(e,t)=>(a._OrtGetOutputName=S.fa)(e,t),a._OrtFree=e=>(a._OrtFree=S.ga)(e),a._OrtCreateTensor=(e,t,n,l,b,y)=>(a._OrtCreateTensor=S.ha)(e,t,n,l,b,y),a._OrtGetTensorData=(e,t,n,l,b)=>(a._OrtGetTensorData=S.ia)(e,t,n,l,b),a._OrtReleaseTensor=e=>(a._OrtReleaseTensor=S.ja)(e),a._OrtCreateRunOptions=(e,t,n,l)=>(a._OrtCreateRunOptions=S.ka)(e,t,n,l),a._OrtAddRunConfigEntry=(e,t,n)=>(a._OrtAddRunConfigEntry=S.la)(e,t,n),a._OrtReleaseRunOptions=e=>(a._OrtReleaseRunOptions=S.ma)(e),a._OrtCreateBinding=e=>(a._OrtCreateBinding=S.na)(e),a._OrtBindInput=(e,t,n)=>(a._OrtBindInput=S.oa)(e,t,n),a._OrtBindOutput=(e,t,n,l)=>(a._OrtBindOutput=S.pa)(e,t,n,l),a._OrtClearBoundOutputs=e=>(a._OrtClearBoundOutputs=S.qa)(e),a._OrtReleaseBinding=e=>(a._OrtReleaseBinding=S.ra)(e),a._OrtRunWithBinding=(e,t,n,l,b)=>(a._OrtRunWithBinding=S.sa)(e,t,n,l,b),a._OrtRun=(e,t,n,l,b,y,_,X)=>(a._OrtRun=S.ta)(e,t,n,l,b,y,_,X),a._OrtEndProfiling=e=>(a._OrtEndProfiling=S.ua)(e);var ft=a._pthread_self=()=>(ft=a._pthread_self=S.va)(),Kt=a._malloc=e=>(Kt=a._malloc=S.wa)(e);a._free=e=>(a._free=S.xa)(e),a.__emscripten_tls_init=()=>(a.__emscripten_tls_init=S.ya)();var er=a.__emscripten_thread_init=(e,t,n,l,b,y)=>(er=a.__emscripten_thread_init=S.Aa)(e,t,n,l,b,y);a.__emscripten_thread_crashed=()=>(a.__emscripten_thread_crashed=S.Ba)();var tr=(e,t,n,l)=>(tr=S.Ca)(e,t,n,l),yt=e=>(yt=S.Da)(e),bt=a.__emscripten_thread_exit=e=>(bt=a.__emscripten_thread_exit=S.Ea)(e),rr=a.__emscripten_check_mailbox=()=>(rr=a.__emscripten_check_mailbox=S.Fa)(),nr=e=>(nr=S.Ga)(e),or=(e,t)=>(or=S.Ha)(e,t),wt=()=>(wt=S.Ia)(),lt=e=>(lt=S.Ja)(e),Ot=e=>(Ot=S.Ka)(e);function qr(e){e=Object.assign({},e);var t=l=>()=>l()>>>0,n=l=>b=>l(b)>>>0;return e.__errno_location=t(e.__errno_location),e.pthread_self=t(e.pthread_self),e.malloc=n(e.malloc),e.stackSave=t(e.stackSave),e.stackAlloc=n(e.stackAlloc),e}a.keepRuntimeAlive=ee,a.wasmMemory=V,a.stackAlloc=Ot,a.stackSave=wt,a.stackRestore=lt,a.UTF8ToString=He,a.stringToUTF8=ie,a.lengthBytesUTF8=re,a.ExitStatus=Ie,a.PThread=M;var ct;be=function e(){ct||ar(),ct||(be=e)};function ar(){function e(){if(!ct&&(ct=!0,a.calledRun=!0,!de)&&(v||je(ge),E(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),!v)){if(a.postRun)for(typeof a.postRun==\"function\"&&(a.postRun=[a.postRun]);a.postRun.length;){var t=a.postRun.shift();Ae.unshift(t)}je(Ae)}}if(!(0yr)});var Or=nt((wn,rn)=>{rn.exports='\"use strict\";var Module={},ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\"),parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",e=>onmessage({data:e}));var fs=require(\"fs\");Object.assign(global,{self:global,require,Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:e=>(0,eval)(fs.readFileSync(e,\"utf8\")+\"//# sourceURL=\"+e),postMessage:e=>parentPort.postMessage(e),performance:global.performance||{now:Date.now}})}var initializedJS=!1;function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,e+`\\n`);return}console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:e,threadId:Module._pthread_self()})}var err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(e,t)=>{var a=Module.wasmModule;Module.wasmModule=null;var r=new WebAssembly.Instance(a,e);return t(r)},self.onunhandledrejection=e=>{throw e.reason??e};function handleMessage(e){try{if(e.data.cmd===\"load\"){let a=[];self.onmessage=r=>a.push(r),self.startWorker=r=>{Module=r,postMessage({cmd:\"loaded\"});for(let s of a)handleMessage(s);self.onmessage=handleMessage},Module.wasmModule=e.data.wasmModule;for(const r of e.data.handlers)Module[r]=(...s)=>{postMessage({cmd:\"callHandler\",handler:r,args:s})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,typeof e.data.urlOrBlob==\"string\")importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}ortWasmThreaded(Module)}else if(e.data.cmd===\"run\"){Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.__emscripten_thread_mailbox_await(e.data.pthread_ptr),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(a){if(a!=\"unwind\")throw a}}else e.data.cmd===\"cancel\"?Module._pthread_self()&&Module.__emscripten_thread_exit(-1):e.data.target===\"setimmediate\"||(e.data.cmd===\"checkMailbox\"?initializedJS&&Module.checkMailbox():e.data.cmd&&(err(\"worker.js received unknown command \"+e.data.cmd),err(e.data)))}catch(a){throw Module.__emscripten_thread_crashed&&Module.__emscripten_thread_crashed(),a}}self.onmessage=handleMessage;\\n'});var _r;_r=dr();var nn=wr(),Dt,Ft=!1,dt=!1,vr=!1,on=s=>{if(s===1)return!1;if(typeof SharedArrayBuffer>\"u\")return typeof self<\"u\"&&!self.crossOriginIsolated&&console.warn(\"env.wasm.numThreads is set to \"+s+\", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.\"),!1;typeof process<\"u\"&&process.versions&&process.versions.node&&console.warn(\"env.wasm.numThreads is set to \"+s+\", however, currently onnxruntime-web does not support multi-threads in Node.js. Please consider using onnxruntime-node for performance critical scenarios.\");try{return typeof MessageChannel<\"u\"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},an=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},sn=(s,c)=>s?c?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-simd.wasm\":c?\"ort-wasm-threaded.wasm\":\"ort-wasm.wasm\",Er=async s=>{if(Ft)return Promise.resolve();if(dt)throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");if(vr)throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");dt=!0;let c=s.initTimeout,o=s.numThreads,h=s.simd,f=on(o),w=h&&an(),g=s.wasmPaths,a=typeof g==\"string\"?g:void 0,E=sn(w,f),x=typeof g==\"object\"?g[E]:void 0,P=!1,R=[];if(c>0&&R.push(new Promise(D=>{setTimeout(()=>{P=!0,D()},c)})),R.push(new Promise((D,K)=>{let I=f?nn:_r,L={locateFile:(v,k)=>f&&v.endsWith(\".worker.js\")&&typeof Blob<\"u\"?URL.createObjectURL(new Blob([Or()],{type:\"text/javascript\"})):v.endsWith(\".wasm\")?x||(a??k)+E:k+v};if(f)if(L.numThreads=o,typeof Blob>\"u\")L.mainScriptUrlOrBlob=(void 0)(__dirname,\"ort-wasm-threaded.js\");else{let v=`var ortWasmThreaded=${I.toString()};`;L.mainScriptUrlOrBlob=new Blob([v],{type:\"text/javascript\"})}I(L).then(v=>{dt=!1,Ft=!0,Dt=v,D()},v=>{dt=!1,vr=!0,K(v)})})),await Promise.race(R),P)throw new Error(`WebAssembly backend initializing failed due to timeout: ${c}ms`)},Q=()=>{if(Ft&&Dt)return Dt;throw new Error(\"WebAssembly is not initialized yet.\")};var $=(s,c)=>{let o=Q(),h=o.lengthBytesUTF8(s)+1,f=o._malloc(h);return o.stringToUTF8(s,f,h),c.push(f),f},at=(s,c,o,h)=>{if(typeof s==\"object\"&&s!==null){if(o.has(s))throw new Error(\"Circular reference in options\");o.add(s)}Object.entries(s).forEach(([f,w])=>{let g=c?c+f:f;if(typeof w==\"object\")at(w,g+\".\",o,h);else if(typeof w==\"string\"||typeof w==\"number\")h(g,w.toString());else if(typeof w==\"boolean\")h(g,w?\"1\":\"0\");else throw new Error(`Can't handle extra config type: ${typeof w}`)})},q=s=>{let c=Q(),o=c.stackSave();try{let h=c.stackAlloc(8);c._OrtGetLastError(h,h+4);let f=c.HEAP32[h/4],w=c.HEAPU32[h/4+1],g=w?c.UTF8ToString(w):\"\";throw new Error(`${s} ERROR_CODE: ${f}, ERROR_MESSAGE: ${g}`)}finally{c.stackRestore(o)}};var Sr=s=>{let c=Q(),o=0,h=[],f=s||{};try{if(s?.logSeverityLevel===void 0)f.logSeverityLevel=2;else if(typeof s.logSeverityLevel!=\"number\"||!Number.isInteger(s.logSeverityLevel)||s.logSeverityLevel<0||s.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${s.logSeverityLevel}`);if(s?.logVerbosityLevel===void 0)f.logVerbosityLevel=0;else if(typeof s.logVerbosityLevel!=\"number\"||!Number.isInteger(s.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${s.logVerbosityLevel}`);s?.terminate===void 0&&(f.terminate=!1);let w=0;return s?.tag!==void 0&&(w=$(s.tag,h)),o=c._OrtCreateRunOptions(f.logSeverityLevel,f.logVerbosityLevel,!!f.terminate,w),o===0&&q(\"Can't create run options.\"),s?.extra!==void 0&&at(s.extra,\"\",new WeakSet,(g,a)=>{let E=$(g,h),x=$(a,h);c._OrtAddRunConfigEntry(o,E,x)!==0&&q(`Can't set a run config entry: ${g} - ${a}.`)}),[o,h]}catch(w){throw o!==0&&c._OrtReleaseRunOptions(o),h.forEach(g=>c._free(g)),w}};var un=s=>{switch(s){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${s}`)}},fn=s=>{switch(s){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${s}`)}},ln=s=>{s.extra||(s.extra={}),s.extra.session||(s.extra.session={});let c=s.extra.session;c.use_ort_model_bytes_directly||(c.use_ort_model_bytes_directly=\"1\"),s.executionProviders&&s.executionProviders.some(o=>(typeof o==\"string\"?o:o.name)===\"webgpu\")&&(s.enableMemPattern=!1)},cn=(s,c,o)=>{for(let h of c){let f=typeof h==\"string\"?h:h.name;switch(f){case\"webnn\":if(f=\"WEBNN\",typeof h!=\"string\"){let g=h;if(g?.deviceType){let a=$(\"deviceType\",o),E=$(g.deviceType,o);Q()._OrtAddSessionConfigEntry(s,a,E)!==0&&q(`Can't set a session config entry: 'deviceType' - ${g.deviceType}.`)}if(g?.numThreads){let a=g.numThreads;(typeof a!=\"number\"||!Number.isInteger(a)||a<0)&&(a=0);let E=$(\"numThreads\",o),x=$(a.toString(),o);Q()._OrtAddSessionConfigEntry(s,E,x)!==0&&q(`Can't set a session config entry: 'numThreads' - ${g.numThreads}.`)}if(g?.powerPreference){let a=$(\"powerPreference\",o),E=$(g.powerPreference,o);Q()._OrtAddSessionConfigEntry(s,a,E)!==0&&q(`Can't set a session config entry: 'powerPreference' - ${g.powerPreference}.`)}}break;case\"webgpu\":if(f=\"JS\",typeof h!=\"string\"){let g=h;if(g?.preferredLayout){if(g.preferredLayout!==\"NCHW\"&&g.preferredLayout!==\"NHWC\")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${g.preferredLayout}`);let a=$(\"preferredLayout\",o),E=$(g.preferredLayout,o);Q()._OrtAddSessionConfigEntry(s,a,E)!==0&&q(`Can't set a session config entry: 'preferredLayout' - ${g.preferredLayout}.`)}}break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported execution provider: ${f}`)}let w=$(f,o);Q()._OrtAppendExecutionProvider(s,w)!==0&&q(`Can't append execution provider: ${f}.`)}},Ar=s=>{let c=Q(),o=0,h=[],f=s||{};ln(f);try{let w=un(f.graphOptimizationLevel??\"all\"),g=fn(f.executionMode??\"sequential\"),a=typeof f.logId==\"string\"?$(f.logId,h):0,E=f.logSeverityLevel??2;if(!Number.isInteger(E)||E<0||E>4)throw new Error(`log serverity level is not valid: ${E}`);let x=f.logVerbosityLevel??0;if(!Number.isInteger(x)||x<0||x>4)throw new Error(`log verbosity level is not valid: ${x}`);let P=typeof f.optimizedModelFilePath==\"string\"?$(f.optimizedModelFilePath,h):0;if(o=c._OrtCreateSessionOptions(w,!!f.enableCpuMemArena,!!f.enableMemPattern,g,!!f.enableProfiling,0,a,E,x,P),o===0&&q(\"Can't create session options.\"),f.executionProviders&&cn(o,f.executionProviders,h),f.enableGraphCapture!==void 0){if(typeof f.enableGraphCapture!=\"boolean\")throw new Error(`enableGraphCapture must be a boolean value: ${f.enableGraphCapture}`);let R=$(\"enableGraphCapture\",h),D=$(f.enableGraphCapture.toString(),h);c._OrtAddSessionConfigEntry(o,R,D)!==0&&q(`Can't set a session config entry: 'enableGraphCapture' - ${f.enableGraphCapture}.`)}if(f.freeDimensionOverrides)for(let[R,D]of Object.entries(f.freeDimensionOverrides)){if(typeof R!=\"string\")throw new Error(`free dimension override name must be a string: ${R}`);if(typeof D!=\"number\"||!Number.isInteger(D)||D<0)throw new Error(`free dimension override value must be a non-negative integer: ${D}`);let K=$(R,h);c._OrtAddFreeDimensionOverride(o,K,D)!==0&&q(`Can't set a free dimension override: ${R} - ${D}.`)}return f.extra!==void 0&&at(f.extra,\"\",new WeakSet,(R,D)=>{let K=$(R,h),I=$(D,h);c._OrtAddSessionConfigEntry(o,K,I)!==0&&q(`Can't set a session config entry: ${R} - ${D}.`)}),[o,h]}catch(w){throw o!==0&&c._OrtReleaseSessionOptions(o),h.forEach(g=>c._free(g)),w}};var xt=s=>{switch(s){case\"int8\":return 3;case\"uint8\":return 2;case\"bool\":return 9;case\"int16\":return 5;case\"uint16\":return 4;case\"int32\":return 6;case\"uint32\":return 12;case\"float16\":return 10;case\"float32\":return 1;case\"float64\":return 11;case\"string\":return 8;case\"int64\":return 7;case\"uint64\":return 13;default:throw new Error(`unsupported data type: ${s}`)}},Tr=s=>{switch(s){case 3:return\"int8\";case 2:return\"uint8\";case 9:return\"bool\";case 5:return\"int16\";case 4:return\"uint16\";case 6:return\"int32\";case 12:return\"uint32\";case 10:return\"float16\";case 1:return\"float32\";case 11:return\"float64\";case 8:return\"string\";case 7:return\"int64\";case 13:return\"uint64\";default:throw new Error(`unsupported data type: ${s}`)}},Pt=s=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][s],Mr=s=>{switch(s){case\"float16\":return typeof Float16Array<\"u\"&&Float16Array.from?Float16Array:Uint16Array;case\"float32\":return Float32Array;case\"uint8\":return Uint8Array;case\"int8\":return Int8Array;case\"uint16\":return Uint16Array;case\"int16\":return Int16Array;case\"int32\":return Int32Array;case\"bool\":return Uint8Array;case\"float64\":return Float64Array;case\"uint32\":return Uint32Array;case\"int64\":return BigInt64Array;case\"uint64\":return BigUint64Array;default:throw new Error(`unsupported type: ${s}`)}},Cr=s=>{switch(s){case\"verbose\":return 0;case\"info\":return 1;case\"warning\":return 2;case\"error\":return 3;case\"fatal\":return 4;default:throw new Error(`unsupported logging level: ${s}`)}},Rr=s=>s===\"float32\"||s===\"float16\"||s===\"int32\"||s===\"int64\"||s===\"uint32\"||s===\"uint8\"||s===\"bool\",Dr=s=>{switch(s){case\"none\":return 0;case\"cpu\":return 1;case\"cpu-pinned\":return 2;case\"texture\":return 3;case\"gpu-buffer\":return 4;default:throw new Error(`unsupported data location: ${s}`)}};var Fr=async s=>{if(typeof s==\"string\")if(typeof process<\"u\"&&process.versions&&process.versions.node)try{return new Uint8Array(await(void 0)(s))}catch(c){if(c.code===\"ERR_FS_FILE_TOO_LARGE\"){let o=(void 0)(s),h=[];for await(let f of o)h.push(f);return new Uint8Array(Buffer.concat(h))}throw c}else{let c=await fetch(s);if(!c.ok)throw new Error(`failed to load external data file: ${s}`);let o=c.headers.get(\"Content-Length\"),h=o?parseInt(o,10):0;if(h<1073741824)return new Uint8Array(await c.arrayBuffer());{if(!c.body)throw new Error(`failed to load external data file: ${s}, no response body.`);let f=c.body.getReader(),w;try{w=new ArrayBuffer(h)}catch(a){if(a instanceof RangeError){let E=Math.ceil(h/65536);w=new WebAssembly.Memory({initial:E,maximum:E}).buffer}else throw a}let g=0;for(;;){let{done:a,value:E}=await f.read();if(a)break;let x=E.byteLength;new Uint8Array(w,g,x).set(E),g+=x}return new Uint8Array(w,0,h)}}else return s instanceof Blob?new Uint8Array(await s.arrayBuffer()):s instanceof Uint8Array?s:new Uint8Array(s)};var dn=(s,c)=>{Q()._OrtInit(s,c)!==0&&q(\"Can't initialize onnxruntime.\")},Pr=async s=>{dn(s.wasm.numThreads,Cr(s.logLevel))},Ir=async(s,c)=>{},ze=new Map,pn=s=>{let c=Q(),o=c.stackSave();try{let h=c.stackAlloc(8);return c._OrtGetInputOutputCount(s,h,h+4)!==0&&q(\"Can't get session input/output count.\"),[c.HEAP32[h/4],c.HEAP32[h/4+1]]}finally{c.stackRestore(o)}},It=s=>{let c=Q(),o=c._malloc(s.byteLength);if(o===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${s.byteLength}.`);return c.HEAPU8.set(s,o),[o,s.byteLength]},Ur=async(s,c)=>{let o,h,f=Q();Array.isArray(s)?[o,h]=s:s.buffer===f.HEAPU8.buffer?[o,h]=[s.byteOffset,s.byteLength]:[o,h]=It(s);let w=0,g=0,a=0,E=[],x=[],P=[];try{if([g,E]=Ar(c),c?.externalData&&f.mountExternalData){let W=[];for(let j of c.externalData){let oe=typeof j==\"string\"?j:j.path;W.push(Fr(typeof j==\"string\"?j:j.data).then(C=>{f.mountExternalData(oe,C)}))}await Promise.all(W)}w=await f._OrtCreateSession(o,h,g),w===0&&q(\"Can't create a session.\");let[R,D]=pn(w),K=!!c?.enableGraphCapture,I=[],L=[],v=[];for(let W=0;Wf._OrtFree(D)),P.forEach(D=>f._OrtFree(D)),a!==0&&f._OrtReleaseBinding(a),w!==0&&f._OrtReleaseSession(w),R}finally{f._free(o),g!==0&&f._OrtReleaseSessionOptions(g),E.forEach(R=>f._free(R)),f.unmountExternalData?.()}},Lr=s=>{let c=Q(),o=ze.get(s);if(!o)throw new Error(`cannot release session. invalid session id: ${s}`);let[h,f,w,g,a]=o;g&&(a&&c._OrtClearBoundOutputs(g.handle),c._OrtReleaseBinding(g.handle)),c.jsepOnReleaseSession?.(s),f.forEach(E=>c._OrtFree(E)),w.forEach(E=>c._OrtFree(E)),c._OrtReleaseSession(h),ze.delete(s)},xr=(s,c,o,h,f,w=!1)=>{if(!s){c.push(0);return}let g=Q(),a=s[0],E=s[1],x=s[3],P,R;if(a===\"string\"&&x===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");if(w&&x!==\"gpu-buffer\")throw new Error(`External buffer must be provided for input/output index ${f} when enableGraphCapture is true.`);if(x===\"gpu-buffer\"){let I=s[2].gpuBuffer,L=Pt(xt(a));R=E.reduce((k,W)=>k*W,1)*L;let v=g.jsepRegisterBuffer;if(!v)throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');P=v(h,f,I,R)}else{let I=s[2];if(Array.isArray(I)){R=4*I.length,P=g._malloc(R),o.push(P);let L=P/4;for(let v=0;vg.HEAP32[I++]=v);let L=g._OrtCreateTensor(xt(a),P,R,K,E.length,Dr(x));L===0&&q(`Can't create tensor for input/output. session=${h}, index=${f}.`),c.push(L)}finally{g.stackRestore(D)}},Br=async(s,c,o,h,f,w)=>{let g=Q(),a=ze.get(s);if(!a)throw new Error(`cannot run inference. invalid session id: ${s}`);let E=a[0],x=a[1],P=a[2],R=a[3],D=a[4],K=a[5],I=c.length,L=h.length,v=0,k=[],W=[],j=[],oe=[],C=g.stackSave(),ve=g.stackAlloc(I*4),Oe=g.stackAlloc(I*4),ce=g.stackAlloc(L*4),A=g.stackAlloc(L*4);try{[v,k]=Sr(w);for(let F=0;Fee*Y,1);J=Tr(Se);let Re=R?.outputPreferredLocations[h[F]];if(J===\"string\"){if(Re===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");let ee=[],Y=fe/4;for(let he=0;he0){let ee=g.jsepGetBuffer;if(!ee)throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');let Y=ee(fe),he=Pt(Se);if(he===void 0||!Rr(J))throw new Error(`Unsupported data type: ${J}`);Ee=!0,S.push([J,ge,{gpuBuffer:Y,download:g.jsepCreateDownloader(Y,Ae*he,J),dispose:()=>{g._OrtReleaseTensor(de)}},\"gpu-buffer\"])}else{let ee=Mr(J),Y=new ee(Ae);new Uint8Array(Y.buffer,Y.byteOffset,Y.byteLength).set(g.HEAPU8.subarray(fe,fe+Y.byteLength)),S.push([J,ge,Y,\"cpu\"])}}finally{g.stackRestore(ue),J===\"string\"&&fe&&g._free(fe),Ee||g._OrtReleaseTensor(de)}}return R&&!D&&(g._OrtClearBoundOutputs(R.handle),ze.set(s,[E,x,P,R,D,!1])),S}finally{g.stackRestore(C),W.forEach(N=>g._OrtReleaseTensor(N)),j.forEach(N=>g._OrtReleaseTensor(N)),oe.forEach(N=>g._free(N)),v!==0&&g._OrtReleaseRunOptions(v),k.forEach(N=>g._free(N))}},kr=s=>{let c=Q(),o=ze.get(s);if(!o)throw new Error(\"invalid session id\");let h=o[0],f=c._OrtEndProfiling(h);f===0&&q(\"Can't get an profile file name.\"),c._OrtFree(f)},Wr=s=>{let c=[];for(let o of s){let h=o[2];!Array.isArray(h)&&\"buffer\"in h&&c.push(h.buffer)}return c};self.onmessage=s=>{let{type:c,in:o}=s.data;try{switch(c){case\"init-wasm\":Er(o.wasm).then(()=>{Pr(o).then(()=>{postMessage({type:c})},h=>{postMessage({type:c,err:h})})},h=>{postMessage({type:c,err:h})});break;case\"init-ep\":{let{epName:h,env:f}=o;Ir(f,h).then(()=>{postMessage({type:c})},w=>{postMessage({type:c,err:w})});break}case\"copy-from\":{let{buffer:h}=o,f=It(h);postMessage({type:c,out:f});break}case\"create\":{let{model:h,options:f}=o;Ur(h,f).then(w=>{postMessage({type:c,out:w})},w=>{postMessage({type:c,err:w})});break}case\"release\":Lr(o),postMessage({type:c});break;case\"run\":{let{sessionId:h,inputIndices:f,inputs:w,outputIndices:g,options:a}=o;Br(h,f,w,g,new Array(g.length).fill(null),a).then(E=>{E.some(x=>x[3]!==\"cpu\")?postMessage({type:c,err:\"Proxy does not support non-cpu tensor location.\"}):postMessage({type:c,out:E},Wr([...w,...E]))},E=>{postMessage({type:c,err:E})});break}case\"end-profiling\":kr(o),postMessage({type:c});break;default:}}catch(h){postMessage({type:c,err:h})}};})();\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env, InferenceSession} from 'onnxruntime-common';\n\nimport {OrtWasmMessage, SerializableInternalBuffer, SerializableSessionMetadata, SerializableTensorMetadata, TensorMetadata} from './proxy-messages';\nimport * as core from './wasm-core-impl';\nimport {initializeWebAssembly} from './wasm-factory';\n\nconst isProxy = (): boolean => !!env.wasm.proxy && typeof document !== 'undefined';\nlet proxyWorker: Worker|undefined;\nlet initializing = false;\nlet initialized = false;\nlet aborted = false;\n\ntype PromiseCallbacks = [resolve: (result: T) => void, reject: (reason: unknown) => void];\nlet initWasmCallbacks: PromiseCallbacks;\nconst queuedCallbacks: Map>> = new Map();\n\nconst enqueueCallbacks = (type: OrtWasmMessage['type'], callbacks: PromiseCallbacks): void => {\n const queue = queuedCallbacks.get(type);\n if (queue) {\n queue.push(callbacks);\n } else {\n queuedCallbacks.set(type, [callbacks]);\n }\n};\n\nconst ensureWorker = (): void => {\n if (initializing || !initialized || aborted || !proxyWorker) {\n throw new Error('worker not ready');\n }\n};\n\nconst onProxyWorkerMessage = (ev: MessageEvent): void => {\n switch (ev.data.type) {\n case 'init-wasm':\n initializing = false;\n if (ev.data.err) {\n aborted = true;\n initWasmCallbacks[1](ev.data.err);\n } else {\n initialized = true;\n initWasmCallbacks[0]();\n }\n break;\n case 'init-ep':\n case 'copy-from':\n case 'create':\n case 'release':\n case 'run':\n case 'end-profiling': {\n const callbacks = queuedCallbacks.get(ev.data.type)!;\n if (ev.data.err) {\n callbacks.shift()![1](ev.data.err);\n } else {\n callbacks.shift()![0](ev.data.out!);\n }\n break;\n }\n default:\n }\n};\n\nconst scriptSrc = typeof document !== 'undefined' ? (document?.currentScript as HTMLScriptElement)?.src : undefined;\n\nexport const initializeWebAssemblyAndOrtRuntime = async(): Promise => {\n if (initialized) {\n return;\n }\n if (initializing) {\n throw new Error('multiple calls to \\'initWasm()\\' detected.');\n }\n if (aborted) {\n throw new Error('previous call to \\'initWasm()\\' failed.');\n }\n\n initializing = true;\n\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n // overwrite wasm filepaths\n if (env.wasm.wasmPaths === undefined) {\n if (scriptSrc && scriptSrc.indexOf('blob:') !== 0) {\n env.wasm.wasmPaths = scriptSrc.substr(0, +(scriptSrc).lastIndexOf('/') + 1);\n }\n }\n\n return new Promise((resolve, reject) => {\n proxyWorker?.terminate();\n\n const workerUrl = URL.createObjectURL(new Blob(\n [\n // This require() function is handled by esbuild plugin to load file content as string.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('./proxy-worker/main')\n ],\n {type: 'text/javascript'}));\n proxyWorker = new Worker(workerUrl, {name: 'ort-wasm-proxy-worker'});\n proxyWorker.onerror = (ev: ErrorEvent) => reject(ev);\n proxyWorker.onmessage = onProxyWorkerMessage;\n URL.revokeObjectURL(workerUrl);\n initWasmCallbacks = [resolve, reject];\n const message: OrtWasmMessage = {type: 'init-wasm', in : env};\n proxyWorker.postMessage(message);\n });\n\n } else {\n try {\n await initializeWebAssembly(env.wasm);\n await core.initRuntime(env);\n initialized = true;\n } catch (e) {\n aborted = true;\n throw e;\n } finally {\n initializing = false;\n }\n }\n};\n\nexport const initializeOrtEp = async(epName: string): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('init-ep', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'init-ep', in : {epName, env}};\n proxyWorker!.postMessage(message);\n });\n } else {\n await core.initEp(env, epName);\n }\n};\n\nexport const copyFromExternalBuffer = async(buffer: Uint8Array): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('copy-from', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'copy-from', in : {buffer}};\n proxyWorker!.postMessage(message, [buffer.buffer]);\n });\n } else {\n return core.copyFromExternalBuffer(buffer);\n }\n};\n\nexport const createSession =\n async(model: SerializableInternalBuffer|Uint8Array, options?: InferenceSession.SessionOptions):\n Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n // check unsupported options\n if (options?.preferredOutputLocation) {\n throw new Error('session option \"preferredOutputLocation\" is not supported for proxy.');\n }\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('create', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'create', in : {model, options: {...options}}};\n const transferable: Transferable[] = [];\n if (model instanceof Uint8Array) {\n transferable.push(model.buffer);\n }\n proxyWorker!.postMessage(message, transferable);\n });\n } else {\n return core.createSession(model, options);\n }\n };\n\nexport const releaseSession = async(sessionId: number): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('release', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'release', in : sessionId};\n proxyWorker!.postMessage(message);\n });\n } else {\n core.releaseSession(sessionId);\n }\n};\n\nexport const run = async(\n sessionId: number, inputIndices: number[], inputs: TensorMetadata[], outputIndices: number[],\n outputs: Array, options: InferenceSession.RunOptions): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n // check inputs location\n if (inputs.some(t => t[3] !== 'cpu')) {\n throw new Error('input tensor on GPU is not supported for proxy.');\n }\n // check outputs location\n if (outputs.some(t => t)) {\n throw new Error('pre-allocated output tensor is not supported for proxy.');\n }\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('run', [resolve, reject]);\n const serializableInputs = inputs as SerializableTensorMetadata[]; // every input is on CPU.\n const message: OrtWasmMessage =\n {type: 'run', in : {sessionId, inputIndices, inputs: serializableInputs, outputIndices, options}};\n proxyWorker!.postMessage(message, core.extractTransferableBuffers(serializableInputs));\n });\n } else {\n return core.run(sessionId, inputIndices, inputs, outputIndices, outputs, options);\n }\n};\n\nexport const endProfiling = async(sessionId: number): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('end-profiling', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'end-profiling', in : sessionId};\n proxyWorker!.postMessage(message);\n });\n } else {\n core.endProfiling(sessionId);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession, InferenceSessionHandler, SessionHandler, Tensor, TRACE_FUNC_BEGIN, TRACE_FUNC_END} from 'onnxruntime-common';\n\nimport {SerializableInternalBuffer, TensorMetadata} from './proxy-messages';\nimport {copyFromExternalBuffer, createSession, endProfiling, releaseSession, run} from './proxy-wrapper';\nimport {isGpuBufferSupportedType} from './wasm-common';\nimport {loadFile} from './wasm-utils-load-file';\n\nexport const encodeTensorMetadata = (tensor: Tensor, getName: () => string): TensorMetadata => {\n switch (tensor.location) {\n case 'cpu':\n return [tensor.type, tensor.dims, tensor.data, 'cpu'];\n case 'gpu-buffer':\n return [tensor.type, tensor.dims, {gpuBuffer: tensor.gpuBuffer}, 'gpu-buffer'];\n default:\n throw new Error(`invalid data location: ${tensor.location} for ${getName()}`);\n }\n};\n\nexport const decodeTensorMetadata = (tensor: TensorMetadata): Tensor => {\n switch (tensor[3]) {\n case 'cpu':\n return new Tensor(tensor[0], tensor[2], tensor[1]);\n case 'gpu-buffer': {\n const dataType = tensor[0];\n if (!isGpuBufferSupportedType(dataType)) {\n throw new Error(`not supported data type: ${dataType} for deserializing GPU tensor`);\n }\n const {gpuBuffer, download, dispose} = tensor[2];\n return Tensor.fromGpuBuffer(gpuBuffer, {dataType, dims: tensor[1], download, dispose});\n }\n default:\n throw new Error(`invalid data location: ${tensor[3]}`);\n }\n};\n\nexport class OnnxruntimeWebAssemblySessionHandler implements InferenceSessionHandler {\n private sessionId: number;\n\n inputNames: string[];\n outputNames: string[];\n\n async fetchModelAndCopyToWasmMemory(path: string): Promise {\n // fetch model from url and move to wasm heap.\n return copyFromExternalBuffer(await loadFile(path));\n }\n\n async loadModel(pathOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions): Promise {\n TRACE_FUNC_BEGIN();\n let model: Parameters[0];\n\n if (typeof pathOrBuffer === 'string') {\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // node\n model = await loadFile(pathOrBuffer);\n } else {\n // browser\n // fetch model and copy to wasm heap.\n model = await this.fetchModelAndCopyToWasmMemory(pathOrBuffer);\n }\n } else {\n model = pathOrBuffer;\n }\n\n [this.sessionId, this.inputNames, this.outputNames] = await createSession(model, options);\n TRACE_FUNC_END();\n }\n\n async dispose(): Promise {\n return releaseSession(this.sessionId);\n }\n\n async run(feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType, options: InferenceSession.RunOptions):\n Promise {\n TRACE_FUNC_BEGIN();\n const inputArray: Tensor[] = [];\n const inputIndices: number[] = [];\n Object.entries(feeds).forEach(kvp => {\n const name = kvp[0];\n const tensor = kvp[1];\n const index = this.inputNames.indexOf(name);\n if (index === -1) {\n throw new Error(`invalid input '${name}'`);\n }\n inputArray.push(tensor);\n inputIndices.push(index);\n });\n\n const outputArray: Array = [];\n const outputIndices: number[] = [];\n Object.entries(fetches).forEach(kvp => {\n const name = kvp[0];\n const tensor = kvp[1];\n const index = this.outputNames.indexOf(name);\n if (index === -1) {\n throw new Error(`invalid output '${name}'`);\n }\n outputArray.push(tensor);\n outputIndices.push(index);\n });\n\n const inputs =\n inputArray.map((t, i) => encodeTensorMetadata(t, () => `input \"${this.inputNames[inputIndices[i]]}\"`));\n const outputs = outputArray.map(\n (t, i) => t ? encodeTensorMetadata(t, () => `output \"${this.outputNames[outputIndices[i]]}\"`) : null);\n\n const results = await run(this.sessionId, inputIndices, inputs, outputIndices, outputs, options);\n\n const resultMap: SessionHandler.ReturnType = {};\n for (let i = 0; i < results.length; i++) {\n resultMap[this.outputNames[outputIndices[i]]] = outputArray[i] ?? decodeTensorMetadata(results[i]);\n }\n TRACE_FUNC_END();\n return resultMap;\n }\n\n startProfiling(): void {\n // TODO: implement profiling\n }\n\n endProfiling(): void {\n void endProfiling(this.sessionId);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {cpus} from 'node:os';\nimport {Backend, env, InferenceSession, InferenceSessionHandler} from 'onnxruntime-common';\n\nimport {initializeOrtEp, initializeWebAssemblyAndOrtRuntime} from './wasm/proxy-wrapper';\nimport {OnnxruntimeWebAssemblySessionHandler} from './wasm/session-handler-inference';\n\n/**\n * This function initializes all flags for WebAssembly.\n *\n * Those flags are accessible from `ort.env.wasm`. Users are allow to set those flags before the first inference session\n * being created, to override default value.\n */\nexport const initializeFlags = (): void => {\n if (typeof env.wasm.initTimeout !== 'number' || env.wasm.initTimeout < 0) {\n env.wasm.initTimeout = 0;\n }\n\n if (typeof env.wasm.simd !== 'boolean') {\n env.wasm.simd = true;\n }\n\n if (typeof env.wasm.proxy !== 'boolean') {\n env.wasm.proxy = false;\n }\n\n if (typeof env.wasm.trace !== 'boolean') {\n env.wasm.trace = false;\n }\n\n if (typeof env.wasm.numThreads !== 'number' || !Number.isInteger(env.wasm.numThreads) || env.wasm.numThreads <= 0) {\n // Web: when crossOriginIsolated is false, SharedArrayBuffer is not available so WebAssembly threads will not work.\n // Node.js: onnxruntime-web does not support multi-threads in Node.js.\n if ((typeof self !== 'undefined' && !self.crossOriginIsolated) ||\n (typeof process !== 'undefined' && process.versions && process.versions.node)) {\n env.wasm.numThreads = 1;\n }\n const numCpuLogicalCores = typeof navigator === 'undefined' ? cpus().length : navigator.hardwareConcurrency;\n env.wasm.numThreads = Math.min(4, Math.ceil((numCpuLogicalCores || 1) / 2));\n }\n};\n\nexport class OnnxruntimeWebAssemblyBackend implements Backend {\n /**\n * This function initializes the WebAssembly backend.\n *\n * This function will be called only once for each backend name. It will be called the first time when\n * `ort.InferenceSession.create()` is called with a registered backend name.\n *\n * @param backendName - the registered backend name.\n */\n async init(backendName: string): Promise {\n // populate wasm flags\n initializeFlags();\n\n // init wasm\n await initializeWebAssemblyAndOrtRuntime();\n\n // performe EP specific initialization\n await initializeOrtEp(backendName);\n }\n createInferenceSessionHandler(path: string, options?: InferenceSession.SessionOptions):\n Promise;\n createInferenceSessionHandler(buffer: Uint8Array, options?: InferenceSession.SessionOptions):\n Promise;\n async createInferenceSessionHandler(pathOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions):\n Promise {\n const handler = new OnnxruntimeWebAssemblySessionHandler();\n await handler.loadModel(pathOrBuffer, options);\n return Promise.resolve(handler);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {OnnxruntimeWebAssemblyBackend} from './backend-wasm';\nexport const wasmBackend = new OnnxruntimeWebAssemblyBackend();\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */\n// We use \"require\" instead of \"import\" here because import statement must be put in top level. Our current code does\n// not allow bundler to tree-shaking code as expected because some codes are treated as having side effects.\n// So we import code inside the if-clause to allow bundler remove the code safely.\n\nexport * from 'onnxruntime-common';\nimport * as ort from 'onnxruntime-common';\nexport default ort;\n\nimport {registerBackend, env} from 'onnxruntime-common';\nimport {version} from './version';\n\nif (!BUILD_DEFS.DISABLE_WEBGL) {\n const onnxjsBackend = require('./backend-onnxjs').onnxjsBackend;\n registerBackend('webgl', onnxjsBackend, -10);\n}\n\nif (!BUILD_DEFS.DISABLE_WASM) {\n const wasmBackend = BUILD_DEFS.DISABLE_TRAINING ? require('./backend-wasm-inference').wasmBackend :\n require('./backend-wasm-training').wasmBackend;\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n registerBackend('webgpu', wasmBackend, 5);\n registerBackend('webnn', wasmBackend, 5);\n }\n registerBackend('cpu', wasmBackend, 10);\n registerBackend('wasm', wasmBackend, 10);\n}\n\nObject.defineProperty(env.versions, 'web', {value: version, enumerable: true});\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// This file is generated by /js/scripts/update-version.ts\n// Do not modify file content manually.\n\nexport const version = '1.18.0';\n"], + "mappings": ";;;;;gqBAAA,IAgBMA,GACAC,GAYOC,GAwCPC,GAwCOC,GA7GbC,GAAAC,EAAA,kBAgBMN,GAAqC,IAAI,IACzCC,GAAqC,CAAA,EAY9BC,GAAkB,CAACK,EAAcC,EAAkBC,IAA0B,CACxF,GAAID,GAAW,OAAOA,EAAQ,MAAS,YAAc,OAAOA,EAAQ,+BAAkC,WAAY,CAChH,IAAME,EAAiBV,GAAS,IAAIO,CAAI,EACxC,GAAIG,IAAmB,OACrBV,GAAS,IAAIO,EAAM,CAAC,QAAAC,EAAS,SAAAC,CAAQ,CAAC,MACjC,IAAIC,EAAe,SAAWD,EAEnC,OACK,GAAIC,EAAe,WAAaD,GACjCC,EAAe,UAAYF,EAC7B,MAAM,IAAI,MAAM,4BAA4BD,CAAI,oBAAoBE,CAAQ,EAAE,EAIlF,GAAIA,GAAY,EAAG,CACjB,IAAME,EAAIV,GAAyB,QAAQM,CAAI,EAC3CI,IAAM,IACRV,GAAyB,OAAOU,EAAG,CAAC,EAGtC,QAASA,EAAI,EAAGA,EAAIV,GAAyB,OAAQU,IACnD,GAAIX,GAAS,IAAIC,GAAyBU,CAAC,CAAC,EAAG,UAAYF,EAAU,CACnER,GAAyB,OAAOU,EAAG,EAAGJ,CAAI,EAC1C,OAGJN,GAAyB,KAAKM,CAAI,EAEpC,OAGF,MAAM,IAAI,UAAU,qBAAqB,CAC3C,EAQMJ,GAAiC,MAAMS,GAAgD,CAC3F,IAAMC,EAAcb,GAAS,IAAIY,CAAW,EAC5C,GAAI,CAACC,E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tFD,GAAgB,MAAOC,EAAa,EAAE,EACtCD,GAAgB,OAAQC,EAAa,EAAE,CACzC,CAEA,OAAO,eAAeC,EAAI,SAAU,MAAO,CAAC,MAAOC,GAAS,WAAY,EAAI,CAAC", + "names": ["backends", "backendsSortedByPriority", "registerBackend", "tryResolveAndInitializeBackend", "resolveBackendAndExecutionProviders", "init_backend_impl", "__esmMin", "name", "backend", "priority", "currentBackend", "i", "backendName", "backendInfo", "isInitializing", "options", "eps", "backendHints", "backendNames", "errors", "availableBackendNames", "resolveResult", "e", "err", "filteredEps", "target", "prop", "init_backend", "__esmMin", "init_backend_impl", "version", "init_version", "__esmMin", "logLevelValue", "env", "init_env_impl", "__esmMin", "init_version", "version", "value", "env", "init_env", "__esmMin", "init_env_impl", "tensorToDataURL", "tensorToImageData", "init_tensor_conversion_impl", "__esmMin", "tensor", "options", "canvas", "pixels2DContext", "width", "height", "inputformat", "norm", "normMean", "normBias", "stride", "rTensorPointer", "gTensorPointer", "bTensorPointer", "aTensorPointer", "i", "j", "R", "G", "B", "A", "image", "channels", "step", "rImagePointer", "gImagePointer", "bImagePointer", "aImagePointer", "bufferToTensor", "tensorFromImage", "tensorFromTexture", "tensorFromGpuBuffer", "tensorFromPinnedBuffer", "init_tensor_factory_impl", "__esmMin", "init_tensor_impl", "buffer", "options", "height", "width", "norm", "normMean", "normBias", "inputformat", "outputformat", "stride", "float32Data", "step", "rImagePointer", "gImagePointer", "bImagePointer", "aImagePointer", "rTensorPointer", "gTensorPointer", "bTensorPointer", "aTensorPointer", "i", "Tensor", "image", "isHTMLImageEle", "isImageDataEle", "isImageBitmap", "isString", "data", "bufferToTensorOptions", "createCanvas", "createCanvasContext", "canvas", "pixels2DContext", "tempCanvas", "resolve", "reject", "context", "newImage", "img", "texture", "download", "dispose", "dims", "gpuBuffer", "dataType", "type", "NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP", "NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP", "isTypedArrayChecked", "checkTypedArray", "init_tensor_impl_type_mapping", "__esmMin", "isBigInt64ArrayAvailable", "isBigUint64ArrayAvailable", "isFloat16ArrayAvailable", "calculateSize", "tensorReshape", "init_tensor_utils_impl", "__esmMin", "init_tensor_impl", "dims", "size", "i", "dim", "tensor", "Tensor", "Tensor", "init_tensor_impl", "__esmMin", "init_tensor_conversion_impl", "init_tensor_factory_impl", "init_tensor_impl_type_mapping", "init_tensor_utils_impl", "arg0", "arg1", "arg2", "checkTypedArray", "type", "dims", "expectedTypedArrayConstructor", "NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP", "data", "maybeDims", "typedArrayConstructor", "firstElementType", "mappedType", "NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP", "size", "calculateSize", "image", "options", "tensorFromImage", "texture", "tensorFromTexture", "gpuBuffer", "tensorFromGpuBuffer", "buffer", "tensorFromPinnedBuffer", "tensorToDataURL", "tensorToImageData", "releaseData", "tensorReshape", "Tensor", "init_tensor", "__esmMin", "init_tensor_impl", "TRACE", "TRACE_FUNC", "TRACE_FUNC_BEGIN", "TRACE_FUNC_END", "init_trace", "__esmMin", "init_env_impl", "deviceType", "label", "env", "msg", "extraMsg", "stack", "hasTraceFunc", "i", "InferenceSession", "init_inference_session_impl", "__esmMin", "init_backend_impl", "init_tensor", "init_trace", "_InferenceSession", "handler", "feeds", "arg1", "arg2", "TRACE_FUNC_BEGIN", "fetches", "options", "Tensor", "isFetchesEmpty", "name", "isFetches", "arg1Keys", "v", "results", "returnValue", "key", "result", "TRACE_FUNC_END", "arg0", "arg3", "filePathOrUint8Array", "buffer", "byteOffset", "byteLength", "backend", "optionsWithValidatedEPs", "resolveBackendAndExecutionProviders", "InferenceSession", "init_inference_session", "__esmMin", "init_inference_session_impl", "init_tensor_conversion", "__esmMin", "init_tensor_factory", "__esmMin", "init_onnx_model", "__esmMin", "init_onnx_value", "__esmMin", "noBackendErrMsg", "TrainingSession", "init_training_session_impl", "__esmMin", "init_backend_impl", "init_tensor", "_TrainingSession", "handler", "hasOptimizerModel", "hasEvalModel", "trainingOptions", "sessionOptions", "evalModel", "optimizerModel", "options", "backend", "optionsWithValidatedEPs", "resolveBackendAndExecutionProviders", "inputNames", "outputNames", "feeds", "arg1", "arg2", "fetches", "Tensor", "isFetchesEmpty", "name", "isFetches", "arg1Keys", "v", "results", "returnValue", "key", "result", "trainableOnly", "array", "paramsSize", "TrainingSession", "init_training_session", "__esmMin", "init_training_session_impl", "esm_exports", "__export", "InferenceSession", "TRACE", "TRACE_FUNC_BEGIN", "TRACE_FUNC_END", "Tensor", "TrainingSession", "env", "registerBackend", "init_esm", "__esmMin", "init_backend", "init_env", "init_inference_session", "init_tensor", "init_tensor_conversion", "init_tensor_factory", "init_trace", "init_onnx_model", "init_onnx_value", "init_training_session", "log", "arg0", "arg1", "arg2", "arg3", "createCategorizedLogger", "logInternal", "category", "severity", "content", "_stack", "config", "LOGGER_CONFIG_MAP", "SEVERITY_VALUE", "LOGGER_PROVIDER_MAP", "NoOpLoggerProvider", "ConsoleLoggerProvider", "LOGGER_DEFAULT_CONFIG", "Logger", "Event", "EventRecord", "Profiler", "now", "init_instrument", "__esmMin", "_severity", "_content", "_category", "verbose", "info", "warning", "error", "fatal", "reset", "set", "previousConfig", "setWithEnv", "env", "name", "startTime", "endCallback", "timer", "ctx", "endTime", "maxNumberEvents", "flushBatchSize", "flushIntervalInMilliseconds", "func", "event", "isPromise", "res", "resolve", "reject", "value", "reason", "eventRes", "e", "currentTime", "previousPointer", "resolveOperator", "node", "opsets", "rules", "rule", "opType", "domain", "versionSelector", "opImpl", "opInit", "opset", "matchSelector", "set", "version", "selector", "rangeStart", "pair", "rangeEnd", "init_opset", "__esmMin", "require_guid", "__commonJSMin", "exports", "Guid", "guid", "value", "count", "out", "i", "other", "Long", "low", "high", "unsigned", "isLong", "obj", "ctz32", "value", "c", "fromInt", "cachedObj", "cache", "UINT_CACHE", "fromBits", "INT_CACHE", "fromNumber", "UZERO", "ZERO", "TWO_PWR_64_DBL", "MAX_UNSIGNED_VALUE", "TWO_PWR_63_DBL", "MIN_VALUE", "MAX_VALUE", "TWO_PWR_32_DBL", "lowBits", "highBits", "fromString", "str", "radix", "p", "radixToPower", "pow_dbl", "result", "i", "size", "power", "fromValue", "val", "wasm", "TWO_PWR_16_DBL", "TWO_PWR_24_DBL", "TWO_PWR_24", "ONE", "UONE", "NEG_ONE", "LongPrototype", "long_default", "init_long", "__esmMin", "radixLong", "div", "rem1", "rem", "remDiv", "intval", "digits", "bit", "other", "thisNeg", "otherNeg", "addend", "a48", "a32", "a16", "a00", "b48", "b32", "b16", "b00", "c48", "c32", "c16", "c00", "subtrahend", "multiplier", "divisor", "approx", "res", "halfThis", "log2", "delta", "approxRes", "approxRem", "numBits", "b", "le", "hi", "lo", "bytes", "flatbuffers", "init_flatbuffers", "__esmMin", "low", "high", "other", "opt_initial_size", "initial_size", "forceDefaults", "size", "additional_bytes", "align_size", "old_buf_size", "byte_size", "i", "value", "voffset", "defaultValue", "obj", "bb", "new_buf_size", "nbb", "offset", "numfields", "vtableloc", "trimmed_size", "standard_fields", "len", "existing_vtable", "vt1", "outer_loop", "vt2", "j", "root_table", "opt_file_identifier", "opt_size_prefix", "size_prefix", "file_identifier", "table", "field", "table_start", "vtable_start", "ok", "elem_size", "num_elems", "alignment", "s", "utf8", "codePoint", "a", "b", "bytes", "position", "result", "bb_pos", "vtable_offset", "vtable", "t", "opt_encoding", "length", "c", "d", "ident", "onnxruntime", "init_ort_generated", "__esmMin", "init_flatbuffers", "experimental", "fbs", "AttributeType", "DimensionValueType", "TensorDataType", "NodeType", "TypeInfoValue", "Shape", "bb", "obj", "flatbuffers", "index", "offset", "builder", "dimOffset", "data", "i", "numElems", "Dimension", "optionalEncoding", "valueOffset", "denotationOffset", "DimensionValue", "dimType", "dimValue", "dimParamOffset", "TensorTypeAndShape", "elemType", "shapeOffset", "MapType", "keyType", "valueTypeOffset", "SequenceType", "elemTypeOffset", "EdgeEnd", "node_index", "src_arg_index", "dst_arg_index", "NodeEdge", "nodeIndex", "inputEdgesOffset", "outputEdgesOffset", "Node", "nameOffset", "docStringOffset", "domainOffset", "sinceVersion", "opTypeOffset", "type", "executionProviderTypeOffset", "inputsOffset", "outputsOffset", "attributesOffset", "inputArgCountsOffset", "implicitInputsOffset", "ValueInfo", "typeOffset", "TypeInfo", "valueType", "OperatorSetId", "version", "Tensor", "dimsOffset", "dataType", "rawDataOffset", "stringDataOffset", "SparseTensor", "valuesOffset", "indicesOffset", "Attribute", "f", "sOffset", "tOffset", "gOffset", "floatsOffset", "intsOffset", "stringsOffset", "tensorsOffset", "graphsOffset", "Graph", "initializersOffset", "nodeArgsOffset", "nodesOffset", "maxNodeIndex", "nodeEdgesOffset", "sparseInitializersOffset", "Model", "irVersion", "opsetImportOffset", "producerNameOffset", "producerVersionOffset", "modelVersion", "graphOffset", "graphDocStringOffset", "KernelCreateInfos", "nodeIndicesOffset", "kernelDefHashesOffset", "SubGraphSessionState", "graphIdOffset", "sessionStateOffset", "SessionState", "kernelsOffset", "subGraphSessionStatesOffset", "InferenceSession", "ortVersionOffset", "modelOffset", "require_aspromise", "__commonJSMin", "exports", "module", "asPromise", "fn", "ctx", "params", "offset", "index", "pending", "resolve", "reject", "err", "require_base64", "__commonJSMin", "exports", "base64", "string", "p", "n", "b64", "s64", "i", "buffer", "start", "end", "parts", "chunk", "j", "t", "b", "invalidEncoding", "offset", "c", "require_eventemitter", "__commonJSMin", "exports", "module", "EventEmitter", "evt", "fn", "ctx", "listeners", "i", "args", "require_float", "__commonJSMin", "exports", "module", "factory", "f32", "f8b", "le", "writeFloat_f32_cpy", "val", "buf", "pos", "writeFloat_f32_rev", "readFloat_f32_cpy", "readFloat_f32_rev", "writeFloat_ieee754", "writeUint", "sign", "exponent", "mantissa", "writeUintLE", "writeUintBE", "readFloat_ieee754", "readUint", "uint", "readUintLE", "readUintBE", "f64", "writeDouble_f64_cpy", "writeDouble_f64_rev", "readDouble_f64_cpy", "readDouble_f64_rev", "writeDouble_ieee754", "off0", "off1", "readDouble_ieee754", "lo", "hi", "require_inquire", "__commonJSMin", "e", "require_utf8", "__commonJSMin", "exports", "utf8", "string", "len", "c", "i", "buffer", "start", "end", "parts", "chunk", "t", "offset", "c1", "c2", "require_pool", "__commonJSMin", "exports", "module", "pool", "alloc", "slice", "size", "SIZE", "MAX", "slab", "offset", "buf", "require_longbits", "__commonJSMin", "exports", "module", "LongBits", "util", "lo", "hi", "zero", "zeroHash", "value", "sign", "unsigned", "charCodeAt", "hash", "mask", "part0", "part1", "part2", "require_minimal", "__commonJSMin", "exports", "util", "value", "obj", "prop", "Buffer", "sizeOrArray", "hash", "unsigned", "bits", "merge", "dst", "src", "ifNotSet", "keys", "i", "str", "newError", "name", "CustomError", "message", "properties", "fieldNames", "fieldMap", "encoding", "size", "require_writer", "__commonJSMin", "exports", "module", "Writer", "util", "BufferWriter", "LongBits", "base64", "utf8", "Op", "fn", "len", "val", "noop", "State", "writer", "create", "size", "writeByte", "buf", "pos", "writeVarint32", "VarintOp", "value", "writeVarint64", "bits", "writeFixed32", "writeBytes", "i", "head", "tail", "BufferWriter_", "require_writer_buffer", "__commonJSMin", "exports", "module", "BufferWriter", "Writer", "util", "val", "buf", "pos", "i", "value", "len", "writeStringBuffer", "require_reader", "__commonJSMin", "exports", "module", "Reader", "util", "BufferReader", "LongBits", "utf8", "indexOutOfRange", "reader", "writeLength", "buffer", "create_array", "create", "value", "readLongVarint", "bits", "i", "readFixed32_end", "buf", "end", "readFixed64", "length", "start", "nativeBuffer", "bytes", "wireType", "BufferReader_", "fn", "require_reader_buffer", "__commonJSMin", "exports", "module", "BufferReader", "Reader", "util", "buffer", "len", "require_service", "__commonJSMin", "exports", "module", "Service", "util", "rpcImpl", "requestDelimited", "responseDelimited", "rpcCall", "method", "requestCtor", "responseCtor", "request", "callback", "self", "err", "response", "endedByRPC", "require_rpc", "__commonJSMin", "exports", "rpc", "require_roots", "__commonJSMin", "exports", "module", "require_index_minimal", "__commonJSMin", "exports", "protobuf", "configure", "require_minimal", "__commonJSMin", "exports", "module", "require_onnx", "__commonJSMin", "exports", "module", "$protobuf", "$Reader", "$Writer", "$util", "$root", "onnx", "valuesById", "values", "AttributeProto", "properties", "keys", "i", "message", "writer", "reader", "length", "end", "tag", "end2", "error", "object", "options", "long", "j", "typeUrlPrefix", "ValueInfoProto", "NodeProto", "TrainingInfoProto", "ModelProto", "StringStringEntryProto", "TensorAnnotation", "GraphProto", "TensorProto", "Segment", "SparseTensorProto", "TensorShapeProto", "Dimension", "$oneOfFields", "TypeProto", "Tensor", "Sequence", "Map", "Optional", "SparseTensor", "OperatorSetIdProto", "FunctionProto", "assert", "expr", "msg", "decodeUtf8String", "buffer", "import_onnx", "ArrayUtil", "MatMulUtil", "BroadcastUtil", "GemmUtil", "ProtoUtil", "LongUtil", "ShapeUtil", "SplitUtil", "PoolConvUtil", "MIN_CLIP", "MAX_CLIP", "init_util", "__esmMin", "init_flatbuffers", "init_long", "init_tensor", "n1", "n2", "i", "dimsA", "dimsB", "a", "b", "outputShape", "aRank", "bRank", "_BroadcastUtil", "adims", "bdims", "isMatMul", "arank", "brank", "crank", "cdims", "cShapeMatMul", "aLen", "bLen", "broadcastedIndices", "originalShape", "originalIndices", "dimOffset", "op", "inplace", "resultType", "size", "c", "Tensor", "outputIndices", "originalIndicesA", "originalIndicesB", "valA", "valB", "isAScalar", "isBScalar", "rest", "j", "shape", "finalShape", "inputRank", "finalRank", "inputShape", "inRank", "dims", "dim", "leftShape", "transLeft", "rightShape", "transRight", "biasShape", "M", "K", "N", "kDim", "_ProtoUtil", "typeProto", "type", "d", "long_default", "valueType", "tensor", "node", "attributes", "n", "unsigned", "flatbuffers", "_ShapeUtil", "axis", "start", "end", "rank", "strides", "indices", "offset", "tensorRank", "axes", "x", "index", "axisToIncrementOn", "k", "originalDims", "shapeHints", "nDims", "reshapedDims", "unknownDimension", "newTensorSize", "oldTensorSize", "perm", "v", "pad", "shape1", "shape2", "total", "y", "right", "outputDims", "inSqueezeList", "inputDimsIterator", "_SplitUtil", "split", "numOutputs", "shapes", "offsets", "numElementsAlongAxis", "_PoolConvUtil", "isGlobalOperator", "inputDims", "kernelShape", "dilations", "pads", "autoPad", "filterDims", "inSize", "stride", "dilation", "kernel", "padHeadIndex", "padTailIndex", "dkernel", "padNeeded", "sizeof", "type", "sizeofProto", "createView", "dataBuffer", "dataviewConstructor", "longToNumber", "i", "ortFbs", "readProto", "view", "byteOffset", "long_default", "import_guid_typescript", "import_onnx", "Tensor", "init_tensor", "__esmMin", "init_long", "init_ort_generated", "init_util", "onnxruntime", "_Tensor", "dims", "dataProvider", "asyncDataProvider", "cache", "dataId", "ShapeUtil", "size", "empty", "constructor", "buf", "data", "indices", "value", "tensorProto", "ProtoUtil", "str", "decodeUtf8String", "dataDest", "dataSource", "elementSize", "length", "n", "array", "element", "ortTensor", "getGlsl", "version", "GLSL_ES_2_0", "GLSL_ES_3_0", "getVertexShaderSource", "glsl", "getFragShaderPreamble", "getDefaultFragShaderMain", "outputShapeLength", "init_glsl_source", "__esmMin", "init_types", "__esmMin", "repeatedTry", "checkFn", "delayFn", "_counter", "maxCounter", "resolve", "reject", "tryCount", "tryFn", "nextBackoff", "generateShaderFuncNameFromInputSamplerName", "samplerName", "assert", "generateShaderFuncNameFromInputSamplerNameAtOutCoords", "squeezeInputShape", "inputShape", "squeezedShape", "newInputShape", "getSqueezedParams", "params", "keptDims", "d", "getCoordsDataType", "rank", "getGlChannels", "init_utils", "__esmMin", "init_util", "getVecChannels", "name", "rank", "getGlChannels", "d", "getChannels", "unpackFromChannel", "init_packing_utils", "__esmMin", "init_utils", "getOutOfBoundsCondition", "rank", "shape", "dims", "cond", "i", "getOutput", "coord00", "coord01", "coord10", "coord11", "D", "getSetup", "rows", "cols", "packProgramMetadata", "createPackProgramInfo", "createPackProgramInfoLoader", "init_pack", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "handler", "input", "glsl", "getGlsl", "inputShape", "inputRank", "outputRank", "coordsDataType", "getCoordsDataType", "channels", "getChannels", "setup", "reversedInputWH", "outOfBoundsCondition", "output", "shaderSource", "processDims3D", "shape", "batch", "i", "isReshapeCheap", "dims", "reshapedDims", "isCheapReshape", "getReshapedInputCoords", "strides", "ShapeUtil", "coords", "index", "stride", "line1", "line2", "getFlattenedIndexFrom3D", "createPackedReshape3DProgramMetadata", "createPackedReshape3DProgramInfo", "createPackedReshape3DProgramInfoLoader", "init_reshape_packed", "__esmMin", "init_util", "init_glsl_source", "init_types", "init_packing_utils", "outputShape3D", "handler", "input3D", "metadata", "inputShape3D", "squeezedOutputShape", "mainLoop", "outputCoords", "glsl", "getGlsl", "shaderSource", "unpackFromChannel", "encodeAsUint8", "init_uint8_encode", "__esmMin", "init_glsl_source", "init_types", "inferenceHandler", "input", "outputShape", "glsl", "getGlsl", "shaderSource", "programInfo", "getSourceCoords", "rank", "dims", "coords", "i", "unpackProgramMetadata", "createUnpackProgramInfo", "createUnpackProgramInfoLoader", "init_unpack", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "handler", "input", "channels", "getChannels", "innerDims", "coordsDataType", "getCoordsDataType", "unpackChannel", "unpackFromChannel", "sourceCoords", "glsl", "getGlsl", "shaderSource", "RedFloat32DataEncoder", "RGBAFloatDataEncoder", "Uint8DataEncoder", "init_texture_data_encoder", "__esmMin", "init_instrument", "gl", "channels", "src", "textureSize", "result", "source", "Logger", "v", "i", "size", "buffer", "dataSize", "_value", "index", "textureType", "dest", "_textureSize", "createTextureLayoutFromTextureType", "calculateTextureWidthAndHeight", "createTextureLayoutFromShape", "init_texture_layout", "__esmMin", "init_util", "init_types", "textureLayoutStrategy", "shape", "textureType", "channel", "isPacked", "reverseWH", "breakAxis", "unpackedShape", "d", "i", "layout", "channels", "prefs", "width", "height", "rank", "inferredDims", "ShapeUtil", "getProgramInfoUniqueKey", "WebGLInferenceHandler", "init_inference_handler", "__esmMin", "init_instrument", "init_tensor", "init_util", "init_pack", "init_reshape_packed", "init_uint8_encode", "init_unpack", "init_texture_data_encoder", "init_texture_layout", "init_types", "programInfo", "inputTextureDatas", "inputs", "texture", "key", "session", "shape", "textureType", "calculateTextureWidthAndHeight", "program", "i", "artifact", "outputTextureLayout", "createTextureLayoutFromTextureType", "outputTextureData", "output", "tensor", "td", "layout", "adjustedKernelShape", "adjustedLayout", "buffer", "numFeatureMaps", "oldRowSize", "newRowSize", "newSize", "f", "oldOffset", "newOffset", "unpackedTextureLayout", "createTextureLayoutFromShape", "unpackedTextureData", "dataType", "data", "usage", "Logger", "input", "reshapedDims", "inputTD", "newTextureLayout", "ShapeUtil", "isReshapeCheap", "squeezedInputShape", "processDims3D", "squeezedOutputShape", "squeezedInputTensor", "squeezedOutputTensor", "createPackedReshape3DProgramInfoLoader", "type", "tensorId", "textureData", "Tensor", "_id", "isPacked", "encodeAsUint8", "createPackProgramInfoLoader", "createUnpackProgramInfoLoader", "AttributeWithCacheKeyImpl", "createAttributeWithCacheKey", "init_attribute_with_cache_key", "__esmMin", "attribute", "name", "batchNormalizationProgramMetadata", "batchNormalization", "parseBatchNormalizationAttributes", "createBatchNormalizationProgramInfo", "validateInputs", "init_batch_normalization", "__esmMin", "init_attribute_with_cache_key", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "attributes", "node", "epsilon", "momentum", "spatial", "createAttributeWithCacheKey", "glsl", "getGlsl", "rank", "scaleWidth", "scaleHeight", "shaderSource", "X", "scale", "B", "mean", "var_", "GlslContext", "GlslLib", "GlslLibRoutine", "GlslLibRoutineNode", "TopologicalSortGlslRoutines", "init_glsl_definitions", "__esmMin", "glContext", "programInfo", "inputTextureLayouts", "outputTextureLayout", "context", "routineBody", "dependencies", "name", "node", "nodes", "cycleCheck", "alreadyTraversed", "result", "graphNodes", "i", "root", "glslAdd", "name", "glslDiv", "glslMul", "glslSub", "glslEqual", "glslGreater", "glslLess", "glslAnd", "glslOr", "glslXor", "glslPow", "glslBuiltinBinary", "glslPRelu", "fname", "createBinaryProgramInfoLoader", "createBinaryProgramInfo", "add", "and", "div", "equal", "greater", "less", "mul", "or", "pow", "pRelu", "sub", "xor", "init_binary_op", "__esmMin", "init_util", "init_glsl_definitions", "init_glsl_source", "init_types", "handler", "inputs", "glslFunc", "outputTensorType", "cacheKey", "textureType", "isBroadcast", "ShapeUtil", "outputShape", "usePackedTexture", "calculatedShape", "BroadcastUtil", "outputRank", "aRank", "bRank", "aBcast", "bBcast", "glsl", "getGlsl", "shaderSource", "cast", "parseCastAttributes", "validateInputs", "init_cast", "__esmMin", "init_util", "handler", "inputs", "to", "node", "ProtoUtil", "createPackedConcatProgramMetadata", "createPackedConcatProgramInfo", "createPackedConcatProgramInfoLoader", "getShiftedChannelsSnippet", "init_concat_packed", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "inputCount", "cacheHint", "_v", "i", "handler", "metadata", "inputs", "axis", "inputShape", "outputShape", "dataNShape", "axisIndex", "rank", "coords", "getChannels", "dtype", "getCoordsDataType", "unpackChannel", "unpackFromChannel", "shapes", "channels", "getGlChannels", "offsets", "channel", "lastChannels", "allChannels", "getValueSnippet", "shift", "lastIndex", "glsl", "getGlsl", "shaderSource", "x", "attributes", "channelIdx", "c", "idx", "concat", "createUnpackedConcatProgramMetadata", "createUnpackedConcatProgramInfo", "createUnpackedConcatProgramInfoLoader", "getTextureIndexWhereDataResidesLinearSearch", "getTextureIndexWhereDataResidesBinarySearch", "getFetchDataFromCorrectTextureMethod", "getGetSizeInConcatAxisValueFromIndexMethod", "parseConcatAttributes", "validateInputs", "init_concat", "__esmMin", "init_attribute_with_cache_key", "init_types", "init_concat_packed", "inferenceHandler", "inputs", "attributes", "createPackedConcatProgramInfoLoader", "inputCount", "cacheHint", "_v", "i", "_handler", "metadata", "axis", "inputShape", "outputShape", "dataNShape", "axisIndex", "rank", "sizeInConcatAxis", "previousSum", "getTextureIndexWhereDataResidesMethod", "fetchDataFromCorrectTextureMethod", "getSizeInConcatAxisValueFromIndexMethod", "shaderSource", "handler", "size", "numberOfTensors", "tensorRank", "codeLines", "node", "createAttributeWithCacheKey", "inputType", "inputDimensionality", "input", "glslAbs", "glslBuiltinUnary", "glslAcos", "glslAsin", "glslAtan", "glslCeil", "glslCos", "glslElu", "alpha", "name", "glslExp", "glslFloor", "glslClip", "min", "max", "glslIdentity", "glslLeakyRelu", "glslLog", "glslNeg", "glslNot", "glslSin", "glslRelu", "glslSigmoid", "glslSqrt", "glslTan", "glslTanh", "createElementwiseProgramInfo", "createElementwiseProgramInfoLoader", "abs", "acos", "asin", "atan", "clip", "parseClipAttributes", "clipV11", "generateClipAttributesFromInputs", "ceil", "cos", "elu", "parseEluAttributes", "exp", "floor", "identity", "leakyRelu", "parseLeakyReluAttributes", "log", "neg", "not", "relu", "sigmoid", "sin", "sqrt", "tan", "tanh", "init_unary_op", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_glsl_definitions", "init_glsl_source", "init_types", "handler", "metadata", "input", "glslFunc", "textureType", "glsl", "getGlsl", "cacheKey", "inputs", "attributes", "node", "createAttributeWithCacheKey", "MIN_CLIP", "MAX_CLIP", "getActivationSnippet", "attributes", "func", "glslRelu", "glslSigmoid", "glslClip", "activationName", "activationFunction", "applyActivation", "parseInternalActivationAttributes", "init_fuse_utils", "__esmMin", "init_util", "init_unary_op", "activation", "clipMin", "clipMax", "MIN_CLIP", "MAX_CLIP", "createUnpackedGroupedConvProgramMetadata", "createUnpackedGroupedConvProgramInfo", "createUnpackedGroupedConvProgramInfoLoader", "init_conv_grouped", "__esmMin", "init_instrument", "init_glsl_source", "init_types", "init_conv", "init_fuse_utils", "hasBias", "cacheHint", "inferenceHandler", "inputs", "metadata", "attributes", "processBias", "xShape", "wShape", "outputChannelsPerGroup", "Logger", "outputShape", "calculateOutputShape", "glsl", "getGlsl", "activationFunction", "applyActivation", "getActivationSnippet", "shaderSource", "createPackedIm2ColProgramMetadata", "createPackedIm2ColProgramInfo", "createPackedIm2ColProgramInfoLoader", "init_im2col_pack", "__esmMin", "init_glsl_source", "init_types", "init_packing_utils", "cacheHint", "inferenceHandler", "metadata", "x", "w", "outputShape", "attributes", "xshape", "wshape", "rowDim", "colDim", "rank", "im2colShape", "kernelSize", "unpackChannel", "unpackFromChannel", "glsl", "getGlsl", "unrolled", "row", "col", "shaderSource", "createMatmulProgramInfo", "metadata", "inputs", "activationAttributes", "aShape", "bShape", "outputShape", "BroadcastUtil", "coordsDataType", "getCoordsDataType", "allGlChannels", "getGlChannels", "activationFunction", "applyActivation", "getActivationSnippet", "hasBias", "processBias", "getBiasForMatmulSnippet", "getBiasForMatmul", "rank", "arank", "brank", "sharedDim", "shaderSource", "createMatmulProgramInfoLoader", "createMatmulProgramMetadata", "inShape", "outShape", "isPacked", "unpackedCoordsSnippet", "inRank", "outRank", "rankDiff", "_s", "i", "coordsSnippet", "d", "isInputScalar", "ShapeUtil", "output", "matMul", "parseMatMulAttributes", "validateInputs", "init_matmul", "__esmMin", "init_util", "init_types", "init_utils", "init_fuse_utils", "init_matmul_pack", "inferenceHandler", "attributes", "createPackedMatmulProgramInfoLoader", "node", "parseInternalActivationAttributes", "cacheHint", "getBcastSamplerForMatmul", "coordsDataType", "allGlChannels", "inputs", "outShape", "unpackedACoordsSnippet", "unpackedBCoordsSnippet", "inAShape", "inBShape", "inARank", "inBRank", "outRank", "rankADiff", "rankBDiff", "_s", "i", "broadcastADims", "BroadcastUtil", "broadcastBDims", "coordsASnippet", "d", "coordsBSnippet", "swapDimSnippet", "getA", "rank", "res", "getB", "createPackedMatmulProgramMetadata", "createPackedMatmulProgramInfo", "createPackedMatmulProgramInfoLoader", "init_matmul_pack", "__esmMin", "init_util", "init_glsl_source", "init_types", "init_utils", "init_fuse_utils", "init_matmul", "hasBias", "cacheHint", "inferenceHandler", "metadata", "activationAttributes", "processBias", "aShape", "bShape", "outputShape", "isBroadcast", "ShapeUtil", "sharedDim", "sharedDimIndex", "aRank", "bRank", "glsl", "getGlsl", "getCoordsDataType", "getGlChannels", "activationFunction", "applyActivation", "getActivationSnippet", "getBiasForMatmulSnippet", "getBiasForMatmul", "getBcastedSamplerForMatmulSnippet", "getSamplerAInLoopSnippet", "getSamplerBInLoopSnippet", "getOutputCoordsSnippet", "shaderSource", "conv2DPacked", "init_conv_pack", "__esmMin", "init_conv", "init_im2col_pack", "init_matmul_pack", "inferenceHandler", "inputs", "attributes", "xshape", "kshape", "outputShape", "calculateOutputShape", "im2colOutput", "createPackedIm2ColProgramInfoLoader", "kernelReshaped", "matmulInputs", "matmulOutput", "createPackedMatmulProgramInfoLoader", "createIm2ColProgramMetadata", "createIm2ColProgramInfo", "createIm2ColProgramInfoLoader", "calculateIm2ColDims", "init_im2col", "__esmMin", "init_types", "cacheHint", "_inferenceHandler", "metadata", "x", "w", "outputShape", "attributes", "xshape", "wshape", "rank", "im2colDims", "shaderSource", "inferenceHandler", "inputShape", "kernelShape", "channels", "createDotProductProgramMetadata", "createDotProductProgramInfo", "createDotProductProgramInfoLoader", "init_dot_product", "__esmMin", "init_util", "init_glsl_source", "init_types", "init_fuse_utils", "init_im2col", "hasBias", "attributes", "inferenceHandler", "metadata", "inputs", "outputShape", "xshape", "kshape", "adjustedKernelShape", "im2colShape", "calculateIm2ColDims", "kWidth", "kHeight", "im2colStrides", "ShapeUtil", "im2colWidth", "im2colHeight", "rank", "initValue", "sharedDim", "activationFunction", "applyActivation", "getActivationSnippet", "glsl", "getGlsl", "shaderSource", "calculateOutputShape", "conv", "conv2d", "conv2DUnpackedPointwise", "conv2DUnpacked", "getAdjustedConvAttributes", "parseConvAttributes", "validateInputs", "init_conv", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_conv_grouped", "init_conv_pack", "init_dot_product", "init_fuse_utils", "init_im2col", "init_matmul", "inputShape", "kernelShape", "dilations", "adjustPads", "strides", "batchSize", "inputSpatialShape", "spatialRank", "outChannels", "dilatedKernelShape", "i", "outputSpatialShape", "inferenceHandler", "inputs", "attributes", "adjustedAttributes", "packMode", "isPointwise", "createUnpackedGroupedConvProgramInfoLoader", "conv2DPacked", "xshape", "kshape", "outputShape", "reshapedX", "reshapedK", "matmulInputs", "matmulOutput", "createMatmulProgramInfoLoader", "xIm2Col", "createIm2ColProgramInfoLoader", "dotProductInputs", "createDotProductProgramInfoLoader", "pads", "PoolConvUtil", "newAttributes", "node", "activationAttributes", "parseInternalActivationAttributes", "autoPad", "group", "createAttributeWithCacheKey", "dataChannel", "filterInChannel", "computeTotalPad", "distributePadding", "calculateOutputShapeAndPads", "convTranspose", "convTranspose2d", "createConvTransposeProgramMetadata", "createUnpackedConvTransposeProgramInfo", "createUnpackedConvTransposeProgramInfoLoader", "convTranspose2DUnpacked", "getAdjustedConvTransposeAttributes", "parseConvTransposeAttributes", "validateInputs", "init_conv_transpose", "__esmMin", "init_attribute_with_cache_key", "init_glsl_source", "init_types", "init_fuse_utils", "inDim", "stride", "adj", "kernel", "dilation", "outSize", "totalPad", "autoPad", "pads", "head", "tail", "smallPad", "inputShape", "kernelShape", "dilations", "strides", "outputPadding", "outputShape", "spatialRank", "updateShape", "i", "inferenceHandler", "inputs", "attributes", "adjustedAttributes", "hasBias", "cacheHint", "metadata", "valueInit", "xShape", "wShape", "outputChannelsPerGroup", "inputChannelsPerGroup", "glsl", "getGlsl", "activationFunction", "applyActivation", "getActivationSnippet", "shaderSource", "newAttributes", "node", "activationAttributes", "parseInternalActivationAttributes", "group", "createAttributeWithCacheKey", "dataChannel", "filterInChannel", "featureMaps", "transposeProgramMetadata", "transpose", "parseTransposeAttributes", "createTransposeProgramInfo", "getAdjustedPerm", "getOutputShape", "getPermFunctionBody", "validateInputs", "init_transpose", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "createAttributeWithCacheKey", "_inferenceHandler", "input", "perm", "inputShape", "unpackedOutputShape", "rank", "shaderSource", "ShapeUtil", "name", "reverseFunc", "i", "depthToSpace", "parseDepthToSpaceAttributes", "validateInputs", "init_depth_to_space", "__esmMin", "init_transpose", "inferenceHandler", "inputs", "attributes", "blocksize", "blocksizeSqr", "transposePerm", "firstReshapeShape", "firstReshapedTensor", "transposeAttributes", "transposeOutput", "transpose", "secondReshapeShape", "node", "mode", "flatten", "parseFlattenAttributes", "validateInputs", "init_flatten", "__esmMin", "init_util", "inferenceHandler", "inputs", "axis", "outputDims", "ShapeUtil", "node", "r", "NUMBER_TYPES", "init_operators", "__esmMin", "gather", "parseGatherAttributes", "gatherProgramMetadata", "createGatherProgramInfo", "createGatherProgramInfoLoader", "validateInputs", "init_gather", "__esmMin", "init_attribute_with_cache_key", "init_operators", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "createAttributeWithCacheKey", "_handler", "metadata", "axis", "inputShape", "indexDataShape", "outputShape", "ShapeUtil", "indexCopyOps", "i", "orank", "irank", "iDrank", "shaderSource", "handler", "tensorRank", "NUMBER_TYPES", "gemm", "parseGemmAttributes", "parseGemmAttributesV7", "parseGemmAttributesV11", "createGemmProgramInfoLoader", "createGemmProgramInfo", "validateInputs", "init_gemm", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "isOptionalC", "transA", "transB", "alpha", "beta", "createAttributeWithCacheKey", "metadata", "aShape", "bShape", "M", "N", "GemmUtil", "outputShape", "sharedDim", "line", "rank", "declareC", "broadcastC", "calculateC", "shaderSource", "imageScaler", "parseImageScalerAttributes", "imageScalerProgramMetadata", "createImageScalerProgramInfo", "createImageScalerProgramInfoLoader", "createGetBiasMethod", "validateInputs", "init_image_scaler", "__esmMin", "init_attribute_with_cache_key", "init_types", "inferenceHandler", "inputs", "attributes", "node", "scale", "bias", "createAttributeWithCacheKey", "_handler", "metadata", "outputShape", "rank", "shaderSource", "handler", "numChannels", "codeLines", "i", "instanceNormalization", "parseInstanceNormalizationAttributes", "meanAndVarianceProgramMetadata", "createMeanAndVarianceProgramInfo", "createMeanAndVarianceProgramInfoLoader", "computeOutputProgramMetadata", "createComputeOutputProgramInfo", "createComputeOutputProgramInfoLoader", "validateInputs", "init_instance_normalization", "__esmMin", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "epsilon", "meanAndVariance", "node", "metadata", "input", "xDims", "channel", "channelSize", "outputShape", "shaderSource", "meanAndVarianceShape", "glsl", "getGlsl", "textureWidth", "textureHeight", "meanAndVarianceWidth", "meanAndVarianceHeight", "X", "scale", "B", "createLrnProgramInfo", "inputs", "attributes", "C", "rank", "from", "to", "alpha", "bias", "beta", "shaderSource", "lrnProgramMetadata", "createLrnProgramInfoLoader", "lrn", "parseLrnAttributes", "validateInputs", "init_lrn", "__esmMin", "init_attribute_with_cache_key", "init_types", "inferenceHandler", "node", "size", "createAttributeWithCacheKey", "padProgramMetadata", "padV2", "parsePadAttributesV2", "padV11", "parsePadAttributesV11", "generatePadAttributesFromInputs", "createPadProgramInfo", "validateInputsV2", "validateInputsV11", "getPadFunction", "getPadConstant", "getPadReflect", "getPadEdge", "init_pad", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "attributes", "node", "mode", "value", "pads", "createAttributeWithCacheKey", "attrubutes", "input", "outputShape", "ShapeUtil", "rank", "shaderSource", "glsl", "getGlsl", "width", "height", "strides", "shape", "block", "i", "averagePool", "parseAveragePoolAttributes", "createAveragePoolProgramInfo", "globalAveragePool", "parseGlobalAveragePoolAttributes", "maxPool", "parseMaxPoolAttributes", "createMaxPoolProgramInfo", "getAdjustedPoolAttributesAndOutputShape", "globalMaxPoolAttributes", "globalMaxPoolMetadata", "globalMaxPool", "validateInputs", "generatePoolingCode", "copyArray", "offsetToIndices", "init_pool", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "metadata", "node", "autoPad", "ceilMode", "countIncludePad", "kernelShape", "strides", "pads", "createAttributeWithCacheKey", "isGlobalOperator", "adjustedAttributes", "outputShape", "kernelSize", "ShapeUtil", "op1", "op2", "shaderSource", "storageOrder", "dilations", "inputShape", "hasDilations", "PoolConvUtil", "newAttributes", "inputDims", "start", "rank", "kw", "sw", "pwStart", "pwEnd", "dimW", "codeW", "codeH", "codeHEnd", "kh", "sh", "phStart", "phEnd", "dimH", "kernelStrides", "stridesRank", "padsRank", "offsetToIndicesFunction", "copyInputDims", "copyPads", "copyKernelStrides", "copyStrides", "hasPads", "sum", "cur", "padCode", "array", "arrayName", "block", "i", "reduce", "parseReduceAttributes", "createReduceProgramInfo", "validateInputs", "reduceSum", "reduceMean", "reduceMax", "reduceMin", "reduceProd", "reduceLogSum", "reduceLogSumSquare", "init_reduce", "__esmMin", "init_attribute_with_cache_key", "init_operators", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "name", "reduceOp", "reduceProgramMetadata", "node", "axes", "keepDims", "createAttributeWithCacheKey", "_handler", "_name", "outputShape", "iRank", "idxCopy", "ShapeUtil", "ops", "reduceOps", "k", "shaderSource", "NUMBER_TYPES", "size", "idxZero", "reshape", "init_reshape", "__esmMin", "init_util", "handler", "inputs", "reshapedDims", "ShapeUtil", "upsampleProgramMetadata", "upsample", "parseUpsampleAttributesV7", "parseUpsampleAttributesV9", "parseUpsampleAttributes", "createUpsampleProgramInfo", "validateInputs", "scalesValidation", "init_upsample", "__esmMin", "init_attribute_with_cache_key", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "attributes", "node", "opset", "isResize", "mode", "scales", "extrapolationValue", "coordinateTransformMode", "needRoiInput", "useExtrapolation", "nearestMode", "cubicCoefficientA", "excludeOutside", "useNearest2xOptimization", "roiInputIdx", "scalesInputIdx", "sizesInputIdx", "createAttributeWithCacheKey", "glsl", "getGlsl", "inputWidth", "inputHeight", "outputShape", "dim", "i", "outputWidth", "outputHeight", "outputPitches", "inputPitches", "precalculatedPitches", "d", "getInputFloatFunction", "shaderSource", "x", "attribute", "scale", "resizeProgramMetadata", "resize", "parseResizeAttributesV10", "parseResizeAttributesV11", "createPackedResizeProgramInfo", "prepareInputs", "parseScalesData", "parseScalesDataFromOutputSize", "init_resize_packed", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "init_upsample", "inferenceHandler", "inputs", "attributes", "validateInputs", "node", "parseUpsampleAttributes", "glsl", "getGlsl", "scales", "outputShape", "s", "dim", "outputHeight", "outputWidth", "inputShape", "inputHeight", "inputWidth", "scalesHeight", "scalesWidth", "getSourceFracIndex", "coordsDataType", "getCoordsDataType", "unpackChannel", "unpackFromChannel", "shaderSource", "xDims", "outputSizes", "scalesTensor", "sizesTensor", "yDims", "i", "scale", "mode", "isResize", "scalesValidation", "length", "end", "shape", "validateInputs", "init_shape", "__esmMin", "init_tensor", "_inferenceHandler", "inputs", "Tensor", "sliceProgramMetadata", "slice", "parseSliceAttributes", "createSliceProgramInfo", "validateInputs", "sliceV10", "generateSliceAttributesFromInputs", "validateInputsV10", "init_slice", "__esmMin", "init_attribute_with_cache_key", "init_operators", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "starts", "ends", "axes", "createAttributeWithCacheKey", "_inferenceHandler", "input", "_val", "i", "normalizedAxes", "ShapeUtil", "start", "end", "outputShape", "sliceOps", "shaderSource", "NUMBER_TYPES", "cacheKey", "softmaxComputeMaxProgramMetadata", "softmaxComputeScaleProgramMetadata", "softmaxProgramMetadata", "softmax", "parseSoftmaxAttributes", "parseSoftmaxAttributesV13", "softmaxV13", "computeSoftmax", "createComputeMaxProgramInfo", "createComputScaleProgramInfo", "createSoftMaxProgramInfo", "validateInputs", "init_softmax", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_glsl_source", "init_types", "init_transpose", "inferenceHandler", "inputs", "attributes", "inputShape", "axis", "ShapeUtil", "logicalRowCount", "featureCount", "node", "createAttributeWithCacheKey", "rank", "isTransposeRequired", "transposedInputShape", "perm", "transposedInputs", "transposeAttribute", "_", "i", "p", "transpose", "output", "computeMaxProgramInfo", "max", "computeScaleProgramInfo", "scale", "softMaxProgramInfo", "input", "outputShape", "textureWidth", "textureHeight", "glsl", "getGlsl", "shaderSource", "maxElementPerLogicalRow", "normalizationPerLogicalRow", "splitProgramMetadata", "split", "parseSplitAttributes", "getProgramCount", "createSplitProgramInfo", "validateInputs", "init_split", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "axis", "ShapeUtil", "count", "output", "i", "node", "numOutputs", "createAttributeWithCacheKey", "_inferenceHandler", "offsets", "SplitUtil", "input", "index", "shapes", "offset", "outputShape", "shaderSource", "squeeze", "squeezeV13", "parseSqueezeAttributes", "validateInputs", "validateInputsV13", "init_squeeze", "__esmMin", "init_util", "inferenceHandler", "inputs", "axes", "outputShape", "ShapeUtil", "node", "sum", "createSumProgramInfo", "validateInputs", "init_sum", "__esmMin", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "sumProgramMetadata", "_v", "i", "glsl", "getGlsl", "outputShape", "shaderSource", "length", "j", "tile", "createTileProgramInfo", "validateInputs", "init_tile", "__esmMin", "init_operators", "init_types", "inferenceHandler", "inputs", "tileProgramMetadata", "_handler", "inputShape", "outputShape", "tileOps", "i", "rank", "shaderSource", "NUMBER_TYPES", "unsqueeze", "unsqueezeV13", "parseUnsqueezeAttributes", "validateInputs", "validateInputsV13", "init_unsqueeze", "__esmMin", "init_util", "inferenceHandler", "inputs", "axes", "outputShape", "ShapeUtil", "node", "WEBGL_OP_RESOLVE_RULES", "init_op_resolve_rules", "__esmMin", "init_batch_normalization", "init_binary_op", "init_cast", "init_concat", "init_conv", "init_conv_transpose", "init_depth_to_space", "init_flatten", "init_gather", "init_gemm", "init_image_scaler", "init_instance_normalization", "init_lrn", "init_matmul", "init_pad", "init_pool", "init_reduce", "init_reshape", "init_resize_packed", "init_shape", "init_slice", "init_softmax", "init_split", "init_squeeze", "init_sum", "init_tile", "init_transpose", "init_unary_op", "init_unsqueeze", "init_upsample", "abs", "acos", "add", "and", "asin", "atan", "averagePool", "parseAveragePoolAttributes", "batchNormalization", "parseBatchNormalizationAttributes", "cast", "parseCastAttributes", "ceil", "clip", "parseClipAttributes", "clipV11", "concat", "parseConcatAttributes", "conv", "parseConvAttributes", "convTranspose", "parseConvTransposeAttributes", "cos", "div", "identity", "depthToSpace", "parseDepthToSpaceAttributes", "equal", "elu", "parseEluAttributes", "exp", "flatten", "parseFlattenAttributes", "floor", "gather", "parseGatherAttributes", "gemm", "parseGemmAttributesV7", "parseGemmAttributesV11", "globalAveragePool", "parseGlobalAveragePoolAttributes", "globalMaxPool", "greater", "imageScaler", "parseImageScalerAttributes", "instanceNormalization", "parseInstanceNormalizationAttributes", "leakyRelu", "parseLeakyReluAttributes", "less", "lrn", "parseLrnAttributes", "log", "matMul", "parseMatMulAttributes", "maxPool", "parseMaxPoolAttributes", "mul", "neg", "not", "or", "padV2", "parsePadAttributesV2", "padV11", "parsePadAttributesV11", "pow", "pRelu", "reduceLogSum", "parseReduceAttributes", "reduceMax", "reduceMean", "reduceMin", "reduceProd", "reduceSum", "reduceLogSumSquare", "relu", "reshape", "resize", "parseResizeAttributesV10", "parseResizeAttributesV11", "shape", "sigmoid", "sin", "sliceV10", "slice", "parseSliceAttributes", "softmax", "parseSoftmaxAttributes", "softmaxV13", "parseSoftmaxAttributesV13", "split", "parseSplitAttributes", "sqrt", "squeeze", "parseSqueezeAttributes", "squeezeV13", "sub", "sum", "tan", "tanh", "tile", "transpose", "parseTransposeAttributes", "upsample", "parseUpsampleAttributesV7", "parseUpsampleAttributesV9", "unsqueeze", "parseUnsqueezeAttributes", "unsqueezeV13", "xor", "replaceInlines", "script", "inlineDefs", "match", "INLINE_FUNC_DEF_REGEX", "params", "s", "tokens", "v", "name", "regexString", "FUNC_CALL_REGEX", "regex", "type", "variable", "declLine", "newBody", "paramRedecLine", "i", "replacement", "init_glsl_function_inliner", "__esmMin", "squeezeShape", "shape", "axis", "newShape", "keptDims", "isEmptyArray", "axes", "parseAxisParam", "j", "rank", "_s", "i", "assert", "ax", "isInt", "a", "sizeFromShape", "size", "sizeToSquarishShape", "width", "PreferLogicalStrategy", "init_texture_layout_strategy", "__esmMin", "init_instrument", "init_util", "maxTextureSize", "prefs", "wh", "isPacked", "wsize", "b", "hsize", "Logger", "logShape", "_d", "d", "CoordsGlslLib", "init_glsl_coordinate_lib", "__esmMin", "init_util", "init_glsl_definitions", "init_glsl_source", "init_texture_layout_strategy", "init_utils", "GlslLib", "context", "funcName", "GlslLibRoutine", "outputLayout", "outShape", "outTexShape", "result", "floatTextureSetRGBASource", "getGlsl", "floatTextureSetRGBAFuncName", "floatTextureSetRSource", "floatTextureSetRFuncName", "_shape", "texShape", "packedTexShape", "source", "shape", "ArrayUtil", "texelsInLogicalRow", "texelsInBatch", "texelsInBatchN", "batches", "coords", "b", "rank", "strides", "i", "coordsToCompute", "coordsFromIndexSnippet", "stride", "line1", "line2", "glsl", "samplerName", "inputLayout", "generateShaderFuncNameFromInputSamplerName", "outCoordFuncName", "generateShaderFuncNameFromInputSamplerNameAtOutCoords", "name", "inShape", "texFuncSnippet", "inRank", "outRank", "broadcastDims", "BroadcastUtil", "type", "getCoordsDataType", "rankDiff", "coordsSnippet", "fields", "getGlChannels", "d", "unpackedCoordsSnippet", "_s", "output", "isInputScalar", "ShapeUtil", "isOutputScalar", "rows", "cols", "swapLastDimsSnippet", "inTexShape", "texNumR", "texNumC", "packedSampler", "valuesPerRow", "squeezedShape", "keptDims", "newInputShape", "squeezeInputShape", "params", "newInputLayout", "samplerRoutine", "getSqueezedParams", "index", "tNumR", "tNumC", "newShape", "squeezeShape", "stride0", "stride1", "routine", "revDims", "stride2", "stride3", "stride4", "xScale", "yScale", "stridesBlock", "body", "layout", "varName", "width", "height", "transpose", "EncodingGlslLib", "init_glsl_encoding_lib", "__esmMin", "init_glsl_definitions", "_EncodingGlslLib", "GlslLib", "context", "GlslLibRoutine", "endianness", "b", "a", "c", "FragColorGlslLib", "init_glsl_fragcolor_lib", "__esmMin", "init_glsl_definitions", "init_glsl_source", "GlslLib", "context", "glsl", "getGlsl", "GlslLibRoutine", "ShapeUtilsGlslLib", "init_glsl_shape_utils_lib", "__esmMin", "init_glsl_definitions", "_ShapeUtilsGlslLib", "GlslLib", "context", "outputRank", "result", "name", "i", "shape", "rank", "dimOffset", "funcName", "block", "body", "GlslLibRoutine", "strides", "stridesBlock", "shapeInit", "VecGlslLib", "init_glsl_vec_lib", "__esmMin", "init_glsl_definitions", "GlslLib", "context", "rank", "nameOp", "result", "name", "fname", "assignmentBlock", "i", "body", "GlslLibRoutine", "block", "glslRegistry", "init_glsl_registered_libs", "__esmMin", "init_glsl_coordinate_lib", "init_glsl_encoding_lib", "init_glsl_fragcolor_lib", "init_glsl_shape_utils_lib", "init_glsl_vec_lib", "EncodingGlslLib", "FragColorGlslLib", "VecGlslLib", "ShapeUtilsGlslLib", "CoordsGlslLib", "GlslPreprocessor", "init_glsl_preprocessor", "__esmMin", "init_glsl_definitions", "init_glsl_function_inliner", "init_glsl_registered_libs", "init_glsl_source", "glContext", "programInfo", "inputTextureLayouts", "outputTextureLayout", "GlslContext", "glslRegistry", "name", "lib", "map", "libName", "routinesInLib", "routine", "key", "currentNode", "GlslLibRoutineNode", "dependencies", "i", "node", "source", "getDefaultFragShaderMain", "replaceInlines", "getFragShaderPreamble", "script", "routinesIncluded", "routines", "nodes", "classAndRoutine", "TopologicalSortGlslRoutines", "samplers", "variables", "uniformLines", "sampler", "variable", "ProgramManager", "init_program_manager", "__esmMin", "init_esm", "init_instrument", "init_glsl_preprocessor", "init_glsl_source", "profiler", "glContext", "textureLayoutStrategy", "key", "artifact", "buildArtifact", "inputs", "output", "gl", "program", "err", "Logger", "a", "programInfo", "inputTextureLayouts", "outputTextureLayout", "preprocessor", "GlslPreprocessor", "fragScript", "fragShaderScript", "vertexShaderScript", "getVertexShaderSource", "env", "fragShader", "td", "width", "height", "attribLocations", "positionHandle", "textureCoordHandle", "uniformLocations", "variables", "textures", "texturePosition", "name", "type", "location", "arrayLength", "value", "v", "uniformHandle", "position", "samplers", "sampler", "variable", "reference", "TextureManager", "init_texture_manager", "__esmMin", "init_instrument", "init_texture_data_encoder", "glContext", "layoutStrategy", "profiler", "config", "dataType", "layout", "data", "usage", "textureDataType", "encoder", "width", "height", "key", "inUseTextures", "idleTextures", "texture", "Logger", "td", "channels", "dataSize", "a", "b", "dataId", "subscribers", "resolve", "tensorData", "textureData", "deleteTexture", "index", "_dataType", "WebGLSessionHandler", "init_session_handler", "__esmMin", "init_instrument", "init_opset", "init_inference_handler", "init_op_resolve_rules", "init_program_manager", "init_texture_layout_strategy", "init_texture_manager", "backend", "context", "PreferLogicalStrategy", "ProgramManager", "TextureManager", "WebGLInferenceHandler", "graph", "initializers", "v", "tensorId", "isPacked", "textureData", "Logger", "td", "node", "opsets", "op", "resolveOperator", "WEBGL_OP_RESOLVE_RULES", "linearSearchLastTrue", "arr", "i", "WebGLContext", "init_webgl_context", "__esmMin", "init_esm", "init_texture_data_encoder", "init_utils", "gl", "version", "width", "height", "encoder", "data", "texture", "buffer", "dataSize", "dataType", "channels", "positionHandle", "textureCoordHandle", "vertexShader", "fragShader", "program", "shaderSource", "shaderType", "shader", "position", "uniformHandle", "env", "error", "label", "usage", "RedFloat32DataEncoder", "RGBAFloatDataEncoder", "Uint8DataEncoder", "unit", "geometry", "fb", "internalFormat", "frameBuffer", "isComplete", "fragmentShader", "gl2", "ext", "query", "available", "disjoint", "timeElapsed", "repeatedTry", "fenceContext", "isFencePassed", "status", "resolve", "index", "x", "resolveFn", "isDoneFn", "createWebGLContext", "contextId", "context", "cache", "offscreenCanvas", "createOffscreenCanvas", "createNewWebGLContext", "canvas", "createCanvas", "gl", "contextAttributes", "ca", "WebGLContext", "err", "Logger", "init_webgl_context_factory", "__esmMin", "init_instrument", "init_webgl_context", "WebGLBackend", "init_backend_webgl", "__esmMin", "init_esm", "init_instrument", "init_session_handler", "init_webgl_context_factory", "env", "value", "createWebGLContext", "Logger", "e", "context", "WebGLSessionHandler", "resolveBackend", "hint", "hints", "backendHint", "cache", "backendsCache", "backend", "tryLoadBackend", "backendObj", "isBackend", "init", "obj", "o", "init_backend", "__esmMin", "init_backend_webgl", "WebGLBackend", "KernelOp", "ExecutionPlan", "init_execution_plan", "__esmMin", "init_instrument", "op", "node", "graph", "ops", "profiler", "graphNodes", "i", "resolved", "input", "sessionHandler", "modelInputs", "inferenceHandler", "graphInputs", "index", "sequence", "graphValues", "rear", "thisOpIndex", "thisOp", "inputList", "inputTensors", "Logger", "t", "outputList", "output", "j", "downstreamNodes", "_output", "currentDownstreamNodeIndex", "currentDownstreamNode", "k", "outputIndex", "outputTensor", "import_onnx", "ortFbs", "Attribute", "init_attribute", "__esmMin", "init_ort_generated", "init_tensor", "init_util", "onnxruntime", "_Attribute", "attributes", "attr", "key", "type", "value", "defaultValue", "valueAndType", "attrType", "LongUtil", "arr", "numberValue", "i", "maybeLong", "Tensor", "decodeUtf8String", "ints", "strings", "tensors", "import_onnx", "ortFbs", "Graph", "Value", "Node", "GraphImpl", "init_graph", "__esmMin", "init_attribute", "init_ort_generated", "init_tensor", "init_util", "onnxruntime", "graphProto", "initializer", "valueInfo", "ProtoUtil", "_nodeProto", "name", "Attribute", "graph", "graphInitializer", "dataIndices", "nodesIndices", "inputValueNames", "i", "currentIndex", "index", "value", "Tensor", "nodeProto", "pick", "node", "output", "dataIndex", "input", "inputName", "j", "type", "shape", "dims", "k", "LongUtil", "outputName", "starters", "nodesStack", "nodesState", "nodeIndex", "outgoingEdgeIndex", "data", "downstreamNodeIndex", "offset", "newIndices", "nodePossition", "ind", "currentData", "inputValueIndex", "outputValueIndex", "nodesConsumingOutput", "delIndex", "replaceIndex", "n", "next", "child", "MIN_CLIP", "MAX_CLIP", "import_onnx", "ortFbs", "Model", "init_model", "__esmMin", "init_flatbuffers", "init_graph", "init_ort_generated", "init_util", "onnxruntime", "buf", "graphInitializer", "isOrtFormat", "onnxError", "e", "modelProto", "LongUtil", "i", "Graph", "fb", "flatbuffers", "ortModel", "opsetId", "Session", "init_session", "__esmMin", "init_backend", "init_execution_plan", "init_instrument", "init_model", "config", "Profiler", "arg", "byteOffset", "length", "backend", "resolveBackend", "Model", "isOrtFormat", "buf", "arr", "modelProtoBlob", "graphInitializer", "ExecutionPlan", "inputs", "inputTensors", "outputTensors", "modelInputNames", "sortedInputs", "sortedInputsIndex", "i", "tensor", "modelInputIndices", "modelValues", "graphInputDims", "graphInput", "graphInputTypes", "givenInputs", "expectedType", "actualType", "noneDimSupported", "expectedDims", "actualDims", "modelOutputNames", "output", "graph", "nodes", "OnnxjsSessionHandler", "init_session_handler_inference", "__esmMin", "init_esm", "init_tensor", "session", "feeds", "_fetches", "_options", "inputMap", "name", "feed", "Tensor", "outputMap", "output", "tensor", "backend_onnxjs_exports", "__export", "onnxjsBackend", "OnnxjsBackend", "init_backend_onnxjs", "__esmMin", "init_session", "init_session_handler_inference", "pathOrBuffer", "options", "session", "Session", "OnnxjsSessionHandler", "fs_exports", "__export", "createReadStream", "readFile", "readFileSync", "init_fs", "__esmMin", "path_exports", "__export", "join", "init_path", "__esmMin", "require_ort_wasm", "__commonJSMin", "exports", "module", "ortWasm", "_scriptDir", "moduleArg", "e", "k", "l", "a", "b", "q", "v", "aa", "x", "ba", "y", "A", "B", "C", "fs", "D", "c", "f", "g", "h", "ca", "E", "noExitRuntime", "G", "H", "I", "da", "J", "K", "L", "M", "ea", "fa", "ha", "ia", "ja", "N", "O", "P", "ka", "Q", "la", "ma", "na", "oa", "pa", "R", "S", "qa", "ra", "sa", "ta", "ua", "m", "T", "U", "V", "r", "W", "va", "wa", "Ba", "Aa", "X", "Ca", "Y", "Da", "Ea", "Fa", "Ga", "Ha", "d", "n", "p", "xa", "z", "w", "t", "u", "ya", "za", "Ja", "Ia", "Ka", "La", "Ma", "Na", "Z", "Oa", "Pa", "require_worker_threads", "__commonJSMin", "require_perf_hooks", "__commonJSMin", "os_exports", "__export", "cpus", "init_os", "__esmMin", "require_ort_wasm_threaded", "__commonJSMin", "exports", "module", "ortWasmThreaded", "_scriptDir", "moduleArg", "aa", "d", "l", "m", "n", "ba", "p", "ca", "r", "da", "ea", "fa", "w", "ha", "x", "a", "b", "ia", "ja", "z", "ka", "A", "B", "D", "E", "la", "ma", "F", "H", "fs", "na", "c", "e", "h", "g", "k", "oa", "pa", "qa", "I", "J", "noExitRuntime", "K", "L", "ra", "M", "N", "O", "sa", "ta", "ua", "va", "wa", "P", "Q", "xa", "R", "ya", "za", "Aa", "S", "Ba", "Ca", "Da", "Ea", "T", "U", "Fa", "Ga", "V", "Ha", "Ia", "Ja", "Ka", "La", "W", "Na", "Ma", "Oa", "X", "t", "Y", "Pa", "Qa", "Ra", "Sa", "Ta", "Ua", "Va", "Wa", "Xa", "Ya", "Za", "$a", "ab", "bb", "cb", "db", "eb", "fb", "gb", "hb", "ib", "jb", "kb", "lb", "mb", "nb", "ob", "pb", "qb", "Z", "rb", "sb", "tb", "ub", "wb", "vb", "yb", "xb", "zb", "Ab", "Bb", "Cb", "Eb", "Db", "Fb", "Gb", "Hb", "Lb", "Mb", "Nb", "Ob", "C", "v", "y", "Pb", "Qb", "Rb", "Sb", "Tb", "f", "q", "u", "Ib", "G", "Jb", "Kb", "Ub", "Xb", "Vb", "Wb", "Yb", "Zb", "$b", "ac", "require_ort_wasm_threaded_worker", "__commonJSMin", "exports", "module", "ortWasmFactory", "ortWasmFactoryThreaded", "wasm", "initialized", "initializing", "aborted", "isMultiThreadSupported", "isSimdSupported", "getWasmFileName", "initializeWebAssembly", "getInstance", "init_wasm_factory", "__esmMin", "numThreads", "useSimd", "useThreads", "flags", "timeout", "simd", "wasmPaths", "wasmPrefixOverride", "wasmFileName", "wasmPathOverride", "isTimeout", "tasks", "resolve", "reject", "factory", "config", "fileName", "scriptDirectory", "scriptSourceCode", "module", "what", "allocWasmString", "iterateExtraOptions", "checkLastError", "init_wasm_utils", "__esmMin", "init_wasm_factory", "data", "allocs", "wasm", "getInstance", "dataLength", "dataOffset", "options", "prefix", "seen", "handler", "key", "value", "name", "message", "stack", "paramsOffset", "errorCode", "errorMessagePointer", "errorMessage", "setRunOptions", "init_run_options", "__esmMin", "init_wasm_factory", "init_wasm_utils", "options", "wasm", "getInstance", "runOptionsHandle", "allocs", "runOptions", "tagDataOffset", "allocWasmString", "checkLastError", "iterateExtraOptions", "key", "value", "keyDataOffset", "valueDataOffset", "e", "alloc", "getGraphOptimzationLevel", "getExecutionMode", "appendDefaultOptions", "setExecutionProviders", "setSessionOptions", "init_session_options", "__esmMin", "init_wasm_factory", "init_wasm_utils", "graphOptimizationLevel", "executionMode", "options", "session", "ep", "sessionOptionsHandle", "executionProviders", "allocs", "epName", "webnnOptions", "keyDataOffset", "allocWasmString", "valueDataOffset", "getInstance", "checkLastError", "numThreads", "webgpuOptions", "epNameDataOffset", "wasm", "sessionOptions", "logIdDataOffset", "logSeverityLevel", "logVerbosityLevel", "optimizedModelFilePathOffset", "name", "value", "nameOffset", "iterateExtraOptions", "key", "e", "alloc", "tensorDataTypeStringToEnum", "tensorDataTypeEnumToString", "getTensorElementSize", "tensorTypeToTypedArrayConstructor", "logLevelStringToEnum", "isGpuBufferSupportedType", "dataLocationStringToEnum", "init_wasm_common", "__esmMin", "type", "typeProto", "dateType", "logLevel", "location", "loadFile", "init_wasm_utils_load_file", "__esmMin", "file", "e", "stream", "chunks", "chunk", "response", "contentLengthHeader", "fileSize", "reader", "buffer", "pages", "offset", "done", "value", "chunkSize", "initOrt", "initRuntime", "initEp", "activeSessions", "getSessionInputOutputCount", "copyFromExternalBuffer", "createSession", "releaseSession", "prepareInputOutputTensor", "run", "endProfiling", "extractTransferableBuffers", "init_wasm_core_impl", "__esmMin", "init_run_options", "init_session_options", "init_wasm_common", "init_wasm_factory", "init_wasm_utils", "init_wasm_utils_load_file", "numThreads", "loggingLevel", "getInstance", "checkLastError", "env", "logLevelStringToEnum", "epName", "sessionHandle", "wasm", "stack", "dataOffset", "model", "modelDataOffset", "modelData", "options", "modelDataLength", "sessionOptionsHandle", "ioBindingHandle", "allocs", "inputNamesUTF8Encoded", "outputNamesUTF8Encoded", "setSessionOptions", "loadingPromises", "file", "path", "loadFile", "data", "inputCount", "outputCount", "enableGraphCapture", "inputNames", "outputNames", "outputPreferredLocations", "i", "name", "nameString", "bindingState", "e", "buf", "alloc", "sessionId", "session", "ioBindingState", "tensor", "tensorHandles", "index", "dataType", "dims", "location", "rawData", "dataByteLength", "gpuBuffer", "elementSizeInBytes", "getTensorElementSize", "tensorDataTypeStringToEnum", "a", "b", "registerBuffer", "dataIndex", "allocWasmString", "dimsOffset", "dimIndex", "d", "dataLocationStringToEnum", "inputIndices", "inputTensors", "outputIndices", "outputTensors", "inputOutputBound", "runOptionsHandle", "runOptionsAllocs", "inputTensorHandles", "outputTensorHandles", "inputOutputAllocs", "beforeRunStack", "inputValuesOffset", "inputNamesOffset", "outputValuesOffset", "outputNamesOffset", "setRunOptions", "inputValuesIndex", "inputNamesIndex", "outputValuesIndex", "outputNamesIndex", "errorCode", "output", "beforeGetTensorDataStack", "tensorDataOffset", "keepOutputTensor", "type", "tensorDataIndex", "dimsLength", "size", "tensorDataTypeEnumToString", "preferredLocation", "stringData", "offset", "maxBytesToRead", "getBuffer", "elementSize", "isGpuBufferSupportedType", "typedArrayConstructor", "tensorTypeToTypedArrayConstructor", "v", "p", "profileFileName", "tensors", "buffers", "require_main", "__commonJSMin", "exports", "module", "isProxy", "proxyWorker", "initializing", "initialized", "aborted", "initWasmCallbacks", "queuedCallbacks", "enqueueCallbacks", "ensureWorker", "onProxyWorkerMessage", "scriptSrc", "initializeWebAssemblyAndOrtRuntime", "initializeOrtEp", "copyFromExternalBuffer", "createSession", "releaseSession", "run", "endProfiling", "init_proxy_wrapper", "__esmMin", "init_esm", "init_wasm_core_impl", "init_wasm_factory", "env", "type", "callbacks", "queue", "ev", "resolve", "reject", "workerUrl", "message", "initializeWebAssembly", "initRuntime", "e", "epName", "initEp", "buffer", "model", "options", "transferable", "sessionId", "inputIndices", "inputs", "outputIndices", "outputs", "t", "serializableInputs", "extractTransferableBuffers", "encodeTensorMetadata", "decodeTensorMetadata", "OnnxruntimeWebAssemblySessionHandler", "init_session_handler_inference", "__esmMin", "init_esm", "init_proxy_wrapper", "init_wasm_common", "init_wasm_utils_load_file", "tensor", "getName", "Tensor", "dataType", "isGpuBufferSupportedType", "gpuBuffer", "download", "dispose", "path", "copyFromExternalBuffer", "loadFile", "pathOrBuffer", "options", "TRACE_FUNC_BEGIN", "model", "createSession", "TRACE_FUNC_END", "releaseSession", "feeds", "fetches", "inputArray", "inputIndices", "kvp", "name", "index", "outputArray", "outputIndices", "inputs", "t", "i", "outputs", "results", "run", "resultMap", "endProfiling", "initializeFlags", "OnnxruntimeWebAssemblyBackend", "init_backend_wasm", "__esmMin", "init_esm", "init_proxy_wrapper", "init_session_handler_inference", "env", "numCpuLogicalCores", "backendName", "initializeWebAssemblyAndOrtRuntime", "initializeOrtEp", "pathOrBuffer", "options", "handler", "OnnxruntimeWebAssemblySessionHandler", "backend_wasm_inference_exports", "__export", "wasmBackend", "init_backend_wasm_inference", "__esmMin", "init_backend_wasm", "OnnxruntimeWebAssemblyBackend", "init_esm", "version", "lib_default", "esm_exports", "onnxjsBackend", "registerBackend", "wasmBackend", "env", "version"] +}