diff --git "a/demo/ort-phi3/dist/esm/ort.all.min.js.map" "b/demo/ort-phi3/dist/esm/ort.all.min.js.map" new file mode 100644--- /dev/null +++ "b/demo/ort-phi3/dist/esm/ort.all.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-simd.jsep.js", "nodejs-ignore:worker_threads", "nodejs-ignore:perf_hooks", "nodejs-ignore:os", "../../lib/wasm/binding/ort-wasm-simd-threaded.jsep.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/jsep/log.ts", "../../lib/wasm/jsep/tensor-view.ts", "../../lib/wasm/jsep/webgpu/types.ts", "../../lib/wasm/jsep/webgpu/gpu-data-manager.ts", "../../lib/wasm/jsep/webgpu/attribute-with-cache-key.ts", "../../lib/wasm/jsep/util.ts", "../../lib/wasm/jsep/webgpu/ops/common.ts", "../../lib/wasm/jsep/webgpu/ops/transpose.ts", "../../lib/wasm/jsep/webgpu/ops/reduce-shared.ts", "../../lib/wasm/jsep/webgpu/ops/reduce.ts", "../../lib/wasm/jsep/webgpu/ops/argminmax.ts", "../../lib/wasm/jsep/webgpu/ops/concat.ts", "../../lib/wasm/jsep/webgpu/ops/attention.ts", "../../lib/wasm/jsep/webgpu/ops/batch-norm.ts", "../../lib/wasm/jsep/webgpu/ops/bias-add.ts", "../../lib/wasm/jsep/webgpu/ops/unary-op.ts", "../../lib/wasm/jsep/webgpu/ops/bias-split-gelu.ts", "../../lib/wasm/jsep/webgpu/ops/binary-op.ts", "../../lib/wasm/jsep/webgpu/ops/fuse-utils.ts", "../../lib/wasm/jsep/webgpu/ops/3rd-party/activation_util.ts", "../../lib/wasm/jsep/webgpu/ops/3rd-party/conv_util.ts", "../../lib/wasm/jsep/webgpu/ops/3rd-party/matmul_packed_webgpu.ts", "../../lib/wasm/jsep/webgpu/ops/3rd-party/conv2d_mm_webgpu.ts", "../../lib/wasm/jsep/webgpu/ops/conv-grouped.ts", "../../lib/wasm/jsep/webgpu/ops/matmul.ts", "../../lib/wasm/jsep/webgpu/ops/conv.ts", "../../lib/wasm/jsep/webgpu/ops/3rd-party/conv_backprop_mm_webgpu.ts", "../../lib/wasm/jsep/webgpu/ops/3rd-party/conv_backprop_webgpu.ts", "../../lib/wasm/jsep/webgpu/ops/conv-transpose.ts", "../../lib/wasm/jsep/webgpu/ops/cumsum.ts", "../../lib/wasm/jsep/webgpu/ops/depth-to-space.ts", "../../lib/wasm/jsep/webgpu/ops/einsum.ts", "../../lib/wasm/jsep/webgpu/ops/expand.ts", "../../lib/wasm/jsep/webgpu/ops/fast-gelu.ts", "../../lib/wasm/jsep/webgpu/ops/gather.ts", "../../lib/wasm/jsep/webgpu/ops/gather-elements.ts", "../../lib/wasm/jsep/webgpu/ops/gemm.ts", "../../lib/wasm/jsep/webgpu/ops/instance-norm.ts", "../../lib/wasm/jsep/webgpu/ops/layer-norm.ts", "../../lib/wasm/jsep/webgpu/ops/matmulnbits.ts", "../../lib/wasm/jsep/webgpu/ops/multihead-attentiion.ts", "../../lib/wasm/jsep/webgpu/ops/pad.ts", "../../lib/wasm/jsep/webgpu/ops/pool.ts", "../../lib/wasm/jsep/webgpu/ops/range.ts", "../../lib/wasm/jsep/webgpu/ops/resize.ts", "../../lib/wasm/jsep/webgpu/ops/rotary-embedding.ts", "../../lib/wasm/jsep/webgpu/ops/skip-layer-norm.ts", "../../lib/wasm/jsep/webgpu/ops/slice.ts", "../../lib/wasm/jsep/webgpu/ops/softmax.ts", "../../lib/wasm/jsep/webgpu/ops/split.ts", "../../lib/wasm/jsep/webgpu/ops/tile.ts", "../../lib/wasm/jsep/webgpu/ops/where.ts", "../../lib/wasm/jsep/webgpu/op-resolve-rules.ts", "../../lib/wasm/jsep/webgpu/program-manager.ts", "../../lib/wasm/jsep/backend-webgpu.ts", "../../lib/wasm/jsep/init.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?.src : undefined;\n if (typeof __filename != 'undefined') _scriptDir ||= __filename;\n return (\nfunction(moduleArg = {}) {\n\nvar g=moduleArg,aa,ba,readyPromise=new Promise((a,b)=>{aa=a;ba=b});\"use strict\";g.mountExternalData=(a,b)=>{(g.Ph||(g.Ph=new Map)).set(a,b)};g.unmountExternalData=()=>{delete g.Ph};\nlet da=()=>{const a=(c,d,e)=>(...f)=>{const h=t,k=d?.();f=c(...f);const l=d?.();k!==l&&(c=l,e(k),d=e=null);return t!=h?ca():f},b=c=>async(...d)=>{try{if(g.Oh)throw Error(\"Session already started\");const e=g.Oh={gi:d[0],errors:[]},f=await c(...d);if(g.Oh!==e)throw Error(\"Session mismatch\");g.Uh?.flush();const h=e.errors;if(0l);if(0g._OrtCreateSession,\nc=>g._OrtCreateSession=c);g._OrtRun=b(a(g._OrtRun,()=>g._OrtRun,c=>g._OrtRun=c));g._OrtRunWithBinding=b(a(g._OrtRunWithBinding,()=>g._OrtRunWithBinding,c=>g._OrtRunWithBinding=c));g._OrtBindInput=a(g._OrtBindInput,()=>g._OrtBindInput,c=>g._OrtBindInput=c);da=void 0};\ng.jsepInit=(a,b)=>{da?.();if(\"webgpu\"===a){[g.Uh,g.Zh,g.ci,g.Vh,g.bi,g.je,g.di,g.fi,g.$h,g.ai,g.ei]=b;const c=g.Uh;g.jsepRegisterBuffer=(d,e,f,h)=>c.registerBuffer(d,e,f,h);g.jsepGetBuffer=d=>c.getBuffer(d);g.jsepCreateDownloader=(d,e,f)=>c.createDownloader(d,e,f);g.jsepOnReleaseSession=d=>{c.onReleaseSession(d)};g.jsepOnRunStart=d=>c.onRunStart(d)}};\nvar ea=Object.assign({},g),fa=\"./this.program\",ha=(a,b)=>{throw b;},ia=\"object\"==typeof window,ja=\"function\"==typeof importScripts,ka=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,v=\"\",la,ma,na;\nif(ka){var fs=require(\"fs\"),oa=require(\"path\");v=ja?oa.dirname(v)+\"/\":__dirname+\"/\";la=(a,b)=>{a=pa(a)?new URL(a):oa.normalize(a);return fs.readFileSync(a,b?void 0:\"utf8\")};na=a=>{a=la(a,!0);a.buffer||(a=new Uint8Array(a));return a};ma=(a,b,c,d=!0)=>{a=pa(a)?new URL(a):oa.normalize(a);fs.readFile(a,d?void 0:\"utf8\",(e,f)=>{e?c(e):b(d?f.buffer:f)})};!g.thisProgram&&1{process.exitCode=a;throw b;}}else if(ia||\nja)ja?v=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(v=document.currentScript.src),_scriptDir&&(v=_scriptDir),v.startsWith(\"blob:\")?v=\"\":v=v.substr(0,v.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1),la=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},ja&&(na=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),ma=(a,b,c)=>{var d=new XMLHttpRequest;d.open(\"GET\",a,!0);d.responseType=\n\"arraybuffer\";d.onload=()=>{200==d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)};var qa=console.log.bind(console),w=console.error.bind(console);Object.assign(g,ea);ea=null;var ra,x=!1,sa,z,E,ta,ua,G,I,va,wa,xa,ya;\nfunction za(){var a=ra.buffer;g.HEAP8=z=new Int8Array(a);g.HEAP16=ta=new Int16Array(a);g.HEAPU8=E=new Uint8Array(a);g.HEAPU16=ua=new Uint16Array(a);g.HEAP32=G=new Int32Array(a);g.HEAPU32=I=new Uint32Array(a);g.HEAPF32=va=new Float32Array(a);g.HEAPF64=ya=new Float64Array(a);g.HEAP64=wa=new BigInt64Array(a);g.HEAPU64=xa=new BigUint64Array(a)}var Aa=[],Ba=[],Ca=[],Da=0,Ea=null,Fa=null;\nfunction Ga(a){a=\"Aborted(\"+a+\")\";w(a);x=!0;sa=1;a=new WebAssembly.RuntimeError(a+\". Build with -sASSERTIONS for more info.\");ba(a);throw a;}var Ha=a=>a.startsWith(\"data:application/octet-stream;base64,\"),pa=a=>a.startsWith(\"file://\"),Ia;Ia=\"ort-wasm-simd.wasm\";if(!Ha(Ia)){var Ja=Ia;Ia=g.locateFile?g.locateFile(Ja,v):v+Ja}function Ka(a){if(na)return na(a);throw\"both async and sync fetching of the wasm failed\";}\nfunction La(a){if(ia||ja){if(\"function\"==typeof fetch&&!pa(a))return fetch(a,{credentials:\"same-origin\"}).then(b=>{if(!b.ok)throw`failed to load wasm binary file at '${a}'`;return b.arrayBuffer()}).catch(()=>Ka(a));if(ma)return new Promise((b,c)=>{ma(a,d=>b(new Uint8Array(d)),c)})}return Promise.resolve().then(()=>Ka(a))}function Ma(a,b,c){return La(a).then(d=>WebAssembly.instantiate(d,b)).then(c,d=>{w(`failed to asynchronously prepare wasm: ${d}`);Ga(d)})}\nfunction Na(a,b){var c=Ia;return\"function\"!=typeof WebAssembly.instantiateStreaming||Ha(c)||pa(c)||ka||\"function\"!=typeof fetch?Ma(c,a,b):fetch(c,{credentials:\"same-origin\"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(e){w(`wasm streaming compile failed: ${e}`);w(\"falling back to ArrayBuffer instantiation\");return Ma(c,a,b)}))}\nvar Oa={1261504:(a,b,c,d)=>{if(\"undefined\"==typeof g||!g.Ph)return 1;a=J(a>>>0);a.startsWith(\"./\")&&(a=a.substring(2));a=g.Ph.get(a);if(!a)return 2;b>>>=0;c>>>=0;if(b+c>a.byteLength)return 3;try{return E.set(a.subarray(b,b+c),d>>>0>>>0),0}catch{return 4}},1262005:(a,b,c)=>{c=J(c);const d=new Uint8Array(b);d.set(E.subarray(a>>>0,a+b>>>0));\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node?require(\"fs\").writeFileSync(c,d):(a=new File([d],c,{type:\"application/octet-stream\"}),\na=URL.createObjectURL(a),window.open(a,\"_blank\"))},1262513:()=>{g.$h()},1262544:()=>{g.ai()},1262573:()=>{g.ei()},1262598:a=>g.Zh(a),1262631:a=>g.ci(a),1262663:(a,b,c)=>{g.Vh(a,b,c,!0)},1262702:(a,b,c)=>{g.Vh(a,b,c)},1262735:a=>{g.je(\"Abs\",a,void 0)},1262786:a=>{g.je(\"Neg\",a,void 0)},1262837:a=>{g.je(\"Floor\",a,void 0)},1262890:a=>{g.je(\"Ceil\",a,void 0)},1262942:a=>{g.je(\"Reciprocal\",a,void 0)},1263E3:a=>{g.je(\"Sqrt\",a,void 0)},1263052:a=>{g.je(\"Exp\",a,void 0)},1263103:a=>{g.je(\"Erf\",a,void 0)},1263154:a=>\n{g.je(\"Sigmoid\",a,void 0)},1263209:(a,b,c)=>{g.je(\"HardSigmoid\",a,{alpha:b,beta:c})},1263288:a=>{g.je(\"Log\",a,void 0)},1263339:a=>{g.je(\"Sin\",a,void 0)},1263390:a=>{g.je(\"Cos\",a,void 0)},1263441:a=>{g.je(\"Tan\",a,void 0)},1263492:a=>{g.je(\"Asin\",a,void 0)},1263544:a=>{g.je(\"Acos\",a,void 0)},1263596:a=>{g.je(\"Atan\",a,void 0)},1263648:a=>{g.je(\"Sinh\",a,void 0)},1263700:a=>{g.je(\"Cosh\",a,void 0)},1263752:a=>{g.je(\"Asinh\",a,void 0)},1263805:a=>{g.je(\"Acosh\",a,void 0)},1263858:a=>{g.je(\"Atanh\",a,void 0)},\n1263911:a=>{g.je(\"Tanh\",a,void 0)},1263963:a=>{g.je(\"Not\",a,void 0)},1264014:(a,b,c)=>{g.je(\"Clip\",a,{min:b,max:c})},1264083:a=>{g.je(\"Clip\",a,void 0)},1264135:(a,b)=>{g.je(\"Elu\",a,{alpha:b})},1264193:a=>{g.je(\"Relu\",a,void 0)},1264245:(a,b)=>{g.je(\"LeakyRelu\",a,{alpha:b})},1264309:(a,b)=>{g.je(\"ThresholdedRelu\",a,{alpha:b})},1264379:(a,b)=>{g.je(\"Cast\",a,{to:b})},1264437:a=>{g.je(\"Add\",a,void 0)},1264488:a=>{g.je(\"Sub\",a,void 0)},1264539:a=>{g.je(\"Mul\",a,void 0)},1264590:a=>{g.je(\"Div\",a,void 0)},\n1264641:a=>{g.je(\"Pow\",a,void 0)},1264692:a=>{g.je(\"Equal\",a,void 0)},1264745:a=>{g.je(\"Greater\",a,void 0)},1264800:a=>{g.je(\"GreaterOrEqual\",a,void 0)},1264862:a=>{g.je(\"Less\",a,void 0)},1264914:a=>{g.je(\"LessOrEqual\",a,void 0)},1264973:(a,b,c,d,e)=>{g.je(\"ReduceMean\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1265132:(a,b,c,d,e)=>{g.je(\"ReduceMax\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1265290:(a,b,c,d,e)=>\n{g.je(\"ReduceMin\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1265448:(a,b,c,d,e)=>{g.je(\"ReduceProd\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1265607:(a,b,c,d,e)=>{g.je(\"ReduceSum\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1265765:(a,b,c,d,e)=>{g.je(\"ReduceL1\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1265922:(a,b,c,d,e)=>\n{g.je(\"ReduceL2\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1266079:(a,b,c,d,e)=>{g.je(\"ReduceLogSum\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1266240:(a,b,c,d,e)=>{g.je(\"ReduceSumSquare\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1266404:(a,b,c,d,e)=>{g.je(\"ReduceLogSumExp\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1266568:a=>\n{g.je(\"Where\",a,void 0)},1266621:(a,b,c)=>{g.je(\"Transpose\",a,{perm:b?Array.from(G.subarray(b>>>0,c>>>0)):[]})},1266729:(a,b,c,d)=>{g.je(\"DepthToSpace\",a,{blocksize:b,mode:J(c),format:d?\"NHWC\":\"NCHW\"})},1266862:(a,b,c,d)=>{g.je(\"DepthToSpace\",a,{blocksize:b,mode:J(c),format:d?\"NHWC\":\"NCHW\"})},1266995:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)=>{g.je(\"ConvTranspose\",a,{format:l?\"NHWC\":\"NCHW\",autoPad:b,dilations:[c],group:d,kernelShape:[e],pads:[f,h],strides:[k],wIsConst:()=>!!z[m>>>0],outputPadding:n?Array.from(G.subarray(n>>>\n0,q>>>0)):[],outputShape:r?Array.from(G.subarray(r>>>0,p>>>0)):[],activation:J(u)})},1267396:(a,b,c,d,e,f,h,k,l,m,n,q,r,p)=>{g.je(\"ConvTranspose\",a,{format:k?\"NHWC\":\"NCHW\",autoPad:b,dilations:Array.from(G.subarray(c>>>0,(c>>>0)+2>>>0)),group:d,kernelShape:Array.from(G.subarray(e>>>0,(e>>>0)+2>>>0)),pads:Array.from(G.subarray(f>>>0,(f>>>0)+4>>>0)),strides:Array.from(G.subarray(h>>>0,(h>>>0)+2>>>0)),wIsConst:()=>!!z[l>>>0],outputPadding:m?Array.from(G.subarray(m>>>0,n>>>0)):[],outputShape:q?Array.from(G.subarray(q>>>\n0,r>>>0)):[],activation:J(p)})},1267961:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)=>{g.je(\"ConvTranspose\",a,{format:l?\"NHWC\":\"NCHW\",autoPad:b,dilations:[c],group:d,kernelShape:[e],pads:[f,h],strides:[k],wIsConst:()=>!!z[m>>>0],outputPadding:n?Array.from(G.subarray(n>>>0,q>>>0)):[],outputShape:r?Array.from(G.subarray(r>>>0,p>>>0)):[],activation:J(u)})},1268362:(a,b,c,d,e,f,h,k,l,m,n,q,r,p)=>{g.je(\"ConvTranspose\",a,{format:k?\"NHWC\":\"NCHW\",autoPad:b,dilations:Array.from(G.subarray(c>>>0,(c>>>0)+2>>>0)),group:d,\nkernelShape:Array.from(G.subarray(e>>>0,(e>>>0)+2>>>0)),pads:Array.from(G.subarray(f>>>0,(f>>>0)+4>>>0)),strides:Array.from(G.subarray(h>>>0,(h>>>0)+2>>>0)),wIsConst:()=>!!z[l>>>0],outputPadding:m?Array.from(G.subarray(m>>>0,n>>>0)):[],outputShape:q?Array.from(G.subarray(q>>>0,r>>>0)):[],activation:J(p)})},1268927:(a,b)=>{g.je(\"GlobalAveragePool\",a,{format:b?\"NHWC\":\"NCHW\"})},1269018:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)=>{g.je(\"AveragePool\",a,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:d,\nstorage_order:e,dilations:[f,h],kernel_shape:[k,l],pads:[m,n,q,r],strides:[p,u]})},1269302:(a,b)=>{g.je(\"GlobalAveragePool\",a,{format:b?\"NHWC\":\"NCHW\"})},1269393:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)=>{g.je(\"AveragePool\",a,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:d,storage_order:e,dilations:[f,h],kernel_shape:[k,l],pads:[m,n,q,r],strides:[p,u]})},1269677:(a,b)=>{g.je(\"GlobalMaxPool\",a,{format:b?\"NHWC\":\"NCHW\"})},1269764:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)=>{g.je(\"MaxPool\",a,{format:y?\n\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:d,storage_order:e,dilations:[f,h],kernel_shape:[k,l],pads:[m,n,q,r],strides:[p,u]})},1270044:(a,b)=>{g.je(\"GlobalMaxPool\",a,{format:b?\"NHWC\":\"NCHW\"})},1270131:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)=>{g.je(\"MaxPool\",a,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:d,storage_order:e,dilations:[f,h],kernel_shape:[k,l],pads:[m,n,q,r],strides:[p,u]})},1270411:(a,b,c,d,e)=>{g.je(\"Gemm\",a,{alpha:b,beta:c,transA:d,transB:e})},1270515:a=>\n{g.je(\"MatMul\",a,void 0)},1270569:(a,b,c,d)=>{g.je(\"ArgMax\",a,{keepDims:!!b,selectLastIndex:!!c,axis:d})},1270677:(a,b,c,d)=>{g.je(\"ArgMin\",a,{keepDims:!!b,selectLastIndex:!!c,axis:d})},1270785:(a,b)=>{g.je(\"Softmax\",a,{axis:b})},1270848:(a,b)=>{g.je(\"Concat\",a,{axis:b})},1270908:(a,b,c,d,e)=>{g.je(\"Split\",a,{axis:b,numOutputs:c,splitSizes:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1271048:a=>{g.je(\"Expand\",a,void 0)},1271102:(a,b)=>{g.je(\"Gather\",a,{axis:Number(b)})},1271173:(a,b)=>{g.je(\"GatherElements\",\na,{axis:Number(b)})},1271252:(a,b,c,d,e,f,h,k,l,m,n)=>{g.je(\"Resize\",a,{antialias:b,axes:c?Array.from(G.subarray(c>>>0,d>>>0)):[],coordinateTransformMode:J(e),cubicCoeffA:f,excludeOutside:h,extrapolationValue:k,keepAspectRatioPolicy:J(l),mode:J(m),nearestMode:J(n)})},1271598:(a,b,c,d,e,f,h)=>{g.je(\"Slice\",a,{starts:b?Array.from(G.subarray(b>>>0,c>>>0)):[],ends:d?Array.from(G.subarray(d>>>0,e>>>0)):[],axes:f?Array.from(G.subarray(f>>>0,h>>>0)):[]})},1271814:a=>{g.je(\"Tile\",a,void 0)},1271866:(a,b,\nc,d)=>{g.je(\"LayerNormalization\",a,{axis:b,epsilon:c,simplified:!!d})},1271977:(a,b,c)=>{g.je(\"InstanceNormalization\",a,{epsilon:b,format:c?\"NHWC\":\"NCHW\"})},1272091:(a,b,c)=>{g.je(\"InstanceNormalization\",a,{epsilon:b,format:c?\"NHWC\":\"NCHW\"})},1272205:a=>{g.je(\"Range\",a,void 0)},1272258:(a,b)=>{g.je(\"Einsum\",a,{equation:J(b)})},1272339:(a,b,c,d,e)=>{g.je(\"Pad\",a,{mode:b,value:c,pads:d?Array.from(G.subarray(d>>>0,e>>>0)):[]})},1272466:(a,b,c,d,e,f)=>{g.je(\"BatchNormalization\",a,{epsilon:b,momentum:c,\nspatial:!!e,trainingMode:!!d,format:f?\"NHWC\":\"NCHW\"})},1272635:(a,b,c,d,e,f)=>{g.je(\"BatchNormalization\",a,{epsilon:b,momentum:c,spatial:!!e,trainingMode:!!d,format:f?\"NHWC\":\"NCHW\"})},1272804:(a,b,c)=>{g.je(\"CumSum\",a,{exclusive:Number(b),reverse:Number(c)})},1272901:(a,b,c,d,e,f,h,k,l)=>{g.je(\"Attention\",a,{numHeads:b,isUnidirectional:c,maskFilterValue:d,scale:e,doRotary:f,qkvHiddenSizes:h?Array.from(G.subarray(Number(k)>>>0,Number(k)+h>>>0)):[],pastPresentShareBuffer:!!l})},1273173:a=>{g.je(\"BiasAdd\",\na,void 0)},1273228:a=>{g.je(\"BiasSplitGelu\",a,void 0)},1273289:a=>{g.je(\"FastGelu\",a,void 0)},1273345:(a,b,c,d,e,f,h,k,l,m,n,q,r)=>{g.je(\"Conv\",a,{format:l?\"NHWC\":\"NCHW\",auto_pad:b,dilations:[c],group:d,kernel_shape:[e],pads:f?Array.from(G.subarray(f>>>0,h>>>0)):[],strides:[k],w_is_const:()=>!!z[m>>>0],activation:J(n),activation_params:q?Array.from(va.subarray(q>>>0,r>>>0)):[]})},1273715:(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)=>{g.je(\"Conv\",a,{format:q?\"NHWC\":\"NCHW\",auto_pad:b,dilations:[c,d],group:e,kernel_shape:[f,\nh],pads:k?Array.from(G.subarray(k>>>0,l>>>0)):[],strides:[m,n],w_is_const:()=>!!z[r>>>0],activation:J(p),activation_params:u?Array.from(va.subarray(u>>>0,y>>>0)):[]})},1274106:a=>{g.je(\"Gelu\",a,void 0)},1274158:(a,b,c,d,e,f)=>{g.je(\"MatMulNBits\",a,{k:b,n:c,accuracyLevel:d,bits:e,blockSize:f})},1274285:(a,b,c,d,e,f)=>{g.je(\"MultiHeadAttention\",a,{numHeads:b,isUnidirectional:c,maskFilterValue:d,scale:e,doRotary:f})},1274444:(a,b,c,d,e)=>{g.je(\"RotaryEmbedding\",a,{interleaved:!!b,numHeads:c,rotaryEmbeddingDim:d,\nscale:e})},1274583:(a,b,c)=>{g.je(\"SkipLayerNormalization\",a,{epsilon:b,simplified:!!c})},1274685:(a,b,c)=>{g.je(\"SkipLayerNormalization\",a,{epsilon:b,simplified:!!c})},1274787:(a,b,c,d)=>{g.je(\"LayerNormalization\",a,{axis:b,epsilon:c,simplified:!!d})},1274898:a=>{g.di(a)},1274932:(a,b)=>g.fi(a,b,g.Oh.gi,g.Oh.errors)};function Pa(a){this.name=\"ExitStatus\";this.message=`Program terminated with exit(${a})`;this.status=a}var Qa=[],Ra=0,L=0;class Sa{constructor(a){this.Nh=a;this.Ih=a-24}}\nvar Za=a=>{var b=L;if(!b)return Ta(0),0;var c=new Sa(b);I[c.Ih+16>>>2>>>0]=b;var d=I[c.Ih+4>>>2>>>0];if(!d)return Ta(0),b;for(var e in a){var f=a[e];if(0===f||f===d)break;if(Ua(f,d,c.Ih+16))return Ta(f),b}Ta(d);return b},$a=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,ab=(a,b,c)=>{b>>>=0;var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},J=(a,b)=>(a>>>=0)?ab(E,a,b):\"\",bb=a=>{for(var b=0,c=0;c=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},M=(a,b,c,d)=>{c>>>=0;if(!(0=h){var k=a.charCodeAt(++f);h=65536+((h&1023)<<10)|k&1023}if(127>=h){if(c>=d)break;b[c++>>>0]=h}else{if(2047>=h){if(c+1>=d)break;b[c++>>>0]=192|h>>6}else{if(65535>=h){if(c+2>=d)break;b[c++>>>0]=224|h>>12}else{if(c+3>=d)break;b[c++>>>0]=240|h>>18;b[c++>>>0]=128|h>>12&63}b[c++>>>0]=128|h>>6&63}b[c++>>>0]=128|h&63}}b[c>>>0]=0;return c-e},cb,N=a=>{for(var b=\"\";E[a>>>0];)b+=cb[E[a++>>>0]];return b},db={},eb={},fb={},O;\nfunction gb(a,b,c={}){var d=b.name;if(!a)throw new O(`type \"${d}\" must have a positive integer typeid pointer`);if(eb.hasOwnProperty(a)){if(c.Xh)return;throw new O(`Cannot register type '${d}' twice`);}eb[a]=b;delete fb[a];db.hasOwnProperty(a)&&(b=db[a],delete db[a],b.forEach(e=>e()))}function P(a,b,c={}){if(!(\"argPackAdvance\"in b))throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");return gb(a,b,c)}\nvar hb=(a,b,c)=>{switch(b){case 1:return c?d=>z[d>>>0]:d=>E[d>>>0];case 2:return c?d=>ta[d>>>1>>>0]:d=>ua[d>>>1>>>0];case 4:return c?d=>G[d>>>2>>>0]:d=>I[d>>>2>>>0];case 8:return c?d=>wa[d>>>3]:d=>xa[d>>>3];default:throw new TypeError(`invalid integer width (${b}): ${a}`);}},ib=[],Q=[];function jb(a){a>>>=0;9{if(!a)throw new O(\"Cannot use deleted val. handle = \"+a);return Q[a]},S=a=>{switch(a){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const b=ib.pop()||Q.length;Q[b]=a;Q[b+1]=1;return b}};function kb(a){return this.fromWireType(I[a>>>2>>>0])}\nvar lb={name:\"emscripten::val\",fromWireType:a=>{var b=R(a);jb(a);return b},toWireType:(a,b)=>S(b),argPackAdvance:8,readValueFromPointer:kb,Mh:null},mb=(a,b)=>{switch(b){case 4:return function(c){return this.fromWireType(va[c>>>2>>>0])};case 8:return function(c){return this.fromWireType(ya[c>>>3>>>0])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}},nb=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf-16le\"):void 0,ob=(a,b)=>{var c=a>>1;for(var d=c+b/2;!(c>=d)&&ua[c>>>0];)++c;\nc<<=1;if(32>>0,c>>>0));c=\"\";for(d=0;!(d>=b/2);++d){var e=ta[a+2*d>>>1>>>0];if(0==e)break;c+=String.fromCharCode(e)}return c},pb=(a,b,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var e=0;e>>1>>>0]=a.charCodeAt(e),b+=2;ta[b>>>1>>>0]=0;return b-d},qb=a=>2*a.length,rb=(a,b)=>{for(var c=0,d=\"\";!(c>=b/4);){var e=G[a+4*c>>>2>>>0];if(0==e)break;++c;65536<=e?(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023)):d+=\nString.fromCharCode(e)}return d},sb=(a,b,c)=>{b>>>=0;c??=2147483647;if(4>c)return 0;var d=b;c=d+c-4;for(var e=0;e=f){var h=a.charCodeAt(++e);f=65536+((f&1023)<<10)|h&1023}G[b>>>2>>>0]=f;b+=4;if(b+4>c)break}G[b>>>2>>>0]=0;return b-d},tb=a=>{for(var b=0,c=0;c=d&&++c;b+=4}return b},vb=(a,b)=>{var c=eb[a];if(void 0===c)throw a=ub(a),c=N(a),T(a),new O(`${b} has unknown type ${c}`);return c},wb=\n(a,b,c)=>{var d=[];a=a.toWireType(d,c);d.length&&(I[b>>>2>>>0]=S(d));return a},xb=a=>{try{a()}catch(b){Ga(b)}},yb=a=>{if(!x)try{a();try{sa=sa=a=sa,g.onExit?.(a),x=!0,ha(a,new Pa(a))}catch(b){b instanceof Pa||\"unwind\"==b||ha(1,b)}}catch(b){b instanceof Pa||\"unwind\"==b||ha(1,b)}};\nfunction zb(){var a=U,b={};for(let [c,d]of Object.entries(a))b[c]=\"function\"==typeof d?(...e)=>{Ab.push(c);try{return d(...e)}finally{x||(Ab.pop(),t&&1===V&&0===Ab.length&&(V=0,xb(Bb),\"undefined\"!=typeof Fibers&&Fibers.mi()))}}:d;return b}var V=0,t=null,Cb=0,Ab=[],Db={},Eb={},Fb=0,Gb=null,Hb=[];function ca(){return new Promise((a,b)=>{Gb={resolve:a,reject:b}})}\nfunction Ib(){var a=Jb(65548),b=a+12;I[a>>>2>>>0]=b;I[a+4>>>2>>>0]=b+65536;b=Ab[0];var c=Db[b];void 0===c&&(c=Fb++,Db[b]=c,Eb[c]=b);G[a+8>>>2>>>0]=c;return a}\nfunction Kb(a){if(!x){if(0===V){var b=!1,c=!1;a((d=0)=>{if(!x&&(Cb=d,b=!0,c)){V=2;xb(()=>Lb(t));\"undefined\"!=typeof Browser&&Browser.Sh.Wh&&Browser.Sh.resume();d=!1;try{var e=(0,U[Eb[G[t+8>>>2>>>0]]])()}catch(k){e=k,d=!0}var f=!1;if(!t){var h=Gb;h&&(Gb=null,(d?h.reject:h.resolve)(e),f=!0)}if(d&&!f)throw e;}});c=!0;b||(V=1,t=Ib(),\"undefined\"!=typeof Browser&&Browser.Sh.Wh&&Browser.Sh.pause(),xb(()=>Mb(t)))}else 2===V?(V=0,xb(Nb),T(t),t=null,Hb.forEach(yb)):Ga(`invalid state: ${V}`);return Cb}}\nfunction Ob(a){return Kb(b=>{a().then(b)})}var Pb=[],Qb={},Rb=a=>{var b=Qb[a];return void 0===b?N(a):b},Sb=()=>\"object\"==typeof globalThis?globalThis:Function(\"return this\")(),Tb=a=>{var b=Pb.length;Pb.push(a);return b},Ub=(a,b)=>{for(var c=Array(a),d=0;d>>2>>>0],\"parameter \"+d);return c},Vb=(a,b)=>Object.defineProperty(b,\"name\",{value:a});\nfunction Wb(a){var b=Function;if(!(b instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof b} which is not a function`);var c=Vb(b.name||\"unknownFunctionName\",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}\nvar W=a=>0===a%4&&(0!==a%100||0===a%400),Xb=[0,31,60,91,121,152,182,213,244,274,305,335],Yb=[0,31,59,90,120,151,181,212,243,273,304,334],Zb=[],$b=(a,b)=>{Zb.length=0;for(var c;c=E[a++>>>0];){var d=105!=c;d&=112!=c;b+=d&&b%8?4:0;Zb.push(112==c?I[b>>>2>>>0]:106==c?wa[b>>>3]:105==c?G[b>>>2>>>0]:ya[b>>>3>>>0]);b+=d?8:4}return Zb},ac={},cc=()=>{if(!bc){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\n\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:fa||\"./this.program\"},b;for(b in ac)void 0===ac[b]?delete a[b]:a[b]=ac[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);bc=c}return bc},bc,dc=[null,[],[]],ec=[31,29,31,30,31,30,31,31,30,31,30,31],fc=[31,28,31,30,31,30,31,31,30,31,30,31];function gc(a){var b=Array(bb(a)+1);M(a,b,0,b.length);return b}\nfunction hc(a,b,c,d){function e(p,u,y){for(p=\"number\"==typeof p?p.toString():p||\"\";p.lengthB?-1:0A-p.getDate())u-=A-p.getDate()+1,p.setDate(1),11>y?p.setMonth(y+1):(p.setMonth(0),p.setFullYear(p.getFullYear()+1));else{p.setDate(p.getDate()+u);break}}y=new Date(p.getFullYear()+1,0,4);u=k(new Date(p.getFullYear(),\n0,4));y=k(y);return 0>=h(u,p)?0>=h(y,p)?p.getFullYear()+1:p.getFullYear():p.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;d>>>=0;var m=I[d+40>>>2>>>0];d={ji:G[d>>>2>>>0],ii:G[d+4>>>2>>>0],Qh:G[d+8>>>2>>>0],Th:G[d+12>>>2>>>0],Rh:G[d+16>>>2>>>0],Lh:G[d+20>>>2>>>0],Jh:G[d+24>>>2>>>0],Kh:G[d+28>>>2>>>0],li:G[d+32>>>2>>>0],hi:G[d+36>>>2>>>0],ki:m?J(m):\"\"};c=J(c);m={\"%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\",\n\"%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 n in m)c=c.replace(new RegExp(n,\"g\"),m[n]);var q=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),r=\"January February March April May June July August September October November December\".split(\" \");m={\"%a\":p=>q[p.Jh].substring(0,3),\"%A\":p=>q[p.Jh],\"%b\":p=>\nr[p.Rh].substring(0,3),\"%B\":p=>r[p.Rh],\"%C\":p=>f((p.Lh+1900)/100|0,2),\"%d\":p=>f(p.Th,2),\"%e\":p=>e(p.Th,2,\" \"),\"%g\":p=>l(p).toString().substring(2),\"%G\":l,\"%H\":p=>f(p.Qh,2),\"%I\":p=>{p=p.Qh;0==p?p=12:12{for(var u=0,y=0;y<=p.Rh-1;u+=(W(p.Lh+1900)?ec:fc)[y++]);return f(p.Th+u,3)},\"%m\":p=>f(p.Rh+1,2),\"%M\":p=>f(p.ii,2),\"%n\":()=>\"\\n\",\"%p\":p=>0<=p.Qh&&12>p.Qh?\"AM\":\"PM\",\"%S\":p=>f(p.ji,2),\"%t\":()=>\"\\t\",\"%u\":p=>p.Jh||7,\"%U\":p=>f(Math.floor((p.Kh+7-p.Jh)/7),2),\"%V\":p=>{var u=\nMath.floor((p.Kh+7-(p.Jh+6)%7)/7);2>=(p.Jh+371-p.Kh-2)%7&&u++;if(u)53==u&&(y=(p.Jh+371-p.Kh)%7,4==y||3==y&&W(p.Lh)||(u=1));else{u=52;var y=(p.Jh+7-p.Kh-1)%7;(4==y||5==y&&W(p.Lh%400-1))&&u++}return f(u,2)},\"%w\":p=>p.Jh,\"%W\":p=>f(Math.floor((p.Kh+7-(p.Jh+6)%7)/7),2),\"%y\":p=>(p.Lh+1900).toString().substring(2),\"%Y\":p=>p.Lh+1900,\"%z\":p=>{p=p.hi;var u=0<=p;p=Math.abs(p)/60;return(u?\"+\":\"-\")+String(\"0000\"+(p/60*100+p%60)).slice(-4)},\"%Z\":p=>p.ki,\"%%\":()=>\"%\"};c=c.replace(/%%/g,\"\\x00\\x00\");for(n in m)c.includes(n)&&\n(c=c.replace(new RegExp(n,\"g\"),m[n](d)));c=c.replace(/\\0\\0/g,\"%\");n=gc(c);if(n.length>b)return 0;z.set(n,a>>>0);return n.length-1}for(var ic=Array(256),jc=0;256>jc;++jc)ic[jc]=String.fromCharCode(jc);cb=ic;O=g.BindingError=class extends Error{constructor(a){super(a);this.name=\"BindingError\"}};g.InternalError=class extends Error{constructor(a){super(a);this.name=\"InternalError\"}};Q.push(0,1,void 0,1,null,1,!0,1,!1,1);g.count_emval_handles=()=>Q.length/2-5-ib.length;\nvar Cf={bd:function(a,b,c){return Ob(async()=>{await g.bi(a,b,c)})},v:function(a){a=new Sa(a>>>0);0==z[a.Ih+12>>>0]&&(z[a.Ih+12>>>0]=1,Ra--);z[a.Ih+13>>>0]=0;Qa.push(a);kc(a.Nh);if(lc(I[a.Ih+4>>>2>>>0]))a=I[a.Nh>>>2>>>0];else{var b=I[a.Ih+16>>>2>>>0];a=0!==b?b:a.Nh}return a},N:()=>{X(0,0);var a=Qa.pop();mc(a.Nh);L=0},a:function(){return Za([])},m:function(a){return Za([a>>>0])},x:function(a,b){return Za([a>>>0,b>>>0])},q:function(a,b,c){return Za([a>>>0,b>>>0,c>>>0])},Bb:()=>{var a=Qa.pop();a||Ga(\"no exception to throw\");\nvar b=a.Nh;0==z[a.Ih+13>>>0]&&(Qa.push(a),z[a.Ih+13>>>0]=1,z[a.Ih+12>>>0]=0,Ra++);L=b;throw L;},s:function(a,b,c){a>>>=0;var d=new Sa(a);I[d.Ih+16>>>2>>>0]=0;I[d.Ih+4>>>2>>>0]=b>>>0;I[d.Ih+8>>>2>>>0]=c>>>0;L=a;Ra++;throw L;},fb:()=>Ra,g:function(a){L||=a>>>0;throw L;},Cb:function(){return 0},$c:function(){},Mc:function(){},Oc:function(){},Gc:function(){return 0},Zc:function(){},Uc:function(){},Yc:function(){},_b:function(){},Nc:function(){},Kc:function(){},_c:function(){},Lc:function(){},Wb:function(a,\nb,c){b=N(b>>>0);P(a>>>0,{name:b,fromWireType:d=>d,toWireType:function(d,e){if(\"bigint\"!=typeof e&&\"number\"!=typeof e)throw null===e?e=\"null\":(d=typeof e,e=\"object\"===d||\"array\"===d||\"function\"===d?e.toString():\"\"+e),new TypeError(`Cannot convert \"${e}\" to ${this.name}`);\"number\"==typeof e&&(e=BigInt(e));return e},argPackAdvance:8,readValueFromPointer:hb(b,c>>>0,-1==b.indexOf(\"u\")),Mh:null})},Ec:function(a,b,c,d){b=N(b>>>0);P(a>>>0,{name:b,fromWireType:function(e){return!!e},toWireType:function(e,\nf){return f?c:d},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(E[e>>>0])},Mh:null})},Cc:function(a){return P(a>>>0,lb)},Vb:function(a,b,c){b=N(b>>>0);P(a>>>0,{name:b,fromWireType:d=>d,toWireType:(d,e)=>e,argPackAdvance:8,readValueFromPointer:mb(b,c>>>0),Mh:null})},Aa:function(a,b,c,d,e){a>>>=0;c>>>=0;b=N(b>>>0);-1===e&&(e=4294967295);e=k=>k;if(0===d){var f=32-8*c;e=k=>k<>>f}var h=b.includes(\"unsigned\")?function(k,l){return l>>>0}:function(k,l){return l};P(a,{name:b,\nfromWireType:e,toWireType:h,argPackAdvance:8,readValueFromPointer:hb(b,c,0!==d),Mh:null})},_:function(a,b,c){function d(f){return new e(z.buffer,I[f+4>>>2>>>0],I[f>>>2>>>0])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=N(c>>>0);P(a>>>0,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},{Xh:!0})},Xb:function(a,b){b=N(b>>>0);var c=\"std::string\"===b;P(a>>>0,{name:b,fromWireType:function(d){var e=I[d>>>\n2>>>0],f=d+4;if(c)for(var h=f,k=0;k<=e;++k){var l=f+k;if(k==e||0==E[l>>>0]){h=J(h,l-h);if(void 0===m)var m=h;else m+=String.fromCharCode(0),m+=h;h=l+1}}else{m=Array(e);for(k=0;k>>0]);m=m.join(\"\")}T(d);return m},toWireType:function(d,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var f=\"string\"==typeof e;if(!(f||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array))throw new O(\"Cannot pass non-string to std::string\");var h=c&&f?bb(e):\ne.length;var k=Jb(4+h+1),l=k+4;I[k>>>2>>>0]=h;if(c&&f)M(e,E,l,h+1);else if(f)for(f=0;f>>0]=m}else for(f=0;f>>0]=e[f];null!==d&&d.push(T,k);return k},argPackAdvance:8,readValueFromPointer:kb,Mh(d){T(d)}})},Ab:function(a,b,c){b>>>=0;c>>>=0;c=N(c);if(2===b){var d=ob;var e=pb;var f=qb;var h=k=>ua[k>>>1>>>0]}else 4===b&&(d=rb,e=sb,f=tb,h=k=>I[k>>>2>>>0]);P(a>>>0,{name:c,\nfromWireType:k=>{for(var l=I[k>>>2>>>0],m,n=k+4,q=0;q<=l;++q){var r=k+4+q*b;if(q==l||0==h(r))n=d(n,r-n),void 0===m?m=n:(m+=String.fromCharCode(0),m+=n),n=r+b}T(k);return m},toWireType:(k,l)=>{if(\"string\"!=typeof l)throw new O(`Cannot pass non-string to C++ string type ${c}`);var m=f(l),n=Jb(4+m+b);I[n>>>2>>>0]=m/b;e(l,n+4,m+b);null!==k&&k.push(T,n);return n},argPackAdvance:8,readValueFromPointer:kb,Mh(k){T(k)}})},Fc:function(a,b){b=N(b>>>0);P(a>>>0,{Yh:!0,name:b,argPackAdvance:0,fromWireType:()=>\n{},toWireType:()=>{}})},ad:()=>1,kd:function(a,b,c){b>>>=0;c>>>=0;a=R(a>>>0);b=vb(b,\"emval::as\");return wb(b,c,a)},Cd:function(a){a>>>=0;return Ob(()=>{a=R(a);return a.then(S)})},ud:function(a,b,c,d){c>>>=0;d>>>=0;a=Pb[a>>>0];b=R(b>>>0);return a(null,b,c,d)},ia:function(a,b,c,d,e){c>>>=0;d>>>=0;e>>>=0;a=Pb[a>>>0];b=R(b>>>0);c=Rb(c);return a(b,b[c],d,e)},Bc:jb,qd:function(a,b){b>>>=0;a=R(a>>>0);b=R(b);return a==b},zd:function(a){a>>>=0;if(0===a)return S(Sb());a=Rb(a);return S(Sb()[a])},ha:function(a,\nb,c){b=Ub(a,b>>>0);var d=b.shift();a--;var e=\"return function (obj, func, destructorsRef, args) {\\n\",f=0,h=[];0===c&&h.push(\"obj\");for(var k=[\"retType\"],l=[d],m=0;mn.name).join(\", \")}) => ${d.name}>`;return Tb(Vb(c,a))},yd:function(a,b){b>>>=0;a=R(a>>>0);b=R(b);return S(a[b])},ba:function(a){a>>>=0;9>>0);for(var b=Array(a.length),c=0;c>>0))},Xa:function(){return S({})},vd:function(a){a>>>=0;for(var b=R(a);b.length;){var c=b.pop();b.pop()(c)}jb(a)},sd:function(a,b,c){b>>>=0;c>>>=0;\na=R(a>>>0);b=R(b);c=R(c);a[b]=c},zb:function(a,b){b>>>=0;a=vb(a>>>0,\"_emval_take_value\");a=a.readValueFromPointer(b);return S(a)},Rc:function(a,b){a=-9007199254740992>a||9007199254740992>>=0;a=new Date(1E3*a);G[b>>>2>>>0]=a.getUTCSeconds();G[b+4>>>2>>>0]=a.getUTCMinutes();G[b+8>>>2>>>0]=a.getUTCHours();G[b+12>>>2>>>0]=a.getUTCDate();G[b+16>>>2>>>0]=a.getUTCMonth();G[b+20>>>2>>>0]=a.getUTCFullYear()-1900;G[b+24>>>2>>>0]=a.getUTCDay();G[b+28>>>2>>>0]=(a.getTime()-Date.UTC(a.getUTCFullYear(),\n0,1,0,0,0,0))/864E5|0},Sc:function(a,b){a=-9007199254740992>a||9007199254740992>>=0;a=new Date(1E3*a);G[b>>>2>>>0]=a.getSeconds();G[b+4>>>2>>>0]=a.getMinutes();G[b+8>>>2>>>0]=a.getHours();G[b+12>>>2>>>0]=a.getDate();G[b+16>>>2>>>0]=a.getMonth();G[b+20>>>2>>>0]=a.getFullYear()-1900;G[b+24>>>2>>>0]=a.getDay();G[b+28>>>2>>>0]=(W(a.getFullYear())?Xb:Yb)[a.getMonth()]+a.getDate()-1|0;G[b+36>>>2>>>0]=-(60*a.getTimezoneOffset());var c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset(),\nd=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();G[b+32>>>2>>>0]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},Tc:function(a){a>>>=0;var b=new Date(G[a+20>>>2>>>0]+1900,G[a+16>>>2>>>0],G[a+12>>>2>>>0],G[a+8>>>2>>>0],G[a+4>>>2>>>0],G[a>>>2>>>0],0),c=G[a+32>>>2>>>0],d=b.getTimezoneOffset(),e=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),f=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),h=Math.min(f,e);0>c?G[a+32>>>2>>>0]=Number(e!=f&&h==d):0>>2>>>0]=b.getDay();G[a+28>>>2>>>0]=(W(b.getFullYear())?Xb:Yb)[b.getMonth()]+b.getDate()-1|0;G[a>>>2>>>0]=b.getSeconds();G[a+4>>>2>>>0]=b.getMinutes();G[a+8>>>2>>>0]=b.getHours();G[a+12>>>2>>>0]=b.getDate();G[a+16>>>2>>>0]=b.getMonth();G[a+20>>>2>>>0]=b.getYear();a=b.getTime();return BigInt(isNaN(a)?-1:a/1E3)},Pc:function(){return-52},Qc:function(){},Ic:function(a,b,c,d){c>>>=0;d>>>=0;var e=(new Date).getFullYear(),f=new Date(e,0,1),h=new Date(e,6,1);e=f.getTimezoneOffset();\nvar k=h.getTimezoneOffset();I[a>>>0>>>2>>>0]=60*Math.max(e,k);G[b>>>0>>>2>>>0]=Number(e!=k);a=l=>l.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:\"short\"}).split(\" \")[1];f=a(f);h=a(h);k{Ga(\"\")},A:function(a,b,c){a>>>=0;b=$b(b>>>0,c>>>0);return Oa[a](...b)},bc:function(a,b,c){a>>>=0;b=$b(b>>>0,c>>>0);return Oa[a](...b)},$b:()=>Date.now(),Jc:function(){return 4294901760},ga:()=>performance.now(),Hc:function(a){a>>>=0;var b=E.length;if(4294901760<\na)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);var e=Math;d=Math.max(a,d);a:{e=(e.min.call(e,4294901760,d+(65536-d%65536)%65536)-ra.buffer.byteLength+65535)/65536;try{ra.grow(e);za();var f=1;break a}catch(h){}f=void 0}if(f)return!0}return!1},Wc:function(a,b){a>>>=0;b>>>=0;var c=0;cc().forEach((d,e)=>{var f=b+c;e=I[a+4*e>>>2>>>0]=f;for(f=0;f>>0]=d.charCodeAt(f);z[e>>>0]=0;c+=d.length+1});return 0},Xc:function(a,b){a>>>=0;b>>>=0;var c=cc();I[a>>>2>>>\n0]=c.length;var d=0;c.forEach(e=>d+=e.length+1);I[b>>>2>>>0]=d;return 0},Db:()=>52,Zb:function(){return 52},Vc:function(){return 70},Yb:function(a,b,c,d){b>>>=0;c>>>=0;d>>>=0;for(var e=0,f=0;f>>2>>>0],k=I[b+4>>>2>>>0];b+=8;for(var l=0;l>>0],n=dc[a];0===m||10===m?((1===a?qa:w)(ab(n,0)),n.length=0):n.push(m)}e+=k}I[d>>>2>>>0]=e;return 0},xb:nc,cd:oc,ua:pc,W:qc,$:rc,ra:sc,ta:tc,dd:uc,ob:vc,P:wc,z:xc,b:yc,Ub:zc,ya:Ac,e:Bc,kb:Cc,h:Dc,X:Ec,i:Fc,ed:Gc,j:Hc,t:Ic,r:Jc,\no:Kc,Wa:Lc,Ca:Mc,ma:Nc,Qb:Oc,db:Pc,Ib:Qc,mb:Rc,kc:Sc,xc:Tc,hc:Uc,ic:Vc,ac:Wc,oa:Xc,yb:Yc,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)try{return g.instantiateWasm(b,a)}catch(c){w(`Module.instantiateWasm callback failed with error: ${c}`),ba(c)}Na(b,function(c){a(c.instance)}).catch(ba);return{}}(),ub=a=>(ub=U.Fd)(a);g._OrtInit=(a,b)=>(g._OrtInit=U.Gd)(a,b);g._OrtGetLastError=(a,b)=>(g._OrtGetLastError=U.Hd)(a,b);\ng._OrtCreateSessionOptions=(a,b,c,d,e,f,h,k,l,m)=>(g._OrtCreateSessionOptions=U.Id)(a,b,c,d,e,f,h,k,l,m);g._OrtAppendExecutionProvider=(a,b)=>(g._OrtAppendExecutionProvider=U.Jd)(a,b);g._OrtAddFreeDimensionOverride=(a,b,c)=>(g._OrtAddFreeDimensionOverride=U.Kd)(a,b,c);g._OrtAddSessionConfigEntry=(a,b,c)=>(g._OrtAddSessionConfigEntry=U.Ld)(a,b,c);g._OrtReleaseSessionOptions=a=>(g._OrtReleaseSessionOptions=U.Md)(a);g._OrtCreateSession=(a,b,c)=>(g._OrtCreateSession=U.Nd)(a,b,c);\ng._OrtReleaseSession=a=>(g._OrtReleaseSession=U.Od)(a);g._OrtGetInputOutputCount=(a,b,c)=>(g._OrtGetInputOutputCount=U.Pd)(a,b,c);g._OrtGetInputName=(a,b)=>(g._OrtGetInputName=U.Qd)(a,b);g._OrtGetOutputName=(a,b)=>(g._OrtGetOutputName=U.Rd)(a,b);g._OrtFree=a=>(g._OrtFree=U.Sd)(a);g._OrtCreateTensor=(a,b,c,d,e,f)=>(g._OrtCreateTensor=U.Td)(a,b,c,d,e,f);g._OrtGetTensorData=(a,b,c,d,e)=>(g._OrtGetTensorData=U.Ud)(a,b,c,d,e);g._OrtReleaseTensor=a=>(g._OrtReleaseTensor=U.Vd)(a);\ng._OrtCreateRunOptions=(a,b,c,d)=>(g._OrtCreateRunOptions=U.Wd)(a,b,c,d);g._OrtAddRunConfigEntry=(a,b,c)=>(g._OrtAddRunConfigEntry=U.Xd)(a,b,c);g._OrtReleaseRunOptions=a=>(g._OrtReleaseRunOptions=U.Yd)(a);g._OrtCreateBinding=a=>(g._OrtCreateBinding=U.Zd)(a);g._OrtBindInput=(a,b,c)=>(g._OrtBindInput=U._d)(a,b,c);g._OrtBindOutput=(a,b,c,d)=>(g._OrtBindOutput=U.$d)(a,b,c,d);g._OrtClearBoundOutputs=a=>(g._OrtClearBoundOutputs=U.ae)(a);g._OrtReleaseBinding=a=>(g._OrtReleaseBinding=U.be)(a);\ng._OrtRunWithBinding=(a,b,c,d,e)=>(g._OrtRunWithBinding=U.ce)(a,b,c,d,e);g._OrtRun=(a,b,c,d,e,f,h,k)=>(g._OrtRun=U.de)(a,b,c,d,e,f,h,k);g._OrtEndProfiling=a=>(g._OrtEndProfiling=U.ee)(a);g._JsepOutput=(a,b,c)=>(g._JsepOutput=U.fe)(a,b,c);g._JsepGetNodeName=a=>(g._JsepGetNodeName=U.ge)(a);\nvar Jb=g._malloc=a=>(Jb=g._malloc=U.he)(a),T=g._free=a=>(T=g._free=U.ie)(a),X=(a,b)=>(X=U.ke)(a,b),Ta=a=>(Ta=U.le)(a),Y=a=>(Y=U.me)(a),Ef=a=>(Ef=U.ne)(a),Z=()=>(Z=U.oe)(),mc=a=>(mc=U.pe)(a),kc=a=>(kc=U.qe)(a),Ua=(a,b,c)=>(Ua=U.re)(a,b,c),lc=a=>(lc=U.se)(a),dynCall_vii=g.dynCall_vii=(a,b,c)=>(dynCall_vii=g.dynCall_vii=U.te)(a,b,c),Ff=g.dynCall_iiii=(a,b,c,d)=>(Ff=g.dynCall_iiii=U.ue)(a,b,c,d),dynCall_iii=g.dynCall_iii=(a,b,c)=>(dynCall_iii=g.dynCall_iii=U.ve)(a,b,c),Gf=g.dynCall_ii=(a,b)=>(Gf=g.dynCall_ii=\nU.we)(a,b),Hf=g.dynCall_iiiiiii=(a,b,c,d,e,f,h)=>(Hf=g.dynCall_iiiiiii=U.xe)(a,b,c,d,e,f,h),dynCall_vi=g.dynCall_vi=(a,b)=>(dynCall_vi=g.dynCall_vi=U.ye)(a,b),dynCall_v=g.dynCall_v=a=>(dynCall_v=g.dynCall_v=U.ze)(a),If=g.dynCall_iiiiii=(a,b,c,d,e,f)=>(If=g.dynCall_iiiiii=U.Ae)(a,b,c,d,e,f),Jf=g.dynCall_iiij=(a,b,c,d)=>(Jf=g.dynCall_iiij=U.Be)(a,b,c,d),Kf=g.dynCall_iiiii=(a,b,c,d,e)=>(Kf=g.dynCall_iiiii=U.Ce)(a,b,c,d,e),Lf=g.dynCall_viii=(a,b,c,d)=>(Lf=g.dynCall_viii=U.De)(a,b,c,d),Mf=g.dynCall_viiiii=\n(a,b,c,d,e,f)=>(Mf=g.dynCall_viiiii=U.Ee)(a,b,c,d,e,f),Nf=g.dynCall_viiii=(a,b,c,d,e)=>(Nf=g.dynCall_viiii=U.Fe)(a,b,c,d,e),Of=g.dynCall_viiiiii=(a,b,c,d,e,f,h)=>(Of=g.dynCall_viiiiii=U.Ge)(a,b,c,d,e,f,h),Pf=g.dynCall_viiji=(a,b,c,d,e)=>(Pf=g.dynCall_viiji=U.He)(a,b,c,d,e),Qf=g.dynCall_viiiiiiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q)=>(Qf=g.dynCall_viiiiiiiiiii=U.Ie)(a,b,c,d,e,f,h,k,l,m,n,q),Rf=g.dynCall_viiijjjii=(a,b,c,d,e,f,h,k,l)=>(Rf=g.dynCall_viiijjjii=U.Je)(a,b,c,d,e,f,h,k,l),Sf=g.dynCall_iid=(a,b,c)=>\n(Sf=g.dynCall_iid=U.Ke)(a,b,c),Tf=g.dynCall_iif=(a,b,c)=>(Tf=g.dynCall_iif=U.Le)(a,b,c),Uf=g.dynCall_iij=(a,b,c)=>(Uf=g.dynCall_iij=U.Me)(a,b,c),Vf=g.dynCall_jii=(a,b,c)=>(Vf=g.dynCall_jii=U.Ne)(a,b,c),Wf=g.dynCall_i=a=>(Wf=g.dynCall_i=U.Oe)(a),Xf=g.dynCall_viiiiiiii=(a,b,c,d,e,f,h,k,l)=>(Xf=g.dynCall_viiiiiiii=U.Pe)(a,b,c,d,e,f,h,k,l),Yf=g.dynCall_viiiiij=(a,b,c,d,e,f,h)=>(Yf=g.dynCall_viiiiij=U.Qe)(a,b,c,d,e,f,h),Zf=g.dynCall_ji=(a,b)=>(Zf=g.dynCall_ji=U.Re)(a,b),$f=g.dynCall_viij=(a,b,c,d)=>($f=\ng.dynCall_viij=U.Se)(a,b,c,d),ag=g.dynCall_iiiiiiiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q)=>(ag=g.dynCall_iiiiiiiiiiii=U.Te)(a,b,c,d,e,f,h,k,l,m,n,q),bg=g.dynCall_viiiiiiiii=(a,b,c,d,e,f,h,k,l,m)=>(bg=g.dynCall_viiiiiiiii=U.Ue)(a,b,c,d,e,f,h,k,l,m),cg=g.dynCall_ij=(a,b)=>(cg=g.dynCall_ij=U.Ve)(a,b),dg=g.dynCall_iiiiij=(a,b,c,d,e,f)=>(dg=g.dynCall_iiiiij=U.We)(a,b,c,d,e,f),eg=g.dynCall_j=a=>(eg=g.dynCall_j=U.Xe)(a),fg=g.dynCall_vij=(a,b,c)=>(fg=g.dynCall_vij=U.Ye)(a,b,c),gg=g.dynCall_viijjjiiiiii=(a,b,c,d,\ne,f,h,k,l,m,n,q)=>(gg=g.dynCall_viijjjiiiiii=U.Ze)(a,b,c,d,e,f,h,k,l,m,n,q),hg=g.dynCall_viiijiiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q)=>(hg=g.dynCall_viiijiiiiiii=U._e)(a,b,c,d,e,f,h,k,l,m,n,q),ig=g.dynCall_iiiiiiii=(a,b,c,d,e,f,h,k)=>(ig=g.dynCall_iiiiiiii=U.$e)(a,b,c,d,e,f,h,k),jg=g.dynCall_viiiiiii=(a,b,c,d,e,f,h,k)=>(jg=g.dynCall_viiiiiii=U.af)(a,b,c,d,e,f,h,k),kg=g.dynCall_iiiiiiiij=(a,b,c,d,e,f,h,k,l)=>(kg=g.dynCall_iiiiiiiij=U.bf)(a,b,c,d,e,f,h,k,l),lg=g.dynCall_viiiiiiiiiiiii=(a,b,c,d,e,f,h,k,l,\nm,n,q,r,p)=>(lg=g.dynCall_viiiiiiiiiiiii=U.cf)(a,b,c,d,e,f,h,k,l,m,n,q,r,p),mg=g.dynCall_iiiiiiiii=(a,b,c,d,e,f,h,k,l)=>(mg=g.dynCall_iiiiiiiii=U.df)(a,b,c,d,e,f,h,k,l),ng=g.dynCall_iiiiijiiiii=(a,b,c,d,e,f,h,k,l,m,n)=>(ng=g.dynCall_iiiiijiiiii=U.ef)(a,b,c,d,e,f,h,k,l,m,n),og=g.dynCall_vijjjiiij=(a,b,c,d,e,f,h,k,l)=>(og=g.dynCall_vijjjiiij=U.ff)(a,b,c,d,e,f,h,k,l),pg=g.dynCall_fi=(a,b)=>(pg=g.dynCall_fi=U.gf)(a,b),qg=g.dynCall_fii=(a,b,c)=>(qg=g.dynCall_fii=U.hf)(a,b,c),rg=g.dynCall_di=(a,b)=>(rg=\ng.dynCall_di=U.jf)(a,b),sg=g.dynCall_dii=(a,b,c)=>(sg=g.dynCall_dii=U.kf)(a,b,c),tg=g.dynCall_vijj=(a,b,c,d)=>(tg=g.dynCall_vijj=U.lf)(a,b,c,d),ug=g.dynCall_iiiiiiiiii=(a,b,c,d,e,f,h,k,l,m)=>(ug=g.dynCall_iiiiiiiiii=U.mf)(a,b,c,d,e,f,h,k,l,m),vg=g.dynCall_viijiii=(a,b,c,d,e,f,h)=>(vg=g.dynCall_viijiii=U.nf)(a,b,c,d,e,f,h),wg=g.dynCall_viid=(a,b,c,d)=>(wg=g.dynCall_viid=U.of)(a,b,c,d),xg=g.dynCall_viffiii=(a,b,c,d,e,f,h)=>(xg=g.dynCall_viffiii=U.pf)(a,b,c,d,e,f,h),yg=g.dynCall_viifiii=(a,b,c,d,e,f,\nh)=>(yg=g.dynCall_viifiii=U.qf)(a,b,c,d,e,f,h),zg=g.dynCall_viiiiidiidi=(a,b,c,d,e,f,h,k,l,m,n)=>(zg=g.dynCall_viiiiidiidi=U.rf)(a,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.dynCall_vijjiiiiii=U.Pf)(a,b,c,d,e,f,h,k,l,m),Yg=g.dynCall_iiiijjj=(a,b,c,d,e,f,h)=>(Yg=g.dynCall_iiiijjj=U.Qf)(a,b,c,d,e,f,h),Zg=g.dynCall_viiiiiiiiii=(a,b,c,d,e,f,h,k,l,m,\nn)=>(Zg=g.dynCall_viiiiiiiiii=U.Rf)(a,b,c,d,e,f,h,k,l,m,n),$g=g.dynCall_iiijjj=(a,b,c,d,e,f)=>($g=g.dynCall_iiijjj=U.Sf)(a,b,c,d,e,f),ah=g.dynCall_fffffff=(a,b,c,d,e,f,h)=>(ah=g.dynCall_fffffff=U.Tf)(a,b,c,d,e,f,h),bh=g.dynCall_viiiij=(a,b,c,d,e,f)=>(bh=g.dynCall_viiiij=U.Uf)(a,b,c,d,e,f),ch=g.dynCall_viiiiiijiifiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p)=>(ch=g.dynCall_viiiiiijiifiii=U.Vf)(a,b,c,d,e,f,h,k,l,m,n,q,r,p),dh=g.dynCall_vjjjjjjffjifiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B)=>(dh=g.dynCall_vjjjjjjffjifiiiiii=\nU.Wf)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B),eh=g.dynCall_viiiiiiffjifiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A)=>(eh=g.dynCall_viiiiiiffjifiiiii=U.Xf)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A),fh=g.dynCall_viiiiiiffjfiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)=>(fh=g.dynCall_viiiiiiffjfiiiii=U.Yf)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y),gh=g.dynCall_viiiiiiffjiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)=>(gh=g.dynCall_viiiiiiffjiiiii=U.Zf)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u),hh=g.dynCall_vjjjjjjjjfffiiifiiiii=(a,b,c,d,e,f,h,k,l,\nm,n,q,r,p,u,y,A,B,C,D,F)=>(hh=g.dynCall_vjjjjjjjjfffiiifiiiii=U._f)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F),ih=g.dynCall_vjjjjjjfffifijiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C)=>(ih=g.dynCall_vjjjjjjfffifijiiiii=U.$f)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C),jh=g.dynCall_vjjjjjjfffifiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B)=>(jh=g.dynCall_vjjjjjjfffifiiiiii=U.ag)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B),kh=g.dynCall_vjjjjjjjjfffjifiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F)=>(kh=g.dynCall_vjjjjjjjjfffjifiiiiii=\nU.bg)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F),lh=g.dynCall_vijiiiiiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r)=>(lh=g.dynCall_vijiiiiiiiiii=U.cg)(a,b,c,d,e,f,h,k,l,m,n,q,r),mh=g.dynCall_vijjfffiii=(a,b,c,d,e,f,h,k,l,m)=>(mh=g.dynCall_vijjfffiii=U.dg)(a,b,c,d,e,f,h,k,l,m),nh=g.dynCall_viiiiiiijiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r)=>(nh=g.dynCall_viiiiiiijiiii=U.eg)(a,b,c,d,e,f,h,k,l,m,n,q,r),oh=g.dynCall_vijjjjjjifiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)=>(oh=g.dynCall_vijjjjjjifiiiii=U.fg)(a,b,c,d,e,f,h,k,l,m,n,\nq,r,p,u),ph=g.dynCall_viifi=(a,b,c,d,e)=>(ph=g.dynCall_viifi=U.gg)(a,b,c,d,e),qh=g.dynCall_vjjjjjiiii=(a,b,c,d,e,f,h,k,l,m)=>(qh=g.dynCall_vjjjjjiiii=U.hg)(a,b,c,d,e,f,h,k,l,m),rh=g.dynCall_vjjjjfiii=(a,b,c,d,e,f,h,k,l)=>(rh=g.dynCall_vjjjjfiii=U.ig)(a,b,c,d,e,f,h,k,l),sh=g.dynCall_viiiiiijiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p)=>(sh=g.dynCall_viiiiiijiiiiii=U.jg)(a,b,c,d,e,f,h,k,l,m,n,q,r,p),th=g.dynCall_vijjii=(a,b,c,d,e,f)=>(th=g.dynCall_vijjii=U.kg)(a,b,c,d,e,f),uh=g.dynCall_viiiiijjiiiii=(a,b,c,\nd,e,f,h,k,l,m,n,q,r)=>(uh=g.dynCall_viiiiijjiiiii=U.lg)(a,b,c,d,e,f,h,k,l,m,n,q,r),vh=g.dynCall_iiiiiji=(a,b,c,d,e,f,h)=>(vh=g.dynCall_iiiiiji=U.mg)(a,b,c,d,e,f,h),wh=g.dynCall_iiiiji=(a,b,c,d,e,f)=>(wh=g.dynCall_iiiiji=U.ng)(a,b,c,d,e,f),xh=g.dynCall_viiiiijiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r)=>(xh=g.dynCall_viiiiijiiiiii=U.og)(a,b,c,d,e,f,h,k,l,m,n,q,r),yh=g.dynCall_viiijiiiiii=(a,b,c,d,e,f,h,k,l,m,n)=>(yh=g.dynCall_viiijiiiiii=U.pg)(a,b,c,d,e,f,h,k,l,m,n),zh=g.dynCall_viijj=(a,b,c,d,e)=>(zh=g.dynCall_viijj=\nU.qg)(a,b,c,d,e),Ah=g.dynCall_viiiijii=(a,b,c,d,e,f,h,k)=>(Ah=g.dynCall_viiiijii=U.rg)(a,b,c,d,e,f,h,k),Bh=g.dynCall_viijjiii=(a,b,c,d,e,f,h,k)=>(Bh=g.dynCall_viijjiii=U.sg)(a,b,c,d,e,f,h,k),Ch=g.dynCall_ijii=(a,b,c,d)=>(Ch=g.dynCall_ijii=U.tg)(a,b,c,d),Dh=g.dynCall_viiiiijjji=(a,b,c,d,e,f,h,k,l,m)=>(Dh=g.dynCall_viiiiijjji=U.ug)(a,b,c,d,e,f,h,k,l,m),Eh=g.dynCall_vijjjjiij=(a,b,c,d,e,f,h,k,l)=>(Eh=g.dynCall_vijjjjiij=U.vg)(a,b,c,d,e,f,h,k,l),Fh=g.dynCall_viiiiijij=(a,b,c,d,e,f,h,k,l)=>(Fh=g.dynCall_viiiiijij=\nU.wg)(a,b,c,d,e,f,h,k,l),Gh=g.dynCall_viiiiiijij=(a,b,c,d,e,f,h,k,l,m)=>(Gh=g.dynCall_viiiiiijij=U.xg)(a,b,c,d,e,f,h,k,l,m),Hh=g.dynCall_vijiii=(a,b,c,d,e,f)=>(Hh=g.dynCall_vijiii=U.yg)(a,b,c,d,e,f),Ih=g.dynCall_viiiiiiiiifi=(a,b,c,d,e,f,h,k,l,m,n,q)=>(Ih=g.dynCall_viiiiiiiiifi=U.zg)(a,b,c,d,e,f,h,k,l,m,n,q),Jh=g.dynCall_iiijiiii=(a,b,c,d,e,f,h,k)=>(Jh=g.dynCall_iiijiiii=U.Ag)(a,b,c,d,e,f,h,k),Kh=g.dynCall_viiiiiijjiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p)=>(Kh=g.dynCall_viiiiiijjiiiii=U.Bg)(a,b,c,d,e,\nf,h,k,l,m,n,q,r,p),Lh=g.dynCall_viiiiiiijiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)=>(Lh=g.dynCall_viiiiiiijiiiiii=U.Cg)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u),Mh=g.dynCall_vif=(a,b,c)=>(Mh=g.dynCall_vif=U.Dg)(a,b,c),Nh=g.dynCall_viif=(a,b,c,d)=>(Nh=g.dynCall_viif=U.Eg)(a,b,c,d),Oh=g.dynCall_fiii=(a,b,c,d)=>(Oh=g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,u,y,A,B,C,D),gi=g.dynCall_viiif=\n(a,b,c,d,e)=>(gi=g.dynCall_viiif=U.Yg)(a,b,c,d,e),hi=g.dynCall_viiijiiiii=(a,b,c,d,e,f,h,k,l,m)=>(hi=g.dynCall_viiijiiiii=U.Zg)(a,b,c,d,e,f,h,k,l,m),ii=g.dynCall_viiij=(a,b,c,d,e)=>(ii=g.dynCall_viiij=U._g)(a,b,c,d,e),ji=g.dynCall_iijjj=(a,b,c,d,e)=>(ji=g.dynCall_iijjj=U.$g)(a,b,c,d,e),ki=g.dynCall_viiiiji=(a,b,c,d,e,f,h)=>(ki=g.dynCall_viiiiji=U.ah)(a,b,c,d,e,f,h),li=g.dynCall_iijjji=(a,b,c,d,e,f)=>(li=g.dynCall_iijjji=U.bh)(a,b,c,d,e,f),mi=g.dynCall_ijijji=(a,b,c,d,e,f)=>(mi=g.dynCall_ijijji=U.ch)(a,\nb,c,d,e,f),ni=g.dynCall_viiijjiii=(a,b,c,d,e,f,h,k,l)=>(ni=g.dynCall_viiijjiii=U.dh)(a,b,c,d,e,f,h,k,l),oi=g.dynCall_iiiiijji=(a,b,c,d,e,f,h,k)=>(oi=g.dynCall_iiiiijji=U.eh)(a,b,c,d,e,f,h,k),pi=g.dynCall_iiiifi=(a,b,c,d,e,f)=>(pi=g.dynCall_iiiifi=U.fh)(a,b,c,d,e,f),qi=g.dynCall_iiijii=(a,b,c,d,e,f)=>(qi=g.dynCall_iiijii=U.gh)(a,b,c,d,e,f),ri=g.dynCall_iiiiiiiiijii=(a,b,c,d,e,f,h,k,l,m,n,q)=>(ri=g.dynCall_iiiiiiiiijii=U.hh)(a,b,c,d,e,f,h,k,l,m,n,q),si=g.dynCall_iiiijjii=(a,b,c,d,e,f,h,k)=>(si=g.dynCall_iiiijjii=\nU.ih)(a,b,c,d,e,f,h,k),ti=g.dynCall_iiiiiijjjii=(a,b,c,d,e,f,h,k,l,m,n)=>(ti=g.dynCall_iiiiiijjjii=U.jh)(a,b,c,d,e,f,h,k,l,m,n),ui=g.dynCall_iiijiii=(a,b,c,d,e,f,h)=>(ui=g.dynCall_iiijiii=U.kh)(a,b,c,d,e,f,h),vi=g.dynCall_iiiiiiiijjjfi=(a,b,c,d,e,f,h,k,l,m,n,q,r)=>(vi=g.dynCall_iiiiiiiijjjfi=U.lh)(a,b,c,d,e,f,h,k,l,m,n,q,r),wi=g.dynCall_iijiiii=(a,b,c,d,e,f,h)=>(wi=g.dynCall_iijiiii=U.mh)(a,b,c,d,e,f,h),xi=g.dynCall_iijjjii=(a,b,c,d,e,f,h)=>(xi=g.dynCall_iijjjii=U.nh)(a,b,c,d,e,f,h),yi=g.dynCall_jij=\n(a,b,c)=>(yi=g.dynCall_jij=U.oh)(a,b,c),zi=g.dynCall_iiji=(a,b,c,d)=>(zi=g.dynCall_iiji=U.ph)(a,b,c,d),Ai=g.dynCall_iiif=(a,b,c,d)=>(Ai=g.dynCall_iiif=U.qh)(a,b,c,d),Bi=g.dynCall_vidi=(a,b,c,d)=>(Bi=g.dynCall_vidi=U.rh)(a,b,c,d),Ci=g.dynCall_vjiii=(a,b,c,d,e)=>(Ci=g.dynCall_vjiii=U.sh)(a,b,c,d,e),Di=g.dynCall_diiii=(a,b,c,d,e)=>(Di=g.dynCall_diiii=U.th)(a,b,c,d,e),Ei=g.dynCall_diiiii=(a,b,c,d,e,f)=>(Ei=g.dynCall_diiiii=U.uh)(a,b,c,d,e,f),Fi=g.dynCall_viiijjiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q)=>(Fi=g.dynCall_viiijjiiiiii=\nU.vh)(a,b,c,d,e,f,h,k,l,m,n,q),Gi=g.dynCall_viijjijjjjiii=(a,b,c,d,e,f,h,k,l,m,n,q,r)=>(Gi=g.dynCall_viijjijjjjiii=U.wh)(a,b,c,d,e,f,h,k,l,m,n,q,r),Hi=g.dynCall_iiiij=(a,b,c,d,e)=>(Hi=g.dynCall_iiiij=U.xh)(a,b,c,d,e),Ii=g.dynCall_viiijii=(a,b,c,d,e,f,h)=>(Ii=g.dynCall_viiijii=U.yh)(a,b,c,d,e,f,h),Ji=g.dynCall_viijiiiiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r)=>(Ji=g.dynCall_viijiiiiiiiii=U.zh)(a,b,c,d,e,f,h,k,l,m,n,q,r),Ki=g.dynCall_fiiii=(a,b,c,d,e)=>(Ki=g.dynCall_fiiii=U.Ah)(a,b,c,d,e),Li=g.dynCall_jfi=\n(a,b,c)=>(Li=g.dynCall_jfi=U.Bh)(a,b,c),Mi=g.dynCall_viiiiiiiiiiiiii=(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)=>(Mi=g.dynCall_viiiiiiiiiiiiii=U.Ch)(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u),Ni=g.dynCall_jiij=(a,b,c,d)=>(Ni=g.dynCall_jiij=U.Dh)(a,b,c,d),Mb=a=>(Mb=U.Eh)(a),Bb=()=>(Bb=U.Fh)(),Lb=a=>(Lb=U.Gh)(a),Nb=()=>(Nb=U.Hh)();g.___start_em_js=1275044;g.___stop_em_js=1275205;function Dc(a,b,c,d){var e=Z();try{return Ff(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}\nfunction Bc(a,b,c){var d=Z();try{return dynCall_iii(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function Jd(a,b,c){var d=Z();try{dynCall_vii(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function yc(a,b){var c=Z();try{return Gf(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0)}}function Fd(a,b){var c=Z();try{dynCall_vi(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0)}}function dd(a,b,c,d){var e=Z();try{return Jf(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}\nfunction Dd(a){var b=Z();try{dynCall_v(a)}catch(c){Y(b);if(c!==c+0)throw c;X(1,0)}}function Ic(a,b,c,d,e,f,h){var k=Z();try{return Hf(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Hc(a,b,c,d,e,f){var h=Z();try{return If(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Fc(a,b,c,d,e){var f=Z();try{return Kf(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Qd(a,b,c,d){var e=Z();try{Lf(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}\nfunction Td(a,b,c,d,e){var f=Z();try{Nf(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Vd(a,b,c,d,e,f){var h=Z();try{Mf(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Zd(a,b,c,d,e,f,h){var k=Z();try{Of(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function ke(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{Qf(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}function zc(a,b,c){var d=Z();try{return Sf(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}\nfunction Ac(a,b,c){var d=Z();try{return Tf(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function md(a,b,c){var d=Z();try{return Uf(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function yd(a,b,c){var d=Z();try{return Vf(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0);return 0n}}function ee(a,b,c,d,e,f,h,k,l){var m=Z();try{Xf(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}function xc(a){var b=Z();try{return Wf(a)}catch(c){Y(b);if(c!==c+0)throw c;X(1,0)}}\nfunction df(a,b,c){var d=Z();try{fg(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function We(a,b,c,d,e){var f=Z();try{Pf(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Ce(a,b,c,d,e,f,h){var k=Z();try{Yf(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function cf(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{gg(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}\nfunction Re(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{hg(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}function Jc(a,b,c,d,e,f,h,k){var l=Z();try{return ig(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function de(a,b,c,d,e,f,h,k){var l=Z();try{jg(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function Nc(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{return ag(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}\nfunction fe(a,b,c,d,e,f,h,k,l,m){var n=Z();try{bg(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function me(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{lg(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}function Yc(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{return ng(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}function Kc(a,b,c,d,e,f,h,k,l){var m=Z();try{return mg(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}\nfunction nf(a,b,c,d,e,f,h,k,l){var m=Z();try{og(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}function Ve(a,b,c,d){var e=Z();try{$f(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function tc(a,b){var c=Z();try{return pg(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0)}}function xd(a,b){var c=Z();try{return Zf(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0);return 0n}}function nc(a,b){var c=Z();try{return rg(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0)}}\nfunction jf(a,b,c,d){var e=Z();try{tg(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function Oe(a,b,c,d,e,f,h){var k=Z();try{Ii(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Ze(a,b,c,d,e){var f=Z();try{zh(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Lc(a,b,c,d,e,f,h,k,l,m){var n=Z();try{return ug(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function Xe(a,b,c,d,e,f,h){var k=Z();try{vg(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}\nfunction Kd(a,b,c,d){var e=Z();try{wg(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function Tc(a,b,c,d,e,f,h,k,l){var m=Z();try{return kg(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}function Id(a,b,c,d,e,f,h){var k=Z();try{xg(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Ue(a,b,c,d,e,f,h,k,l){var m=Z();try{Rf(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}\nfunction Pd(a,b,c,d,e,f,h){var k=Z();try{yg(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Wd(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{zg(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}function zd(a,b,c,d){var e=Z();try{return Bg(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0);return 0n}}function uf(a,b,c,d,e,f,h,k){var l=Z();try{Cg(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}\nfunction Rd(a,b,c,d,e){var f=Z();try{Dg(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function ef(a,b,c,d){var e=Z();try{Fg(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function rf(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y){var A=Z();try{Gg(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)}catch(B){Y(A);if(B!==B+0)throw B;X(1,0)}}function Ne(a,b,c,d,e,f){var h=Z();try{Hg(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}\nfunction of(a,b,c,d,e,f,h,k,l){var m=Z();try{Ig(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}function ed(a,b,c,d,e){var f=Z();try{return Jg(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function kd(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{return Kg(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}function sf(a,b){var c=Z();try{Lg(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0)}}\nfunction Cd(a,b,c){var d=Z();try{return Mg(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0);return 0n}}function jd(a,b,c,d,e,f,h,k,l,m){var n=Z();try{return Ng(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function ie(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{Sg(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}function Ed(a,b,c,d,e){var f=Z();try{Og(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}\nfunction Ud(a,b,c,d,e,f,h){var k=Z();try{Pg(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Md(a,b,c,d,e){var f=Z();try{Rg(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Xd(a,b,c,d,e,f,h,k){var l=Z();try{Qg(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function ue(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{Tg(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}\nfunction Oc(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A){var B=Z();try{return Ug(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A)}catch(C){Y(B);if(C!==C+0)throw C;X(1,0)}}function le(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{Vg(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function sd(a,b){var c=Z();try{return cg(a,b)}catch(d){Y(c);if(d!==d+0)throw d;X(1,0)}}function wc(a,b,c,d,e){var f=Z();try{return Ki(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}\nfunction Pc(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D){var F=Z();try{return Wg(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D)}catch(H){Y(F);if(H!==H+0)throw H;X(1,0)}}function mf(a,b,c,d,e,f,h,k,l,m){var n=Z();try{Xg(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function cd(a,b,c,d,e,f,h){var k=Z();try{return Yg(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function je(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{Zg(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}\nfunction ld(a,b,c,d,e,f){var h=Z();try{return $g(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Ie(a,b,c,d,e,f){var h=Z();try{bh(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function ye(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{ch(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}function zf(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B){var C=Z();try{dh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B)}catch(D){Y(C);if(D!==D+0)throw D;X(1,0)}}\nfunction ae(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A){var B=Z();try{eh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A)}catch(C){Y(B);if(C!==C+0)throw C;X(1,0)}}function $d(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y){var A=Z();try{fh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)}catch(B){Y(A);if(B!==B+0)throw B;X(1,0)}}function be(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u){var y=Z();try{gh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)}catch(A){Y(y);if(A!==A+0)throw A;X(1,0)}}\nfunction Af(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F){var H=Z();try{hh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F)}catch(K){Y(H);if(K!==K+0)throw K;X(1,0)}}function yf(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C){var D=Z();try{ih(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C)}catch(F){Y(D);if(F!==F+0)throw F;X(1,0)}}function xf(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B){var C=Z();try{jh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B)}catch(D){Y(C);if(D!==D+0)throw D;X(1,0)}}\nfunction Bf(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F){var H=Z();try{kh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F)}catch(K){Y(H);if(K!==K+0)throw K;X(1,0)}}function gf(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{lh(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function kf(a,b,c,d,e,f,h,k,l,m){var n=Z();try{mh(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}\nfunction ve(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{nh(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function qf(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u){var y=Z();try{oh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)}catch(A){Y(y);if(A!==A+0)throw A;X(1,0)}}function wf(a,b,c,d,e,f,h,k,l,m){var n=Z();try{qh(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function vf(a,b,c,d,e,f,h,k,l){var m=Z();try{rh(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}\nfunction sc(a,b,c,d,e,f,h){var k=Z();try{return ah(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Nd(a,b,c,d,e){var f=Z();try{ph(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function wd(a,b,c){var d=Z();try{return Li(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0);return 0n}}function ze(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{sh(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}\nfunction Ge(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{uh(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function Xc(a,b,c,d,e,f,h){var k=Z();try{return vh(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function ad(a,b,c,d,e,f){var h=Z();try{return wh(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function De(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{xh(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}\nfunction lf(a,b,c,d,e,f){var h=Z();try{th(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Qe(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{yh(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}function Ke(a,b,c,d,e,f,h,k){var l=Z();try{Ah(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function af(a,b,c,d,e,f,h,k){var l=Z();try{Bh(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}\nfunction td(a,b,c,d){var e=Z();try{return Ch(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function He(a,b,c,d,e,f,h,k,l,m){var n=Z();try{Dh(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function pf(a,b,c,d,e,f,h,k,l){var m=Z();try{Eh(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}function Fe(a,b,c,d,e,f,h,k,l){var m=Z();try{Fh(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}\nfunction Ae(a,b,c,d,e,f,h,k,l,m){var n=Z();try{Gh(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function ff(a,b,c,d,e,f){var h=Z();try{Hh(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function he(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{Ih(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}function hd(a,b,c,d,e,f,h,k){var l=Z();try{return Jh(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}\nfunction ne(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u){var y=Z();try{Mi(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)}catch(A){Y(y);if(A!==A+0)throw A;X(1,0)}}function Be(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{Kh(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}function we(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u){var y=Z();try{Lh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u)}catch(A){Y(y);if(A!==A+0)throw A;X(1,0)}}function Hd(a,b,c){var d=Z();try{Mh(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}\nfunction vc(a,b,c,d){var e=Z();try{return Oh(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function pc(a,b,c,d){var e=Z();try{return Ph(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function ce(a,b,c,d,e,f,h,k,l,m){var n=Z();try{Qh(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}function Ee(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F,H,K,Va,Wa,Xa){var Qi=Z();try{Rh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F,H,K,Va,Wa,Xa)}catch(Ya){Y(Qi);if(Ya!==Ya+0)throw Ya;X(1,0)}}\nfunction $e(a,b,c,d,e,f){var h=Z();try{Sh(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Rc(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{return Th(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function Od(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{Uh(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}\nfunction se(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F){var H=Z();try{Vh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D,F)}catch(K){Y(H);if(K!==K+0)throw K;X(1,0)}}function Yd(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{Wh(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function hf(a,b,c,d,e,f,h,k,l,m,n,q,r,p){var u=Z();try{Xh(a,b,c,d,e,f,h,k,l,m,n,q,r,p)}catch(y){Y(u);if(y!==y+0)throw y;X(1,0)}}\nfunction re(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D){var F=Z();try{Zh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D)}catch(H){Y(F);if(H!==H+0)throw H;X(1,0)}}function pe(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A){var B=Z();try{ai(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A)}catch(C){Y(B);if(C!==C+0)throw C;X(1,0)}}function qe(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C){var D=Z();try{Yh(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C)}catch(F){Y(D);if(F!==F+0)throw F;X(1,0)}}\nfunction Le(a,b,c,d,e,f,h,k){var l=Z();try{bi(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function xe(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{di(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}function Mc(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{return ei(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}\nfunction Qc(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D){var F=Z();try{return fi(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y,A,B,C,D)}catch(H){Y(F);if(H!==H+0)throw H;X(1,0)}}function Sd(a,b,c,d,e){var f=Z();try{gi(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function ge(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{Ag(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}function Pe(a,b,c,d,e,f,h,k,l,m){var n=Z();try{hi(a,b,c,d,e,f,h,k,l,m)}catch(q){Y(n);if(q!==q+0)throw q;X(1,0)}}\nfunction Me(a,b,c,d,e){var f=Z();try{ii(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Ye(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{Ji(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function pd(a,b,c,d,e){var f=Z();try{return ji(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function Ad(a,b,c,d){var e=Z();try{return Ni(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0);return 0n}}\nfunction Je(a,b,c,d,e,f,h){var k=Z();try{ki(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function qd(a,b,c,d,e,f){var h=Z();try{return li(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function ud(a,b,c,d,e,f){var h=Z();try{return mi(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Se(a,b,c,d,e,f,h,k,l){var m=Z();try{ni(a,b,c,d,e,f,h,k,l)}catch(n){Y(m);if(n!==n+0)throw n;X(1,0)}}\nfunction Ld(a,b,c,d){var e=Z();try{Nh(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function Zc(a,b,c,d,e,f,h,k){var l=Z();try{return oi(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function Ec(a,b,c,d,e,f){var h=Z();try{return pi(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function fd(a,b,c,d,e,f){var h=Z();try{return qi(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}\nfunction Sc(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{return ri(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}function bd(a,b,c,d,e,f,h,k){var l=Z();try{return si(a,b,c,d,e,f,h,k)}catch(m){Y(l);if(m!==m+0)throw m;X(1,0)}}function Vc(a,b,c,d,e,f,h,k,l,m,n){var q=Z();try{return ti(a,b,c,d,e,f,h,k,l,m,n)}catch(r){Y(q);if(r!==r+0)throw r;X(1,0)}}function gd(a,b,c,d,e,f,h){var k=Z();try{return ui(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}\nfunction Uc(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{return vi(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function od(a,b,c,d,e,f,h){var k=Z();try{return wi(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function rd(a,b,c,d,e,f,h){var k=Z();try{return xi(a,b,c,d,e,f,h)}catch(l){Y(k);if(l!==l+0)throw l;X(1,0)}}function Bd(a,b,c){var d=Z();try{return yi(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0);return 0n}}\nfunction nd(a,b,c,d){var e=Z();try{return zi(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function Gd(a,b,c,d){var e=Z();try{Bi(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function Cc(a,b,c,d){var e=Z();try{return Ai(a,b,c,d)}catch(f){Y(e);if(f!==f+0)throw f;X(1,0)}}function tf(a,b,c,d,e){var f=Z();try{Ci(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function qc(a,b,c,d,e){var f=Z();try{return Di(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}\nfunction rc(a,b,c,d,e,f){var h=Z();try{return Ei(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Te(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{Fi(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}function bf(a,b,c,d,e,f,h,k,l,m,n,q,r){var p=Z();try{Gi(a,b,c,d,e,f,h,k,l,m,n,q,r)}catch(u){Y(p);if(u!==u+0)throw u;X(1,0)}}function te(a,b,c,d,e,f,h,k,l,m,n,q){var r=Z();try{Eg(a,b,c,d,e,f,h,k,l,m,n,q)}catch(p){Y(r);if(p!==p+0)throw p;X(1,0)}}\nfunction $c(a,b,c,d,e){var f=Z();try{return Hi(a,b,c,d,e)}catch(h){Y(f);if(h!==h+0)throw h;X(1,0)}}function vd(a){var b=Z();try{return eg(a)}catch(c){Y(b);if(c!==c+0)throw c;X(1,0);return 0n}}function Wc(a,b,c,d,e,f){var h=Z();try{return dg(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}function Gc(a,b,c,d,e,f){var h=Z();try{return ci(a,b,c,d,e,f)}catch(k){Y(h);if(k!==k+0)throw k;X(1,0)}}\nfunction oe(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y){var A=Z();try{$h(a,b,c,d,e,f,h,k,l,m,n,q,r,p,u,y)}catch(B){Y(A);if(B!==B+0)throw B;X(1,0)}}function uc(a,b,c){var d=Z();try{return qg(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function oc(a,b,c){var d=Z();try{return sg(a,b,c)}catch(e){Y(d);if(e!==e+0)throw e;X(1,0)}}function Df(){var a=U;a=Object.assign({},a);var b=c=>d=>c(d)>>>0;a.Fd=b(a.Fd);a.he=b(a.he);a.ne=b(a.ne);a.oe=(c=>()=>c()>>>0)(a.oe);return a}g.stackSave=()=>Z();g.stackRestore=a=>Y(a);\ng.stackAlloc=a=>Ef(a);g.UTF8ToString=J;g.stringToUTF8=(a,b,c)=>M(a,E,b,c);g.lengthBytesUTF8=bb;var Oi;Fa=function Pi(){Oi||Ri();Oi||(Fa=Pi)};function Ri(){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 d(){l.buffer!=p.buffer&&t();return p}function v(){l.buffer!=p.buffer&&t();return aa}function z(){l.buffer!=p.buffer&&t();return ba}function A(){l.buffer!=p.buffer&&t();return ca}function da(){l.buffer!=p.buffer&&t();return ea}var B=moduleArg,fa,C;B.ready=new Promise((a,b)=>{fa=a;C=b});\"use strict\";\nB.jsepInit=(a,b,c,e,f,h,k,q)=>{B.Qb=a;B.wb=b;B.yb=c;B.jb=e;B.xb=f;B.Ea=h;B.zb=k;B.Ab=q;b=(n,m,r)=>(...w)=>{const x=D,g=m?.();w=n(...w);const u=m?.();g!==u&&(n=u,r(g),m=r=null);return D!=x?ha():w};c=n=>async(...m)=>{try{if(B.bb)throw Error(\"Session already started\");const r=B.bb={Fb:m[0],errors:[]},w=await n(...m);if(B.bb!==r)throw Error(\"Session mismatch\");a.flush();const x=r.errors;if(0u);if(0B._OrtRun,n=>B._OrtRun=n));B._OrtRunWithBinding=c(b(B._OrtRunWithBinding,()=>B._OrtRunWithBinding,n=>B._OrtRunWithBinding=n));B._OrtBindInput=b(B._OrtBindInput,()=>B._OrtBindInput,n=>B._OrtBindInput=n);B.jsepRegisterBuffer=(n,m,r,w)=>a.registerBuffer(n,m,r,w);B.jsepUnregisterBuffers=n=>{a.unregisterBuffers(n)};B.jsepGetBuffer=n=>a.getBuffer(n);B.jsepCreateDownloader=(n,m,r)=>a.createDownloader(n,m,r)};\nvar ia=Object.assign({},B),ja=\"./this.program\",E=(a,b)=>{throw b;},ka=\"object\"==typeof window,F=\"function\"==typeof importScripts,G=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,H=B.ENVIRONMENT_IS_PTHREAD||!1,I=\"\";function la(a){return B.locateFile?B.locateFile(a,I):I+a}var ma,J,na;\nif(G){var fs=require(\"fs\"),oa=require(\"path\");I=F?oa.dirname(I)+\"/\":__dirname+\"/\";ma=(b,c)=>{b=b.startsWith(\"file://\")?new URL(b):oa.normalize(b);return fs.readFileSync(b,c?void 0:\"utf8\")};na=b=>{b=ma(b,!0);b.buffer||(b=new Uint8Array(b));return b};J=(b,c,e,f=!0)=>{b=b.startsWith(\"file://\")?new URL(b):oa.normalize(b);fs.readFile(b,f?void 0:\"utf8\",(h,k)=>{h?e(h):c(f?k.buffer:k)})};!B.thisProgram&&1{process.exitCode=\nb;throw c;};B.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||F)F?I=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(I=document.currentScript.src),(typeof _scriptDir !== \"undefined\" && _scriptDir)&&(I=_scriptDir),0!==I.indexOf(\"blob:\")?I=I.substr(0,I.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):I=\"\",G||(ma=a=>{var b=\nnew XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},F&&(na=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),J=(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)});G&&\"undefined\"==typeof performance&&(global.performance=require(\"perf_hooks\").performance);\nvar pa=console.log.bind(console),qa=console.error.bind(console);G&&(pa=(...a)=>fs.writeSync(1,a.join(\" \")+\"\\n\"),qa=(...a)=>fs.writeSync(2,a.join(\" \")+\"\\n\"));var ra=B.print||pa,K=B.printErr||qa;Object.assign(B,ia);ia=null;B.thisProgram&&(ja=B.thisProgram);B.quit&&(E=B.quit);var L;B.wasmBinary&&(L=B.wasmBinary);var noExitRuntime=B.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&M(\"no native wasm support detected\");var l,N,sa,P=!1,Q,p,aa,ba,ca,ea;\nfunction t(){var a=l.buffer;B.HEAP8=p=new Int8Array(a);B.HEAP16=new Int16Array(a);B.HEAP32=ba=new Int32Array(a);B.HEAPU8=aa=new Uint8Array(a);B.HEAPU16=new Uint16Array(a);B.HEAPU32=ca=new Uint32Array(a);B.HEAPF32=new Float32Array(a);B.HEAPF64=ea=new Float64Array(a)}var ta=B.INITIAL_MEMORY||16777216;5242880<=ta||M(\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+ta+\"! (STACK_SIZE=5242880)\");\nif(H)l=B.wasmMemory;else if(B.wasmMemory)l=B.wasmMemory;else if(l=new WebAssembly.Memory({initial:ta/65536,maximum:65536,shared:!0}),!(l.buffer instanceof SharedArrayBuffer))throw K(\"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\"),G&&K(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),\nError(\"bad memory\");t();ta=l.buffer.byteLength;var ua=[],va=[],wa=[],xa=0;function ya(){return noExitRuntime||0{if(!b.ok)throw\"failed to load wasm binary file at '\"+a+\"'\";return b.arrayBuffer()}).catch(()=>Da(a));if(J)return new Promise((b,c)=>{J(a,e=>b(new Uint8Array(e)),c)})}return Promise.resolve().then(()=>Da(a))}function Fa(a,b,c){return Ea(a).then(e=>WebAssembly.instantiate(e,b)).then(e=>e).then(c,e=>{K(\"failed to asynchronously prepare wasm: \"+e);M(e)})}\nfunction Ga(a,b){var c=T;return L||\"function\"!=typeof WebAssembly.instantiateStreaming||Ca(c)||c.startsWith(\"file://\")||G||\"function\"!=typeof fetch?Fa(c,a,b):fetch(c,{credentials:\"same-origin\"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(f){K(\"wasm streaming compile failed: \"+f);K(\"falling back to ArrayBuffer instantiation\");return Fa(c,a,b)}))}\nvar U,Ha={906828:a=>{B.Ea(\"Abs\",a,void 0)},906879:a=>{B.Ea(\"Neg\",a,void 0)},906930:a=>{B.Ea(\"Floor\",a,void 0)},906983:a=>{B.Ea(\"Ceil\",a,void 0)},907035:a=>{B.Ea(\"Reciprocal\",a,void 0)},907093:a=>{B.Ea(\"Sqrt\",a,void 0)},907145:a=>{B.Ea(\"Exp\",a,void 0)},907196:a=>{B.Ea(\"Erf\",a,void 0)},907247:a=>{B.Ea(\"Sigmoid\",a,void 0)},907302:a=>{B.Ea(\"Log\",a,void 0)},907353:a=>{B.Ea(\"Sin\",a,void 0)},907404:a=>{B.Ea(\"Cos\",a,void 0)},907455:a=>{B.Ea(\"Tan\",a,void 0)},907506:a=>{B.Ea(\"Asin\",a,void 0)},907558:a=>{B.Ea(\"Acos\",\na,void 0)},907610:a=>{B.Ea(\"Atan\",a,void 0)},907662:a=>{B.Ea(\"Sinh\",a,void 0)},907714:a=>{B.Ea(\"Cosh\",a,void 0)},907766:a=>{B.Ea(\"Asinh\",a,void 0)},907819:a=>{B.Ea(\"Acosh\",a,void 0)},907872:a=>{B.Ea(\"Atanh\",a,void 0)},907925:a=>{B.Ea(\"Tanh\",a,void 0)},907977:a=>{B.Ea(\"Not\",a,void 0)},908028:(a,b,c)=>{B.Ea(\"ClipV10\",a,{min:b,max:c})},908100:a=>{B.Ea(\"Clip\",a,void 0)},908152:(a,b)=>{B.Ea(\"Elu\",a,{alpha:b})},908210:a=>{B.Ea(\"Relu\",a,void 0)},908262:(a,b)=>{B.Ea(\"LeakyRelu\",a,{alpha:b})},908326:(a,b)=>\n{B.Ea(\"ThresholdedRelu\",a,{alpha:b})},908396:(a,b)=>{B.Ea(\"Cast\",a,{to:b})},908454:a=>{B.Ea(\"Add\",a,void 0)},908505:a=>{B.Ea(\"Sub\",a,void 0)},908556:a=>{B.Ea(\"Mul\",a,void 0)},908607:a=>{B.Ea(\"Div\",a,void 0)},908658:a=>{B.Ea(\"Pow\",a,void 0)},908709:a=>{B.Ea(\"Equal\",a,void 0)},908762:a=>{B.Ea(\"Greater\",a,void 0)},908817:a=>{B.Ea(\"GreaterOrEqual\",a,void 0)},908879:a=>{B.Ea(\"Less\",a,void 0)},908931:a=>{B.Ea(\"LessOrEqual\",a,void 0)},908990:(a,b,c,e,f)=>{B.Ea(\"ReduceMean\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,\naxes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},909154:(a,b,c,e,f)=>{B.Ea(\"ReduceMax\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},909317:(a,b,c,e,f)=>{B.Ea(\"ReduceMin\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},909480:(a,b,c,e,f)=>{B.Ea(\"ReduceProd\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},909644:(a,b,c,e,f)=>{B.Ea(\"ReduceSum\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,\naxes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},909807:(a,b,c,e,f)=>{B.Ea(\"ReduceL1\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},909969:(a,b,c,e,f)=>{B.Ea(\"ReduceL2\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},910131:(a,b,c,e,f)=>{B.Ea(\"ReduceLogSum\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},910297:(a,b,c,e,f)=>{B.Ea(\"ReduceSumSquare\",a,{keepDims:!!b,\nnoopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},910466:(a,b,c,e,f)=>{B.Ea(\"ReduceLogSumExp\",a,{keepDims:!!b,noopWithEmptyAxes:!!c,axes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},910635:a=>{B.Ea(\"Where\",a,void 0)},910688:(a,b,c)=>{B.Ea(\"Transpose\",a,{perm:b?Array.from(z().subarray(c>>>0,c+b>>>0)):[]})},910801:(a,b,c,e,f,h,k,q,n,m)=>{B.Ea(\"Conv\",a,{format:n?\"NHWC\":\"NCHW\",auto_pad:b,dilations:[c],group:e,kernel_shape:[f],pads:[h,k],strides:[q],w_is_const:()=>!!d()[m>>>\n0]})},911029:(a,b,c,e,f,h,k,q,n,m,r,w,x,g,u)=>{B.Ea(\"Conv\",a,{format:g?\"NHWC\":\"NCHW\",auto_pad:b,dilations:[c,e],group:f,kernel_shape:[h,k],pads:[q,n,m,r],strides:[w,x],w_is_const:()=>!!d()[u>>>0]})},911288:(a,b,c,e,f,h,k,q,n,m)=>{B.Ea(\"Conv\",a,{format:n?\"NHWC\":\"NCHW\",auto_pad:b,dilations:[c],group:e,kernel_shape:[f],pads:[h,k],strides:[q],w_is_const:()=>!!d()[m>>>0]})},911516:(a,b,c,e,f,h,k,q,n,m,r,w,x,g,u)=>{B.Ea(\"Conv\",a,{format:g?\"NHWC\":\"NCHW\",auto_pad:b,dilations:[c,e],group:f,kernel_shape:[h,\nk],pads:[q,n,m,r],strides:[w,x],w_is_const:()=>!!d()[u>>>0]})},911775:(a,b,c,e,f,h,k,q,n,m,r,w,x,g)=>{B.Ea(\"ConvTranspose\",a,{format:n?\"NHWC\":\"NCHW\",autoPad:b,dilations:[c],group:e,kernel_shape:[f],pads:[h,k],strides:[q],wIsConst:()=>!!d()[m>>>0],outputPadding:r?Array.from(z().subarray(w>>>0,w+r>>>0)):[],outputShape:x?Array.from(z().subarray(g>>>0,g+x>>>0)):[]})},912155:(a,b,c,e,f,h,k,q,n,m,r,w,x)=>{B.Ea(\"ConvTranspose\",a,{format:q?\"NHWC\":\"NCHW\",autoPad:b,dilations:Array.from(z().subarray(c>>>0,c+\n2>>>0)),group:e,kernelShape:Array.from(z().subarray(f>>>0,f+2>>>0)),pads:Array.from(z().subarray(h>>>0,h+4>>>0)),strides:Array.from(z().subarray(k>>>0,k+2>>>0)),wIsConst:()=>!!d()[n>>>0],outputPadding:0>>0,r+m>>>0)):[],outputShape:0>>0,x+w>>>0)):[]})},912678:(a,b,c,e,f,h,k,q,n,m,r,w,x,g)=>{B.Ea(\"ConvTranspose\",a,{format:n?\"NHWC\":\"NCHW\",autoPad:b,dilations:[c],group:e,kernel_shape:[f],pads:[h,k],strides:[q],wIsConst:()=>!!d()[m>>>0],outputPadding:r?\nArray.from(z().subarray(w>>>0,w+r>>>0)):[],outputShape:x?Array.from(z().subarray(g>>>0,g+x>>>0)):[]})},913058:(a,b,c,e,f,h,k,q,n,m,r,w,x)=>{B.Ea(\"ConvTranspose\",a,{format:q?\"NHWC\":\"NCHW\",autoPad:b,dilations:Array.from(z().subarray(c>>>0,c+2>>>0)),group:e,kernelShape:Array.from(z().subarray(f>>>0,f+2>>>0)),pads:Array.from(z().subarray(h>>>0,h+4>>>0)),strides:Array.from(z().subarray(k>>>0,k+2>>>0)),wIsConst:()=>!!d()[n>>>0],outputPadding:0>>0,r+m>>>0)):[],outputShape:0<\nw?Array.from(z().subarray(x>>>0,x+w>>>0)):[]})},913581:(a,b)=>{B.Ea(\"GlobalAveragePool\",a,{format:b?\"NHWC\":\"NCHW\"})},913672:(a,b,c,e,f,h,k,q,n,m,r,w,x,g,u,y)=>{B.Ea(\"AveragePool\",a,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:e,storage_order:f,dilations:[h,k],kernel_shape:[q,n],pads:[m,r,w,x],strides:[g,u]})},913956:(a,b)=>{B.Ea(\"GlobalAveragePool\",a,{format:b?\"NHWC\":\"NCHW\"})},914047:(a,b,c,e,f,h,k,q,n,m,r,w,x,g,u,y)=>{B.Ea(\"AveragePool\",a,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,\ncount_include_pad:e,storage_order:f,dilations:[h,k],kernel_shape:[q,n],pads:[m,r,w,x],strides:[g,u]})},914331:(a,b)=>{B.Ea(\"GlobalMaxPool\",a,{format:b?\"NHWC\":\"NCHW\"})},914418:(a,b,c,e,f,h,k,q,n,m,r,w,x,g,u,y)=>{B.Ea(\"MaxPool\",a,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:e,storage_order:f,dilations:[h,k],kernel_shape:[q,n],pads:[m,r,w,x],strides:[g,u]})},914698:(a,b)=>{B.Ea(\"GlobalMaxPool\",a,{format:b?\"NHWC\":\"NCHW\"})},914785:(a,b,c,e,f,h,k,q,n,m,r,w,x,g,u,y)=>{B.Ea(\"MaxPool\",\na,{format:y?\"NHWC\":\"NCHW\",auto_pad:b,ceil_mode:c,count_include_pad:e,storage_order:f,dilations:[h,k],kernel_shape:[q,n],pads:[m,r,w,x],strides:[g,u]})},915065:(a,b,c,e,f)=>{B.Ea(\"Gemm\",a,{alpha:b,beta:c,transA:e,transB:f})},915169:a=>{B.Ea(\"MatMul\",a,void 0)},915223:(a,b,c,e)=>{B.Ea(\"ArgMax\",a,{keepDims:!!b,selectLastIndex:!!c,axis:e})},915331:(a,b,c,e)=>{B.Ea(\"ArgMin\",a,{keepDims:!!b,selectLastIndex:!!c,axis:e})},915439:(a,b)=>{B.Ea(\"Softmax\",a,{axis:b})},915502:(a,b)=>{B.Ea(\"Concat\",a,{axis:b})},\n915562:(a,b,c,e,f)=>{B.Ea(\"Split\",a,{axis:b,numOutputs:c,splitSizes:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},915707:a=>{B.Ea(\"Expand\",a,void 0)},915761:(a,b)=>{B.Ea(\"Gather\",a,{axis:Number(b)})},915832:(a,b)=>{B.Ea(\"GatherElements\",a,{axis:Number(b)})},915911:(a,b,c,e,f,h,k,q,n,m,r)=>{B.Ea(\"Resize\",a,{antialias:b,axes:c?Array.from(z().subarray(e>>>0,e+c>>>0)):[],coordinateTransformMode:V(f),cubicCoeffA:h,excludeOutside:k,extrapolationValue:q,keepAspectRatioPolicy:V(n),mode:V(m),nearestMode:V(r)})},\n916262:(a,b,c,e,f,h,k)=>{B.Ea(\"Slice\",a,{starts:b?Array.from(z().subarray(c>>>0,c+b>>>0)):[],ends:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[],axes:h?Array.from(z().subarray(k>>>0,k+h>>>0)):[]})},916493:a=>{B.Ea(\"Tile\",a,void 0)},916545:(a,b,c)=>{B.Ea(\"LayerNormalization\",a,{axis:Number(b),epsilon:Number(c)})},916652:(a,b,c)=>{B.Ea(\"InstanceNormalization\",a,{epsilon:b,format:c?\"NHWC\":\"NCHW\"})},916766:(a,b,c)=>{B.Ea(\"InstanceNormalization\",a,{epsilon:b,format:c?\"NHWC\":\"NCHW\"})},916880:a=>{B.Ea(\"Range\",\na,void 0)},916933:(a,b)=>{B.Ea(\"Einsum\",a,{equation:V(b)})},917014:(a,b,c,e,f)=>{B.Ea(\"Pad\",a,{mode:b,value:c,pads:e?Array.from(z().subarray(f>>>0,f+e>>>0)):[]})},917146:a=>{B.Ea(\"Gelu\",a,void 0)},917198:a=>{B.Ea(\"BiasAdd\",a,void 0)},917253:a=>{B.Ea(\"BiasSplitGelu\",a,void 0)},917314:(a,b)=>{B.Ea(\"SkipLayerNormalization\",a,{epsilon:b})},917395:a=>{B.zb(a)},917429:(a,b)=>B.Ab(a,b,B.bb.Fb,B.bb.errors),917541:a=>B.wb(a),917574:a=>B.yb(a),917606:(a,b,c)=>{B.jb(a,b,c,!0)},917645:(a,b,c)=>{B.jb(a,b,c)}};\nfunction Ia(a){this.name=\"ExitStatus\";this.message=`Program terminated with exit(${a})`;this.status=a}function Ja(a){a.terminate();a.onmessage=()=>{}}function Ka(a){(a=W.Qa[a])||M();W.Eb(a)}function La(a){var b=W.tb();if(!b)return 6;W.Ya.push(b);W.Qa[a.Xa]=b;b.Xa=a.Xa;var c={cmd:\"run\",start_routine:a.Gb,arg:a.rb,pthread_ptr:a.Xa};G&&b.unref();b.postMessage(c,a.Mb);return 0}\nvar Ma=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,Na=(a,b,c)=>{b>>>=0;var e=b+c;for(c=b;a[c]&&!(c>=e);)++c;if(16f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>\n10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e},V=(a,b)=>(a>>>=0)?Na(v(),a,b):\"\";function Oa(a){if(H)return X(1,1,a);Q=a;if(!ya()){W.Hb();if(B.onExit)B.onExit(a);P=!0}E(a,new Ia(a))}\nvar Qa=a=>{Q=a;if(H)throw Pa(a),\"unwind\";Oa(a)},W={ab:[],Ya:[],mb:[],Qa:{},gb:function(){H?W.vb():W.ub()},ub:function(){ua.unshift(()=>{Aa();W.Bb(()=>Ba())})},vb:function(){W.receiveObjectTransfer=W.Db;W.threadInitTLS=W.lb;W.setExitStatus=W.kb;noExitRuntime=!1},kb:function(a){Q=a},Sb:[\"$terminateWorker\"],Hb:function(){for(var a of W.Ya)Ja(a);for(a of W.ab)Ja(a);W.ab=[];W.Ya=[];W.Qa=[]},Eb:function(a){var b=a.Xa;delete W.Qa[b];W.ab.push(a);W.Ya.splice(W.Ya.indexOf(a),1);a.Xa=0;Ra(b)},Db:function(){},\nlb:function(){W.mb.forEach(a=>a())},Cb:a=>new Promise(b=>{a.onmessage=h=>{h=h.data;var k=h.cmd;if(h.targetThread&&h.targetThread!=Sa()){var q=W.Qa[h.Rb];q?q.postMessage(h,h.transferList):K('Internal error! Worker sent a message \"'+k+'\" to target pthread '+h.targetThread+\", but that thread no longer exists!\")}else if(\"checkMailbox\"===k)Ta();else if(\"spawnThread\"===k)La(h);else if(\"cleanupThread\"===k)Ka(h.thread);else if(\"killThread\"===k)h=h.thread,k=W.Qa[h],delete W.Qa[h],Ja(k),Ra(h),W.Ya.splice(W.Ya.indexOf(k),\n1),k.Xa=0;else if(\"cancelThread\"===k)W.Qa[h.thread].postMessage({cmd:\"cancel\"});else if(\"loaded\"===k)a.loaded=!0,b(a);else if(\"alert\"===k)alert(\"Thread \"+h.threadId+\": \"+h.text);else if(\"setimmediate\"===h.target)a.postMessage(h);else if(\"callHandler\"===k)B[h.handler](...h.args);else k&&K(\"worker sent an unknown command \"+k)};a.onerror=h=>{K(\"worker sent an error! \"+h.filename+\":\"+h.lineno+\": \"+h.message);throw h;};G&&(a.on(\"message\",function(h){a.onmessage({data:h})}),a.on(\"error\",function(h){a.onerror(h)}));\nvar c=[],e=[\"onExit\",\"onAbort\",\"print\",\"printErr\"],f;for(f of e)B.hasOwnProperty(f)&&c.push(f);a.postMessage({cmd:\"load\",handlers:c,urlOrBlob:B.mainScriptUrlOrBlob||_scriptDir,wasmMemory:l,wasmModule:sa})}),Bb:function(a){a()},qb:function(){var a=la(\"ort-wasm-simd-threaded.worker.js\");a=new Worker(a);W.ab.push(a)},tb:function(){0==W.ab.length&&(W.qb(),W.Cb(W.ab[0]));return W.ab.pop()}};B.PThread=W;var Ua=a=>{for(;0>2>>>0];a=z()[a+56>>2>>>0];Va(b,b-a);Wa(b)};function Pa(a){if(H)return X(2,0,a);Qa(a)}B.invokeEntryPoint=function(a,b){a=Xa.apply(null,[a,b]);ya()?W.kb(a):Ya(a)};function Za(a){this.fb=a-24;this.pb=function(b){A()[this.fb+4>>2>>>0]=b};this.ob=function(b){A()[this.fb+8>>2>>>0]=b};this.gb=function(b,c){this.nb();this.pb(b);this.ob(c)};this.nb=function(){A()[this.fb+16>>2>>>0]=0}}var $a=0,ab=0;\nfunction bb(a,b,c,e){return H?X(3,1,a,b,c,e):cb(a,b,c,e)}function cb(a,b,c,e){a>>>=0;b>>>=0;c>>>=0;e>>>=0;if(\"undefined\"==typeof SharedArrayBuffer)return K(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var f=[];if(H&&0===f.length)return bb(a,b,c,e);a={Gb:c,Xa:a,rb:e,Mb:f};return H?(a.Ob=\"spawnThread\",postMessage(a,f),0):La(a)}function db(a,b,c){return H?X(4,1,a,b,c):0}function eb(a,b){if(H)return X(5,1,a,b)}\nvar fb=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},gb=(a,b,c,e)=>{c>>>=0;if(!(0=k){var q=a.charCodeAt(++h);k=65536+((k&1023)<<10)|q&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-f},hb=(a,b,c)=>gb(a,v(),b,c);function ib(a,b){if(H)return X(6,1,a,b)}function jb(a,b,c){if(H)return X(7,1,a,b,c)}function kb(a,b,c){return H?X(8,1,a,b,c):0}function lb(a,b){if(H)return X(9,1,a,b)}function mb(a,b,c){if(H)return X(10,1,a,b,c)}function nb(a,b,c,e){if(H)return X(11,1,a,b,c,e)}function ob(a,b,c,e){if(H)return X(12,1,a,b,c,e)}function pb(a,b,c,e){if(H)return X(13,1,a,b,c,e)}\nfunction qb(a){if(H)return X(14,1,a)}function rb(a,b){if(H)return X(15,1,a,b)}function sb(a,b,c){if(H)return X(16,1,a,b,c)}var tb=a=>{if(!P)try{if(a(),!ya())try{H?Ya(Q):Qa(Q)}catch(b){b instanceof Ia||\"unwind\"==b||E(1,b)}}catch(b){b instanceof Ia||\"unwind\"==b||E(1,b)}};function ub(a){a>>>=0;\"function\"===typeof Atomics.Nb&&(Atomics.Nb(z(),a>>2,a).value.then(Ta),a+=128,Atomics.store(z(),a>>2,1))}B.__emscripten_thread_mailbox_await=ub;function Ta(){var a=Sa();a&&(ub(a),tb(()=>vb()))}B.checkMailbox=Ta;\nvar Y=a=>0===a%4&&(0!==a%100||0===a%400),wb=[0,31,60,91,121,152,182,213,244,274,305,335],xb=[0,31,59,90,120,151,181,212,243,273,304,334];function yb(a,b,c,e,f,h,k,q){return H?X(17,1,a,b,c,e,f,h,k,q):-52}function zb(a,b,c,e,f,h,k){if(H)return X(18,1,a,b,c,e,f,h,k)}var Bb=a=>{var b=fb(a)+1,c=Ab(b);c&&hb(a,c,b);return c},Cb=[],Db=(a,b)=>{Cb.length=0;var c;for(b>>=2;c=v()[a++>>>0];)b+=105!=c&b,Cb.push(105==c?z()[b>>>0]:da()[b++>>>1]),++b;return Cb},Fb=a=>{var b=Eb();a=a();Wa(b);return a};\nfunction X(a,b){var c=arguments.length-2,e=arguments;return Fb(()=>{for(var f=Gb(8*c),h=f>>3,k=0;k>>0]=q}return Hb(a,c,f,b)})}\nvar Ib=[],Jb={},Lb=()=>{if(!Kb){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 Jb)void 0===Jb[b]?delete a[b]:a[b]=Jb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Kb=c}return Kb},Kb;\nfunction Mb(a,b){if(H)return X(19,1,a,b);a>>>=0;b>>>=0;var c=0;Lb().forEach(function(e,f){var h=b+c;f=A()[a+4*f>>2>>>0]=h;for(h=0;h>0>>>0]=e.charCodeAt(h);d()[f>>0>>>0]=0;c+=e.length+1});return 0}function Nb(a,b){if(H)return X(20,1,a,b);a>>>=0;b>>>=0;var c=Lb();A()[a>>2>>>0]=c.length;var e=0;c.forEach(function(f){e+=f.length+1});A()[b>>2>>>0]=e;return 0}function Ob(a){return H?X(21,1,a):52}function Pb(a,b,c,e){return H?X(22,1,a,b,c,e):52}\nfunction Qb(a,b,c,e,f){return H?X(23,1,a,b,c,e,f):70}var Rb=[null,[],[]];function Tb(a,b,c,e){if(H)return X(24,1,a,b,c,e);b>>>=0;c>>>=0;e>>>=0;for(var f=0,h=0;h>2>>>0],q=A()[b+4>>2>>>0];b+=8;for(var n=0;n>>0],r=Rb[a];0===m||10===m?((1===a?ra:K)(Na(r,0)),r.length=0):r.push(m)}f+=q}A()[e>>2>>>0]=f;return 0}var Ub=[31,29,31,30,31,30,31,31,30,31,30,31],Vb=[31,28,31,30,31,30,31,31,30,31,30,31];function Wb(a){var b=Array(fb(a)+1);gb(a,b,0,b.length);return b}\nvar Xb=(a,b)=>{d().set(a,b>>>0)};\nfunction Yb(a,b,c,e){function f(g,u,y){for(g=\"number\"==typeof g?g.toString():g||\"\";g.lengthSb?-1:0O-g.getDate())u-=O-g.getDate()+1,g.setDate(1),11>y?g.setMonth(y+1):(g.setMonth(0),g.setFullYear(g.getFullYear()+1));else{g.setDate(g.getDate()+u);break}}y=new Date(g.getFullYear()+1,0,4);u=q(new Date(g.getFullYear(),\n0,4));y=q(y);return 0>=k(u,g)?0>=k(y,g)?g.getFullYear()+1:g.getFullYear():g.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;e>>>=0;var m=z()[e+40>>2>>>0];e={Kb:z()[e>>2>>>0],Jb:z()[e+4>>2>>>0],cb:z()[e+8>>2>>>0],ib:z()[e+12>>2>>>0],eb:z()[e+16>>2>>>0],$a:z()[e+20>>2>>>0],Wa:z()[e+24>>2>>>0],Za:z()[e+28>>2>>>0],Tb:z()[e+32>>2>>>0],Ib:z()[e+36>>2>>>0],Lb:m?V(m):\"\"};c=V(c);m={\"%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\",\n\"%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 r in m)c=c.replace(new RegExp(r,\"g\"),m[r]);var w=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),x=\"January February March April May June July August September October November December\".split(\" \");m={\"%a\":g=>w[g.Wa].substring(0,3),\"%A\":g=>w[g.Wa],\"%b\":g=>\nx[g.eb].substring(0,3),\"%B\":g=>x[g.eb],\"%C\":g=>h((g.$a+1900)/100|0,2),\"%d\":g=>h(g.ib,2),\"%e\":g=>f(g.ib,2,\" \"),\"%g\":g=>n(g).toString().substring(2),\"%G\":g=>n(g),\"%H\":g=>h(g.cb,2),\"%I\":g=>{g=g.cb;0==g?g=12:12{for(var u=0,y=0;y<=g.eb-1;u+=(Y(g.$a+1900)?Ub:Vb)[y++]);return h(g.ib+u,3)},\"%m\":g=>h(g.eb+1,2),\"%M\":g=>h(g.Jb,2),\"%n\":()=>\"\\n\",\"%p\":g=>0<=g.cb&&12>g.cb?\"AM\":\"PM\",\"%S\":g=>h(g.Kb,2),\"%t\":()=>\"\\t\",\"%u\":g=>g.Wa||7,\"%U\":g=>h(Math.floor((g.Za+7-g.Wa)/7),2),\"%V\":g=>\n{var u=Math.floor((g.Za+7-(g.Wa+6)%7)/7);2>=(g.Wa+371-g.Za-2)%7&&u++;if(u)53==u&&(y=(g.Wa+371-g.Za)%7,4==y||3==y&&Y(g.$a)||(u=1));else{u=52;var y=(g.Wa+7-g.Za-1)%7;(4==y||5==y&&Y(g.$a%400-1))&&u++}return h(u,2)},\"%w\":g=>g.Wa,\"%W\":g=>h(Math.floor((g.Za+7-(g.Wa+6)%7)/7),2),\"%y\":g=>(g.$a+1900).toString().substring(2),\"%Y\":g=>g.$a+1900,\"%z\":g=>{g=g.Ib;var u=0<=g;g=Math.abs(g)/60;return(u?\"+\":\"-\")+String(\"0000\"+(g/60*100+g%60)).slice(-4)},\"%Z\":g=>g.Lb,\"%%\":()=>\"%\"};c=c.replace(/%%/g,\"\\x00\\x00\");for(r in m)c.includes(r)&&\n(c=c.replace(new RegExp(r,\"g\"),m[r](e)));c=c.replace(/\\0\\0/g,\"%\");r=Wb(c);if(r.length>b)return 0;Xb(r,a);return r.length-1}function Zb(a){try{a()}catch(b){M(b)}}function $b(a){var b={},c;for(c in a)(function(e){var f=a[e];b[e]=\"function\"==typeof f?function(){ac.push(e);try{return f.apply(null,arguments)}finally{P||(ac.pop()===e||M(),D&&1===Z&&0===ac.length&&(Z=0,xa+=1,Zb(bc),\"undefined\"!=typeof Fibers&&Fibers.Ub()))}}:f})(c);return b}var Z=0,D=null,cc=0,ac=[],dc={},ec={},fc=0,gc=null,hc=[];\nfunction ha(){return new Promise((a,b)=>{gc={resolve:a,reject:b}})}function ic(){var a=Ab(65548),b=a+12;A()[a>>2>>>0]=b;A()[a+4>>2>>>0]=b+65536;b=ac[0];var c=dc[b];void 0===c&&(c=fc++,dc[b]=c,ec[c]=b);b=c;z()[a+8>>2>>>0]=b;return a}function jc(){var a=z()[D+8>>2>>>0];a=N[ec[a]];--xa;return a()}\nfunction kc(a){if(!P){if(0===Z){var b=!1,c=!1;a((e=0)=>{if(!P&&(cc=e,b=!0,c)){Z=2;Zb(()=>lc(D));\"undefined\"!=typeof Browser&&Browser.hb.sb&&Browser.hb.resume();e=!1;try{var f=jc()}catch(q){f=q,e=!0}var h=!1;if(!D){var k=gc;k&&(gc=null,(e?k.reject:k.resolve)(f),h=!0)}if(e&&!h)throw f;}});c=!0;b||(Z=1,D=ic(),\"undefined\"!=typeof Browser&&Browser.hb.sb&&Browser.hb.pause(),Zb(()=>mc(D)))}else 2===Z?(Z=0,Zb(nc),oc(D),D=null,hc.forEach(e=>tb(e))):M(`invalid state: ${Z}`);return cc}}\nfunction pc(a){return kc(b=>{a().then(b)})}W.gb();\nvar qc=[null,Oa,Pa,bb,db,eb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,yb,zb,Mb,Nb,Ob,Pb,Qb,Tb],tc={r:function(a,b,c){return pc(async()=>{await B.xb(a,b,c)})},b:function(a,b,c){a>>>=0;(new Za(a)).gb(b>>>0,c>>>0);$a=a;ab++;throw $a;},O:function(a){rc(a>>>0,!F,1,!ka,131072,!1);W.lb()},l:function(a){a>>>=0;H?postMessage({cmd:\"cleanupThread\",thread:a}):Ka(a)},I:cb,i:db,U:eb,E:ib,G:jb,V:kb,S:lb,K:mb,R:nb,p:ob,F:pb,C:qb,T:rb,D:sb,q:()=>!0,A:function(a,b){a>>>=0;a==b>>>0?setTimeout(()=>Ta()):H?postMessage({targetThread:a,\ncmd:\"checkMailbox\"}):(a=W.Qa[a])&&a.postMessage({cmd:\"checkMailbox\"})},M:function(){return-1},N:ub,X:function(a){G&&W.Qa[a>>>0].ref()},u:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);z()[c>>2>>>0]=a.getUTCSeconds();z()[c+4>>2>>>0]=a.getUTCMinutes();z()[c+8>>2>>>0]=a.getUTCHours();z()[c+12>>2>>>0]=a.getUTCDate();z()[c+16>>2>>>0]=a.getUTCMonth();z()[c+20>>2>>>0]=a.getUTCFullYear()-1900;z()[c+24>>2>>>0]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),\n0,1,0,0,0,0))/864E5|0;z()[c+28>>2>>>0]=a},v:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);z()[c>>2>>>0]=a.getSeconds();z()[c+4>>2>>>0]=a.getMinutes();z()[c+8>>2>>>0]=a.getHours();z()[c+12>>2>>>0]=a.getDate();z()[c+16>>2>>>0]=a.getMonth();z()[c+20>>2>>>0]=a.getFullYear()-1900;z()[c+24>>2>>>0]=a.getDay();b=(Y(a.getFullYear())?wb:xb)[a.getMonth()]+a.getDate()-1|0;z()[c+28>>2>>>0]=b;z()[c+36>>2>>>0]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),\n6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();a=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0;z()[c+32>>2>>>0]=a},w:function(a){a>>>=0;var b=new Date(z()[a+20>>2>>>0]+1900,z()[a+16>>2>>>0],z()[a+12>>2>>>0],z()[a+8>>2>>>0],z()[a+4>>2>>>0],z()[a>>2>>>0],0),c=z()[a+32>>2>>>0],e=b.getTimezoneOffset(),f=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),h=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),k=Math.min(h,f);0>c?z()[a+32>>2>>>0]=Number(f!=h&&k==e):\n0>2>>>0]=b.getDay();c=(Y(b.getFullYear())?wb:xb)[b.getMonth()]+b.getDate()-1|0;z()[a+28>>2>>>0]=c;z()[a>>2>>>0]=b.getSeconds();z()[a+4>>2>>>0]=b.getMinutes();z()[a+8>>2>>>0]=b.getHours();z()[a+12>>2>>>0]=b.getDate();z()[a+16>>2>>>0]=b.getMonth();z()[a+20>>2>>>0]=b.getYear();a=b.getTime()/1E3;return sc((U=a,1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)),a>>>0},s:yb,t:zb,\nz:function(a,b,c){function e(m){return(m=m.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?m[1]:\"GMT\"}a>>>=0;b>>>=0;c>>>=0;var f=(new Date).getFullYear(),h=new Date(f,0,1),k=new Date(f,6,1);f=h.getTimezoneOffset();var q=k.getTimezoneOffset(),n=Math.max(f,q);A()[a>>2>>>0]=60*n;z()[b>>2>>>0]=Number(f!=q);a=e(h);b=e(k);a=Bb(a);b=Bb(b);q>2>>>0]=a,A()[c+4>>2>>>0]=b):(A()[c>>2>>>0]=b,A()[c+4>>2>>>0]=a)},d:()=>{M(\"\")},c:function(a,b,c){a>>>=0;b=Db(b>>>0,c>>>0);return Ha[a].apply(null,b)},k:function(a,\nb,c){a>>>=0;b=Db(b>>>0,c>>>0);return Ha[a].apply(null,b)},m:function(){},j:function(){return Date.now()},W:()=>{xa+=1;throw\"unwind\";},B:function(){return 4294901760},f:()=>performance.timeOrigin+performance.now(),g:function(){return G?require(\"os\").cpus().length:navigator.hardwareConcurrency},L:function(a,b,c,e){W.Pb=b>>>0;Ib.length=c;b=e>>>0>>3;for(e=0;e>>0];return(0>a?Ha[-a-1]:qc[a]).apply(null,Ib)},y:function(a){a>>>=0;var b=v().length;if(a<=b||4294901760=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var f=Math;e=Math.max(a,e);a:{f=f.min.call(f,4294901760,e+(65536-e%65536)%65536)-l.buffer.byteLength+65535>>>16;try{l.grow(f);t();var h=1;break a}catch(k){}h=void 0}if(h)return!0}return!1},P:Mb,Q:Nb,H:Qa,h:Ob,o:Pb,x:Qb,n:Tb,a:l||B.wasmMemory,J:Yb,e:function(a,b,c,e){return Yb(a>>>0,b>>>0,c>>>0,e>>>0)}};\n(function(){function a(c,e){c=c.exports;c=$b(c);N=c=uc(c);W.mb.push(N.Da);va.unshift(N.Y);sa=e;Ba();return c}var b={a:tc};Aa();if(B.instantiateWasm)try{return B.instantiateWasm(b,a)}catch(c){K(\"Module.instantiateWasm callback failed with error: \"+c),C(c)}Ga(b,function(c){a(c.instance,c.module)}).catch(C);return{}})();B._OrtInit=(a,b)=>(B._OrtInit=N.Z)(a,b);B._OrtGetLastError=(a,b)=>(B._OrtGetLastError=N._)(a,b);\nB._OrtCreateSessionOptions=(a,b,c,e,f,h,k,q,n,m)=>(B._OrtCreateSessionOptions=N.$)(a,b,c,e,f,h,k,q,n,m);B._OrtAppendExecutionProvider=(a,b)=>(B._OrtAppendExecutionProvider=N.aa)(a,b);B._OrtAddFreeDimensionOverride=(a,b,c)=>(B._OrtAddFreeDimensionOverride=N.ba)(a,b,c);B._OrtAddSessionConfigEntry=(a,b,c)=>(B._OrtAddSessionConfigEntry=N.ca)(a,b,c);B._OrtReleaseSessionOptions=a=>(B._OrtReleaseSessionOptions=N.da)(a);B._OrtCreateSession=(a,b,c)=>(B._OrtCreateSession=N.ea)(a,b,c);\nB._OrtReleaseSession=a=>(B._OrtReleaseSession=N.fa)(a);B._OrtGetInputOutputCount=(a,b,c)=>(B._OrtGetInputOutputCount=N.ga)(a,b,c);B._OrtGetInputName=(a,b)=>(B._OrtGetInputName=N.ha)(a,b);B._OrtGetOutputName=(a,b)=>(B._OrtGetOutputName=N.ia)(a,b);B._OrtFree=a=>(B._OrtFree=N.ja)(a);B._OrtCreateTensor=(a,b,c,e,f,h)=>(B._OrtCreateTensor=N.ka)(a,b,c,e,f,h);B._OrtGetTensorData=(a,b,c,e,f)=>(B._OrtGetTensorData=N.la)(a,b,c,e,f);B._OrtReleaseTensor=a=>(B._OrtReleaseTensor=N.ma)(a);\nB._OrtCreateRunOptions=(a,b,c,e)=>(B._OrtCreateRunOptions=N.na)(a,b,c,e);B._OrtAddRunConfigEntry=(a,b,c)=>(B._OrtAddRunConfigEntry=N.oa)(a,b,c);B._OrtReleaseRunOptions=a=>(B._OrtReleaseRunOptions=N.pa)(a);B._OrtCreateBinding=a=>(B._OrtCreateBinding=N.qa)(a);B._OrtBindInput=(a,b,c)=>(B._OrtBindInput=N.ra)(a,b,c);B._OrtBindOutput=(a,b,c,e)=>(B._OrtBindOutput=N.sa)(a,b,c,e);B._OrtClearBoundOutputs=a=>(B._OrtClearBoundOutputs=N.ta)(a);B._OrtReleaseBinding=a=>(B._OrtReleaseBinding=N.ua)(a);\nB._OrtRunWithBinding=(a,b,c,e,f)=>(B._OrtRunWithBinding=N.va)(a,b,c,e,f);B._OrtRun=(a,b,c,e,f,h,k,q)=>(B._OrtRun=N.wa)(a,b,c,e,f,h,k,q);B._OrtEndProfiling=a=>(B._OrtEndProfiling=N.xa)(a);B._JsepOutput=(a,b,c)=>(B._JsepOutput=N.ya)(a,b,c);B._JsepGetNodeName=a=>(B._JsepGetNodeName=N.za)(a);var Sa=B._pthread_self=()=>(Sa=B._pthread_self=N.Aa)(),Ab=B._malloc=a=>(Ab=B._malloc=N.Ba)(a),oc=B._free=a=>(oc=B._free=N.Ca)(a);B.__emscripten_tls_init=()=>(B.__emscripten_tls_init=N.Da)();\nvar rc=B.__emscripten_thread_init=(a,b,c,e,f,h)=>(rc=B.__emscripten_thread_init=N.Fa)(a,b,c,e,f,h);B.__emscripten_thread_crashed=()=>(B.__emscripten_thread_crashed=N.Ga)();\nvar Hb=(a,b,c,e)=>(Hb=N.Ha)(a,b,c,e),Ra=a=>(Ra=N.Ia)(a),Ya=B.__emscripten_thread_exit=a=>(Ya=B.__emscripten_thread_exit=N.Ja)(a),vb=B.__emscripten_check_mailbox=()=>(vb=B.__emscripten_check_mailbox=N.Ka)(),sc=a=>(sc=N.La)(a),Va=(a,b)=>(Va=N.Ma)(a,b),Eb=()=>(Eb=N.Na)(),Wa=a=>(Wa=N.Oa)(a),Gb=a=>(Gb=N.Pa)(a),Xa=B.dynCall_ii=(a,b)=>(Xa=B.dynCall_ii=N.Ra)(a,b),mc=a=>(mc=N.Sa)(a),bc=()=>(bc=N.Ta)(),lc=a=>(lc=N.Ua)(a),nc=()=>(nc=N.Va)();B.___start_em_js=917678;B.___stop_em_js=917839;\nfunction uc(a){a=Object.assign({},a);var b=e=>()=>e()>>>0,c=e=>f=>e(f)>>>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}B.keepRuntimeAlive=ya;B.wasmMemory=l;B.stackAlloc=Gb;B.stackSave=Eb;B.stackRestore=Wa;B.UTF8ToString=V;B.stringToUTF8=hb;B.lengthBytesUTF8=fb;B.ExitStatus=Ia;B.PThread=W;var vc;S=function wc(){vc||xc();vc||(S=wc)};\nfunction xc(){function a(){if(!vc&&(vc=!0,B.calledRun=!0,!P)){H||Ua(va);fa(B);if(B.onRuntimeInitialized)B.onRuntimeInitialized();if(!H){if(B.postRun)for(\"function\"==typeof B.postRun&&(B.postRun=[B.postRun]);B.postRun.length;){var b=B.postRun.shift();wa.unshift(b)}Ua(wa)}}}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} from 'onnxruntime-common';\n\nimport {logLevelStringToEnum} from '../wasm-common';\n\ntype LogLevel = NonNullable;\ntype MessageString = string;\ntype MessageFunction = () => string;\ntype Message = MessageString|MessageFunction;\n\nconst logLevelPrefix = ['V', 'I', 'W', 'E', 'F'];\n\nconst doLog = (level: number, message: string): void => {\n // eslint-disable-next-line no-console\n console.log(`[${logLevelPrefix[level]},${new Date().toISOString()}]${message}`);\n};\n\nlet configLogLevel: LogLevel|undefined;\nlet debug: boolean|undefined;\n\nexport const configureLogger = ($configLogLevel: LogLevel, $debug: boolean): void => {\n configLogLevel = $configLogLevel;\n debug = $debug;\n};\n\n/**\n * A simple logging utility to log messages to the console.\n */\nexport const LOG = (logLevel: LogLevel, msg: Message): void => {\n const messageLevel = logLevelStringToEnum(logLevel);\n const configLevel = logLevelStringToEnum(configLogLevel);\n if (messageLevel >= configLevel) {\n doLog(messageLevel, typeof msg === 'function' ? msg() : msg);\n }\n};\n\n/**\n * A simple logging utility to log messages to the console. Only logs when debug is enabled.\n */\nexport const LOG_DEBUG: typeof LOG = (...args: Parameters) => {\n if (debug) {\n LOG(...args);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from 'onnxruntime-common';\n\nimport {tensorTypeToTypedArrayConstructor} from '../wasm-common';\n\nexport const createView = (dataBuffer: ArrayBuffer, type: Tensor.Type): Int32Array|Uint32Array|BigInt64Array|\n BigUint64Array|Uint8Array|Float32Array|Float64Array|Int8Array|Int16Array|Uint16Array =>\n new (tensorTypeToTypedArrayConstructor(type))(dataBuffer);\n\n/**\n * a TensorView does not own the data.\n */\nexport interface TensorView {\n readonly data: number;\n readonly dataType: number;\n readonly dims: readonly number[];\n\n /**\n * get a Float32Array data view of the tensor data. tensor data must be on CPU.\n */\n getFloat32Array(): Float32Array;\n\n /**\n * get a BigInt64Array data view of the tensor data. tensor data must be on CPU.\n */\n getBigInt64Array(): BigInt64Array;\n\n /**\n * get a Int32Array data view of the tensor data. tensor data must be on CPU.\n */\n getInt32Array(): Int32Array;\n\n /**\n * create a new tensor view with the same data but different dimensions.\n */\n reshape(newDims: readonly number[]): TensorView;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../wasm-common';\nimport {TensorView} from '../tensor-view';\n\nimport {ShaderHelper} from './ops/common';\n\nexport type SessionState = 'default'|'capturing'|'replaying';\n\nexport enum GpuDataType {\n default = 0,\n upload = 1,\n profile = 2\n}\nexport type GpuDataId = number;\n\nexport type GpuArchitecture = 'ampere';\nexport type GpuVendor = 'amd'|'intel'|'nvidia';\nexport interface AdapterInfo {\n isArchitecture: (architecture: GpuArchitecture) => boolean;\n isVendor: (vendor: GpuVendor) => boolean;\n}\n\nexport interface GpuData {\n type: GpuDataType;\n id: GpuDataId;\n buffer: GPUBuffer;\n}\n\nexport interface TensorInfo {\n dims: readonly number[];\n dataType: number;\n}\n\nexport interface ProgramUniform {\n type: DataType;\n data: number|readonly number[];\n}\n\nexport type ProgramUniformVariableInfo = [type: DataType, length: number];\n\n/**\n * Represent the dependency of a program on a specific input tensor.\n *\n * - 'none': the shader/uniform does not depend on this input's info\n * - 'type': the shader/uniform depends on data type of this input\n * - 'rank': the shader/uniform depends on data type and the rank of this input\n * - 'dims': the shader/uniform depends on data type and the dims of this input\n * - 'data': the shader/uniform depends on data type, the dims and the data of this input\n */\nexport type ProgramInputTensorInfoDependency = 'none'|'type'|'rank'|'dims'|'data';\n\n/**\n * Represent information about a program's cache for shader.\n */\nexport interface ProgramShaderCacheInfo {\n /**\n * an optional string as a cache hint in the artifact cache. If this is not specified, the cache hint will be empty.\n *\n * This hint string should only contains initializing-time information, such as the attributes or any information of\n * initializers. It should NOT contain any runtime information, such as the shape of inputs.\n */\n hint?: string;\n\n /**\n * an optional list of dependencies of the program on the input tensors. If this is not specified, the program depends\n * on 'dims' of all inputs.\n */\n inputDependencies?: ProgramInputTensorInfoDependency[];\n}\n\n/**\n * Represent information about a program's cache for uniform.\n */\nexport interface ProgramUniformCacheInfo {\n /**\n * an optional string as a cache hint in the uniform cache. If this is not specified, the cache hint will be empty.\n *\n * This hint string should only contains runtime information, such as the shape of inputs.\n */\n hint?: string;\n\n /**\n * an optional list of dependencies of the program on the input tensors. If this is not specified, the program depends\n * on 'none' of all inputs.\n */\n inputDependencies?: ProgramInputTensorInfoDependency[];\n}\n\n\n/**\n * A set of data that represent a shader program\n */\nexport interface ProgramInfo {\n /**\n * the name of the program. used for debugging and profiling\n */\n name: string;\n\n /**\n * an optional object describing the cache information of the program shader.\n *\n * If this is not specified, assume hint is empty and inputDependencies are ['dims'] for all inputs.\n */\n shaderCache?: ProgramShaderCacheInfo;\n\n /**\n * the shader's processing source code.\n *\n * This function will be called when shader cache missed.\n */\n getShaderSource: (shaderHelper: ShaderHelper) => string;\n\n /**\n * A function to get run data required to run the program.\n *\n * This function will be called every time the program is executed. Should keep this function as simple as possible.\n */\n getRunData: (inputs: readonly TensorView[]) => {\n outputs: readonly TensorInfo[];\n dispatchGroup: {x: number; y?: number; z?: number};\n programUniforms?: readonly ProgramUniform[];\n };\n}\n\nexport interface Artifact {\n programInfo: ProgramInfo;\n computePipeline: GPUComputePipeline;\n uniformVariablesInfo: readonly ProgramUniformVariableInfo[]|undefined;\n}\n\nexport interface ComputeContextInputsOutputsMapping {\n /**\n * specify the mapping to the program's inputs. the value can be a number or a tensor view.\n * - if it's a number, it's the index of the kernel's input\n * - if it's a tensor view, it's an existing tensor view that will be used as the input\n *\n * if inputs is not specified, the mapping will be the kernel's inputs in order.\n */\n readonly inputs?: ReadonlyArray;\n /**\n * specify the mapping to the program's outputs. the value must be a number.\n * - if it's a non-negative number, it's the index of the kernel's output\n * - if it's -1, it's an output that will be created as a temporary value. this value will be released after\n * the kernel is executed.\n * - if it's -2, it's an output that will be created as a persistent value. this value will be released when the\n * kernel is released.\n *\n * if outputs is not specified, the mapping will be the kernel's outputs in order.\n */\n readonly outputs?: readonly number[];\n}\n\n/**\n * A ComputeContext instance carries the states that representing the current running of a kernel.\n */\nexport interface ComputeContext {\n /**\n * gpu adapter info\n */\n readonly adapterInfo: AdapterInfo;\n\n /**\n * stores the pointer to OpKernelContext\n */\n readonly opKernelContext: number;\n\n /**\n * a list of inputs, each input is an instance of TensorView\n */\n readonly inputs: readonly TensorView[];\n\n /**\n * a custom data object that can be used to store any data that is needed by the kernel\n */\n readonly kernelCustomData: {[key: string]: unknown};\n\n /**\n * a buffer that can be used to access custom data created each time the kernel is executed\n */\n readonly customDataBuffer: Uint8Array;\n\n /**\n * a number of outputs for the node\n */\n readonly outputCount: number;\n\n compute(program: ProgramInfo, inputsOutputsMapping?: ComputeContextInputsOutputsMapping): TensorView[];\n output(index: number, dims: readonly number[]): number;\n getMaxComputeWorkgroupSizes(): [number, number, number];\n getMaxComputeWorkgroupStoragesize(): number;\n}\n\nexport type TimestampQuery = 'none'|'inside-passes'|'at-passes';\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {WebGpuBackend} from '../backend-webgpu';\nimport {LOG_DEBUG} from '../log';\n\nimport {GpuData, GpuDataId, GpuDataType} from './types';\n\n/**\n * manages GpuDataId -> GpuBuffer\n */\nexport interface GpuDataManager {\n /**\n * copy data from CPU to GPU.\n */\n upload(id: GpuDataId, data: Uint8Array): void;\n /**\n * copy data from GPU to GPU.\n */\n memcpy(sourceId: GpuDataId, destinationId: GpuDataId): void;\n /**\n * create new data on GPU.\n */\n create(size: number, usage?: number): GpuData;\n /**\n * get GPU data by ID.\n */\n get(id: GpuDataId): GpuData|undefined;\n /**\n * release the data on GPU by ID.\n *\n * @return size of the data released\n */\n release(id: GpuDataId): number;\n /**\n * copy data from GPU to CPU.\n */\n download(id: GpuDataId, getTargetBuffer: () => Uint8Array): Promise;\n\n /**\n * refresh the buffers that marked for release.\n *\n * when release() is called, the buffer is not released immediately. this is because we need to wait for the commands\n * to be submitted to the GPU. this function is called after the commands are submitted so that the buffers can be\n * actually released.\n */\n refreshPendingBuffers(): void;\n\n /**\n * register an external buffer for IO Binding. If the buffer is already registered, return the existing GPU data ID.\n *\n * GPU data manager only manages a mapping between the buffer and the GPU data ID. It will not manage the lifecycle of\n * the external buffer.\n */\n registerExternalBuffer(buffer: GPUBuffer, originalSize: number, previousBuffer?: GPUBuffer): number;\n\n /**\n * unregister an external buffer for IO Binding.\n */\n unregisterExternalBuffer(buffer: GPUBuffer): void;\n\n /**\n * destroy all gpu buffers.\n */\n dispose(): void;\n\n /**\n * release session related data.\n * @param sessionId - specify the session ID.\n */\n onReleaseSession(sessionId: number): void;\n}\n\ninterface StorageCacheValue {\n gpuData: GpuData;\n originalSize: number;\n}\n\nconst bucketFreelist: Map = new Map([\n [64, 250],\n [128, 200],\n [256, 200],\n [512, 200],\n [2048, 230],\n [4096, 200],\n [8192, 50],\n [16384, 50],\n [32768, 50],\n [65536, 50],\n [131072, 50],\n [262144, 50],\n [524288, 50],\n [1048576, 50],\n [2097152, 30],\n [4194304, 20],\n [8388608, 10],\n [12582912, 10],\n [16777216, 10],\n [26214400, 15],\n [33554432, 22],\n [44236800, 2],\n [58982400, 6],\n // we don't want to cache the bucket sizes below but not caching them\n // results in some major performance hits for models like sd-turbo.\n [67108864, 6],\n [134217728, 6],\n [167772160, 6],\n]);\n\nconst bucketArr: number[] = [];\n\n/**\n * normalize the buffer size so that it fits the 128-bits (16 bytes) alignment.\n */\nconst calcNormalizedBufferSize = (size: number) => Math.ceil(size / 16) * 16;\n\n/**\n * calculate the buffer size so that it fits into buckets.\n */\nconst calcBucketBufferSize = (size: number) => {\n for (let idx = 0; idx < bucketArr.length; idx++) {\n const sizeForBucket = bucketArr[idx];\n if (size <= sizeForBucket) {\n return sizeForBucket;\n }\n }\n // not in bucket list -> caller will not cache, round up to 16.\n return Math.ceil(size / 16) * 16;\n};\n\nlet guid = 1;\nconst createNewGpuDataId = () => guid++;\n\n/**\n * exported standard download function. This function is used by the session to download the data from GPU, and also by\n * factory to create GPU tensors with the capacity of downloading data from GPU.\n *\n * @param backend - the WebGPU backend\n * @param gpuBuffer - the GPU buffer to download\n * @param originalSize - the original size of the data\n * @param getTargetBuffer - optional. If provided, the data will be copied to the target buffer. Otherwise, a new buffer\n * will be created and returned.\n */\nexport const downloadGpuData =\n async(backend: WebGpuBackend, gpuBuffer: GPUBuffer, originalSize: number, getTargetBuffer?: () => Uint8Array):\n Promise => {\n const bufferSize = calcNormalizedBufferSize(originalSize);\n const gpuReadBuffer = backend.device.createBuffer(\n // eslint-disable-next-line no-bitwise\n {size: bufferSize, usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ});\n try {\n const commandEncoder = backend.getCommandEncoder();\n backend.endComputePass();\n commandEncoder.copyBufferToBuffer(\n gpuBuffer /* source buffer */, 0 /* source offset */, gpuReadBuffer /* destination buffer */,\n 0 /* destination offset */, bufferSize /* size */\n );\n backend.flush();\n\n await gpuReadBuffer.mapAsync(GPUMapMode.READ);\n\n const arrayBuffer = gpuReadBuffer.getMappedRange();\n if (getTargetBuffer) {\n // if we already have a CPU buffer to accept the data, no need to clone the ArrayBuffer.\n const targetBuffer = getTargetBuffer();\n targetBuffer.set(new Uint8Array(arrayBuffer, 0, originalSize));\n return targetBuffer;\n } else {\n // the mapped ArrayBuffer will be released when the GPU buffer is destroyed. Need to clone the\n // ArrayBuffer.\n return new Uint8Array(arrayBuffer.slice(0, originalSize));\n }\n } finally {\n gpuReadBuffer.destroy();\n }\n };\n\nclass GpuDataManagerImpl implements GpuDataManager {\n // GPU Data ID => GPU Data ( storage buffer )\n private storageCache: Map;\n\n // pending buffers for uploading ( data is unmapped )\n private buffersForUploadingPending: GPUBuffer[];\n // pending buffers for computing\n private buffersPending: GPUBuffer[];\n\n // The reusable storage buffers for computing.\n private freeBuffers: Map;\n // The reusable uniform buffers\n private freeUniformBuffers: Map;\n\n // The external buffers registered users for IO Binding.\n private externalBuffers: Map;\n\n // The pendingBuffers for capture graph.\n // a SessionID -> GPUBuffer[] mapping.\n private capturedPendingBuffers: Map;\n\n constructor(private backend: WebGpuBackend) {\n this.storageCache = new Map();\n this.freeBuffers = new Map();\n this.freeUniformBuffers = new Map();\n this.buffersForUploadingPending = [];\n this.buffersPending = [];\n this.externalBuffers = new Map();\n this.capturedPendingBuffers = new Map();\n\n for (const [key, ] of bucketFreelist) {\n bucketArr.push(key);\n this.freeBuffers.set(key, []);\n this.freeUniformBuffers.set(key, []);\n }\n }\n\n upload(id: GpuDataId, data: Uint8Array): void {\n const srcArrayBuffer = data.buffer;\n const srcOffset = data.byteOffset;\n const srcLength = data.byteLength;\n const size = calcNormalizedBufferSize(srcLength);\n\n // get destination gpu buffer\n const gpuDataCache = this.storageCache.get(id);\n if (!gpuDataCache) {\n throw new Error('gpu data for uploading does not exist');\n }\n if (gpuDataCache.originalSize !== srcLength) {\n throw new Error(`inconsistent data size. gpu data size=${gpuDataCache.originalSize}, data size=${srcLength}`);\n }\n\n // create gpu buffer\n const gpuBufferForUploading = this.backend.device.createBuffer(\n // eslint-disable-next-line no-bitwise\n {mappedAtCreation: true, size, usage: GPUBufferUsage.MAP_WRITE | GPUBufferUsage.COPY_SRC});\n\n // copy (upload) data\n const arrayBuffer = gpuBufferForUploading.getMappedRange();\n new Uint8Array(arrayBuffer).set(new Uint8Array(srcArrayBuffer, srcOffset, srcLength));\n gpuBufferForUploading.unmap();\n\n\n // GPU copy\n const commandEncoder = this.backend.getCommandEncoder();\n this.backend.endComputePass();\n commandEncoder.copyBufferToBuffer(gpuBufferForUploading, 0, gpuDataCache.gpuData.buffer, 0, size);\n\n LOG_DEBUG('verbose', () => `[WebGPU] GpuDataManager.upload(id=${id})`);\n\n this.buffersForUploadingPending.push(gpuBufferForUploading);\n }\n\n memcpy(sourceId: GpuDataId, destinationId: GpuDataId): void {\n // get source gpu buffer\n const sourceGpuDataCache = this.storageCache.get(sourceId);\n if (!sourceGpuDataCache) {\n throw new Error('source gpu data for memcpy does not exist');\n }\n // get destination gpu buffer\n const destinationGpuDataCache = this.storageCache.get(destinationId);\n if (!destinationGpuDataCache) {\n throw new Error('destination gpu data for memcpy does not exist');\n }\n if (sourceGpuDataCache.originalSize !== destinationGpuDataCache.originalSize) {\n throw new Error('inconsistent source and destination gpu data size');\n }\n\n const size = calcNormalizedBufferSize(sourceGpuDataCache.originalSize);\n\n // GPU copy\n const commandEncoder = this.backend.getCommandEncoder();\n this.backend.endComputePass();\n commandEncoder.copyBufferToBuffer(\n sourceGpuDataCache.gpuData.buffer, 0, destinationGpuDataCache.gpuData.buffer, 0, size);\n }\n\n registerExternalBuffer(buffer: GPUBuffer, originalSize: number, previousBuffer?: GPUBuffer): number {\n let id: number|undefined;\n if (previousBuffer) {\n id = this.externalBuffers.get(previousBuffer);\n if (id === undefined) {\n throw new Error('previous buffer is not registered');\n }\n if (buffer === previousBuffer) {\n LOG_DEBUG(\n 'verbose',\n () => `[WebGPU] GpuDataManager.registerExternalBuffer(size=${originalSize}) => id=${\n id}, buffer is the same, skip.`);\n return id;\n } else if (this.backend.capturedCommandList.has(this.backend.currentSessionId!)) {\n throw new Error(`Registering a different external buffer under graph capture mode is not supported yet.\n Please use the previous external buffer!`);\n }\n this.externalBuffers.delete(previousBuffer);\n } else {\n id = createNewGpuDataId();\n }\n\n this.storageCache.set(id, {gpuData: {id, type: GpuDataType.default, buffer}, originalSize});\n this.externalBuffers.set(buffer, id);\n LOG_DEBUG(\n 'verbose',\n () => `[WebGPU] GpuDataManager.registerExternalBuffer(size=${originalSize}) => id=${id}, registered.`);\n return id;\n }\n\n unregisterExternalBuffer(buffer: GPUBuffer): void {\n const id = this.externalBuffers.get(buffer);\n if (id !== undefined) {\n this.storageCache.delete(id);\n this.externalBuffers.delete(buffer);\n LOG_DEBUG('verbose', () => `[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${id}`);\n }\n }\n\n // eslint-disable-next-line no-bitwise\n create(size: number, usage = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST): GpuData {\n const bufferSize = calcBucketBufferSize(size);\n\n let gpuBuffer;\n // Currently, only storage buffers are reused.\n // eslint-disable-next-line no-bitwise\n const isStorage = (usage & GPUBufferUsage.STORAGE) === GPUBufferUsage.STORAGE;\n // eslint-disable-next-line no-bitwise\n const isUniform = (usage & GPUBufferUsage.UNIFORM) === GPUBufferUsage.UNIFORM;\n if (isStorage || isUniform) {\n const freeBuffers = isStorage ? this.freeBuffers : this.freeUniformBuffers;\n const buffers = freeBuffers.get(bufferSize);\n if (!buffers) {\n // no such bucket/freelist - create gpu buffer\n gpuBuffer = this.backend.device.createBuffer({size: bufferSize, usage});\n } else {\n if (buffers.length > 0) {\n // in freelist, use it\n gpuBuffer = buffers.pop() as GPUBuffer;\n } else {\n // bucket empty, create gpu buffer\n gpuBuffer = this.backend.device.createBuffer({size: bufferSize, usage});\n }\n }\n } else {\n // create gpu buffer\n gpuBuffer = this.backend.device.createBuffer({size: bufferSize, usage});\n }\n\n const gpuData = {id: createNewGpuDataId(), type: GpuDataType.default, buffer: gpuBuffer};\n this.storageCache.set(gpuData.id, {gpuData, originalSize: size});\n\n LOG_DEBUG('verbose', () => `[WebGPU] GpuDataManager.create(size=${size}) => id=${gpuData.id}`);\n return gpuData;\n }\n\n get(id: GpuDataId): GpuData|undefined {\n return this.storageCache.get(id)?.gpuData;\n }\n\n release(id: GpuDataId): number {\n const cachedData = this.storageCache.get(id);\n if (!cachedData) {\n throw new Error('releasing data does not exist');\n }\n\n LOG_DEBUG('verbose', () => `[WebGPU] GpuDataManager.release(id=${id}), gpuDataId=${cachedData.gpuData.id}`);\n\n this.storageCache.delete(id);\n this.buffersPending.push(cachedData.gpuData.buffer);\n // cachedData.gpuData.buffer.destroy();\n\n return cachedData.originalSize;\n }\n\n async download(id: GpuDataId, getTargetBuffer: () => Uint8Array): Promise {\n const cachedData = this.storageCache.get(id);\n if (!cachedData) {\n throw new Error('data does not exist');\n }\n await downloadGpuData(this.backend, cachedData.gpuData.buffer, cachedData.originalSize, getTargetBuffer);\n }\n\n refreshPendingBuffers(): void {\n for (const buffer of this.buffersForUploadingPending) {\n // upload buffer is only useful in the session creation time. So we don't need to reuse them in session running.\n buffer.destroy();\n }\n this.buffersForUploadingPending = [];\n\n if (this.buffersPending.length === 0) {\n return;\n }\n\n if (this.backend.sessionStatus === 'default') {\n for (const buffer of this.buffersPending) {\n const maxInFreeList = bucketFreelist.get(buffer.size);\n\n // eslint-disable-next-line no-bitwise\n if ((buffer.usage & GPUBufferUsage.STORAGE) === GPUBufferUsage.STORAGE) {\n // Put the pending buffer to freeBuffers list instead of really destroying it for buffer reusing.\n const freelist = this.freeBuffers.get(buffer.size) || [];\n if (maxInFreeList === undefined || freelist.length >= maxInFreeList) {\n buffer.destroy();\n } else {\n freelist.push(buffer);\n }\n // eslint-disable-next-line no-bitwise\n } else if ((buffer.usage & GPUBufferUsage.UNIFORM) === GPUBufferUsage.UNIFORM) {\n // Put the pending buffer to freeUniformBuffers list instead of really destroying it for buffer reusing.\n const freelist = this.freeUniformBuffers.get(buffer.size) || [];\n if (maxInFreeList === undefined || freelist.length >= maxInFreeList) {\n buffer.destroy();\n } else {\n freelist.push(buffer);\n }\n } else {\n buffer.destroy();\n }\n }\n this.buffersPending = [];\n } else {\n // Don't release intermediate tensors in non-default mode.\n // TODO: reuse the storage buffers in non-default mode.\n let capturedBuffers = this.capturedPendingBuffers.get(this.backend.currentSessionId!);\n if (!capturedBuffers) {\n capturedBuffers = [];\n this.capturedPendingBuffers.set(this.backend.currentSessionId!, capturedBuffers);\n }\n for (const buffer of this.buffersPending) {\n capturedBuffers.push(buffer);\n }\n this.buffersPending = [];\n }\n }\n\n dispose() {\n this.freeBuffers.forEach((buffers) => {\n buffers.forEach(buffer => {\n buffer.destroy();\n });\n });\n this.freeUniformBuffers.forEach((buffers) => {\n buffers.forEach(buffer => {\n buffer.destroy();\n });\n });\n\n this.storageCache.forEach((storage) => {\n storage.gpuData.buffer.destroy();\n });\n\n this.capturedPendingBuffers.forEach((buffers) => {\n buffers.forEach(buffer => {\n buffer.destroy();\n });\n });\n this.storageCache = new Map();\n this.freeBuffers = new Map();\n this.freeUniformBuffers = new Map();\n this.capturedPendingBuffers = new Map();\n }\n\n onReleaseSession(sessionId: number) {\n // release the captured pending buffers.\n const pendingBuffers = this.capturedPendingBuffers.get(sessionId);\n if (pendingBuffers) {\n pendingBuffers.forEach(buffer => {\n buffer.destroy();\n });\n this.capturedPendingBuffers.delete(sessionId);\n }\n }\n}\n\nexport const createGpuDataManager = (...args: ConstructorParameters): GpuDataManager =>\n new GpuDataManagerImpl(...args);\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\n/**\n * create a new object from the given attribute, and add a cacheKey property to it\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\n/* eslint-disable no-param-reassign */\n\nexport class MatMulUtil {\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\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 const max = Math.max(aLen, bLen);\n if (aLen && bLen) {\n cdims[crank - i] = Math.max(aLen, bLen);\n } else {\n // when either aLen or bLen is 0, the other should be either 0 or 1, otherwise it is not broadcastable.\n if (max > 1) {\n return undefined;\n }\n cdims[crank - i] = 0;\n }\n }\n\n return cdims;\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\nexport class ShapeUtil {\n /**\n * calculate the size (number of elements)\n */\n static size(dims: readonly number[]): number {\n return ShapeUtil.getSizeFromDimensionRange(dims, 0, dims.length);\n }\n\n /**\n * convert dims corresponding to type change to pack. ex. uint8 data to uint32\n */\n static convertShape(dims: readonly number[], size = 4): readonly number[] {\n const rank = dims.length;\n if (rank === 0) {\n return [];\n }\n const newDims = new Array(rank);\n let i = rank - 1;\n while (i >= 0) {\n if (dims[i] % size === 0) {\n newDims[i] = dims[i] / size;\n break;\n }\n if (size % dims[i] !== 0) {\n throw new Error('cannot convert shape');\n }\n newDims[i] = 1;\n size /= dims[i];\n i--;\n }\n for (i--; i >= 0; i--) {\n newDims[i] = dims[i];\n }\n return newDims;\n }\n\n /**\n * calculate the size (number of elements) from the given axis (inclusive)\n */\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 /**\n * calculate the size (number of elements) to the given axis (exclusive)\n */\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 /**\n * calculate the size (number of elements) from and to the given axis [start, end)\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 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 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 /**\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 ?? axes.length));\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\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[]): void {\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[], isChannelLast: boolean, autoPad?: string): void {\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 + (isChannelLast ? 1 : 2)], strides[dim], dilations[dim], kernelShape[dim], pads, dim,\n dim + inputDims.length - 2, 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 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\n\nexport const MIN_CLIP = -3.4028234663852886e+38;\nexport const MAX_CLIP = 3.4028234663852886e+38;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {ShapeUtil} from '../../util';\nimport {ProgramUniform, ProgramUniformVariableInfo} from '../types';\n\n/**\n * constant value for a workgroup size.\n *\n * We definitely can do further optimization in future, but for now we use 64.\n *\n * rule of thumb: Use [a workgroup size of] 64 unless you know what GPU you are targeting or that your workload\n * needs something different.\n *\n * from: https://surma.dev/things/webgpu/\n **/\nexport const WORKGROUP_SIZE = 64;\n\ninterface IndicesHelperTypes {\n /**\n * WGSL type of indices expression\n */\n readonly indices: string;\n\n /**\n * WGSL type of a value\n */\n readonly value: string;\n\n /**\n * WGSL type of storage type representing a value\n *\n * This is usually the same to `value`, but for some type (eg. bool), we need to use `u32` as storage type for\n * value type `vec4`\n */\n readonly storage: string;\n\n /**\n * tensor type as represented in TensorView\n */\n readonly tensor: number;\n}\n\n/**\n * A helper class for generating WGSL code for manipulating indices and data for a shader's input or output.\n *\n * This class is designed to offer a unified way to generate WGSL code for manipulating indices and data for a shader's\n * input or output.\n *\n * The following is a list of terminologies used in this class:\n * - `offset`: a uint32 value representing the offset of an element in the data buffer.\n * - `indices`: an abstraction of a multi-dimensional array's indices representing the data's index on each dimension.\n * - `value`: a value of a data element.\n *\n * Users are expected to create an instance of this class for each shader's input or output, and use the instance to\n * generate WGSL code for manipulating indices and data. The following 2 exported functions are for users to call to\n * create an instance of an indices helper:\n * - `inputVariable()`: create an indices helper instance for an input.\n * - `outputVariable()`: create an indices helper instance for an output.\n * - `internalVariable()`: create an indices helper instance for an internal variable.\n *\n * An indices helper instance contains helper functions for the following operations:\n * - access readonly basic information, including: `name`(the name of the input or output), `usage`(whether it's an\n * input, an output or an internal variable) and `shape`(the passed in shape).\n * - `type`: access readonly type information, including: `indices`(the type of indices), `value`(the type of value at\n * runtime), `storage`(the type of value at storage) and `tensor`(the tensor type as represented in TensorView).\n * - generate WGSL code for getting indices from offset. Use `offsetToIndices()` for WGSL code snippet to calculate\n * indices from offset, and use `indicesToOffset()` for WGSL code snippet to calculate offset from indices.\n * - to manipulate an instance of indices, use `setIndices()` and `getIndices()` to set and get the indices on an\n * indices variable.\n * - to manipulate data, use `set()`/`get()` to access data at the given indices from parameter list, use\n * `setByIndices()`/`getByIndices()` to access data at the given indices from an indices variable, and use\n * `setByOffset()`/`getByOffset()` to access data at the given offset.\n * - `impl`: get WGSL code of function implementation for the util functions mentioned above.\n */\nexport interface IndicesHelper {\n /**\n * get WGSL code of function implementation for the util functions.\n *\n */\n readonly impl: () => string;\n\n /**\n * get type info\n */\n readonly type: IndicesHelperTypes;\n\n /**\n * WGSL code of a expression for getting indices from offset.\n *\n * @param varOffset - a u32 expression representing the offset.\n *\n * @returns an `type.indices` expression\n */\n readonly offsetToIndices: (varOffset: string) => string;\n\n /**\n * WGSL code of an `u32` expression for getting offset from indices.\n *\n * @param varIndices - a `type.indices` expression representing the indices.\n *\n * @returns an `u32` expression\n */\n readonly indicesToOffset: (varIndices: string) => string;\n\n /**\n * WGSL code of an `u32` expression for getting original offset from broadcasted indices.\n *\n * @param varIndices - a `type.indices` expression representing the output indices.\n * @param output - output IndicesHelper.\n *\n * @returns an `u32` expression\n */\n readonly broadcastedIndicesToOffset: (varIndices: string, output: IndicesHelper) => string;\n\n /**\n * WGSL code of generating an indices literal\n *\n * @param init - initial value.\n */\n readonly indices: (...init: ReadonlyArray) => string;\n\n /**\n * WGSL code of a statement for setting indices.\n *\n * @param varIndices - a variable name for the indices.\n * @param idx - the index of the indices to set. can be a number or a string (WGSL `u32` expression).\n * @param value - the value to set. can be a number or a string (WGSL `u32` expression).\n *\n * @returns a WGSL statement\n */\n readonly indicesSet: (varIndices: string, idx: number|string, value: number|string) => void;\n\n /**\n * WGSL code of an `u32` expression for getting indices.\n *\n * @param varIndices - a variable name for the indices.\n * @param idx - the index of the indices to get. can be a number or a string (WGSL `u32` expression).\n *\n * @returns an `u32` expression\n */\n readonly indicesGet: (varIndices: string, idx: number|string) => string;\n\n /**\n * WGSL code for a statement for setting data at the given indices.\n *\n * @param indicesAndValue - an array of numbers or strings (WGSL `u32` expression) representing the indices, followed\n * by the value to set. This array should have exactly `shape.length + 1` elements.\n */\n readonly set: (...indicesAndValue: ReadonlyArray) => string;\n\n /**\n * WGSL code for a statement for setting data at the given indices variable.\n *\n * @param varIndices - a variable name for the indices.\n * @param value - the value to set. should be a WGSL expression.\n */\n readonly setByIndices: (varIndices: string, value: string) => string;\n\n /**\n * WGSL code for a statement for setting data at the given offset.\n *\n * @param offset - a number or a string (WGSL `u32` expression) representing the offset.\n * @param value - the value to set. should be a WGSL expression.\n */\n readonly setByOffset: (offset: number|string, value: string) => string;\n\n /**\n * WGSL code for an expression for getting data at the given indices.\n *\n * @param indices - an array of numbers or strings (WGSL `u32` expression) representing the indices.\n */\n readonly get: (...indices: ReadonlyArray) => string;\n\n /**\n * WGSL code for an expression for getting data at the given indices variable.\n *\n * @param varIndices - a variable name for the indices.\n */\n readonly getByIndices: (varIndices: string) => string;\n\n /**\n * WGSL code for an expression for getting data at the given offset.\n *\n * @param offset - a number or a string (WGSL `u32` expression) representing the offset.\n */\n readonly getByOffset: (offset: number|string) => string;\n\n /**\n * name of the data variable\n */\n readonly name: string;\n\n /**\n * whether the helper is for an input, an output or an internal variable.\n */\n readonly usage: 'input'|'output'|'internal';\n\n /**\n * the rank of the input or output.\n */\n readonly rank: number;\n\n /**\n * a string representing the variable name for the shape of the input or output.\n */\n readonly shape: string;\n\n /**\n * a string representing the variable name for the strides of the input or output.\n */\n readonly strides: string;\n}\n\nconst getWgslMappedType = (type: number, components: 1|2|3|4): string|[string, string] => {\n if (components === 3) {\n throw new Error('vec3 has same alignment as vec4, use vec4 instead');\n }\n\n // return type is [ storage type, runtime type ] or a single string for both\n switch (type) {\n case DataType.float16:\n return components > 1 ? `vec${components}` : 'f16';\n case DataType.float:\n return components > 1 ? `vec${components}` : 'f32';\n case DataType.int32:\n return components > 1 ? `vec${components}` : 'i32';\n case DataType.uint32:\n return components > 1 ? `vec${components}` : 'u32';\n case DataType.int64:\n if (components > 1) {\n throw new Error('currently not supported vecX of uint64 yet');\n }\n return ['vec2', 'i32'];\n case DataType.uint64:\n if (components > 1) {\n throw new Error('currently not supported vecX of uint64 yet');\n }\n return ['vec2', 'u32'];\n case DataType.bool:\n if (components !== 4) {\n throw new Error('bool must be vec4');\n }\n return ['u32', 'vec4'];\n\n default:\n throw new Error(`Unknown data type: ${type}`);\n }\n};\n\nexport const tensorTypeToWsglStorageType = (type: DataType, components: 1|2|3|4 = 1) => {\n const mappedType = getWgslMappedType(type, components);\n return typeof mappedType === 'string' ? mappedType : mappedType[0];\n};\n\nexport const tensorTypeToWsglValueType = (type: DataType, components: 1|2|3|4 = 1) => {\n const mappedType = getWgslMappedType(type, components);\n return typeof mappedType === 'string' ? mappedType : mappedType[1];\n};\n\nexport const createTensorShapeVariables = (...dims: ReadonlyArray): ProgramUniform[] => {\n const programUniforms: ProgramUniform[] = [];\n dims.forEach(dim => {\n if (dim.length !== 0) {\n programUniforms.push(\n {type: DataType.uint32, data: dim}, {type: DataType.uint32, data: ShapeUtil.computeStrides(dim)});\n }\n });\n return programUniforms;\n};\n\n/**\n * A helper function to get maximum vector size for specified data length\n * @param size\n */\nexport const getMaxComponents = (size: number) => {\n // we cannot use vec3 type since it has alignment of 16 bytes\n if (size % 4 === 0) {\n return 4;\n } else if (size % 2 === 0) {\n return 2;\n }\n\n return 1;\n};\n\n/**\n * A helper function that initializes variable as a scalar or vector. e.g. f32(0) or vec4f(0,0,0,0)\n * @param dataType\n * @param components\n * @param value\n */\nexport const fillVector = (dataType = 'f32', components?: number, value = '0') => {\n if (!components || components === 1) {\n return `${dataType}(${value})`;\n }\n\n return `vec${components}<${dataType}>(${value})`;\n};\n\n/**\n * A helper function that casts value or vector to f32\n * @param dataType\n * @param components\n * @param value\n */\nexport const castToF32 = (dataType: string, components: number, value: string) => {\n if (dataType === 'f32') {\n return value;\n }\n if (components === 1) {\n return `f32(${value})`;\n }\n\n return `vec${components}(${value})`;\n};\n\n/**\n * A helper function that returns scalar or sums all components of a vector\n * @param name\n * @param components\n */\nexport const sumVector = (name: string, components: number) => {\n if (components === 4) {\n return `(${name}.x + ${name}.y + ${name}.z + ${name}.w)`;\n } else if (components === 2) {\n return `(${name}.x + ${name}.y)`;\n } else if (components === 3) {\n return `(${name}.x + ${name}.y + ${name}.z)`;\n }\n\n return name;\n};\n\n/**\n * A helper function that returns variable element at index.\n * @param name - the name of variable.\n * @param index - the index of variable element.\n * @param length - the length of variable.\n * @param type - the type of variable, optional.\n */\nexport const getElementAt =\n (name: string, index: number|string, length: number, type?: UniformDataElementType): string => {\n if (name.startsWith('uniforms.') && length > 4) {\n if (typeof (index) === 'string') {\n if (type === 'f16') {\n return `${name}[(${index}) / 8][(${index}) % 8 / 4][(${index}) % 8 % 4]`;\n } else {\n return `${name}[(${index}) / 4][(${index}) % 4]`;\n }\n } else {\n if (type === 'f16') {\n return `${name}[${Math.floor(index / 8)}][${Math.floor(index % 8 / 4)}][${index % 8 % 4}]`;\n } else {\n return `${name}[${Math.floor(index / 4)}][${index % 4}]`;\n }\n }\n } else {\n return length > 1 ? `${name}[${index}]` : name;\n }\n };\n\n/**\n * A helper function to get a IndicesHelper for a given input or output.\n *\n * @param name - the name of the input or output.\n * @param tensorType - the tensor type of the input or output.\n * @param shapeOrRank - the tensor shape or the rank of the input or output.\n * @param usage - the usage of the indices helper.\n * @param components - indicates the number of components of each element. 1 for scalar, 2 for vec2, 3 for vec3, 4 for\n * vec4.\n */\nconst createIndicesHelper =\n (name: string, tensorType: number, shapeOrRank: number|readonly number[], usage: IndicesHelper['usage'],\n components: 1|2|3|4): IndicesHelper => {\n const useUniform = typeof shapeOrRank === 'number';\n const rank = useUniform ? shapeOrRank : shapeOrRank.length;\n const rankIdentity = [...new Array(rank).keys()];\n const indicesType = rank < 2 ? 'u32' : rank <= 4 ? `vec${rank}` : `array`;\n const mappedType = getWgslMappedType(tensorType, components);\n const valueType = typeof mappedType === 'string' ? mappedType : mappedType[1];\n const storageType = typeof mappedType === 'string' ? mappedType : mappedType[0];\n const type = {indices: indicesType, value: valueType, storage: storageType, tensor: tensorType};\n\n const normalizeDim = (dim: number|string): string => typeof dim === 'string' ? dim : `${dim}u`;\n\n const implementationUsed = {\n offsetToIndices: false,\n indicesToOffset: false,\n broadcastedIndicesToOffset: false,\n set: false,\n setByIndices: false,\n get: false,\n getByIndices: false,\n };\n\n const uniformPrefix = useUniform ? 'uniforms.' : '';\n const shape = `${uniformPrefix}${name}_shape`;\n const strides = `${uniformPrefix}${name}_strides`;\n\n let o2iSnippet = '';\n for (let i = 0; i < rank - 1; i++) {\n o2iSnippet += `\n let dim${i} = current / ${getElementAt(strides, i, rank)};\n let rest${i} = current % ${getElementAt(strides, i, rank)};\n indices[${i}] = dim${i};\n current = rest${i};\n `;\n }\n o2iSnippet += `indices[${rank - 1}] = current;`;\n\n const offsetToIndicesImplementation = rank < 2 ? '' : `\n fn o2i_${name}(offset: u32) -> ${type.indices} {\n var indices: ${type.indices};\n var current = offset;\n ${o2iSnippet}\n return indices;\n }`;\n\n const offsetToIndices = (varOffset: string) => {\n implementationUsed.offsetToIndices = true;\n return rank < 2 ? varOffset : `o2i_${name}(${varOffset})`;\n };\n\n const offsets: string[] = [];\n if (rank >= 2) {\n for (let i = rank - 1; i >= 0; i--) {\n offsets.push(`${getElementAt(strides, i, rank)} * (indices[${i}])`);\n }\n }\n\n const indicesToOffsetImplementation = rank < 2 ? '' : `\n fn i2o_${name}(indices: ${type.indices}) -> u32 {\n return ${offsets.join('+')};\n }`;\n\n const indicesToOffset = (varIndices: string) => {\n implementationUsed.indicesToOffset = true;\n return rank < 2 ? varIndices : `i2o_${name}(${varIndices})`;\n };\n\n const indices = (...init: ReadonlyArray) =>\n rank === 0 ? '0u' : `${type.indices}(${init.map(normalizeDim).join(',')})`;\n\n const indicesGet = (varIndices: string, idx: number|string) => {\n if (rank < 2) {\n return `${varIndices}`;\n } else {\n return `${getElementAt(varIndices, idx, rank)}`;\n }\n };\n\n const indicesSet = (varIndices: string, idx: number|string, value: string) => {\n if (rank < 2) {\n return `${varIndices}=${value};`;\n } else {\n return `${getElementAt(varIndices, idx, rank)}=${value};`;\n }\n };\n\n const broadcastedIndicesToOffsetImplementation: {[key: string]: string} = {};\n const broadcastedIndicesToOffset = (varIndices: string, output: IndicesHelper) => {\n implementationUsed.broadcastedIndicesToOffset = true;\n const implKey = `${output.name}broadcastedIndicesTo${name}Offset`;\n if (implKey in broadcastedIndicesToOffsetImplementation) {\n return `${implKey}(${varIndices})`;\n }\n const offsets = [];\n for (let i = rank - 1; i >= 0; i--) {\n const idx = output.indicesGet('outputIndices', i + output.rank - rank);\n offsets.push(`${indicesGet(strides, i)} * (${idx} % ${indicesGet(shape, i)})`);\n }\n broadcastedIndicesToOffsetImplementation[implKey] =\n `fn ${implKey}(outputIndices: ${output.type.indices}) -> u32 {\n return ${offsets.length > 0 ? offsets.join('+') : '0u'};\n }`;\n\n return `${implKey}(${varIndices})`;\n };\n\n const setByOffset = (offset: number|string, value: string) => (() => {\n if (type.storage === type.value) {\n return `${name}[${offset}]=${value};`;\n } else if (type.storage === 'vec2' && type.value === 'i32') {\n // int64, components === 1\n return `${name}[${offset}]=vec2(u32(${value}), select(0u, 0xFFFFFFFFu, ${value} < 0));`;\n } else if (type.storage === 'vec2' && type.value === 'u32') {\n // uint64, components === 1\n return `${name}[${offset}]=vec2(u32(${value}), 0u);`;\n } else if (type.storage === 'u32' && type.value === 'vec4') {\n // bool, components === 4\n return `${name}[${offset}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${value}));`;\n } else {\n throw new Error(`not supported combination of storage type ${type.storage} and value type ${type.value} yet`);\n }\n })();\n\n const getByOffset = (offset: number|string) => (() => {\n if (type.storage === type.value) {\n return `${name}[${offset}]`;\n } else if (type.storage === 'vec2' && type.value === 'i32') {\n // int64, components === 1\n return `i32(${name}[${offset}].x)`;\n } else if (type.storage === 'vec2' && type.value === 'u32') {\n // uint64, components === 1\n return `u32(${name}[${offset}].x)`;\n } else if (type.storage === 'u32' && type.value === 'vec4') {\n // bool, components === 4\n return `vec4(bool(${name}[${offset}] & 0xFFu), bool(${name}[${offset}] & 0xFF00u), bool(${name}[${\n offset}] & 0xFF0000u), bool(${name}[${offset}] & 0xFF000000u))`;\n } else {\n throw new Error(`not supported combination of storage type ${type.storage} and value type ${type.value} yet`);\n }\n })();\n\n const getByIndicesImplementation = rank < 2 ? '' : `\n fn get_${name}ByIndices(indices: ${type.indices}) -> ${valueType} {\n return ${getByOffset(`i2o_${name}(indices)`)};\n }`;\n\n const getImplementation = rank < 2 ? '' : (() => {\n const functionParams = rankIdentity.map(i => `d${i}: u32`).join(', ');\n const dimsParams = rankIdentity.map(i => `d${i}`).join(', ');\n return `\n fn get_${name}(${functionParams}) -> ${valueType} {\n return get_${name}ByIndices(${indices(dimsParams)});\n }`;\n })();\n\n const get = (...indices: ReadonlyArray) => {\n if (indices.length !== rank) {\n throw new Error(`indices length must be ${rank}`);\n }\n\n const normalizedIndices = indices.map(normalizeDim).join(',');\n\n if (rank === 0) {\n return getByOffset('0u');\n } else if (rank === 1) {\n return getByOffset(normalizedIndices[0]);\n } else {\n implementationUsed.get = true;\n implementationUsed.getByIndices = true;\n implementationUsed.indicesToOffset = true;\n return `get_${name}(${normalizedIndices})`;\n }\n };\n\n const getByIndices = (varIndices: string) => {\n if (rank < 2) {\n return getByOffset(varIndices);\n } else {\n implementationUsed.getByIndices = true;\n implementationUsed.indicesToOffset = true;\n return `get_${name}ByIndices(${varIndices})`;\n }\n };\n\n const setByIndicesImplementation = rank < 2 ? '' : `\n fn set_${name}ByIndices(indices: ${type.indices}, value: ${valueType}) {\n ${setByOffset(`i2o_${name}(indices)`, 'value')}\n }`;\n\n const setImplementation = rank < 2 ? '' : (() => {\n const functionParams = rankIdentity.map(i => `d${i}: u32`).join(', ');\n const dimsParams = rankIdentity.map(i => `d${i}`).join(', ');\n return `\n fn set_${name}(${functionParams}, value: ${valueType}) {\n set_${name}ByIndices(${indices(dimsParams)}, value);\n }`;\n })();\n\n const set = (...indicesAndValue: ReadonlyArray) => {\n if (indicesAndValue.length !== rank + 1) {\n throw new Error(`indices length must be ${rank}`);\n }\n const value = indicesAndValue[rank];\n if (typeof value !== 'string') {\n throw new Error('value must be string');\n }\n\n const normalizedIndices = indicesAndValue.slice(0, rank).map(normalizeDim).join(',');\n\n if (rank === 0) {\n return setByOffset('0u', value);\n } else if (rank === 1) {\n return setByOffset(normalizedIndices[0], value);\n } else {\n implementationUsed.set = true;\n implementationUsed.setByIndices = true;\n implementationUsed.indicesToOffset = true;\n return `set_${name}(${normalizedIndices}, ${value})`;\n }\n };\n\n const setByIndices = (varIndices: string, value: string) => {\n if (rank < 2) {\n return setByOffset(varIndices, value);\n } else {\n implementationUsed.setByIndices = true;\n implementationUsed.indicesToOffset = true;\n return `set_${name}ByIndices(${varIndices}, ${value});`;\n }\n };\n\n const impl = () => {\n const impls = [];\n let needShapeStrides = false;\n if (implementationUsed.offsetToIndices) {\n impls.push(offsetToIndicesImplementation);\n needShapeStrides = true;\n }\n if (implementationUsed.indicesToOffset) {\n impls.push(indicesToOffsetImplementation);\n needShapeStrides = true;\n }\n if (implementationUsed.broadcastedIndicesToOffset) {\n Object.values(broadcastedIndicesToOffsetImplementation).forEach(impl => impls.push(impl));\n needShapeStrides = true;\n }\n if (implementationUsed.set) {\n impls.push(setImplementation);\n needShapeStrides = true;\n }\n if (implementationUsed.setByIndices) {\n impls.push(setByIndicesImplementation);\n needShapeStrides = true;\n }\n if (implementationUsed.get) {\n impls.push(getImplementation);\n needShapeStrides = true;\n }\n if (implementationUsed.getByIndices) {\n impls.push(getByIndicesImplementation);\n needShapeStrides = true;\n }\n if (!useUniform && needShapeStrides) {\n impls.unshift(\n `const ${shape} = ${type.indices}(${shapeOrRank.join(',')});`,\n `const ${strides} = ${type.indices}(${ShapeUtil.computeStrides(shapeOrRank).join(',')});`);\n }\n return impls.join('\\n');\n };\n\n return {\n impl,\n type,\n offsetToIndices,\n indicesToOffset,\n broadcastedIndicesToOffset,\n indices,\n indicesGet,\n indicesSet,\n set,\n setByOffset,\n setByIndices,\n get,\n getByOffset,\n getByIndices,\n // isVec4,\n usage,\n name,\n strides,\n shape,\n rank\n };\n };\n\n/**\n * Create a IndicesHelper for an input.\n *\n * @param name - the name of the input.\n * @param type - the tensor type of the input.\n * @param shapeOrRank - the tensor shape or the rank of the input.\n * @param components - the number of components of the input. available values are 1, 2, 3, 4. default is 1.\n * @returns an IndicesHelper for the input.\n */\nexport const inputVariable =\n (name: string, type: number, shapeOrRank: number|readonly number[], components: 1|2|3|4 = 1): IndicesHelper =>\n createIndicesHelper(name, type, shapeOrRank, 'input', components);\n\n/**\n * Create a IndicesHelper for an output.\n *\n * @param name - the name of the output.\n * @param type - the tensor type of the output.\n * @param shapeOrRank - the tensor shape or the rank of the output.\n * @param components - the number of components of the output. available values are 1, 2, 3, 4. default is 1.\n * @returns an IndicesHelper for the output.\n */\nexport const outputVariable =\n (name: string, type: number, shapeOrRank: number|readonly number[], components: 1|2|3|4 = 1): IndicesHelper =>\n createIndicesHelper(name, type, shapeOrRank, 'output', components);\n\n/**\n * Create a IndicesHelper for an internal variable.\n *\n * @param name - the name of the variable.\n * @param type - the tensor type of the variable.\n * @param shapeOrRank - the tensor shape or the rank of the variable.\n * @param components - the number of components of the variable. available values are 1, 2, 3, 4. default is 1.\n * @returns an IndicesHelper for the variable.\n */\nexport const internalVariable =\n (name: string, type: number, shapeOrRank: number|readonly number[], components: 1|2|3|4 = 1): IndicesHelper =>\n createIndicesHelper(name, type, shapeOrRank, 'internal', components);\n\nexport type UniformDataElementType = 'u32'|'f16'|'f32'|'i32';\nexport type UniformsArrayType = Array<{name: string; type: UniformDataElementType; length?: number}>;\n\n/**\n * A ShaderHelper is a helper class for generating WGSL code.\n */\nexport interface ShaderHelper {\n /**\n * A helper function to generate the start of main function in WGSL source code.\n *\n * @example\n * const getShaderSource = (shaderHelper: ShaderHelper) => `\n * ...\n *\n * ${shaderHelper.mainStart()}\n * // your code here inside main() function\n * ...\n * }\n * `;\n *\n * @param workgroupSize - an optional workgroup size. default is WORKGROUP_SIZE.\n */\n mainStart(workgroupSize?: number|[number, number, number]): string;\n\n /**\n * A helper function to generate the code snippet for guarding against out-of-bounds size.\n *\n * @example\n * const getShaderSource = (shaderHelper: ShaderHelper) => `\n * ...\n *\n * ${shaderHelper.mainStart()}\n * ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes(outputSize)}\n *\n * // your code here inside main() function\n * ...\n * }\n * `;\n *\n * @param size - the size of the data to guard against. can be a number or a string (WGSL `u32` expression).\n */\n guardAgainstOutOfBoundsWorkgroupSizes(size: unknown): string;\n\n /**\n * A helper function to generate the code snippet for declaring multiple inputs or outputs.\n *\n * @param variables - an array of IndicesHelper for the variables.\n */\n declareVariables(...variables: IndicesHelper[]): string;\n\n /**\n * A helper function to register one uniform. Can be called multiple times to register multiple uniforms.\n *\n * @param name - the name of the uniform.\n * @param type - the type of the uniform.\n * @param length - the length of the uniform, default to 1 when it is not provided.\n */\n registerUniform(name: string, type: string, length?: number): ShaderHelper;\n\n /**\n * A helper function to register multiple uniforms. Can be called multiple times to register multiple uniforms.\n *\n * @param uniforms - an array of uniforms. Each element of the array is an object with 2 properties: `name` and\n * `type`.\n */\n registerUniforms(uniforms: UniformsArrayType): ShaderHelper;\n\n /**\n * A helper function to register multiple internal variables. Can be called multiple times to register multiple\n * internal variables.\n *\n * @param variables - an array of IndicesHelper for the variables.\n */\n registerInternalVariables(...variables: IndicesHelper[]): ShaderHelper;\n}\n\nclass ShaderHelperImpl implements ShaderHelper {\n constructor(private normalizedDispatchGroup: [number, number, number], private limits: GPUSupportedLimits) {}\n\n guardAgainstOutOfBoundsWorkgroupSizes(size: number|string): string {\n // Guard against out-of-bounds work group sizes\n const sizeInCode = typeof size === 'number' ? `${size}u` : size;\n return `if (global_idx >= ${sizeInCode}) { return; }`;\n }\n\n mainStart(workgroupSize: number|[number, number, number] = WORKGROUP_SIZE) {\n const workgroupSizeX = typeof workgroupSize === 'number' ? workgroupSize : workgroupSize[0];\n const workgroupSizeY = typeof workgroupSize === 'number' ? 1 : workgroupSize[1];\n const workgroupSizeZ = typeof workgroupSize === 'number' ? 1 : workgroupSize[2];\n\n if (workgroupSizeX > this.limits.maxComputeWorkgroupSizeX ||\n workgroupSizeY > this.limits.maxComputeWorkgroupSizeY ||\n workgroupSizeZ > this.limits.maxComputeWorkgroupSizeZ) {\n throw new Error(`workgroup size [${workgroupSizeX}, ${workgroupSizeY}, ${\n workgroupSizeZ}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${\n this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);\n }\n\n if (workgroupSizeX * workgroupSizeY * workgroupSizeZ > this.limits.maxComputeInvocationsPerWorkgroup) {\n throw new Error(`workgroup size [${workgroupSizeX}, ${workgroupSizeY}, ${\n workgroupSizeZ}] exceeds the maximum workgroup invocations ${\n this.limits.maxComputeInvocationsPerWorkgroup}.`);\n }\n\n const is1DimensionDispatch = this.normalizedDispatchGroup[1] === 1 && this.normalizedDispatchGroup[2] === 1;\n const paramList = is1DimensionDispatch ? `@builtin(global_invocation_id) global_id : vec3,\n @builtin(workgroup_id) workgroup_id : vec3,\n @builtin(local_invocation_id) local_id : vec3` :\n `@builtin(global_invocation_id) global_id : vec3,\n @builtin(local_invocation_id) local_id : vec3,\n @builtin(local_invocation_index) local_idx : u32,\n @builtin(workgroup_id) workgroup_id : vec3,\n @builtin(num_workgroups) num_workgroups : vec3`;\n const globalIdxDefinition = is1DimensionDispatch ?\n 'let global_idx = global_id.x; let local_idx = local_id.x;' :\n `let global_idx = (workgroup_id.z * num_workgroups[0] * num_workgroups[1] +\n workgroup_id.y * num_workgroups[0] + workgroup_id.x) * ${\n workgroupSizeX * workgroupSizeY * workgroupSizeZ}u + local_idx;`;\n\n return `@compute @workgroup_size(${workgroupSizeX}, ${workgroupSizeY}, ${workgroupSizeZ})\n fn main(${paramList}) {\n ${globalIdxDefinition}\n `;\n }\n\n private appendVariableUniforms(variable: IndicesHelper): void {\n if (variable.rank !== 0) {\n if (variable.shape.startsWith('uniforms.')) {\n this.uniforms.push({name: variable.shape.replace('uniforms.', ''), type: 'u32', length: variable.rank});\n }\n if (variable.strides.startsWith('uniforms.')) {\n this.uniforms.push({name: variable.strides.replace('uniforms.', ''), type: 'u32', length: variable.rank});\n }\n }\n }\n\n private declareVariable(variable: IndicesHelper, bindingIndex: number): string {\n if (variable.usage === 'internal') {\n throw new Error('cannot use internal variable with declareVariable(). use registerInternalVariables() instead.');\n }\n this.variables.push(variable);\n this.appendVariableUniforms(variable);\n\n const access = variable.usage === 'input' ? 'read' : 'read_write';\n const storageType = variable.type.storage;\n return `@group(0) @binding(${bindingIndex}) var ${variable.name}: array<${storageType}>;`;\n }\n\n declareVariables(...variables: IndicesHelper[]): string {\n return variables.map(v => this.declareVariable(v, this.variableIndex++)).join('\\n');\n }\n\n private registerInternalVariable(variable: IndicesHelper): void {\n if (variable.usage !== 'internal') {\n throw new Error(\n 'cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.');\n }\n\n this.internalVariables.push(variable);\n this.appendVariableUniforms(variable);\n }\n\n registerInternalVariables(...variables: IndicesHelper[]): ShaderHelper {\n variables.forEach(v => this.registerInternalVariable(v));\n return this;\n }\n\n registerUniform(name: string, type: UniformDataElementType, length = 1): ShaderHelper {\n this.uniforms.push({name, type, length});\n return this;\n }\n\n registerUniforms(additionalUniforms: UniformsArrayType): ShaderHelper {\n this.uniforms = this.uniforms.concat(additionalUniforms);\n return this;\n }\n\n private internalVariables: IndicesHelper[] = [];\n private variables: IndicesHelper[] = [];\n private uniforms: UniformsArrayType = [];\n private uniformDeclaration(): string {\n if (this.uniforms.length === 0) {\n return '';\n }\n\n const uniformSnippets: string[] = [];\n for (const {name, type, length} of this.uniforms) {\n if (length && length > 4) {\n if (type === 'f16') {\n uniformSnippets.push(`@align(16) ${name}:array, ${Math.ceil(length / 8)}>`);\n } else {\n uniformSnippets.push(`${name}:array, ${Math.ceil(length / 4)}>`);\n }\n } else {\n const typeTemp = length == null || length === 1 ? type : `vec${length}<${type}>`;\n uniformSnippets.push(`${name}:${typeTemp}`);\n }\n }\n\n return `\n struct Uniforms { ${uniformSnippets.join(', ')} };\n @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`;\n }\n private variableIndex = 0;\n\n /**\n * Get additional implementation that needs to be added to the shader source.\n */\n get additionalImplementations(): string {\n return this.uniformDeclaration() + this.variables.map(i => i.impl()).join('\\n') +\n this.internalVariables.map(i => i.impl()).join('\\n');\n }\n\n /**\n * Get the variable info of the shader program.\n */\n get variablesInfo(): ProgramUniformVariableInfo[]|undefined {\n if (this.uniforms.length === 0) {\n return undefined;\n }\n\n const uniformWgslTypeToDataType = (type: UniformDataElementType) =>\n ([DataType.uint32, DataType.float16, DataType.float,\n DataType.int32][['u32', 'f16', 'f32', 'i32'].indexOf(type)]);\n return this.uniforms.map(u => ([uniformWgslTypeToDataType(u.type), u.length ?? 1]));\n }\n}\n\nexport const createShaderHelper = (dispatchGroup: [number, number, number], limits: GPUSupportedLimits) =>\n new ShaderHelperImpl(dispatchGroup, limits);\n\n/**\n * This function comes from https://github.com/tensorflow/tfjs/blob/master/tfjs-core/src/ops/broadcast_util.ts#L18-L40\n * Returns the dimensions in the input shape that are broadcasted to\n * produce the provided output shape.\n *\n * The returned dimensions are 0-indexed and sorted. An example:\n * inShape = [4, 1, 3]\n * outShape = [5, 4, 3, 3]\n * result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.\n */\nexport const getBroadcastDims = (inShape: readonly number[], outShape: readonly number[]): number[] => {\n const inRank = inShape.length;\n const dims: number[] = [];\n for (let i = 0; i < inRank; i++) {\n const dim = inRank - 1 - i;\n const a = inShape[dim] || 1;\n const b = outShape[outShape.length - 1 - i] || 1;\n if (b > 1 && a === 1) {\n dims.unshift(dim);\n }\n }\n return dims;\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, IndicesHelper, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface TransposeAttributes extends AttributeWithCacheKey {\n readonly perm: number[];\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Transpose requires 1 input.');\n }\n};\n\nconst getAdjustedPerm = (inputRank: number, perm: number[]): number[] =>\n (perm && perm.length !== inputRank) ? [...(new Array(inputRank).keys())].reverse() : perm;\n\nconst getOutputShape = (inputShape: readonly number[], perm: number[]): readonly number[] =>\n ShapeUtil.sortBasedOnPerm(inputShape, getAdjustedPerm(inputShape.length, perm));\n\nconst permFunctionBody = (perm: number[], rank: number, input: IndicesHelper, output: IndicesHelper): string => {\n const reverseFunc = [];\n reverseFunc.push(`fn perm(i: ${output.type.indices}) -> ${input.type.indices} {\n var a: ${input.type.indices};`);\n for (let i = 0; i < rank; ++i) {\n reverseFunc.push(input.indicesSet('a', perm[i], `i[${i}]`));\n }\n reverseFunc.push('return a;}');\n return reverseFunc.join('\\n');\n};\n\nexport const createTransposeProgramInfo = (inputTensor: TensorView, permAttr: number[]): ProgramInfo => {\n const inputDataType = inputTensor.dataType;\n const inputRank = inputTensor.dims.length;\n const perm = getAdjustedPerm(inputRank, permAttr);\n const outputShape = getOutputShape(inputTensor.dims, perm);\n const output = outputVariable('output', inputDataType, outputShape.length);\n const input = inputVariable('a', inputDataType, inputRank);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${shaderHelper.registerUniform('output_size', 'u32').declareVariables(input, output)}\n\n ${permFunctionBody(perm, inputRank, input, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n\n let indices = ${output.offsetToIndices('global_idx')};\n let aIndices = perm(indices);\n\n ${output.setByOffset('global_idx', input.getByIndices('aIndices'))}\n }`;\n return {\n name: 'Transpose',\n shaderCache: {hint: `${permAttr}`, inputDependencies: ['rank']},\n getRunData: (inputs) => {\n const outputSize = ShapeUtil.size(outputShape);\n return {\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms:\n [{type: DataType.uint32, data: outputSize}, ...createTensorShapeVariables(inputs[0].dims, outputShape)],\n };\n },\n getShaderSource,\n };\n};\n\nexport const transpose = (context: ComputeContext, attributes: TransposeAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createTransposeProgramInfo(context.inputs[0], attributes.perm));\n};\n\nexport const parseTransposeAttributes = (attributes: Record): TransposeAttributes =>\n createAttributeWithCacheKey({perm: attributes.perm as number[]});\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramShaderCacheInfo} from '../types';\n\nimport {inputVariable, outputVariable, ShaderHelper} from './common';\nimport {createReduceAttributesFromInputs, ReduceAttributes} from './reduce';\nimport {createTransposeProgramInfo} from './transpose';\n\nconst reduceOps: {[key: string]: string} = {\n max: 'select(bestValue, candidate, candidate > bestValue)',\n min: 'select(bestValue, candidate, candidate < bestValue)',\n mean: 'bestValue + candidate',\n sum: 'bestValue + candidate',\n prod: 'bestValue * candidate',\n sumSquare: 'bestValue + candidate * candidate',\n logSumExp: 'bestValue + exp(candidate)',\n l1: 'bestValue + abs(candidate)',\n l2: 'bestValue + candidate * candidate',\n logSum: 'bestValue + candidate'\n};\n\nconst reduceSharedOps: {[key: string]: string} = {\n max: 'select(bestValue, candidate, candidate > bestValue)',\n min: 'select(bestValue, candidate, candidate < bestValue)',\n mean: 'bestValue + candidate',\n sum: 'bestValue + candidate',\n prod: 'bestValue * candidate',\n sumSquare: 'bestValue + candidate',\n logSumExp: 'bestValue + candidate',\n l1: 'bestValue + candidate',\n l2: 'bestValue + candidate',\n logSum: 'bestValue + candidate'\n};\n\nconst reduceInitValues: {[key: string]: string} = {\n max: '_A[offset]',\n min: '_A[offset]',\n mean: '0',\n sum: '0',\n prod: '1',\n sumSquare: '0',\n logSumExp: '0',\n l1: '0',\n l2: '0',\n logSum: '0'\n};\n\nconst reduceOutputValues: {[key: string]: string} = {\n max: 'bestValue',\n min: 'bestValue',\n sum: 'bestValue',\n prod: 'bestValue',\n sumSquare: 'bestValue',\n logSumExp: 'log(bestValue)',\n l1: 'bestValue',\n l2: 'sqrt(bestValue)',\n logSum: 'log(bestValue)'\n};\n\nconst getInnerMostAxes = (numInnerAxes: number, rank: number): number[] => {\n const res = [];\n for (let i = rank - numInnerAxes; i < rank; ++i) {\n res.push(i);\n }\n return res;\n};\n\nconst computeOutAndReduceShapes = (shape: readonly number[], axes: readonly number[]): [number[], number[]] => {\n const outputShape = [];\n const rank = shape.length;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n outputShape.push(shape[dim]);\n }\n }\n const reduceShape = axes.map(dim => shape[dim]);\n return [outputShape, reduceShape];\n};\n\nconst expandShapeToKeepDim = (shape: number[], axes: number[]): number[] => {\n const rank = shape.length + axes.length;\n const expandShape = [];\n let shapeIdx = 0;\n for (let dim = 0; dim < rank; dim++) {\n if (axes.indexOf(dim) === -1) {\n expandShape.push(shape[shapeIdx++]);\n } else {\n expandShape.push(1);\n }\n }\n return expandShape;\n};\n\nconst areAxesInnerMostDims = (axes: number[], rank: number): boolean => {\n for (let i = 0; i < axes.length; ++i) {\n if (axes[axes.length - i - 1] !== rank - 1 - i) {\n return false;\n }\n }\n return true;\n};\n\nconst getAxesPermutation = (axes: number[], rank: number): number[] => {\n const res = [];\n if (!areAxesInnerMostDims(axes, rank)) {\n for (let i = 0; i < rank; ++i) {\n if (axes.indexOf(i) === -1) {\n res.push(i);\n }\n }\n axes.forEach(axis => res.push(axis));\n }\n return res;\n};\n\nexport const createReduceSharedProgramInfo =\n (name: string, shaderCache: ProgramShaderCacheInfo, inputs: readonly TensorView[], reduceType: string,\n outputDataType: DataType, outputShape: number[], reduceShape: number[]): ProgramInfo => {\n const inputShape = inputs[0].dims;\n\n const outputSize = ShapeUtil.size(outputShape);\n const reduceSize = ShapeUtil.size(reduceShape);\n\n const input = inputVariable('_A', inputs[0].dataType, inputShape);\n const output = outputVariable('output', outputDataType, outputShape);\n\n const workgroupSize = 32;\n\n const sharedMemorySnippet = `\n var aBestValues : array;\n `;\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${shaderHelper.registerUniform('reduceSize', 'u32').declareVariables(input, output)}\n ${sharedMemorySnippet}\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\n return ((a - 1u) / b + 1u);\n }\n ${shaderHelper.mainStart(workgroupSize)}\n\n let outputIndex = global_idx / ${workgroupSize};\n let offset = outputIndex * uniforms.reduceSize;\n\n var bestValue = f32(${reduceInitValues[reduceType]});\n let Length = uniforms.reduceSize;\n for (var k = local_idx; k < Length; k = k + ${workgroupSize}) {\n let candidate = f32(${input.getByOffset('offset + k')});\n bestValue = ${reduceOps[reduceType]};\n }\n aBestValues[local_idx] = bestValue;\n workgroupBarrier();\n\n var reduceSize = min(Length, ${workgroupSize}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (local_idx < currentSize) {\n let candidate = aBestValues[local_idx + interval];\n bestValue = ${reduceSharedOps[reduceType]};\n aBestValues[local_idx] = bestValue;\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (local_idx == 0u) {\n ${\n output.setByOffset(\n 'outputIndex',\n `${\n reduceType === 'mean' ? `${output.type.storage}(bestValue / f32(uniforms.reduceSize))` :\n `${output.type.storage}(${reduceOutputValues[reduceType]})`}`)};\n }\n }`;\n\n // One work group is responsible for only one element of output.\n return {\n name,\n shaderCache,\n getShaderSource,\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: outputDataType}],\n dispatchGroup: {x: outputSize},\n programUniforms: [{type: DataType.uint32, data: reduceSize}]\n }),\n };\n };\n\nconst reduceCommon =\n (context: ComputeContext, name: string, attributes: ReduceAttributes,\n reduceType: 'sum'|'sumSquare'|'prod'|'min'|'max'|'mean'|'logSumExp'|'l1'|'l2'|'logSum'): void => {\n const updatedAttributes: ReduceAttributes =\n context.inputs.length === 1 ? attributes : createReduceAttributesFromInputs(context.inputs, attributes);\n\n let updatedAxes = updatedAttributes.axes;\n if (updatedAxes.length === 0 && !updatedAttributes.noopWithEmptyAxes) {\n updatedAxes = context.inputs[0].dims.map((_dim, i) => i);\n }\n const normalizeAxes = ShapeUtil.normalizeAxes(updatedAxes, context.inputs[0].dims.length);\n\n let axes = normalizeAxes;\n let input = context.inputs[0];\n const permutedAxes = getAxesPermutation(axes, context.inputs[0].dims.length);\n if (permutedAxes.length > 0) {\n input = context.compute(\n createTransposeProgramInfo(context.inputs[0], permutedAxes), {inputs: [0], outputs: [-1]})[0];\n axes = getInnerMostAxes(axes.length, input.dims.length);\n }\n\n const [outputShape, reduceShape] = computeOutAndReduceShapes(input.dims, axes);\n let finalOutputShape = outputShape;\n if (updatedAttributes.keepDims) {\n finalOutputShape = expandShapeToKeepDim(outputShape, normalizeAxes);\n }\n\n context.compute(\n createReduceSharedProgramInfo(\n name, {hint: updatedAttributes.cacheKey, inputDependencies: ['type']}, [input], reduceType,\n context.inputs[0].dataType, finalOutputShape, reduceShape),\n {inputs: [input]});\n };\n\nexport const reduceMeanShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceMeanShared', attributes, 'mean');\n};\n\nexport const reduceL1Shared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceL1Shared', attributes, 'l1');\n};\n\nexport const reduceL2Shared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceL2Shared', attributes, 'l2');\n};\n\nexport const reduceLogSumExpShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceLogSumExpShared', attributes, 'logSumExp');\n};\n\nexport const reduceMaxShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceMaxShared', attributes, 'max');\n};\n\nexport const reduceMinShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceMinShared', attributes, 'min');\n};\n\nexport const reduceProdShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceProdShared', attributes, 'prod');\n};\n\nexport const reduceSumShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceSumShared', attributes, 'sum');\n};\n\nexport const reduceSumSquareShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceSumSquareShared', attributes, 'sumSquare');\n};\n\nexport const reduceLogSumShared = (context: ComputeContext, attributes: ReduceAttributes): void => {\n reduceCommon(context, 'ReduceLogSumShared', attributes, 'logSum');\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramShaderCacheInfo} from '../types';\n\nimport {createTensorShapeVariables, IndicesHelper, inputVariable, outputVariable, ShaderHelper} from './common';\nimport {reduceL1Shared, reduceL2Shared, reduceLogSumExpShared, reduceLogSumShared, reduceMaxShared, reduceMeanShared, reduceMinShared, reduceProdShared, reduceSumShared, reduceSumSquareShared} from './reduce-shared';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length === 0 || inputs.length > 2) {\n throw new Error('Reduce op requires 1 or 2 inputs.');\n }\n\n if (inputs.length === 2 && inputs[1].dims.length !== 1) {\n throw new Error('Invalid axes input dims.');\n }\n};\n\nexport interface ReduceAttributes extends AttributeWithCacheKey {\n keepDims: boolean;\n noopWithEmptyAxes: boolean;\n axes: number[];\n}\n\nexport type ReduceOp =\n (input: IndicesHelper, output: IndicesHelper,\n axes: readonly number[]) => [string, string, string, string, ...string[]];\n\nconst noOp: ReduceOp = (input) => ['', '', `var value = ${input.getByIndices('input_indices')};`, ''];\nexport const createReduceProgramInfo =\n (name: string, shaderCache: ProgramShaderCacheInfo, inputs: readonly TensorView[], reduceOp: ReduceOp,\n axesInput: number[], outputDataType: DataType, keepDims = false, noopWithEmptyAxes = false): ProgramInfo => {\n const outputShape: number[] = [];\n const inputShape = inputs[0].dims;\n const inputRank = inputShape.length;\n const axes = ShapeUtil.normalizeAxes(axesInput, inputRank);\n const reduceOnAllAxes = !noopWithEmptyAxes && axes.length === 0;\n inputShape.forEach((d, i) => {\n if (reduceOnAllAxes || axes.indexOf(i) >= 0) {\n if (keepDims) {\n outputShape.push(1);\n } // else { // skip this axis}\n } else {\n outputShape.push(d);\n }\n });\n const outputRank = outputShape.length;\n const outputSize = ShapeUtil.size(outputShape);\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const idxCopy: string[] = []; // copy output indexes to input indexes\n\n const input = inputVariable('_A', inputs[0].dataType, inputRank);\n const output = outputVariable('output', outputDataType, outputRank);\n const ops = reduceOp(input, output, axes);\n let reduceOps = ops[2];\n\n for (let k = 0, l = 0; k < inputRank; k++) {\n // if this axis is reduced\n if (reduceOnAllAxes || axes.indexOf(k) >= 0) {\n if (keepDims) {\n l++;\n }\n // loop over the d-th axis\n reduceOps = `for(var j${k}: u32 = 0; j${k} < ${inputShape[k]}; j${k}++) {\n ${ops[2].includes('last_index') ? `let last_index = j${k};` : ''}\n ${input.indicesSet('input_indices', k, `j${k}`)}\n ${reduceOps}\n }`;\n } else {\n idxCopy.push(`${input.indicesSet('input_indices', k, output.indicesGet('output_indices', l))};`);\n l++;\n }\n }\n return `\n\n ${shaderHelper.registerUniform('output_size', 'u32').declareVariables(input, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n var input_indices: ${input.type.indices};\n let output_indices = ${output.offsetToIndices('global_idx')};\n\n ${idxCopy.join('\\n')}\n ${ops[0]} // init ops for reduce max/min\n ${ops[1]}\n ${reduceOps}\n ${ops[3]}\n ${ops.length === 4 ? output.setByOffset('global_idx', 'value') : ops.slice(4).join('\\n')}\n }`;\n };\n\n return {\n name,\n shaderCache,\n getShaderSource,\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: outputDataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms:\n [{type: DataType.uint32, data: outputSize}, ...createTensorShapeVariables(inputShape, outputShape)]\n }),\n };\n };\n\nexport const createReduceAttributesFromInputs =\n (inputs: readonly TensorView[], attributes: ReduceAttributes): ReduceAttributes => {\n const axes: number[] = [];\n if (inputs[1].dims[0] > 0) {\n inputs[1].getBigInt64Array().forEach(v => axes.push(Number(v)));\n }\n return createAttributeWithCacheKey(\n {axes, keepDims: attributes.keepDims, noopWithEmptyAxes: attributes.noopWithEmptyAxes});\n };\n\nconst runReduceProgram =\n (context: ComputeContext, name: string, attributes: ReduceAttributes, reduceOp: ReduceOp): void => {\n const inputs = context.inputs;\n const updatedAttributes: ReduceAttributes =\n inputs.length === 1 ? attributes : createReduceAttributesFromInputs(inputs, attributes);\n\n context.compute(\n createReduceProgramInfo(\n name, {hint: updatedAttributes.cacheKey, inputDependencies: ['rank']}, [inputs[0]],\n updatedAttributes.noopWithEmptyAxes && updatedAttributes.axes.length === 0 ? noOp : reduceOp,\n updatedAttributes.axes, inputs[0].dataType, updatedAttributes.keepDims,\n updatedAttributes.noopWithEmptyAxes),\n {inputs: [0]});\n };\n\nconst reduceLogSumNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var value = ${output.type.storage}(0);`,\n '',\n `value += ${input.getByIndices('input_indices')};`,\n 'value = log(value);',\n ];\n runReduceProgram(context, 'ReduceLogSum', attributes, reduceOp);\n};\n\nconst reduceL1Naive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var value = ${output.type.storage}(0);`,\n '',\n `value += abs(${input.getByIndices('input_indices')});`,\n '',\n ];\n runReduceProgram(context, 'ReduceL1', attributes, reduceOp);\n};\n\nconst reduceL2Naive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var t = ${output.type.value}(0); var value = ${output.type.value}(0);`,\n '',\n `t = ${input.getByIndices('input_indices')}; value += (t * t);`,\n 'value = sqrt(value);',\n ];\n runReduceProgram(context, 'ReduceL2', attributes, reduceOp);\n};\n\nconst reduceLogSumExpNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var value = ${output.type.storage}(0);`,\n '',\n `value += exp(${input.getByIndices('input_indices')});`,\n 'value = log(value);',\n ];\n runReduceProgram(context, 'ReduceLogSumExp', attributes, reduceOp);\n};\n\nconst reduceMaxNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, _output, axes) => {\n const idxZero = [];\n for (let k = 0; k < input.rank; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n idxZero.push(input.indicesSet('input_indices', k, 0));\n }\n }\n\n return [\n `${idxZero.join('\\n')}`,\n `var value = ${input.getByIndices('input_indices')};`,\n `value = max(value, ${input.getByIndices('input_indices')});`,\n '',\n ];\n };\n runReduceProgram(context, 'ReduceMax', attributes, reduceOp);\n};\n\nconst reduceMeanNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output, axes) => {\n let size = 1.0;\n for (let k = 0; k < input.rank; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n // TODO: this depends on the input dims. If we want to use uniform, this need to be updated.\n size *= context.inputs[0].dims[k];\n }\n }\n\n return [\n 'var sum = f32(0);',\n '',\n `sum += f32(${input.getByIndices('input_indices')});`,\n `let value = ${output.type.value}(sum / ${size});`,\n ];\n };\n runReduceProgram(context, 'ReduceMean', attributes, reduceOp);\n};\n\nconst reduceMinNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, _output, axes) => {\n const idxZero = [];\n for (let k = 0; k < input.rank; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n idxZero.push(`input_indices[${k}] = 0;`); // first element\n }\n }\n\n return [\n `${idxZero.join('\\n')}`,\n `var value = ${input.getByIndices('input_indices')};`,\n `value = min(value, ${input.getByIndices('input_indices')});`,\n '',\n ];\n };\n runReduceProgram(context, 'ReduceMin', attributes, reduceOp);\n};\n\nconst reduceProdNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var value = ${output.type.storage}(1);`,\n '',\n `value *= ${input.getByIndices('input_indices')};`,\n '',\n ];\n runReduceProgram(context, 'ReduceProd', attributes, reduceOp);\n};\n\nconst reduceSumNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var value = ${output.type.storage}(0);`,\n '',\n `value += ${input.getByIndices('input_indices')};`,\n '',\n ];\n runReduceProgram(context, 'ReduceSum', attributes, reduceOp);\n};\n\nconst reduceSumSquareNaive = (context: ComputeContext, attributes: ReduceAttributes): void => {\n validateInputs(context.inputs);\n const reduceOp: ReduceOp = (input, output) =>\n [`var t = ${output.type.value}(0); var value = ${output.type.value}(0);`,\n '',\n `t = ${input.getByIndices('input_indices')}; value += t * t;`,\n '',\n ];\n runReduceProgram(context, 'ReduceSumSquare', attributes, reduceOp);\n};\n\nconst useNaiveReduceMethod =\n (shape: readonly number[], axes: readonly number[], noopWithEmptyAxes: boolean): boolean => {\n if (axes.length === 0) {\n return noopWithEmptyAxes;\n }\n\n let outputSize = 1;\n let reduceSize = 1;\n for (let dim = 0; dim < axes.length; dim++) {\n if (axes.indexOf(dim) === -1) {\n outputSize *= shape[dim];\n } else {\n reduceSize *= shape[dim];\n }\n }\n\n // The condition data is very rough, although considering the count of Execution Unit (EU), the potential\n // work groups in a EU and the counts of loops in the naive and shared methods, also doing experiments\n // on some machines.\n return reduceSize < 32 && outputSize > 1024;\n };\n\nexport const reduceMean = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceMeanNaive(context, attributes);\n } else {\n reduceMeanShared(context, attributes);\n }\n};\n\nexport const reduceL1 = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceL1Naive(context, attributes);\n } else {\n reduceL1Shared(context, attributes);\n }\n};\n\nexport const reduceL2 = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceL2Naive(context, attributes);\n } else {\n reduceL2Shared(context, attributes);\n }\n};\n\nexport const reduceLogSumExp = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceLogSumExpNaive(context, attributes);\n } else {\n reduceLogSumExpShared(context, attributes);\n }\n};\n\nexport const reduceMax = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceMaxNaive(context, attributes);\n } else {\n reduceMaxShared(context, attributes);\n }\n};\n\nexport const reduceMin = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceMinNaive(context, attributes);\n } else {\n reduceMinShared(context, attributes);\n }\n};\n\nexport const reduceProd = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceProdNaive(context, attributes);\n } else {\n reduceProdShared(context, attributes);\n }\n};\n\nexport const reduceSum = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceSumNaive(context, attributes);\n } else {\n reduceSumShared(context, attributes);\n }\n};\n\nexport const reduceSumSquare = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceSumSquareNaive(context, attributes);\n } else {\n reduceSumSquareShared(context, attributes);\n }\n};\n\nexport const reduceLogSum = (context: ComputeContext, attributes: ReduceAttributes): void => {\n if (useNaiveReduceMethod(context.inputs[0].dims, attributes.axes, attributes.noopWithEmptyAxes)) {\n reduceLogSumNaive(context, attributes);\n } else {\n reduceLogSumShared(context, attributes);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// TODO: this is the same naive implementation we use for reduce that has\n// performance limitations when the reduced axis is long. Need to add\n// a optimized codepath for this.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext} from '../types';\n\nimport {createReduceProgramInfo, ReduceOp} from './reduce';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length === 0 || inputs.length > 2) {\n throw new Error('ArgMinMaxOp op requires 1 or 2 inputs.');\n }\n if (inputs[0].dataType !== DataType.float) {\n throw new Error('Invalid input type.');\n }\n};\n\nexport interface ArgMinMaxAttributes extends AttributeWithCacheKey {\n keepDims: boolean;\n axis: number;\n selectLastIndex: number;\n}\n\nexport const argMin = (context: ComputeContext, attributes: ArgMinMaxAttributes): void => {\n validateInputs(context.inputs);\n const argMinMaxOp: ReduceOp = (input, output, axes) => {\n const idxZero = [];\n for (let k = 0; k < input.rank; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n idxZero.push(`input_indices[${k}] = 0;`); // first element\n }\n }\n return [\n `${idxZero.join('\\n')}`, `var value = ${input.getByIndices('input_indices')};\\nvar best_index : i32 = 0;`,\n `if (${input.getByIndices('input_indices')} ${attributes.selectLastIndex > 0 ? '<=' : '<'} value) {\n value = ${input.getByIndices('input_indices')};\n best_index = i32(last_index);\n }`,\n '', output.setByOffset('global_idx', 'best_index')\n ];\n };\n\n context.compute(\n createReduceProgramInfo(\n 'ArgMin', {hint: attributes.cacheKey, inputDependencies: ['rank']}, [context.inputs[0]], argMinMaxOp,\n [attributes.axis], DataType.int64, attributes.keepDims),\n {inputs: [0]});\n};\n\nexport const argMax = (context: ComputeContext, attributes: ArgMinMaxAttributes): void => {\n validateInputs(context.inputs);\n const argMinMaxOp: ReduceOp = (input, output, axes) => {\n const idxZero = [];\n for (let k = 0; k < input.rank; k++) {\n if (axes.indexOf(k) >= 0 || axes.length === 0) {\n idxZero.push(`input_indices[${k}] = 0;`); // first element\n }\n }\n return [\n `${idxZero.join('\\n')}`, `var value = ${input.getByIndices('input_indices')};\\nvar best_index : i32 = 0;`,\n `if (${input.getByIndices('input_indices')} ${attributes.selectLastIndex > 0 ? '>=' : '>'} value) {\n value = ${input.getByIndices('input_indices')};\n best_index = i32(last_index);\n }`,\n '', output.setByOffset('global_idx', 'best_index')\n ];\n };\n\n context.compute(\n createReduceProgramInfo(\n 'argMax', {hint: attributes.cacheKey, inputDependencies: ['rank']}, [context.inputs[0]], argMinMaxOp,\n [attributes.axis], DataType.int64, attributes.keepDims),\n {inputs: [0]});\n};\n\nexport const parseArgMinMaxAttributes = (attributes: Record): ArgMinMaxAttributes =>\n createAttributeWithCacheKey(attributes as Omit);\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, IndicesHelper, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface ConcatAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[], axis: number): void => {\n if (!inputs || inputs.length < 1) {\n throw new Error('too few inputs');\n }\n const referenceIndex = 0;\n const referenceInput = inputs[referenceIndex];\n const inputType = referenceInput.dataType;\n const inputRank = referenceInput.dims.length;\n inputs.forEach((input, i) => {\n if (i === referenceIndex) {\n return;\n }\n // make sure types of all inputs match\n if (input.dataType !== inputType) {\n throw new Error('input tensors should be one type');\n }\n // make sure the dimensionality of all inputs are the same\n if (input.dims.length !== inputRank) {\n throw new Error('input tensors should have the same shape');\n }\n input.dims.forEach((dim, i) => {\n if (i !== axis && dim !== referenceInput.dims[i]) {\n throw new Error('non concat dimensions must match');\n }\n });\n });\n};\n\nconst calculateInputIndexImpl = (numberOfTensors: number, sizeInConcatAxisStr: string): string => `\n fn calculateInputIndex(index: u32) -> u32 {\n let sizeInConcatAxis = array(${sizeInConcatAxisStr});\n for (var i: u32 = 0u; i < ${numberOfTensors}; i += 1u ) {\n if (index < sizeInConcatAxis[i]) {\n return i;\n }\n }\n return ${numberOfTensors}u;\n }`;\n\nconst assignOutputData = (inputs: readonly IndicesHelper[], output: IndicesHelper) => {\n const numberOfTensors = inputs.length;\n\n const codeLines: string[] = [];\n for (let i = 0; i < numberOfTensors; ++i) {\n const returnSnippet = output.setByOffset('global_idx', inputs[i].getByIndices('indices'));\n if (numberOfTensors === 1) {\n codeLines.push(returnSnippet);\n } else if (i === 0) {\n codeLines.push(`if (inputIndex == ${i}u) { ${returnSnippet} }`);\n } else if (i === numberOfTensors - 1) {\n codeLines.push(`else { ${returnSnippet} }`);\n } else {\n codeLines.push(`else if (inputIndex == ${i}) { ${returnSnippet} }`);\n }\n }\n return codeLines.join('\\n');\n};\n\nexport const createConcatProgramInfo =\n (inputs: readonly TensorView[], adjustedAxis: number, outputShape: number[], dataType: DataType): ProgramInfo => {\n const outputSize = ShapeUtil.size(outputShape);\n\n const sizeInConcatAxis = new Array(inputs.length);\n const inputVars = new Array(inputs.length);\n\n let previousSum = 0;\n const inputDependencies: ProgramInputTensorInfoDependency[] = [];\n const inputRanks = [];\n const programUniforms: ProgramUniform[] = [{type: DataType.uint32, data: outputSize}];\n for (let i = 0; i < inputs.length; ++i) {\n previousSum += inputs[i].dims[adjustedAxis];\n sizeInConcatAxis[i] = previousSum;\n inputRanks.push(inputs[i].dims.length);\n inputVars[i] = inputVariable(`input${i}`, dataType, inputRanks[i]);\n inputDependencies.push('rank');\n programUniforms.push({type: DataType.uint32, data: sizeInConcatAxis[i]});\n }\n for (let i = 0; i < inputs.length; ++i) {\n programUniforms.push(...createTensorShapeVariables(inputs[i].dims));\n }\n programUniforms.push(...createTensorShapeVariables(outputShape));\n\n const output = outputVariable('output', dataType, outputShape.length);\n const indicesAxis = output.indicesGet('indices', adjustedAxis);\n const sizeInConcatAxisStr =\n Array.from(Array(sizeInConcatAxis.length).keys()).map(i => `uniforms.sizeInConcatAxis${i}`).join(',');\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n\n ${(() => {\n shaderHelper.registerUniform('outputSize', 'u32');\n for (let i = 0; i < inputs.length; i++) {\n shaderHelper.registerUniform(`sizeInConcatAxis${i}`, 'u32');\n }\n return shaderHelper.declareVariables(...inputVars, output);\n })()}\n\n ${calculateInputIndexImpl(sizeInConcatAxis.length, sizeInConcatAxisStr)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n\n var indices = ${output.offsetToIndices('global_idx')};\n\n let inputIndex = calculateInputIndex(${indicesAxis});\n if (inputIndex != 0u) {\n let sizeInConcatAxis = array(${sizeInConcatAxisStr});\n ${indicesAxis} -= sizeInConcatAxis[inputIndex - 1u];\n }\n\n ${assignOutputData(inputVars, output)}\n }`;\n\n return {\n name: 'Concat',\n shaderCache: {hint: `${adjustedAxis}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms,\n }),\n getShaderSource,\n };\n };\n\nexport const concat = (context: ComputeContext, attributes: ConcatAttributes): void => {\n const inputs = context.inputs;\n const inputShape = inputs[0].dims;\n const adjustedAxis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);\n validateInputs(inputs, adjustedAxis);\n const outputShape = inputShape.slice();\n outputShape[adjustedAxis] =\n inputs.reduce((sum, input) => sum + (input.dims.length > adjustedAxis ? input.dims[adjustedAxis] : 0), 0);\n // 0 length tensors are valid for concat, remove them\n const nonEmptyInputs = inputs.filter(input => ShapeUtil.size(input.dims) > 0);\n context.compute(\n createConcatProgramInfo(nonEmptyInputs, adjustedAxis, outputShape, inputs[0].dataType), {inputs: nonEmptyInputs});\n};\n\nexport const parseConcatAttributes = (attributes: Record): ConcatAttributes =>\n createAttributeWithCacheKey({axis: attributes.axis as number});\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ComputeContext, GpuDataType, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, getMaxComponents, inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, tensorTypeToWsglValueType, UniformDataElementType, UniformsArrayType} from './common';\nimport {createConcatProgramInfo} from './concat';\n\nexport const enum AttentionQkvFormat {\n unknown, // enum value not set, or depends on qkv projection implementation details\n qkvBNSH, // for non-packed qkv, permuted\n qkvBSNH, // for non-packed qkv, not permuted, used by memory efficient attention or MultiHeadAttention\n qkvBSN3H, // for TRT fused attention, qkv are packed\n qkvBNSHqkvBS3NH, // for TRT fused causal attention, data has two formats (qkv is 3BNSH, gemm_buffer is BS3NH)\n qKvBSNHxBSN2H, // for TRT fused cross attention, kv are packed\n qkvTNH, // for memory efficient attention, qkv are not packed, and paddings are removed.\n qkvTN3H, // for TRT fused attention, qkv are packed and paddings are removed\n}\n\nexport const enum AttentionMaskType {\n none, // No mask\n mask1dKeySeqLen, // [batch_size], key sequence length\n mask1dEndStart, // [2 * batch_size] with end positions and start positions\n mask1DKeySeqLenStart, // [3 * batch_size + 2] with [key_len[0], ..., key_len[batch_size - 1], query_start[0],\n // ..., query_start[batch_size - 1], query_end[batch_size - 1], key_start[0], ...,\n // key_start[batch_size - 1], key_end[batch_size - 1]]\n mask2dDummy, // dummy mask with shape [1, 1] or [batch_size, 1]. It has same effect as no mask.\n mask2dKeyPadding, // [batch_size, total_sequence_length]\n mask3dAttention, // [batch_size, sequence_length, total_sequence_length]\n mask4dMegatron, // Megatron causal mask with shape [batch_size, 1, max_sequence_length, max_sequence_length]\n maskUnknown\n}\n\nexport interface AttentionParameters {\n batchSize: number;\n sequenceLength: number;\n pastSequenceLength: number;\n kvSequenceLength: number;\n totalSequenceLength: number;\n maxSequenceLength: number;\n inputHiddenSize: number;\n hiddenSize: number;\n vHiddenSize: number;\n headSize: number;\n vHeadSize: number;\n numHeads: number;\n isUnidirectional: boolean;\n pastPresentShareBuffer: boolean;\n maskFilterValue: number;\n maskType: AttentionMaskType;\n scale: number;\n broadcastResPosBias: boolean;\n passPastInKv: boolean;\n qkvFormat: AttentionQkvFormat;\n}\n\nexport interface AttentionAttrs {\n numHeads: number;\n isUnidirectional: number;\n maskFilterValue: number;\n scale: number;\n doRotary: number;\n qkvHiddenSizes: number[];\n pastPresentShareBuffer: boolean;\n}\n\nconst validateAttentionInputs = (inputs: readonly TensorView[], attributes: AttentionAttrs): AttentionParameters => {\n // Abbreviation and Meanings:\n // B: batch_size\n // S: sequence_length (input sequence length of query)\n // P: past_sequence_length (past sequence length of key or value)\n // L: kv_sequence_length (input sequence length of key or value)\n // M: max_sequence_length\n // T: total_sequence_length = past_sequence_length + kv_sequence_length\n // N: num_heads\n // H: head size for Q and K, aka q_head_size or k_head_size or qk_head_size\n // H_v: v_head_size\n // D_i: input hidden size\n // D: hidden size for Q and K (D = N * H), aka q_hidden_size or k_hidden_size or qk_hidden_size\n // D_v: v_hidden_size = num_heads * v_head_size\n\n // When past state is used, Q, K and V should have same hidden size (unless we split it into past_key and past_value).\n\n // Input shapes:\n // input (Q/K/V) : (B, S, D_i)\n // weights (Q/K/V) : (D_i, D + D + D_v)\n // bias (Q/K/V) : (D + D + D_v)\n // mask_index : see below\n // past (K/V) : (2, B, N, P, H) or NULL\n // relative_position_bias : (B, N, S, T) or NULL\n\n // For mask_index, the following shapes are supported:\n // NULL, (B, 1), (1, 1)\n // (B), (2 * B), (3 * B + 2)\n // (B, T)\n // (B, S, T)\n // (B, 1, M, M)\n //\n // When a model is pruned (like some attention heads are removed in Q/K/V), input_hidden_size could be larger\n // than hidden dimension of Q, K and V.\n\n const input = inputs[0];\n const weights = inputs[1];\n const bias = inputs[2];\n const maskIndex = inputs[3];\n const past = inputs[4];\n const relativePositionBias = inputs[5];\n\n if (past && relativePositionBias) {\n throw new Error('Attention cannot have both past and relative_position_bias');\n }\n\n if (input.dims.length !== 3) {\n throw new Error('Input \"input\" must have 3 dimensions');\n }\n\n const batchSize = input.dims[0];\n const sequenceLength = input.dims[1];\n const inputHiddenSize = input.dims[2];\n\n if (bias.dims.length !== 1) {\n throw new Error('Input \"bias\" is expected to have 1 dimensions');\n }\n\n if (weights.dims.length !== 2) {\n throw new Error('Input \"weights\" is expected to have 2 dimensions');\n }\n\n if (weights.dims[0] !== inputHiddenSize) {\n throw new Error('Input 1 dimension 0 should have same length as dimension 2 of input 0');\n }\n\n if (bias.dims[0] !== weights.dims[1]) {\n throw new Error('Input \"bias\" dimension 0 should have same length as dimension 1 of input \"weights\"');\n }\n\n let qHiddenSize = bias.dims[0] / 3;\n let kHiddenSize = qHiddenSize;\n let vHiddenSize = kHiddenSize;\n if (attributes.qkvHiddenSizes.length > 0) {\n if (attributes.qkvHiddenSizes.length !== 3) {\n throw new Error('qkv_hidden_sizes attribute should have 3 elements');\n }\n for (const sz of attributes.qkvHiddenSizes) {\n if (sz % attributes.numHeads !== 0) {\n throw new Error('qkv_hidden_sizes should be divisible by num_heads');\n }\n }\n\n qHiddenSize = attributes.qkvHiddenSizes[0];\n kHiddenSize = attributes.qkvHiddenSizes[1];\n vHiddenSize = attributes.qkvHiddenSizes[2];\n }\n\n const kvSequenceLength = sequenceLength;\n\n if (qHiddenSize !== kHiddenSize) {\n throw new Error('qkv_hidden_sizes first element should be same as the second');\n }\n\n if (bias.dims[0] !== qHiddenSize + kHiddenSize + vHiddenSize) {\n throw new Error('Input \"bias\" dimension 0 should have same length as sum of Q/K/V hidden sizes');\n }\n\n let pastSequenceLength = 0;\n if (past) {\n if (kHiddenSize !== vHiddenSize) {\n throw new Error('Input \"past\" expect k_hidden_size == v_hidden_size');\n }\n if (past.dims.length !== 5) {\n throw new Error('Input \"past\" must have 5 dimensions');\n }\n if (past.dims[0] !== 2) {\n throw new Error('Input \"past\" first dimension must be 2');\n }\n if (past.dims[1] !== batchSize) {\n throw new Error('Input \"past\" second dimension must be batch_size');\n }\n if (past.dims[2] !== attributes.numHeads) {\n throw new Error('Input \"past\" third dimension must be num_heads');\n }\n if (past.dims[4] !== kHiddenSize / attributes.numHeads) {\n throw new Error('Input \"past\" fifth dimension must be k_hidden_size / num_heads');\n }\n\n if (!attributes.pastPresentShareBuffer) {\n pastSequenceLength = past.dims[3];\n }\n // TODO: handle past_seq_len\n }\n\n const totalSequenceLength = kvSequenceLength + pastSequenceLength;\n const maxSequenceLength = -1;\n\n const maskType = AttentionMaskType.none;\n if (maskIndex) {\n // maskType = AttentionMaskType.MASK_UNKNOWN;\n // TODO: handle mask\n throw new Error('Mask not supported');\n }\n\n if (past) {\n throw new Error('past is not supported');\n }\n\n return {\n batchSize,\n sequenceLength,\n pastSequenceLength,\n kvSequenceLength,\n totalSequenceLength,\n maxSequenceLength,\n inputHiddenSize,\n hiddenSize: qHiddenSize,\n vHiddenSize,\n headSize: Math.floor(qHiddenSize / attributes.numHeads),\n vHeadSize: Math.floor(vHiddenSize / attributes.numHeads),\n numHeads: attributes.numHeads,\n isUnidirectional: false,\n pastPresentShareBuffer: false,\n maskFilterValue: attributes.maskFilterValue,\n maskType,\n scale: attributes.scale,\n broadcastResPosBias: false,\n passPastInKv: false,\n qkvFormat: AttentionQkvFormat.qkvBNSH,\n };\n};\n\nconst createInPlaceSoftmaxProgramInfo = (_context: ComputeContext, input: TensorView, n: number, d: number) => {\n const components = getMaxComponents(d);\n let WG = 64;\n const dComp = d / components;\n if (dComp < WG) {\n WG = 1;\n } else if (dComp / 8 < 64) {\n WG = Math.ceil(dComp / 8);\n }\n const elementsPerThread = Math.ceil(d / components / WG);\n const programUniforms: ProgramUniform[] = [\n {type: input.dataType, data: 1 / d}, {type: DataType.uint32, data: dComp},\n {type: DataType.uint32, data: elementsPerThread}\n ];\n const dataType = tensorTypeToWsglStorageType(input.dataType, components);\n const f32Type = tensorTypeToWsglValueType(DataType.float, components);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const inputHelper = outputVariable('x', input.dataType, input.dims, components);\n const elemValueType = tensorTypeToWsglValueType(input.dataType);\n const uniforms: UniformsArrayType = [\n {name: 'd_inv', type: elemValueType as UniformDataElementType}, {name: 'd_comp', type: 'u32'},\n {name: 'elements_per_thread', type: 'u32'}\n ];\n\n return `\n var thread_max: array;\n var thread_sum: array;\n ${shaderHelper.registerUniforms(uniforms).declareVariables(inputHelper)}\n ${shaderHelper.mainStart([\n WG, 1, 1\n ])}\n let local_offset = local_idx * uniforms.elements_per_thread;\n let offset = workgroup_id.x * uniforms.d_comp + local_offset;\n\n var thread_max_vector = ${f32Type}(-3.402823e+38f);\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n thread_max_vector = max(${f32Type}(x[offset + i]), thread_max_vector);\n }\n thread_max[local_idx] = ${(() => {\n switch (components) {\n case 1:\n return 'thread_max_vector';\n case 2:\n return 'max(thread_max_vector.x, thread_max_vector.y)';\n case 4:\n return 'max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))';\n default:\n throw new Error(`Unsupported components: ${components}`);\n }\n })()};\n workgroupBarrier();\n\n var max_value = f32(-3.402823e+38f);\n for (var i = 0u; i < ${WG}; i++) {\n max_value = max(thread_max[i], max_value);\n }\n\n var sum_vector = ${f32Type}(0);\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n sum_vector += exp(${f32Type}(x[offset + i]) - max_value);\n }\n thread_sum[local_idx] = ${(() => {\n switch (components) {\n case 1:\n return 'sum_vector';\n case 2:\n return 'sum_vector.x + sum_vector.y';\n case 4:\n return 'sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w';\n default:\n throw new Error(`Unsupported components: ${components}`);\n }\n })()};\n workgroupBarrier();\n\n var sum: f32 = 0;\n for (var i = 0u; i < ${WG}; i++) {\n sum += thread_sum[i];\n }\n\n if (sum == 0) {\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n x[offset + i] = ${inputHelper.type.value}(uniforms.d_inv);\n }\n } else {\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n var f32input = ${f32Type}(x[offset + i]);\n x[offset + i] = ${inputHelper.type.value}(exp(f32input - max_value) / sum);\n }\n }\n }`;\n };\n\n return {\n name: 'AttentionProbsSoftmax',\n shaderCache: {hint: `${WG};${dataType};${components}`},\n getShaderSource,\n getRunData: () => ({outputs: [], dispatchGroup: {x: n}, programUniforms}),\n };\n};\n\nconst createAttentionProbsProgramInfo =\n (_context: ComputeContext, q: TensorView, key: TensorView, relativePositionBias: TensorView|undefined,\n parameters: AttentionParameters, attributes: AttentionAttrs, pastSequenceLength: number) => {\n const totalSequenceLength = pastSequenceLength + parameters.kvSequenceLength;\n const probsShape = [parameters.batchSize, parameters.numHeads, parameters.sequenceLength, totalSequenceLength];\n\n // TODO: handle mask\n\n const alpha = attributes.scale === 0 ? 1.0 / Math.sqrt(parameters.headSize) : attributes.scale;\n const components = getMaxComponents(parameters.headSize);\n const vectorizedHeadSize = parameters.headSize / components;\n const TILE_SIZE = 12;\n const dispatch = {\n x: Math.ceil(totalSequenceLength / TILE_SIZE),\n y: Math.ceil(parameters.sequenceLength / TILE_SIZE),\n z: parameters.batchSize * parameters.numHeads\n };\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: parameters.sequenceLength}, {type: DataType.uint32, data: vectorizedHeadSize},\n {type: DataType.uint32, data: totalSequenceLength}, {type: DataType.uint32, data: parameters.numHeads},\n {type: DataType.float, data: alpha}\n ];\n\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['type', 'type'];\n if (relativePositionBias) {\n inputDependencies.push('rank');\n programUniforms.push(...createTensorShapeVariables(relativePositionBias.dims));\n }\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const qInput = inputVariable('q', q.dataType, q.dims, components);\n const kInput = inputVariable('key', key.dataType, key.dims, components);\n const inputVars = [qInput, kInput];\n const relativePositionBiasInput = relativePositionBias ?\n inputVariable('relative_position_bias', relativePositionBias.dataType, relativePositionBias.dims.length) :\n undefined;\n if (relativePositionBiasInput) {\n inputVars.push(relativePositionBiasInput);\n }\n const output = outputVariable('output', q.dataType, probsShape);\n // const dataType = tensorTypeToWsglStorageType(q.dataType);\n const f32Type = tensorTypeToWsglValueType(DataType.float, components);\n\n const uniforms: UniformsArrayType = [\n {name: 'M', type: 'u32'}, {name: 'K', type: 'u32'}, {name: 'N', type: 'u32'},\n {name: 'num_heads', type: 'u32'}, {name: 'alpha', type: 'f32' as UniformDataElementType}\n ];\n return `\n const TILE_SIZE = ${TILE_SIZE}u;\n\n var tileQ: array<${qInput.type.storage}, ${TILE_SIZE * TILE_SIZE}>;\n var tileK: array<${qInput.type.storage}, ${TILE_SIZE * TILE_SIZE}>;\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVars, output)}\n ${shaderHelper.mainStart([\n TILE_SIZE, TILE_SIZE, 1\n ])}\n // x holds the N and y holds the M\n let headIdx = workgroup_id.z;\n let m = workgroup_id.y * TILE_SIZE;\n let n = workgroup_id.x * TILE_SIZE;\n let qOffset = uniforms.M * uniforms.K * headIdx + m * uniforms.K;\n let kOffset = uniforms.N * uniforms.K * headIdx + n * uniforms.K;\n\n var value = ${f32Type}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) {\n tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x];\n }\n if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) {\n tileK[TILE_SIZE * local_id.y + local_id.x] = key[kOffset + local_id.y * uniforms.K + w + local_id.x];\n }\n workgroupBarrier();\n\n for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) {\n value += ${f32Type}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]);\n }\n\n workgroupBarrier();\n }\n\n let headOffset = headIdx * uniforms.M * uniforms.N;\n if (global_id.y < uniforms.M && global_id.x < uniforms.N) {\n let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x;\n var sum: f32 = ${(() => {\n switch (components) {\n case 1:\n return 'value';\n case 2:\n return 'value.x + value.y';\n case 4:\n return 'value.x + value.y + value.z + value.w';\n default:\n throw new Error(`Unsupported components: ${components}`);\n }\n })()};\n\n ${(() => {\n if (relativePositionBiasInput) {\n return `\n let batch = workgroup_id.z / uniforms.num_heads;\n let head = workgroup_id.z % uniforms.num_heads;\n var indices = ${relativePositionBiasInput.type.indices}(batch, head, global_id.y, global_id.x);\n output[outputIdx] = ${output.type.value}(sum * uniforms.alpha) + ${\n relativePositionBiasInput.getByIndices('indices')};`;\n }\n return `output[outputIdx] = ${output.type.value} (sum * uniforms.alpha);`;\n })()}\n }\n }`;\n };\n return {\n name: 'AttentionProbs',\n shaderCache: {hint: `${components}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: probsShape, dataType: q.dataType, gpuDataType: GpuDataType.default}],\n dispatchGroup: dispatch,\n programUniforms\n }),\n getShaderSource,\n };\n };\n\n\nconst createVxAttentionScoreProgramInfo =\n (_context: ComputeContext, probs: TensorView, v: TensorView, params: AttentionParameters,\n pastSequenceLength: number) => {\n const totalSequenceLength = pastSequenceLength + params.kvSequenceLength;\n const outputShape = [params.batchSize, params.sequenceLength, params.vHiddenSize];\n const TILE_SIZE = 12;\n const dispatch = {\n x: Math.ceil(params.vHeadSize / TILE_SIZE),\n y: Math.ceil(params.sequenceLength / TILE_SIZE),\n z: params.batchSize * params.numHeads\n };\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: params.sequenceLength}, {type: DataType.uint32, data: totalSequenceLength},\n {type: DataType.uint32, data: params.vHeadSize}, {type: DataType.uint32, data: params.numHeads},\n {type: DataType.uint32, data: params.vHiddenSize}\n ];\n\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['type', 'type'];\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const probsHelper = inputVariable('probs', probs.dataType, probs.dims);\n const vHelper = inputVariable('v', v.dataType, v.dims);\n const output = outputVariable('output', probs.dataType, outputShape);\n const uniforms: UniformsArrayType = [\n {name: 'M', type: 'u32'}, {name: 'K', type: 'u32'}, {name: 'N', type: 'u32'},\n {name: 'num_heads', type: 'u32'}, {name: 'v_hidden_size', type: 'u32'}\n ];\n return `\n const TILE_SIZE = ${TILE_SIZE}u;\n var tileQ: array<${probsHelper.type.value}, ${TILE_SIZE * TILE_SIZE}>;\n var tileK: array<${probsHelper.type.value}, ${TILE_SIZE * TILE_SIZE}>;\n ${shaderHelper.registerUniforms(uniforms).declareVariables(probsHelper, vHelper, output)}\n ${shaderHelper.mainStart([\n TILE_SIZE, TILE_SIZE, 1\n ])}\n let headIdx = workgroup_id.z;\n let m = global_id.y;\n let n = global_id.x;\n\n let offsetA = headIdx * (uniforms.M * uniforms.K) + m * uniforms.K;\n let offsetB = headIdx * (uniforms.N * uniforms.K) + n;\n\n var value = ${probsHelper.type.storage}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\n tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x];\n }\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\n tileK[TILE_SIZE * local_id.y + local_id.x] = v[offsetB + (w + local_id.y) * uniforms.N];\n }\n workgroupBarrier();\n for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) {\n value += tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * k + local_id.x];\n }\n workgroupBarrier();\n }\n\n // we need to transpose output from BNSH_v to BSND_v\n let batchIdx = workgroup_id.z / uniforms.num_heads;\n let currentBatchHeadNumber = workgroup_id.z % uniforms.num_heads;\n if (m < uniforms.M && n < uniforms.N) {\n let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size\n + currentBatchHeadNumber * uniforms.N + n;\n output[outputIdx] = value;\n }\n }`;\n };\n\n return {\n name: 'AttentionScore',\n shaderCache: {inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: probs.dataType, gpuDataType: GpuDataType.default}],\n dispatchGroup: dispatch,\n programUniforms\n }),\n getShaderSource,\n };\n };\n\nexport const applyAttention =\n (context: ComputeContext, q: TensorView, k: TensorView, v: TensorView, _maskIndex: TensorView|undefined,\n _past: TensorView|undefined, pastKey: TensorView|undefined, pastValue: TensorView|undefined,\n relativePositionBias: TensorView|undefined, parameters: AttentionParameters, attributes: AttentionAttrs) => {\n const outputPresentKey = context.outputCount > 1;\n const outputPresentValue = context.outputCount > 2;\n const pastSequenceLength = (outputPresentKey && outputPresentValue) ? parameters.pastSequenceLength : 0;\n const totalSequenceLength = pastSequenceLength + parameters.kvSequenceLength;\n // Concatinate pastKey and K to produce presentKey.\n const presentKeyShape = [parameters.batchSize, parameters.numHeads, totalSequenceLength, parameters.headSize];\n const concatKeyInputs = pastKey ? [pastKey, k] : [k];\n const key = outputPresentKey ? context.compute(\n createConcatProgramInfo(concatKeyInputs, 2, presentKeyShape, k.dataType),\n {inputs: concatKeyInputs, outputs: [1]})[0] :\n k;\n\n // Concatinate pastValue and V to produce presentValue.\n const presentValueShape = [parameters.batchSize, parameters.numHeads, totalSequenceLength, parameters.headSize];\n const concatValueInputs = pastValue ? [pastValue, v] : [v];\n const value = outputPresentValue ?\n context.compute(\n createConcatProgramInfo(concatValueInputs, 2, presentValueShape, v.dataType),\n {inputs: concatValueInputs, outputs: [2]})[0] :\n v;\n const inputsK = [q, key];\n if (relativePositionBias) {\n inputsK.push(relativePositionBias);\n }\n\n // Run AttentionProbs\n const probs = context.compute(\n createAttentionProbsProgramInfo(\n context, q, key, relativePositionBias, parameters, attributes, pastSequenceLength),\n {inputs: inputsK, outputs: [-1]})[0];\n\n // Run Softmax\n context.compute(\n createInPlaceSoftmaxProgramInfo(\n context, probs, parameters.batchSize * parameters.numHeads * parameters.sequenceLength,\n totalSequenceLength),\n {inputs: [probs], outputs: []});\n\n // Run AttrionScore\n const inputsV = [probs, value];\n context.compute(\n createVxAttentionScoreProgramInfo(context, probs, value, parameters, pastSequenceLength),\n {inputs: inputsV, outputs: [0]});\n };\n\nconst prepare = (context: ComputeContext, parameters: AttentionParameters) => {\n const outputShape = [\n parameters.batchSize,\n parameters.numHeads,\n parameters.sequenceLength,\n parameters.headSize,\n ];\n const M = parameters.sequenceLength;\n const K = parameters.inputHiddenSize;\n const N = parameters.headSize;\n const TILE_SIZE = 12;\n const dispatch = {\n x: Math.ceil(parameters.headSize / TILE_SIZE),\n y: Math.ceil(parameters.sequenceLength / TILE_SIZE),\n z: parameters.batchSize * parameters.numHeads\n };\n const inputs = [context.inputs[0], context.inputs[1], context.inputs[2]];\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: M}, {type: DataType.uint32, data: K}, {type: DataType.uint32, data: N},\n {type: DataType.uint32, data: parameters.numHeads}, {type: DataType.uint32, data: parameters.headSize},\n {type: DataType.uint32, data: parameters.hiddenSize},\n {type: DataType.uint32, data: parameters.hiddenSize + parameters.hiddenSize + parameters.vHiddenSize}\n ];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const outputQ = outputVariable('output_q', inputs[0].dataType, outputShape);\n const outputK = outputVariable('output_k', inputs[0].dataType, outputShape);\n const outputV = outputVariable('output_v', inputs[0].dataType, outputShape);\n const input = inputVariable('input', inputs[0].dataType, inputs[0].dims);\n const weight = inputVariable('weight', inputs[1].dataType, inputs[1].dims);\n const bias = inputVariable('bias', inputs[2].dataType, inputs[2].dims);\n const dataType = input.type.storage;\n\n const uniforms: UniformsArrayType = [\n {name: 'M', type: 'u32'}, {name: 'K', type: 'u32'}, {name: 'N', type: 'u32'}, {name: 'num_heads', type: 'u32'},\n {name: 'head_size', type: 'u32'}, {name: 'hidden_size', type: 'u32'}, {name: 'ldb', type: 'u32'}\n ];\n return `\n const TILE_SIZE = ${TILE_SIZE}u;\n var tileInput: array<${dataType}, ${TILE_SIZE * TILE_SIZE}>;\n var tileWeightQ: array<${dataType}, ${TILE_SIZE * TILE_SIZE}>;\n var tileWeightK: array<${dataType}, ${TILE_SIZE * TILE_SIZE}>;\n var tileWeightV: array<${dataType}, ${TILE_SIZE * TILE_SIZE}>;\n ${shaderHelper.registerUniforms(uniforms).declareVariables(input, weight, bias, outputQ, outputK, outputV)}\n ${shaderHelper.mainStart([\n TILE_SIZE, TILE_SIZE, 1\n ])}\n let batchIndex = workgroup_id.z / uniforms.num_heads;\n let headNumber = workgroup_id.z % uniforms.num_heads;\n let m = global_id.y;\n let n = global_id.x;\n\n let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K;\n let biasOffsetQ = headNumber * uniforms.head_size;\n let biasOffsetK = uniforms.hidden_size + biasOffsetQ;\n let biasOffsetV = uniforms.hidden_size + biasOffsetK;\n\n var valueQ = ${dataType}(0);\n var valueK = ${dataType}(0);\n var valueV = ${dataType}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\n tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x];\n }\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\n let offset = n + (w + local_id.y) * uniforms.ldb;\n tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset];\n tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset];\n tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset];\n }\n workgroupBarrier();\n for (var k: u32 = 0u; k ({\n outputs: [\n {dims: outputShape, dataType: context.inputs[0].dataType, gpuDataType: GpuDataType.default},\n {dims: outputShape, dataType: context.inputs[0].dataType, gpuDataType: GpuDataType.default},\n {dims: outputShape, dataType: context.inputs[0].dataType, gpuDataType: GpuDataType.default},\n ],\n dispatchGroup: dispatch,\n programUniforms\n }),\n getShaderSource,\n },\n {inputs, outputs: [-1, -1, -1]});\n};\n\nexport const attention = (context: ComputeContext, attributes: AttentionAttrs): void => {\n const params = validateAttentionInputs(context.inputs, attributes);\n\n const [q, k, v] = prepare(context, params);\n\n return applyAttention(\n context, q, k, v, context.inputs[4], undefined, undefined, undefined, context.inputs[5], params, attributes);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from 'onnxruntime-common';\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, getMaxComponents, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface BatchNormAttributes extends AttributeWithCacheKey {\n readonly epsilon: number;\n readonly momentum: number;\n readonly spatial: boolean;\n readonly trainingMode: boolean;\n readonly format: 'NHWC'|'NCHW';\n readonly outputCount: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: BatchNormAttributes): void => {\n if (!inputs || inputs.length !== 5) {\n throw new Error('BatchNormalization requires 5 inputs');\n }\n\n const checkShapeEqual = (actual: readonly number[], expected: readonly number[], message: string) => {\n const r = expected.length;\n if (r !== actual.length) {\n throw new Error(`${message}: num dimensions != ${r}`);\n }\n expected.forEach((v, i) => {\n if (v !== actual[i]) {\n throw new Error(`${message}: dim[${i}] do not match`);\n }\n });\n };\n\n if (inputs[0].dims.length > 1) {\n const shape = attributes.format === 'NHWC' ?\n (attributes.spatial ? inputs[0].dims.slice(-1) :\n inputs[0].dims.slice(-1).concat(inputs[0].dims.slice(1, inputs[0].dims.length - 1))) :\n inputs[0].dims.slice(1, attributes.spatial ? 2 : undefined);\n checkShapeEqual(inputs[1].dims, shape, 'Invalid input scale');\n checkShapeEqual(inputs[2].dims, shape, 'Invalid input B');\n checkShapeEqual(inputs[3].dims, shape, 'Invalid input mean');\n checkShapeEqual(inputs[4].dims, shape, 'Invalid input var');\n } else {\n checkShapeEqual(inputs[1].dims, [1], 'Invalid input scale');\n checkShapeEqual(inputs[2].dims, [1], 'Invalid input B');\n checkShapeEqual(inputs[3].dims, [1], 'Invalid input mean');\n checkShapeEqual(inputs[4].dims, [1], 'Invalid input var');\n }\n};\n\nconst createBatchNormInferenceProgramInfo =\n (inputs: readonly TensorView[], attributes: BatchNormAttributes): ProgramInfo => {\n const {epsilon, spatial, format} = attributes;\n const yShape = inputs[0].dims;\n const components = spatial ? getMaxComponents(yShape[yShape.length - 1]) : 1;\n const cComponents = format === 'NHWC' && yShape.length > 1 ? components : 1;\n const outputSize = ShapeUtil.size(yShape) / components;\n // Only support uniforms for opset version >= 9 (spatial = true).\n const useShapesUniforms = spatial;\n const shapeOrRank = useShapesUniforms ? yShape.length : yShape;\n const x = inputVariable('x', inputs[0].dataType, inputs[0].dims, components);\n const scale = inputVariable('scale', inputs[1].dataType, inputs[1].dims, cComponents);\n const bias = inputVariable('bias', inputs[2].dataType, inputs[2].dims, cComponents);\n const inputMean = inputVariable('inputMean', inputs[3].dataType, inputs[3].dims, cComponents);\n const inputVar = inputVariable('inputVar', inputs[4].dataType, inputs[4].dims, cComponents);\n const y = outputVariable('y', inputs[0].dataType, shapeOrRank, components);\n // TODO: support inputs with different data type. Current we need to make sure all inputs have the same data type.\n // Otherwise, the shader compilation will fail.\n const calcCOffset = (): string => {\n let cOffset = '';\n if (spatial) {\n cOffset = `let cOffset = ${\n yShape.length === 1 ? '0u' :\n format === 'NHWC' ? `outputIndices[${yShape.length - 1}] / ${components}` :\n 'outputIndices[1]'};`;\n } else {\n if (format === 'NCHW') {\n cOffset = `\n ${y.indicesSet('outputIndices', '0', '0')}\n let cOffset = ${y.indicesToOffset('outputIndices')};`;\n } else {\n // update C channel.\n cOffset = `var cIndices = ${scale.type.indices}(0);\n cIndices[0] = outputIndices[${yShape.length - 1}];`;\n // update D1 x ... x Dn channels.\n for (let i = 1; i < scale.rank; i++) {\n cOffset += `cIndices[${i}] = outputIndices[${i}];`;\n }\n cOffset += `let cOffset = ${scale.indicesToOffset('cIndices')};`;\n }\n }\n return cOffset;\n };\n const getInferenceModeShaderSource = (helper: ShaderHelper) => `\n const epsilon = ${epsilon};\n ${helper.registerUniform('outputSize', 'u32').declareVariables(x, scale, bias, inputMean, inputVar, y)}\n ${helper.mainStart()}\n ${helper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n var outputIndices = ${y.offsetToIndices(`global_idx * ${components}`)};\n ${calcCOffset()}\n let scale = ${scale.getByOffset('cOffset')};\n let bias = ${bias.getByOffset('cOffset')};\n let inputMean = ${inputMean.getByOffset('cOffset')};\n let inputVar = ${inputVar.getByOffset('cOffset')};\n let x = ${x.getByOffset('global_idx')};\n let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias;\n ${y.setByOffset('global_idx', 'value')}\n }`;\n return {\n name: 'BatchNormalization',\n shaderCache: {\n hint: `${attributes.epsilon}_${attributes.format}_${spatial}_${components}`,\n inputDependencies: useShapesUniforms ? ['rank', 'type', 'type', 'type', 'type'] : undefined,\n },\n getShaderSource: getInferenceModeShaderSource,\n getRunData: () => ({\n outputs: [{dims: inputs[0].dims, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms: useShapesUniforms ?\n [\n {type: DataType.uint32, data: outputSize},\n ...createTensorShapeVariables(yShape),\n ] :\n [\n {type: DataType.uint32, data: outputSize},\n ],\n }),\n };\n };\n\nexport const parseBatchNormAttributes = (attributes: Record): BatchNormAttributes =>\n createAttributeWithCacheKey(attributes as Omit);\n\nexport const batchNorm = (context: ComputeContext, attributes: Record): void => {\n const {inputs, outputCount} = context;\n const updatedAttributes = parseBatchNormAttributes({...attributes, outputCount});\n if (env.webgpu.validateInputContent) {\n validateInputs(inputs, updatedAttributes);\n }\n if (attributes.trainingMode) {\n throw new Error('BatchNormalization trainingMode is not supported yet.');\n } else {\n context.compute(createBatchNormInferenceProgramInfo(inputs, updatedAttributes));\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {inputVariable, outputVariable, ShaderHelper} from './common';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (inputs[0].dims.length !== 3) {\n throw new Error('input should have 3 dimensions');\n }\n\n if (![320, 640, 1280].includes(inputs[0].dims[2])) {\n throw new Error('number of channels should be 320, 640 or 1280');\n }\n\n if (inputs[1].dims.length !== 1) {\n throw new Error('bias is expected to have 1 dimensions');\n }\n\n if (inputs[0].dims[2] !== inputs[1].dims[0]) {\n throw new Error('last dimension of input and bias are not the same');\n }\n};\n\nconst createBiasAddProgramInfo = (inputs: readonly TensorView[]): ProgramInfo => {\n const outputShape = inputs[0].dims;\n\n const channels = inputs[0].dims[2];\n // since channel number can be only 320/640/1280, it's always divisable by 4\n const outputSize = ShapeUtil.size(outputShape) / 4;\n\n const dataType = inputs[0].dataType;\n const input = inputVariable('input', dataType, outputShape, 4);\n const bias = inputVariable('bias', dataType, [channels], 4);\n const residual = inputVariable('residual', dataType, outputShape, 4);\n const output = outputVariable('output', dataType, outputShape, 4);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n const channels = ${channels}u / 4;\n ${shaderHelper.declareVariables(input, bias, residual, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes(outputSize)}\n let value = ${input.getByOffset('global_idx')}\n + ${bias.getByOffset('global_idx % channels')} + ${residual.getByOffset('global_idx')};\n ${output.setByOffset('global_idx', 'value')}\n }`;\n\n return {\n name: 'BiasAdd',\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)}\n }),\n getShaderSource,\n };\n};\n\nexport const biasAdd = (context: ComputeContext): void => {\n validateInputs(context.inputs);\n context.compute(createBiasAddProgramInfo(context.inputs));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {MAX_CLIP, MIN_CLIP, ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglValueType} from './common';\n\ntype BuiltinFunctionName = string;\ntype ElementwiseCustomExpression = (expression: string) => string;\ntype ElementwiseFunctionCall = BuiltinFunctionName|ElementwiseCustomExpression;\n\nconst createElementwiseProgramShader =\n (shaderHelper: ShaderHelper, datasize: number, inputDataType: number, outputDataType: number,\n funcCall: ElementwiseFunctionCall, additionalImplementation?: string): string => {\n const vecSize = Math.ceil(datasize / 4);\n\n let expression = '';\n if (typeof funcCall === 'string') {\n expression = `${funcCall}(a)`;\n } else {\n expression = funcCall('a');\n }\n\n const input = inputVariable('inputData', inputDataType, [vecSize], 4);\n const output = outputVariable('outputData', outputDataType, [vecSize], 4);\n\n return `\n ${shaderHelper.registerUniform('vec_size', 'u32').declareVariables(input, output)}\n\n ${additionalImplementation ?? ''}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.vec_size')}\n\n let a = ${input.getByOffset('global_idx')};\n ${output.setByOffset('global_idx', expression)}\n }`;\n };\n\nconst createElementwiseProgramInfo =\n (input: TensorView, name: string, funcCall: ElementwiseFunctionCall, additionalImplementation?: string,\n cacheKey?: string, outputDataType: number = input.dataType): ProgramInfo => ({\n name,\n shaderCache: {hint: cacheKey, inputDependencies: ['type']},\n getShaderSource: shaderHelper => createElementwiseProgramShader(\n shaderHelper, ShapeUtil.size(input.dims), input.dataType, outputDataType, funcCall, additionalImplementation),\n getRunData: (inputTensors) => ({\n outputs: [{dims: input.dims, dataType: outputDataType}],\n dispatchGroup:\n {x: Math.ceil(ShapeUtil.size(inputTensors[0].dims) / 64 /* workgroup size */ / 4 /* vec size */)},\n programUniforms: [\n {type: DataType.uint32, data: Math.ceil(ShapeUtil.size(input.dims) / 4)},\n ],\n })\n });\n\nexport const abs = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Abs', 'abs'));\n};\n\nexport const acos = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Acos', 'acos'));\n};\n\nexport const acosh = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Acosh', 'acosh'));\n};\n\nexport const asin = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Asin', 'asin'));\n};\n\nexport const asinh = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Asinh', 'asinh'));\n};\n\nexport const atan = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Atan', 'atan'));\n};\nexport const atanh = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Atanh', 'atanh'));\n};\n\nexport interface CastAttributes extends AttributeWithCacheKey {\n readonly to: number;\n readonly saturate?: boolean;\n}\n\nexport const parseCastAttributes = (attributes: Record): CastAttributes =>\n createAttributeWithCacheKey(attributes as {to: number});\n\n\nexport const cast = (context: ComputeContext, attributes: CastAttributes): void => {\n let func: ElementwiseFunctionCall;\n switch (attributes.to) {\n case DataType.float16:\n func = 'vec4';\n break;\n case DataType.float:\n func = 'vec4';\n break;\n case DataType.uint32:\n func = 'vec4';\n break;\n case DataType.int32:\n func = 'vec4';\n break;\n case DataType.bool:\n func = 'vec4';\n break;\n default:\n throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${attributes.to}`);\n }\n context.compute(\n createElementwiseProgramInfo(context.inputs[0], 'Cast', func, undefined, attributes.cacheKey, attributes.to));\n};\n\nexport interface ClipAttributes extends AttributeWithCacheKey {\n readonly min: number;\n readonly max: number;\n}\n\nconst generateClipAttributesFromInputs = (inputs: readonly TensorView[]): ClipAttributes => {\n const min = (inputs.length >= 2 && inputs[1].data !== 0) ? inputs[1].getFloat32Array()[0] : MIN_CLIP;\n const max = (inputs.length >= 3 && inputs[2].data !== 0) ? inputs[2].getFloat32Array()[0] : MAX_CLIP;\n return createAttributeWithCacheKey({min, max});\n};\n\nexport const clip = (context: ComputeContext, clipAttributes: ClipAttributes): void => {\n const attributes = context.inputs.length === 1 ? clipAttributes : generateClipAttributesFromInputs(context.inputs);\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(\n createElementwiseProgramInfo(\n context.inputs[0], 'Clip', a => `clamp(${a}, clip_min_, clip_max_)`, `\n const clip_min_: vec4<${dataType}> = vec4(${dataType}(${attributes.min}));\n const clip_max_: vec4<${dataType}> = vec4(${dataType}(${attributes.max}));\n`,\n attributes.cacheKey),\n {inputs: [0]});\n};\n\nexport const ceil = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Ceil', 'ceil'));\n};\n\nexport const cos = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Cos', 'cos'));\n};\n\nexport const cosh = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Cosh', 'cosh'));\n};\n\nexport interface AlphaAttributes extends AttributeWithCacheKey {\n readonly alpha: number;\n}\n\nexport const parseAlphaAttributes = (attributes: Record): AlphaAttributes =>\n createAttributeWithCacheKey(attributes as {alpha: number});\n\nexport const elu = (context: ComputeContext, attributes: AlphaAttributes): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'Elu', a => `elu_vf32(${a})`, `\n const elu_alpha_ = ${dataType}(${attributes.alpha});\n\n fn elu_f32(a: ${dataType}) -> ${dataType} {\n return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0);\n }\n\n fn elu_vf32(v: vec4<${dataType}>) -> vec4<${dataType}> {\n return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w));\n }`,\n attributes.cacheKey));\n};\n\nexport const erfImpl = (varType = 'f32') => `\nconst r0: ${varType} = 0.3275911;\nconst r1: ${varType} = 0.254829592;\nconst r2: ${varType} = -0.284496736;\nconst r3: ${varType} = 1.421413741;\nconst r4: ${varType} = -1.453152027;\nconst r5: ${varType} = 1.061405429;\n\nfn erf_vf32(v: vec4<${varType}>) -> vec4<${varType}> {\n let absv = abs(v);\n let x = 1.0 / (1.0 + r0 * absv);\n return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv));\n}`;\n\nexport const erf = (context: ComputeContext): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Erf', a => `erf_vf32(${a})`, erfImpl(dataType)));\n};\n\nexport const exp = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Exp', 'exp'));\n};\n\nexport const floor = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Floor', 'floor'));\n};\n\nexport const gelu = (context: ComputeContext): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'Gelu', a => `0.5 * ${a} * (1.0 + erf_vf32(${a} * 0.7071067811865475))`, erfImpl(dataType)));\n};\n\nexport const leakyRelu = (context: ComputeContext, attributes: AlphaAttributes): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'LeakyRelu', a => `select(leaky_relu_alpha_ * ${a}, ${a}, ${a} >= vec4<${dataType}>(0.0))`,\n `const leaky_relu_alpha_ = ${dataType}(${attributes.alpha});`, attributes.cacheKey));\n};\n\nexport const not = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Not', a => `!${a}`));\n};\n\nexport const neg = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Neg', a => `-${a}`));\n};\n\nexport const reciprocal = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Reciprocal', a => `1.0/${a}`));\n};\n\nexport const relu = (context: ComputeContext): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'Relu', a => `select(vec4<${dataType}>(0.0), ${a}, ${a} > vec4<${dataType}>(0.0))`));\n};\n\nexport const sigmoid = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Sigmoid', a => `(1.0 / (1.0 + exp(-${a})))`));\n};\n\nexport interface HardSigmoidAttributes extends AttributeWithCacheKey {\n readonly alpha: number;\n readonly beta: number;\n}\n\nexport const parseHardSigmoidAttributes = (attributes: Record): HardSigmoidAttributes =>\n createAttributeWithCacheKey(attributes as {\n alpha: number;\n beta: number;\n });\n\nexport const hardSigmoid = (context: ComputeContext, attributes: HardSigmoidAttributes): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'HardSigmoid',\n a => `max(vec4<${dataType}>(0.0), min(vec4<${dataType}>(1.0), ${attributes.alpha} * ${a} + vec4<${dataType}>(${\n attributes.beta})))`,\n undefined, attributes.cacheKey));\n};\n\nexport const sin = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Sin', 'sin'));\n};\n\nexport const sinh = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Sinh', 'sinh'));\n};\n\nexport const sqrt = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Sqrt', 'sqrt'));\n};\n\nexport const tan = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Tan', 'tan'));\n};\n\nexport const tanhExpression = (a: string) => `sign(${a}) * (1 - exp(-2 * abs(${a}))) / (1 + exp(-2 * abs(${a})))`;\n\nexport const tanh = (context: ComputeContext): void => {\n // TODO: revisit after https://github.com/gpuweb/gpuweb/issues/4458 is resolved\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Tanh', tanhExpression));\n};\n\nexport const fastGeluImpl = (varType = 'f32') => `\nconst fast_gelu_a: ${varType} = 0.5;\nconst fast_gelu_b: ${varType} = 0.7978845608028654;\nconst fast_gelu_c: ${varType} = 0.035677408136300125;\n\nfn tanh_v(v: vec4<${varType}>) -> vec4<${varType}> {\n return ${tanhExpression('v')};\n}\n`;\n\nexport const fastGeluExpression = (x: string) =>\n `(fast_gelu_a + fast_gelu_a * tanh_v(${x} * (fast_gelu_c * ${x} * ${x} + fast_gelu_b))) * ${x}`;\n\nexport const fastGelu = (context: ComputeContext): void => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'FastGelu', fastGeluExpression, fastGeluImpl(dataType), undefined,\n context.inputs[0].dataType));\n};\n\nexport const thresholdedRelu = (context: ComputeContext, attributes: AlphaAttributes): number => {\n const dataType = tensorTypeToWsglValueType(context.inputs[0].dataType);\n context.compute(createElementwiseProgramInfo(\n context.inputs[0], 'ThresholdedRelu', a => `select(vec4<${dataType}>(0.0), ${a}, ${a} > thresholded_relu_alpha_)`,\n `const thresholded_relu_alpha_ = vec4<${dataType}>(${attributes.alpha});`, attributes.cacheKey));\n return 0;\n};\n\nexport const log = (context: ComputeContext): void => {\n context.compute(createElementwiseProgramInfo(context.inputs[0], 'Log', 'log'));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType} from './common';\nimport {erfImpl} from './unary-op';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (inputs[0].dims.length !== 3) {\n throw new Error('input should have 3 dimensions');\n }\n\n if (![2560, 5120, 10240].includes(inputs[0].dims[2])) {\n throw new Error('hidden state should be 2560, 5120 or 10240');\n }\n\n if (inputs[1].dims.length !== 1) {\n throw new Error('bias is expected to have 1 dimensions');\n }\n\n if (inputs[0].dims[2] !== inputs[1].dims[0]) {\n throw new Error('last dimension of input and bias are not the same');\n }\n};\n\nconst createBiasSplitGeluProgramInfo = (inputs: readonly TensorView[]): ProgramInfo => {\n const outputShape = inputs[0].dims.slice();\n outputShape[2] = outputShape[2] / 2;\n\n const input = inputVariable('input', inputs[0].dataType, inputs[0].dims, 4);\n const bias = inputVariable('bias', inputs[0].dataType, [inputs[0].dims[2]], 4);\n const output = outputVariable('output', inputs[0].dataType, outputShape, 4);\n\n const outputSize = ShapeUtil.size(outputShape) / 4;\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n const M_SQRT2 = sqrt(2.0);\n const halfChannels = ${inputs[0].dims[2] / 4 / 2}u;\n\n ${shaderHelper.declareVariables(input, bias, output)}\n\n ${erfImpl(dataType)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes(outputSize)}\n let biasIdx = global_idx % halfChannels;\n let batchIndex = global_idx / halfChannels;\n let inputOffset = biasIdx + batchIndex * halfChannels * 2;\n let valueLeft = input[inputOffset] + bias[biasIdx];\n let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels];\n let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1);\n\n ${output.setByOffset('global_idx', 'valueLeft * geluRight')}\n }`;\n\n return {\n name: 'BiasSplitGelu',\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)}\n }),\n getShaderSource,\n };\n};\n\nexport const biasSplitGelu = (context: ComputeContext): void => {\n validateInputs(context.inputs);\n context.compute(createBiasSplitGeluProgramInfo(context.inputs));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {BroadcastUtil, ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\ntype BuiltinFunctionName = string;\ntype BinaryCustomExpression = (expressionA: string, expressionB: string) => string;\ntype BinaryFunctionCall = BuiltinFunctionName|BinaryCustomExpression|{\n scalar: BinaryCustomExpression;\n vector: BinaryCustomExpression;\n};\n\nconst createBinaryOpProgramShader =\n (shaderHelper: ShaderHelper, dimsA: readonly number[], dimsB: readonly number[], dimsOutput: readonly number[],\n vectorize: boolean, doBroadcast: boolean, sharedDimensionDivisibleBy4: boolean, funcCall: BinaryFunctionCall,\n typeA: number, typeB: number, typeOutput: number, additionalImplementation?: string) => {\n let expressionScalar: BinaryCustomExpression;\n let expressionVector: BinaryCustomExpression;\n if (typeof funcCall === 'string') {\n expressionScalar = expressionVector = (a, b) => `${funcCall}((${a}),(${b}))`;\n } else if (typeof funcCall === 'function') {\n expressionScalar = expressionVector = funcCall;\n } else {\n expressionScalar = funcCall.scalar;\n expressionVector = funcCall.vector;\n }\n\n const output = outputVariable('outputData', typeOutput, dimsOutput.length, 4);\n const a = inputVariable('aData', typeA, dimsA.length, 4);\n const b = inputVariable('bData', typeB, dimsB.length, 4);\n\n let assignment: string;\n if (vectorize) {\n if (doBroadcast) {\n const isAOneElement = ShapeUtil.size(dimsA) === 1;\n const isBOneElement = ShapeUtil.size(dimsB) === 1;\n const aLastDimDivisibleBy4 = dimsA.length > 0 && dimsA[dimsA.length - 1] % 4 === 0;\n const bLastDimDivisibleBy4 = dimsB.length > 0 && dimsB[dimsB.length - 1] % 4 === 0;\n if (isAOneElement || isBOneElement) {\n assignment = output.setByOffset(\n 'global_idx',\n expressionVector(\n isAOneElement ? `${a.type.value}(${a.getByOffset('0')}.x)` : a.getByOffset('global_idx'),\n isBOneElement ? `${b.type.value}(${b.getByOffset('0')}.x)` : b.getByOffset('global_idx')));\n } else {\n assignment = `\n let outputIndices = ${output.offsetToIndices('global_idx * 4u')};\n let offsetA = ${a.broadcastedIndicesToOffset('outputIndices', output)};\n let offsetB = ${b.broadcastedIndicesToOffset('outputIndices', output)};\n ${\n output.setByOffset(\n 'global_idx',\n expressionVector(\n sharedDimensionDivisibleBy4 || aLastDimDivisibleBy4 ?\n a.getByOffset('offsetA / 4u') :\n `${a.type.value}(${a.getByOffset('offsetA / 4u')}[offsetA % 4u])`,\n sharedDimensionDivisibleBy4 || bLastDimDivisibleBy4 ?\n b.getByOffset('offsetB / 4u') :\n `${b.type.value}(${b.getByOffset('offsetB / 4u')}[offsetB % 4u])`))}\n `;\n }\n } else {\n assignment = output.setByOffset(\n 'global_idx', expressionVector(a.getByOffset('global_idx'), b.getByOffset('global_idx')));\n }\n } else {\n if (!doBroadcast) {\n throw new Error('no necessary to use scalar implementation for element-wise binary op implementation.');\n }\n\n const singleAssignment = (resStr: string, x: number, typeCast = '') => {\n const expressionA = `aData[indexA${x}][componentA${x}]`;\n const expressionB = `bData[indexB${x}][componentB${x}]`;\n return `\n let outputIndices${x} = ${output.offsetToIndices(`global_idx * 4u + ${x}u`)};\n let offsetA${x} = ${a.broadcastedIndicesToOffset(`outputIndices${x}`, output)};\n let offsetB${x} = ${b.broadcastedIndicesToOffset(`outputIndices${x}`, output)};\n let indexA${x} = offsetA${x} / 4u;\n let indexB${x} = offsetB${x} / 4u;\n let componentA${x} = offsetA${x} % 4u;\n let componentB${x} = offsetB${x} % 4u;\n ${resStr}[${x}] = ${typeCast}(${expressionScalar(expressionA, expressionB)});\n `;\n };\n if (typeOutput === DataType.bool) {\n assignment = `\n var data = vec4(0);\n ${singleAssignment('data', 0, 'u32')}\n ${singleAssignment('data', 1, 'u32')}\n ${singleAssignment('data', 2, 'u32')}\n ${singleAssignment('data', 3, 'u32')}\n outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`;\n } else {\n assignment = `\n ${singleAssignment('outputData[global_idx]', 0)}\n ${singleAssignment('outputData[global_idx]', 1)}\n ${singleAssignment('outputData[global_idx]', 2)}\n ${singleAssignment('outputData[global_idx]', 3)}\n `;\n }\n }\n\n return `\n ${shaderHelper.registerUniform('vec_size', 'u32').declareVariables(a, b, output)}\n\n ${additionalImplementation ?? ''}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.vec_size')}\n ${assignment}\n }`;\n };\n\nconst createBinaryOpProgramInfo =\n (name: string, cacheKey: string, a: TensorView, b: TensorView, funcCall: BinaryFunctionCall,\n additionalImplementation?: string, outputDataType: number = a.dataType): ProgramInfo => {\n const isBroadcast = !ShapeUtil.areEqual(a.dims, b.dims);\n let outputShape = a.dims;\n let outputSize = ShapeUtil.size(a.dims);\n\n let vectorize = false;\n let sharedDimensionDivisibleBy4 = false;\n\n // TODO: deal with zero-sized tensors (eg. dims=[1,0])\n const cacheKeyAux = [isBroadcast];\n if (isBroadcast) {\n const calculatedShape = BroadcastUtil.calcShape(a.dims, b.dims, false);\n if (!calculatedShape) {\n throw new Error('Can\\'t perform binary op on the given tensors');\n }\n outputShape = calculatedShape;\n outputSize = ShapeUtil.size(outputShape);\n const isAOneElement = ShapeUtil.size(a.dims) === 1;\n const isBOneElement = ShapeUtil.size(b.dims) === 1;\n const aLastDimDivisibleBy4 = a.dims.length > 0 && a.dims[a.dims.length - 1] % 4 === 0;\n const bLastDimDivisibleBy4 = b.dims.length > 0 && b.dims[b.dims.length - 1] % 4 === 0;\n cacheKeyAux.push(isAOneElement);\n cacheKeyAux.push(isBOneElement);\n cacheKeyAux.push(aLastDimDivisibleBy4);\n cacheKeyAux.push(bLastDimDivisibleBy4);\n // check whether vectorize can be enabled\n let sharedDimension = 1;\n for (let i = 1; i < outputShape.length; i++) {\n const dimA = a.dims[a.dims.length - i] ?? 1;\n const dimB = b.dims[b.dims.length - i] ?? 1;\n if (dimA === dimB) {\n sharedDimension *= dimA;\n } else {\n break;\n }\n }\n if (sharedDimension % 4 === 0) {\n sharedDimensionDivisibleBy4 = true;\n vectorize = true;\n } else if (isAOneElement || isBOneElement || aLastDimDivisibleBy4 || bLastDimDivisibleBy4) {\n vectorize = true;\n }\n } else {\n // element-wise\n vectorize = true;\n }\n cacheKeyAux.push(vectorize);\n\n return {\n name,\n shaderCache: {\n hint: cacheKey + cacheKeyAux.map((x) => x.toString()).join('_'),\n inputDependencies: ['rank', 'rank'],\n },\n getShaderSource: (shaderHelper) => createBinaryOpProgramShader(\n shaderHelper, a.dims, b.dims, outputShape, vectorize, isBroadcast, sharedDimensionDivisibleBy4, funcCall,\n a.dataType, b.dataType, outputDataType, additionalImplementation),\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: outputDataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */ / 4 /* component size */)},\n programUniforms: [\n {type: DataType.uint32, data: Math.ceil(ShapeUtil.size(outputShape) / 4)},\n ...createTensorShapeVariables(a.dims, b.dims, outputShape)\n ],\n }),\n };\n };\n\nconst runBinaryOp =\n (context: ComputeContext, name: string, funcCall: BinaryFunctionCall, additionalImplementation?: string,\n cacheKey?: string, outputDataType?: number): void => {\n context.compute(createBinaryOpProgramInfo(\n name, cacheKey ?? '', context.inputs[0], context.inputs[1], funcCall, additionalImplementation,\n outputDataType));\n };\n\nexport const add = (context: ComputeContext): void => {\n runBinaryOp(context, 'Add', (a, b) => `${a}+${b}`);\n};\n\nexport const div = (context: ComputeContext): void => {\n runBinaryOp(context, 'Div', (a, b) => `${a}/${b}`);\n};\n\nexport const equal = (context: ComputeContext): void => {\n runBinaryOp(\n context, 'Equal', ({scalar: (a, b) => `u32(${a}==${b})`, vector: (a, b) => `vec4(${a}==${b})`}), undefined,\n undefined, DataType.bool);\n};\n\nexport const mul = (context: ComputeContext): void => {\n runBinaryOp(context, 'Mul', (a, b) => `${a}*${b}`);\n};\n\nexport const pow = (context: ComputeContext): void => {\n const type = inputVariable('input', context.inputs[0].dataType, context.inputs[0].dims).type.value;\n const roundStr = type === 'i32' ? 'round' : '';\n runBinaryOp(\n context, 'Pow', ({scalar: (a, b) => `pow_custom(${a},${b})`, vector: (a, b) => `pow_vector_custom(${a},${b})`}),\n `\n fn pow_custom(a : ${type}, b : ${type}) -> ${type} {\n if (b == ${type}(0.0)) {\n return ${type}(1.0);\n } else if (a < ${type}(0.0) && f32(b) != floor(f32(b))) {\n return ${type}(pow(f32(a), f32(b))); // NaN\n }\n return select(sign(a), ${type}(1.0), round(f32(abs(b) % ${type}(2.0))) != 1.0) * ${type}(${\n roundStr}(pow(f32(abs(a)), f32(b))));\n }\n fn pow_vector_custom(a : vec4<${type}>, b : vec4<${type}>) -> vec4<${type}> {\n // TODO: implement vectorized pow\n return vec4<${type}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w));\n }\n `);\n};\n\nexport const sub = (context: ComputeContext): void => {\n runBinaryOp(context, 'Sub', (a, b) => `${a}-${b}`);\n};\n\nexport const greater = (context: ComputeContext): void => {\n runBinaryOp(\n context, 'Greater', ({scalar: (a, b) => `u32(${a}>${b})`, vector: (a, b) => `vec4(${a}>${b})`}), undefined,\n undefined, DataType.bool);\n};\n\nexport const less = (context: ComputeContext): void => {\n runBinaryOp(\n context, 'Less', ({scalar: (a, b) => `u32(${a}<${b})`, vector: (a, b) => `vec4(${a}<${b})`}), undefined,\n undefined, DataType.bool);\n};\n\nexport const greaterOrEqual = (context: ComputeContext): void => {\n runBinaryOp(\n context, 'GreaterOrEqual', ({scalar: (a, b) => `u32(${a}>=${b})`, vector: (a, b) => `vec4(${a}>=${b})`}),\n undefined, undefined, DataType.bool);\n};\n\nexport const lessOrEqual = (context: ComputeContext): void => {\n runBinaryOp(\n context, 'LessOrEqual', ({scalar: (a, b) => `u32(${a}<=${b})`, vector: (a, b) => `vec4(${a}<=${b})`}),\n undefined, undefined, DataType.bool);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {MAX_CLIP, MIN_CLIP} from '../../util';\nimport {ProgramUniform} from '../types';\n\nimport {UniformsArrayType} from './common';\n\nexport interface InternalActivationAttributes {\n readonly activation: string;\n readonly clipMin?: number;\n readonly clipMax?: number;\n readonly alpha?: number;\n readonly beta?: number;\n}\n\nexport const getActivationSnippet =\n (attributes: InternalActivationAttributes, valueType: string, baseType = 'f32'): string => {\n switch (attributes.activation) {\n case 'Relu':\n return `value = max(value, ${valueType}(0.0));`;\n case 'Sigmoid':\n return `value = (${valueType}(1.0) / (${valueType}(1.0) + exp(-value)));`;\n case 'Clip':\n return `value = clamp(value, ${valueType}(${baseType}(uniforms.clip_min)), ${valueType}(${\n baseType}(uniforms.clip_max)));`;\n case 'HardSigmoid':\n return `value = max(${valueType}(0.0), min(${valueType}(1.0), ${baseType}(uniforms.alpha) * value + ${\n baseType}(uniforms.beta)));`;\n case 'LeakyRelu':\n return `value = select(${baseType}(uniforms.alpha) * value, value, value >= ${valueType}(0.0));`;\n case '':\n return '';\n // TODO: adding other activations that can be fused.\n default:\n throw new Error(`Unsupported activation ${attributes.activation}`);\n }\n };\n\nexport const appendActivationUniformsData =\n (attributes: InternalActivationAttributes, programUniform: ProgramUniform[]) => {\n if (attributes.activation === 'Clip') {\n programUniform.push(\n {type: DataType.float, data: attributes.clipMax!}, {type: DataType.float, data: attributes.clipMin!});\n } else if (attributes.activation === 'HardSigmoid') {\n programUniform.push(\n {type: DataType.float, data: attributes.alpha!}, {type: DataType.float, data: attributes.beta!});\n } else if (attributes.activation === 'LeakyRelu') {\n programUniform.push({type: DataType.float, data: attributes.alpha!});\n }\n };\n\nexport const appendActivationUniforms = (attributes: InternalActivationAttributes, uniforms: UniformsArrayType) => {\n if (attributes.activation === 'Clip') {\n uniforms.push({name: 'clip_max', type: 'f32'}, {name: 'clip_min', type: 'f32'});\n } else if (attributes.activation === 'HardSigmoid') {\n uniforms.push({name: 'alpha', type: 'f32'}, {name: 'beta', type: 'f32'});\n } else if (attributes.activation === 'LeakyRelu') {\n uniforms.push({name: 'alpha', type: 'f32'});\n }\n};\n\nexport const parseInternalActivationAttributes =\n (attributes: Record|undefined): InternalActivationAttributes => {\n const activation = attributes?.activation as string || '';\n if (activation === 'HardSigmoid') {\n const [alpha, beta] = attributes?.activation_params as [number, number] || [0.2, 0.5];\n return {activation, alpha, beta};\n } else if (activation === 'Clip') {\n const [clipMin, clipMax] = attributes?.activation_params as [number, number] || [MIN_CLIP, MAX_CLIP];\n return {activation, clipMax, clipMin};\n } else if (activation === 'LeakyRelu') {\n const [alpha] = attributes?.activation_params as [number] || [0.01];\n return {activation, alpha};\n }\n return {activation};\n };\n", "/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\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 */\n\n// sampled from [@tensorflow/tfjs] tfjs-backend-webgpu/src/activation_util.ts\n//\n// modified to fit the needs of the project\n\nexport const typeSnippet = (component: number, dataType: string) => {\n switch (component) {\n case 1:\n return dataType;\n case 2:\n return `vec2<${dataType}>`;\n case 3:\n return `vec3<${dataType}>`;\n case 4:\n return `vec4<${dataType}>`;\n default:\n throw new Error(`${component}-component is not supported.`);\n }\n};\n\nexport const biasSnippet = (hasBias: boolean): string => `\n ${hasBias ? 'value = value + getBiasByOutputCoords(coords);' : ''}\n `;\n", "/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\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 */\n\n// sampled from [@tensorflow/tfjs] tfjs-core/src/ops/conv_util.ts\n//\n// modified to fit the needs of the project\n\nexport const utilFunctions = (strideStr: string) => (`\nfn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\n return dot(coords, vec4(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n}\nfn getOutputIndexFromCoords(coords : vec4) -> i32 {\n return dot(coords, vec4(\n i32(${strideStr}.x), i32(${strideStr}.y), i32(${strideStr}.z), 1));\n}\n`);\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\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 */\n\n// sampled from [@tensorflow/tfjs] tfjs-backend-webgpu/src/matmul_packed_webgpu.ts\n//\n// modified to fit the needs of the project\n\nimport {DataType} from '../../../../wasm-common';\nimport {TensorView} from '../../../tensor-view';\nimport {ShapeUtil} from '../../../util';\nimport {ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../../types';\nimport {createTensorShapeVariables, getBroadcastDims, IndicesHelper, inputVariable, internalVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from '../common';\nimport {appendActivationUniforms, appendActivationUniformsData, getActivationSnippet, InternalActivationAttributes} from '../fuse-utils';\n\nimport {typeSnippet} from './activation_util';\n\nconst writeDataToSubAVec4Snippet = (transpose: boolean, batchDims?: IndicesHelper) => {\n if (transpose) {\n return `\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart / innerElementSize + inputCol${batchDims ? ', batchIndices' : ''});\n `;\n\n } else {\n return `\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRow + innerRow,\n kStart / innerElementSize + inputCol${batchDims ? ', batchIndices' : ''});\n `;\n }\n};\n\nconst calculateResultSnippet = (transposeA: boolean, innerElementSize: number) => {\n if (transposeA) {\n return `\n let ACached0 = mm_Asub[k * innerElementSize][localRow];\n let ACached1 = mm_Asub[k * innerElementSize + 1][localRow];\n let ACached2 = mm_Asub[k * innerElementSize + 2][localRow];\n ${innerElementSize === 3 ? '' : 'let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];'}\n for (var i = 0; i < rowPerThread; i = i + 1) {\n acc[i] = BCached0 * ACached0[i] + acc[i];\n acc[i] = BCached1 * ACached1[i] + acc[i];\n acc[i] = BCached2 * ACached2[i] + acc[i];\n ${innerElementSize === 3 ? '' : 'acc[i] = BCached3 * ACached3[i] + acc[i];'}\n }`;\n } else {\n return `\n for (var i = 0; i < rowPerThread; i = i + 1) {\n let ACached = mm_Asub[tileRow + i][k];\n acc[i] = BCached0 * ACached.x + acc[i];\n acc[i] = BCached1 * ACached.y + acc[i];\n acc[i] = BCached2 * ACached.z + acc[i];\n ${innerElementSize === 3 ? '' : 'acc[i] = BCached3 * ACached.w + acc[i];'}\n }`;\n }\n};\n\nexport const makeMatMulPackedVec4Source =\n (workPerThread: number[], workgroupSize: [number, number, number], type = 'f32', batchDims?: IndicesHelper,\n transposeA = false, tileInner = 32, splitK = false, splitedDimInner = 32): string => {\n const tileAOuter = workgroupSize[1] * workPerThread[1];\n const tileBOuter = workgroupSize[0] * workPerThread[0];\n const tileAWidth = transposeA ? tileAOuter : tileInner;\n const tileAHight = transposeA ? tileInner : tileAOuter;\n const innerElementSize = tileAWidth / workgroupSize[0];\n const rowPerThreadB = tileInner / workgroupSize[1];\n\n if (!(((transposeA && innerElementSize === 4 && workPerThread[1] === 4) ||\n (!transposeA && (innerElementSize === 3 || innerElementSize === 4))) &&\n tileAWidth % workgroupSize[0] === 0 && tileInner % workgroupSize[1] === 0 && workPerThread[0] === 4)) {\n throw new Error(`If transposeA ${transposeA} is true, innerElementSize ${\n innerElementSize} and workPerThread[1] ${workPerThread[1]} must be 4.\n Otherwise, innerElementSize ${innerElementSize} must be 3 or 4.\n tileAWidth ${tileAWidth} must be divisible by workgroupSize[0]${workgroupSize[0]}. tileInner ${\n tileInner} must be divisible by workgroupSize[1] ${workgroupSize[1]}. colPerThread ${\n workPerThread[0]} must be 4.`);\n }\n return `\nvar mm_Asub: array, ${tileAWidth / innerElementSize}>, ${tileAHight}>;\nvar mm_Bsub: array, ${tileBOuter / workPerThread[0]}>, ${tileInner}>;\n\nconst rowPerThread = ${workPerThread[1]};\nconst colPerThread = ${workPerThread[0]};\nconst innerElementSize = ${innerElementSize};\nconst tileInner = ${tileInner};\n\n@compute @workgroup_size(${workgroupSize[0]}, ${workgroupSize[1]}, ${workgroupSize[2]})\nfn main(@builtin(local_invocation_id) localId : vec3,\n @builtin(global_invocation_id) globalId : vec3,\n @builtin(workgroup_id) workgroupId : vec3) {\n let localRow = i32(localId.y);\n let tileRow = localRow * rowPerThread;\n let tileCol = i32(localId.x);\n\n let globalRow =i32(globalId.y) * rowPerThread;\n let globalCol = i32(globalId.x);\n let batch = ${splitK ? '0' : 'i32(globalId.z)'};\n ${batchDims ? `let batchIndices = ${batchDims.offsetToIndices('u32(batch)')};` : ''}\n let globalRowStart = i32(workgroupId.y) * ${tileAOuter};\n\n let num_tiles = ${splitK ? `${Math.ceil(splitedDimInner / tileInner)}` : '(uniforms.dim_inner - 1) / tileInner + 1'};\n var kStart = ${splitK ? `i32(globalId.z) * ${splitedDimInner}` : '0'};\n\n var acc: array, rowPerThread>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${rowPerThreadB};\n for (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${writeDataToSubAVec4Snippet(transposeA, batchDims)}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${rowPerThreadB}; innerRow = innerRow + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${\n batchDims ? ', batchIndices' : ''});\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < tileInner / innerElementSize; k = k + 1) {\n let BCached0 = mm_Bsub[k * innerElementSize][tileCol];\n let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol];\n let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol];\n ${innerElementSize === 3 ? '' : 'let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];'}\n\n ${calculateResultSnippet(transposeA, innerElementSize)}\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n}`;\n };\n\nconst writeDataToSubASnippet = (transpose: boolean, batchDims?: IndicesHelper) => {\n if (transpose) {\n return `\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart + inputCol${batchDims ? ', batchIndices' : ''});\n `;\n\n } else {\n return `\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRowStart + inputRow,\n kStart + inputCol${batchDims ? ', batchIndices' : ''});\n `;\n }\n};\n\nconst readDataFromSubASnippet = (transposeA: boolean) =>\n transposeA ? 'let ACached = mm_Asub[k][tileRow + innerRow];' : 'let ACached = mm_Asub[tileRow + innerRow][k];';\n\n// sequentialAccessByThreads means sequential data in memory is accessed by\n// threads, instead of a single thread (default behavior).\nexport const makeMatMulPackedSource =\n (workPerThread: number[], workgroupSize: [number, number, number], type = 'f32', batchDims?: IndicesHelper,\n transposeA = false, tileInner = 32, splitK = false, splitedDimInner = 32,\n sequentialAccessByThreads = false): string => {\n const tileAOuter = workPerThread[1] * workgroupSize[1];\n const tileBOuter = workPerThread[0] * workgroupSize[0];\n const tileAWidth = transposeA ? tileAOuter : tileInner;\n const tileAHight = transposeA ? tileInner : tileAOuter;\n\n if (!(tileAHight % workgroupSize[1] === 0 && tileAWidth % workgroupSize[0] === 0 &&\n tileInner % workgroupSize[1] === 0)) {\n throw new Error(`tileAHight ${tileAHight} must be divisible by workgroupSize[1]${\n workgroupSize[1]}, tileAWidth ${tileAWidth} must be divisible by workgroupSize[0]${\n workgroupSize[0]}, tileInner ${tileInner} must be divisible by workgroupSize[1]${workgroupSize[1]}`);\n }\n const rowPerThreadA = tileAHight / workgroupSize[1];\n const colPerThreadA = tileAWidth / workgroupSize[0];\n const rowPerThreadB = tileInner / workgroupSize[1];\n const matmulSnippet = sequentialAccessByThreads ?\n `\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${tileAOuter};\n let globalColStart = i32(workgroupId.x) * ${tileBOuter};\n\n // Loop over shared dimension.\n for (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${tileAHight}; inputRow = inputRow + ${workgroupSize[1]}) {\n for (var inputCol = localCol; inputCol < ${tileAWidth}; inputCol = inputCol + ${workgroupSize[0]}) {\n ${writeDataToSubASnippet(transposeA, batchDims)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${tileInner}; inputRow = inputRow + ${workgroupSize[1]}) {\n for (var inputCol = localCol; inputCol < ${tileBOuter}; inputCol = inputCol + ${workgroupSize[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalColStart + inputCol${batchDims ? ', batchIndices' : ''});\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<${type}, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${workgroupSize[0]}];\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let ACached = ${\n transposeA ? `mm_Asub[k][localRow + innerRow * ${workgroupSize[1]}];` :\n `mm_Asub[localRow + innerRow * ${workgroupSize[1]}][k];`}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] +\n ACached * BCached[innerCol];\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let gRow = globalRowStart + localRow + innerRow * ${workgroupSize[1]};\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let gCol = globalColStart + localCol + innerCol * ${workgroupSize[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n ` :\n `\nlet tileRow = i32(localId.y) * rowPerThread;\nlet tileCol = i32(localId.x) * colPerThread;\n\nlet globalRow = i32(globalId.y) * rowPerThread;\nlet globalCol = i32(globalId.x) * colPerThread;\nlet globalRowStart = i32(workgroupId.y) * ${tileAOuter};\n\nlet tileRowA = i32(localId.y) * ${rowPerThreadA};\nlet tileColA = i32(localId.x) * ${colPerThreadA};\nlet tileRowB = i32(localId.y) * ${rowPerThreadB};\n// Loop over shared dimension.\nfor (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${rowPerThreadA}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < ${colPerThreadA}; innerCol = innerCol + 1) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${writeDataToSubASnippet(transposeA, batchDims)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${rowPerThreadB}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalCol + innerCol${batchDims ? ', batchIndices' : ''});\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<${type}, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n ${readDataFromSubASnippet(transposeA)}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol];\n }\n }\n }\n\n workgroupBarrier();\n}\n\nfor (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n}\n`;\n\n return `\n var mm_Asub : array, ${tileAHight}>;\n var mm_Bsub : array, ${tileInner}>;\n const rowPerThread = ${workPerThread[1]};\n const colPerThread = ${workPerThread[0]};\n const tileInner = ${tileInner};\n\n@compute @workgroup_size(${workgroupSize[0]}, ${workgroupSize[1]}, ${workgroupSize[2]})\nfn main(@builtin(local_invocation_id) localId : vec3,\n @builtin(global_invocation_id) globalId : vec3,\n @builtin(workgroup_id) workgroupId : vec3) {\n let batch = ${splitK ? '0' : 'i32(globalId.z)'};\n ${batchDims ? `let batchIndices = ${batchDims.offsetToIndices('u32(batch)')};` : ''}\n let num_tiles = ${\n splitK ? `${Math.ceil(splitedDimInner / tileInner)}` : '(uniforms.dim_inner - 1) / tileInner + 1'};\n var kStart = ${splitK ? `i32(globalId.z) * ${splitedDimInner}` : '0'};\n\n var acc : array, rowPerThread>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${matmulSnippet}\n }\n`;\n };\n\nconst matMulReadWriteFnSource =\n (component: number, hasBias: boolean, applyActivation: string, variables: IndicesHelper[],\n batchShapes: Array, isChannelsLast = false): string => {\n const [batchAShape, batchBShape, batchShape] = batchShapes;\n const [batchVariable, aVariable, bVariable, outputVariable] = variables;\n const broadCastADims = getBroadcastDims(batchAShape, batchShape);\n const broadCastBDims = getBroadcastDims(batchBShape, batchShape);\n const dataType = tensorTypeToWsglStorageType(variables[0].type.tensor);\n const getAIndices = () => {\n const aRank = aVariable.rank;\n const batchRank = batchVariable.rank;\n let resStr = `var aIndices: ${aVariable.type.indices};`;\n for (let i = aRank - 2 - 1, j = batchRank - 1; i >= 0; i--, j--) {\n resStr += `\\naIndices[${i}] = ${batchRank > 1 ? `batchIndices[${j}]` : 'batchIndices'};`;\n }\n broadCastADims.forEach(i => {\n resStr += `\\naIndices[${i}] = 0;`;\n });\n resStr += `\\naIndices[${aRank - 2}] = u32(row);\n aIndices[${aRank - 1}] = u32(colIn);`;\n return resStr;\n };\n const getBIndices = () => {\n const bRank = bVariable.rank;\n const batchRank = batchVariable.rank;\n let resStr = `var bIndices: ${bVariable.type.indices};`;\n for (let i = bRank - 2 - 1, j = batchRank - 1; i >= 0; i--, j--) {\n resStr += `\\nbIndices[${i}] = ${batchRank > 1 ? `batchIndices[${j}]` : 'batchIndices'};`;\n }\n broadCastBDims.forEach(i => {\n resStr += `\\nbIndices[${i}] = 0;`;\n });\n resStr += `\\nbIndices[${bRank - 2}] = u32(row);\n bIndices[${bRank - 1}] = u32(colIn);`;\n return resStr;\n };\n const source = `\n fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${batchVariable.type.indices}) -> ${\n typeSnippet(component, dataType)} {\n var value = ${typeSnippet(component, dataType)}(0.0);\n let col = colIn * ${component};\n if(row < uniforms.dim_a_outer && col < uniforms.dim_inner)\n {\n ${getAIndices()}\n value = ${aVariable.getByIndices('aIndices')};\n }\n return value;\n }\n\n fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${batchVariable.type.indices}) -> ${\n typeSnippet(component, dataType)} {\n var value = ${typeSnippet(component, dataType)}(0.0);\n let col = colIn * ${component};\n if(row < uniforms.dim_inner && col < uniforms.dim_b_outer)\n {\n ${getBIndices()}\n value = ${bVariable.getByIndices('bIndices')};\n }\n return value;\n }\n\n fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${typeSnippet(component, dataType)}) {\n let col = colIn * ${component};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\n var value = valueIn;\n let coords = vec3(batch, row, colIn);\n ${\n hasBias ?\n `value = value + ${isChannelsLast ? 'bias[colIn]' : `${typeSnippet(component, dataType)}(bias[row])`};` :\n '' }\n ${applyActivation}\n ${outputVariable.setByIndices('vec3(coords)', 'value')}\n }\n }\n `;\n return source;\n };\n\nexport const createMatmulProgramInfo =\n (inputs: readonly TensorView[], activationAttributes: InternalActivationAttributes, outputShape: readonly number[],\n reshapedOutputShape?: readonly number[],\n isChannelsLast = false /* only used for conv2dByMatMul*/): ProgramInfo => {\n const aShape = inputs[0].dims;\n const bShape = inputs[1].dims;\n const outerDimsA = aShape.slice(0, -2);\n const outerDimsB = bShape.slice(0, -2);\n const outerDims = reshapedOutputShape ? reshapedOutputShape.slice(0, -2) : outputShape.slice(0, -2);\n const batchSize = ShapeUtil.size(outerDims);\n const dimAOuter = aShape[aShape.length - 2];\n const dimInner = aShape[aShape.length - 1];\n const dimBOuter = bShape[bShape.length - 1];\n const isVec4 = dimInner % 4 === 0 && dimBOuter % 4 === 0;\n\n // TODO: fine tune size\n const elementsPerThread = dimAOuter <= 8 ? [4, 1, 1] : [4, 4, 1];\n const workgroupSize: [number, number, number] = [8, 8, 1];\n const dispatch = [\n Math.ceil(dimBOuter / workgroupSize[0] / elementsPerThread[0]),\n Math.ceil(dimAOuter / workgroupSize[1] / elementsPerThread[1]),\n Math.ceil(batchSize / workgroupSize[2] / elementsPerThread[2])\n ];\n\n const components = isVec4 ? 4 : 1;\n const aShapeTemp = [...outerDimsA, dimAOuter, dimInner / components];\n const aRank = aShapeTemp.length;\n const bShapeTemp = [...outerDimsB, dimInner, dimBOuter / components];\n const bRank = bShapeTemp.length;\n const outputShapeTemp = [batchSize, dimAOuter, dimBOuter / components];\n const programUniforms: ProgramUniform[] = [\n {type: DataType.int32, data: dimAOuter}, {type: DataType.int32, data: dimBOuter},\n {type: DataType.int32, data: dimInner}\n ];\n appendActivationUniformsData(activationAttributes, programUniforms);\n programUniforms.push(...createTensorShapeVariables(outerDims, aShapeTemp, bShapeTemp));\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'rank'];\n\n const hasBias = inputs.length > 2;\n if (hasBias) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n inputDependencies.push('rank');\n }\n programUniforms.push(...createTensorShapeVariables(outputShapeTemp));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const batchRank = outerDims.length;\n const batchDims = internalVariable('batchDims', inputs[0].dataType, batchRank, 1);\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n\n const A = inputVariable('a', inputs[0].dataType, aRank, components);\n const B = inputVariable('b', inputs[1].dataType, bRank, components);\n const output = outputVariable('result', inputs[0].dataType, outputShapeTemp.length, components);\n const inputVariables = [A, B];\n if (hasBias) {\n const biasComponents = isChannelsLast ? components : 1;\n inputVariables.push(inputVariable('bias', inputs[2].dataType, inputs[2].dims.length, biasComponents));\n }\n const uniforms: UniformsArrayType =\n [{name: 'dim_a_outer', type: 'i32'}, {name: 'dim_b_outer', type: 'i32'}, {name: 'dim_inner', type: 'i32'}];\n appendActivationUniforms(activationAttributes, uniforms);\n const baseType = tensorTypeToWsglStorageType(output.type.tensor);\n const applyActivation = getActivationSnippet(activationAttributes, output.type.value, baseType);\n const declareFunctions = matMulReadWriteFnSource(\n components, hasBias, applyActivation, [batchDims, A, B, output], [outerDimsA, outerDimsB, outerDims],\n isChannelsLast);\n return `\n ${\n shaderHelper.registerUniforms(uniforms).registerInternalVariables(batchDims).declareVariables(\n ...inputVariables, output)}\n ${declareFunctions}\n ${\n isVec4 ? makeMatMulPackedVec4Source(elementsPerThread, workgroupSize, dataType, batchDims) :\n makeMatMulPackedSource(elementsPerThread, workgroupSize, dataType, batchDims)}\n `;\n };\n return {\n name: 'MatMul',\n shaderCache: {\n hint: `${elementsPerThread};${activationAttributes.activation};${isVec4};${isChannelsLast}`,\n inputDependencies\n },\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: dispatch[0], y: dispatch[1], z: dispatch[2]},\n programUniforms\n }),\n getShaderSource,\n };\n };\n", "/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\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 */\n\n// sampled from [@tensorflow/tfjs] tfjs-backend-webgpu/src/conv2d_mm_webgpu.ts\n//\n// modified to fit the needs of the project\n\nimport {DataType} from '../../../../wasm-common';\nimport {LOG_DEBUG} from '../../../log';\nimport {TensorView} from '../../../tensor-view';\nimport {ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../../types';\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from '../common';\nimport {ConvAttributes} from '../conv';\nimport {appendActivationUniforms, appendActivationUniformsData, getActivationSnippet} from '../fuse-utils';\n\nimport {biasSnippet, typeSnippet} from './activation_util';\nimport {utilFunctions} from './conv_util';\nimport {makeMatMulPackedSource, makeMatMulPackedVec4Source} from './matmul_packed_webgpu';\n\nconst conv2dCommonSnippet =\n (isChannelsLast: boolean, fitAOuter: boolean, fitBOuter: boolean, fitInner: boolean, addBias = false,\n attributes: ConvAttributes, innerElementSizeX = 4, innerElementSizeW = 4, innerElementSize = 4,\n dataType = 'f32'): string => {\n const getXSnippet = (innerElementSize: number) => {\n switch (innerElementSize) {\n case 1:\n return 'resData = x[xIndex];';\n case 3:\n return `resData = vec3<${dataType}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;\n case 4:\n return 'resData = x[xIndex / 4];';\n default:\n throw new Error(`innerElementSize ${innerElementSize} is not supported.`);\n }\n };\n const getWSnippet = (innerElementSize: number) => {\n switch (innerElementSize) {\n case 1:\n return 'return w[row * i32(uniforms.w_shape[3]) + colIn];';\n case 4:\n return 'return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];';\n default:\n throw new Error(`innerElementSize ${innerElementSize} is not supported.`);\n }\n };\n const coordASnippet = isChannelsLast ? `\n let coord = vec4(batch, xRow, xCol, xCh);\n ` :\n `\n let coord = vec4(batch, xCh, xRow, xCol);\n `;\n\n const coordResSnippet = isChannelsLast ? `\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n ` :\n `\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `;\n\n const xHeight = isChannelsLast ? 'i32(uniforms.x_shape[1])' : 'i32(uniforms.x_shape[2])';\n const xWidth = isChannelsLast ? 'i32(uniforms.x_shape[2])' : 'i32(uniforms.x_shape[3])';\n const row = isChannelsLast ? 'row' : 'col';\n const col = isChannelsLast ? 'col' : 'row';\n const readXSnippet = `\n let inChannels = i32(uniforms.w_shape[2]);\n let outWidth = ${isChannelsLast ? 'i32(uniforms.result_shape[2])' : 'i32(uniforms.result_shape[3])'};\n let outRow = ${row} / outWidth;\n let outCol = ${row} % outWidth;\n\n let WRow = ${col} / (i32(uniforms.w_shape[1]) * inChannels);\n let WCol = ${col} / inChannels % i32(uniforms.w_shape[1]);\n let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0];\n let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1];\n let xCh = ${col} % inChannels;\n var resData = ${typeSnippet(innerElementSizeX, dataType)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${xHeight} && xCol >= 0 && xCol < ${xWidth}) {\n ${coordASnippet}\n let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape));\n ${getXSnippet(innerElementSizeX)}\n }\n return resData;`;\n\n const sampleX = isChannelsLast ? (fitAOuter && fitInner ? `\n let col = colIn * ${innerElementSizeX};\n ${readXSnippet}` :\n `\n let col = colIn * ${innerElementSizeX};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\n ${readXSnippet}\n }\n return ${typeSnippet(innerElementSizeX, dataType)}(0.0);`) :\n (fitInner && fitBOuter ? `\n let col = colIn * ${innerElementSizeX};\n ${readXSnippet}` :\n `\n let col = colIn * ${innerElementSizeX};\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\n ${readXSnippet}\n }\n return ${typeSnippet(innerElementSizeX, dataType)}(0.0);`);\n\n const sampleW = `${getWSnippet(innerElementSizeW)}`;\n\n const resType = typeSnippet(innerElementSize, dataType);\n const aType =\n isChannelsLast ? typeSnippet(innerElementSizeX, dataType) : typeSnippet(innerElementSizeW, dataType);\n const bType =\n isChannelsLast ? typeSnippet(innerElementSizeW, dataType) : typeSnippet(innerElementSizeX, dataType);\n const applyActivation = getActivationSnippet(attributes, resType, dataType);\n const userCode = `\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${aType} {\n ${isChannelsLast ? sampleX : sampleW}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${bType} {\n ${isChannelsLast ? sampleW : sampleX}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${resType}) {\n let col = colIn * ${innerElementSize};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer)\n {\n var value = valueIn;\n let outWidth = ${isChannelsLast ? 'i32(uniforms.result_shape[2])' : 'i32(uniforms.result_shape[3])'};\n ${coordResSnippet}\n ${biasSnippet(addBias)}\n ${applyActivation}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`;\n return userCode;\n };\n\nexport const createConv2DMatMulProgramInfo =\n (inputs: readonly TensorView[], attributes: ConvAttributes, outputShape: readonly number[], dimAOuter: number,\n dimBOuter: number, dimInner: number, hasBias: boolean, sequentialAccessByThreads: boolean): ProgramInfo => {\n const isChannelsLast = attributes.format === 'NHWC';\n const inChannels = isChannelsLast ? inputs[0].dims[3] : inputs[0].dims[1];\n const batchSize = outputShape[0];\n const outWidth = isChannelsLast ? outputShape[2] : outputShape[3];\n const outHeight = isChannelsLast ? outputShape[1] : outputShape[2];\n const outChannels = isChannelsLast ? outputShape[3] : outputShape[1];\n // TODO: enable vec4 for NCHW\n const isVec4 = isChannelsLast && (inChannels % 4 === 0 || inChannels % 3 === 0) && outChannels % 4 === 0;\n\n // TODO: fine tune size\n const dispatchX = isChannelsLast ? outChannels : outWidth * outHeight;\n const dispatchY = isChannelsLast ? outWidth * outHeight : outChannels;\n const workGroupSize: [number, number, number] = [8, 8, 1];\n const elementsPerThread = dimAOuter <= 8 ? [4, 1, 1] : [4, 4, 1];\n const dispatch = [\n Math.ceil(dispatchX / workGroupSize[0] / elementsPerThread[0]),\n Math.ceil(dispatchY / workGroupSize[1] / elementsPerThread[1]),\n Math.ceil(batchSize / workGroupSize[2] / elementsPerThread[2])\n ];\n\n LOG_DEBUG('verbose', () => `[conv2d_mm_webgpu] dispatch = ${dispatch}`);\n\n const innerElementSize = isVec4 ? (isChannelsLast && inChannels % 4 !== 0 ? 3 : 4) : 1;\n const tileAOuter = workGroupSize[1] * elementsPerThread[1];\n const tileBOuter = workGroupSize[0] * elementsPerThread[0];\n const tileInner = Math.max(workGroupSize[0] * innerElementSize, workGroupSize[1]);\n const fitAOuter = dimAOuter % tileAOuter === 0;\n const fitBOuter = dimBOuter % tileBOuter === 0;\n const fitInner = dimInner % tileInner === 0;\n const elementsSize = isVec4 ? [innerElementSize, 4, 4] : [1, 1, 1];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.int32, data: dimAOuter}, {type: DataType.int32, data: dimBOuter},\n {type: DataType.int32, data: dimInner}, {type: DataType.int32, data: [attributes.pads[0], attributes.pads[1]]},\n {type: DataType.int32, data: attributes.strides}, {type: DataType.int32, data: attributes.dilations}\n ];\n appendActivationUniformsData(attributes, programUniforms);\n programUniforms.push(...createTensorShapeVariables(inputs[0].dims, inputs[1].dims));\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'rank'];\n if (hasBias) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n inputDependencies.push('rank');\n }\n programUniforms.push(...createTensorShapeVariables(outputShape));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const uniforms: UniformsArrayType = [\n {name: 'dim_a_outer', type: 'i32'}, {name: 'dim_b_outer', type: 'i32'}, {name: 'dim_inner', type: 'i32'},\n {name: 'pad', type: 'i32', length: 2}, {name: 'stride', type: 'i32', length: 2},\n {name: 'dilation', type: 'i32', length: 2}\n ];\n appendActivationUniforms(attributes, uniforms);\n\n // TODO: support component 2, 3.\n const components = isVec4 ? 4 : 1;\n const t = tensorTypeToWsglStorageType(inputs[0].dataType);\n let declareFunctions = `\n fn setOutputAtIndex(flatIndex : i32, value : ${isVec4 ? `vec4<${t}>` : t}) {\n result[flatIndex] = ${isVec4 ? `vec4<${t}>` : t}(value);\n }\n fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${isVec4 ? `vec4<${t}>` : t}) {\n let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3));\n setOutputAtIndex(flatIndex ${isVec4 ? '/ 4' : ''}, value);\n }`;\n const x = inputVariable(\n 'x', inputs[0].dataType, inputs[0].dims.length, innerElementSize === 3 ? 1 : innerElementSize);\n const w = inputVariable('w', inputs[1].dataType, inputs[1].dims.length, components);\n const inputVariables = [x, w];\n const output = outputVariable('result', inputs[0].dataType, outputShape.length, components);\n if (hasBias) {\n const bias = inputVariable('bias', inputs[2].dataType, inputs[2].dims.length, components);\n inputVariables.push(bias);\n declareFunctions += `\n fn getBiasByOutputCoords(coords : vec4) -> ${isVec4 ? `vec4<${t}>` : t} {\n return bias[coords.${isChannelsLast ? 'w' : 'y'}${isVec4 ? '/ 4' : ''}];\n }`;\n }\n\n return `\n ${utilFunctions('uniforms.result_strides')}\n //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4,\n // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2,\n // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 };\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVariables, output)}\n ${declareFunctions}\n ${\n conv2dCommonSnippet(\n isChannelsLast, fitAOuter, fitBOuter, fitInner, hasBias, attributes, elementsSize[0], elementsSize[1],\n elementsSize[2], t)}\n ${\n isVec4 ?\n makeMatMulPackedVec4Source(elementsPerThread, workGroupSize, t, undefined, !isChannelsLast, tileInner) :\n makeMatMulPackedSource(\n elementsPerThread, workGroupSize, t, undefined, !isChannelsLast, tileInner, false, undefined,\n sequentialAccessByThreads)}`;\n };\n return {\n name: 'Conv2DMatMul',\n shaderCache: {\n hint: `${attributes.cacheKey};${innerElementSize};${isVec4};${fitAOuter};${fitBOuter};${fitInner};${\n tileAOuter};${tileBOuter};${tileInner}`,\n inputDependencies\n },\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: dispatch[0], y: dispatch[1], z: dispatch[2]},\n programUniforms,\n }),\n getShaderSource\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, getMaxComponents, inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from './common';\nimport {calculateOutputShape, ConvAttributes} from './conv';\nimport {appendActivationUniforms, appendActivationUniformsData, getActivationSnippet} from './fuse-utils';\n\n/**\n * naive grouped conv implementation, supports 1d/2d conv\n * @param squeezeOutputShapeFunction - an optional function to squeeze the output shape, only used in conv1d\n */\nexport const createGroupedConvProgramInfo =\n (inputs: readonly TensorView[], attributes: ConvAttributes,\n squeezeOutputShapeFunction?: (shape: readonly number[]) => number[]): ProgramInfo => {\n const hasBias = inputs.length > 2;\n const processBias = hasBias ? 'value += b[output_channel];' : '';\n const xShape = inputs[0].dims;\n const wShape = inputs[1].dims;\n const outputChannelsPerGroup = wShape[0] / attributes.group;\n\n const isChannelLast = attributes.format === 'NHWC';\n const outputShape = calculateOutputShape(\n xShape, wShape, attributes.dilations, attributes.pads, attributes.strides, isChannelLast);\n const outputSize = ShapeUtil.size(outputShape);\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: attributes.dilations},\n {type: DataType.uint32, data: [attributes.strides[0], attributes.strides[1]]},\n {type: DataType.uint32, data: [attributes.pads[0], attributes.pads[1]]},\n {type: DataType.uint32, data: outputChannelsPerGroup}\n ];\n appendActivationUniformsData(attributes, programUniforms);\n programUniforms.push(...createTensorShapeVariables(xShape, wShape));\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'rank'];\n if (hasBias) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n inputDependencies.push('rank');\n }\n programUniforms.push(...createTensorShapeVariables(outputShape));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const output = outputVariable('output', inputs[0].dataType, outputShape.length);\n const baseType = tensorTypeToWsglStorageType(output.type.tensor);\n const applyActivation = getActivationSnippet(attributes, output.type.value, baseType);\n const x = inputVariable('x', inputs[0].dataType, xShape.length);\n const w = inputVariable('w', inputs[1].dataType, wShape.length);\n const inputVars = [x, w];\n if (hasBias) {\n inputVars.push(inputVariable('b', inputs[2].dataType, inputs[2].dims.length));\n }\n\n const uniforms: UniformsArrayType = [\n {name: 'output_size', type: 'u32'}, {name: 'dilations', type: 'u32', length: attributes.dilations.length},\n {name: 'strides', type: 'u32', length: 2}, {name: 'pads', type: 'u32', length: 2},\n {name: 'output_channels_per_group', type: 'u32'}\n ];\n appendActivationUniforms(attributes, uniforms);\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVars, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n\n let outputIndices = ${output.offsetToIndices('global_idx')};\n let batch: u32 = outputIndices[0];\n let output_channel: u32 = outputIndices[${isChannelLast ? 3 : 1}];\n let xRCCorner: vec2 = vec2(outputIndices[${isChannelLast ? 1 : 2}], outputIndices[${\n isChannelLast ? 2 : 3}]) * uniforms.strides - uniforms.pads;\n let group_id: u32 = output_channel / uniforms.output_channels_per_group;\n\n var value: ${output.type.value} = ${output.type.value}(0);\n for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) {\n let input_channel = group_id * uniforms.w_shape[1] + wInChannel;\n for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) {\n let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0];\n\n if (xHeight < 0u || xHeight >= uniforms.x_shape[${isChannelLast ? 1 : 2}]) {\n continue;\n }\n\n for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) {\n let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1];\n if (xWidth < 0u || xWidth >= uniforms.x_shape[${isChannelLast ? 2 : 3}]) {\n continue;\n }\n\n let xVal = ${\n isChannelLast ? x.get('batch', 'xHeight', 'xWidth', 'input_channel') :\n x.get('batch', 'input_channel', 'xHeight', 'xWidth')};\n let wVal = ${w.get('output_channel', 'wInChannel', 'wHeight', 'wWidth')};\n value += xVal*wVal;\n }\n }\n }\n ${processBias}\n ${applyActivation}\n ${output.setByOffset('global_idx', 'value')}\n }`;\n };\n return {\n name: 'GroupedConv',\n shaderCache: {hint: attributes.cacheKey, inputDependencies},\n getRunData: () => ({\n outputs: [{\n dims: squeezeOutputShapeFunction ? squeezeOutputShapeFunction(outputShape) : outputShape,\n dataType: inputs[0].dataType\n }],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n };\n };\n\nexport const createGroupedConvVectorizeProgramInfo =\n (inputs: readonly TensorView[], attributes: ConvAttributes, outputShape: readonly number[]): ProgramInfo => {\n const hasBias = inputs.length > 2;\n const components = getMaxComponents(outputShape[3]);\n const outputNumber = getMaxComponents(outputShape[2]);\n const outputSize = ShapeUtil.size(outputShape) / components / outputNumber;\n const xShape = [inputs[0].dims[0], inputs[0].dims[1], inputs[0].dims[2], inputs[0].dims[3] / components];\n const wShape = [inputs[1].dims[0], inputs[1].dims[1], inputs[1].dims[2], inputs[1].dims[3] / components];\n const outputShapeInShader = [outputShape[0], outputShape[1], outputShape[2], outputShape[3] / components];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize},\n {type: DataType.int32, data: [attributes.strides[0], attributes.strides[1]]},\n {type: DataType.int32, data: [attributes.pads[0], attributes.pads[1]]}\n ];\n appendActivationUniformsData(attributes, programUniforms);\n programUniforms.push(...createTensorShapeVariables(xShape, wShape, outputShapeInShader));\n const xNumber = (outputNumber - 1) * attributes.strides[1] + wShape[1];\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const output = outputVariable('output', inputs[0].dataType, outputShapeInShader.length, components);\n const baseType = tensorTypeToWsglStorageType(output.type.tensor);\n const applyActivation = getActivationSnippet(attributes, output.type.value, baseType);\n const x = inputVariable('x', inputs[0].dataType, xShape.length, components);\n const w = inputVariable('w', inputs[1].dataType, wShape.length, components);\n const inputVars = [x, w];\n if (hasBias) {\n inputVars.push(inputVariable('b', inputs[2].dataType, inputs[2].dims, components));\n }\n const processBias = hasBias ? 'value += b[output_channel];' : '';\n const uniforms: UniformsArrayType = [\n {name: 'output_size', type: 'u32'},\n {name: 'strides', type: 'i32', length: 2},\n {name: 'pads', type: 'i32', length: 2},\n ];\n appendActivationUniforms(attributes, uniforms);\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVars, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n let width0 = uniforms.output_shape[3];\n let output_channel = global_idx % width0;\n var index1 = global_idx / width0;\n let width1 = uniforms.output_shape[2] / ${outputNumber}u;\n let col = (index1 % width1) * ${outputNumber}u;\n index1 = index1 / width1;\n let row = index1 % uniforms.output_shape[1];\n let batch = index1 / uniforms.output_shape[1];\n\n let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads;\n\n var x_vals: array<${x.type.value}, ${xNumber}>;\n var values: array<${output.type.value}, ${outputNumber}>;\n let input_channel = output_channel;\n // Use constant instead of uniform can give better performance for w's height/width.\n for (var w_height: u32 = 0u; w_height < ${wShape[0]}; w_height++) {\n let x_height = x_corner.x + i32(w_height);\n if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) {\n for (var i = 0; i < ${xNumber}; i++) {\n let x_width = x_corner.y + i;\n if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) {\n x_vals[i] = ${x.get('batch', 'u32(x_height)', 'u32(x_width)', 'input_channel')};\n } else {\n x_vals[i] = ${x.type.value}(0);\n }\n }\n for (var w_width: u32 = 0u; w_width < ${wShape[1]}; w_width++) {\n let w_val = ${w.get('w_height', 'w_width', '0', 'output_channel')};\n for (var i = 0u; i < ${outputNumber}u; i++) {\n values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]);\n }\n }\n }\n }\n\n for (var i = 0u; i < ${outputNumber}u; i++) {\n var value = values[i];\n ${processBias}\n ${applyActivation}\n ${output.set('batch', 'row', 'col + i', 'output_channel', 'value')};\n }\n }`;\n };\n\n return {\n name: 'GroupedConv-Vectorize',\n shaderCache: {\n hint: `${attributes.cacheKey};${components};${outputNumber};${xNumber};${wShape[0]};${wShape[1]}`,\n inputDependencies: hasBias ? ['rank', 'rank', 'type'] : ['rank', 'rank']\n },\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {BroadcastUtil, ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createMatmulProgramInfo} from './3rd-party/matmul_packed_webgpu';\nimport {createTensorShapeVariables, getBroadcastDims, getMaxComponents, IndicesHelper, inputVariable, internalVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from './common';\nimport {appendActivationUniforms, appendActivationUniformsData, getActivationSnippet, InternalActivationAttributes} from './fuse-utils';\n\nexport const createNaiveMatmulProgramInfo =\n (inputs: readonly TensorView[], activationAttributes: InternalActivationAttributes, outputShape: readonly number[],\n reshapedOutputShape?: readonly number[],\n isChannelsLast = false /* only used for conv2dByMatMul*/): ProgramInfo => {\n const aShape = inputs[0].dims;\n const bShape = inputs[1].dims;\n\n const M = aShape[aShape.length - 2];\n const N = bShape[bShape.length - 1];\n const K = aShape[aShape.length - 1];\n const components = getMaxComponents(N);\n const aComponents = getMaxComponents(K);\n const outputNumber = getMaxComponents(M);\n const outputSize = ShapeUtil.size(outputShape) / components / outputNumber;\n const hasBias = inputs.length > 2;\n const outerDims = reshapedOutputShape ? reshapedOutputShape.slice(0, -2) : outputShape.slice(0, -2);\n const batchSize = ShapeUtil.size(outerDims);\n const outputShapeInShader = [batchSize, M, N];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: M}, {type: DataType.uint32, data: N},\n {type: DataType.uint32, data: K}\n ];\n appendActivationUniformsData(activationAttributes, programUniforms);\n programUniforms.push(...createTensorShapeVariables(outerDims, aShape, bShape));\n if (hasBias) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n }\n programUniforms.push(...createTensorShapeVariables(outputShapeInShader));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const batchDims = internalVariable('batch_dims', inputs[0].dataType, outerDims.length);\n const a = inputVariable('a', inputs[0].dataType, aShape.length, aComponents);\n const b = inputVariable('b', inputs[1].dataType, bShape.length, components);\n const output = outputVariable('output', inputs[0].dataType, outputShapeInShader.length, components);\n const baseType = tensorTypeToWsglStorageType(output.type.tensor);\n const applyActivation = getActivationSnippet(activationAttributes, output.type.value, baseType);\n const inputVariables = [a, b];\n let processBias = '';\n if (hasBias) {\n const biasComponents = isChannelsLast ? components : 1;\n inputVariables.push(inputVariable('bias', inputs[2].dataType, inputs[2].dims.length, biasComponents));\n processBias = `${\n isChannelsLast ? `value += bias[col / ${biasComponents}];` :\n `value += ${output.type.value}(bias[row + i]);`}`;\n }\n\n const outerDimsA = aShape.slice(0, -2);\n const outerDimsB = bShape.slice(0, -2);\n const broadCastADims = getBroadcastDims(outerDimsA, outerDims);\n const broadCastBDims = getBroadcastDims(outerDimsB, outerDims);\n const uniforms: UniformsArrayType = [\n {name: 'output_size', type: 'u32'}, {name: 'M', type: 'u32'}, {name: 'N', type: 'u32'},\n {name: 'K', type: 'u32'}\n ];\n appendActivationUniforms(activationAttributes, uniforms);\n\n const getIndices = (variable: IndicesHelper, broadCastDims: number[]) => {\n const rank = variable.rank;\n const name = variable.name;\n if (rank === 2) {\n return `var ${name}_indices = ${variable.type.indices}(0u, 0u);`;\n }\n const batchRank = batchDims.rank;\n let resStr = `var ${name}_indices: ${variable.type.indices};`;\n for (let i = rank - 2 - 1, j = batchRank - 1; i >= 0; i--, j--) {\n resStr += `\\n${name}_indices[${i}] = ${batchRank > 1 ? `batch_indices[${j}]` : 'batch_indices'};`;\n }\n broadCastDims.forEach(i => {\n resStr += `\\n${name}_indices[${i}] = 0;`;\n });\n resStr += `${name}_indices[${rank - 2}] = 0u;\n ${name}_indices[${rank - 1}] = 0u;`;\n return resStr;\n };\n\n const calcResult = (): string => {\n let calcStr = `var a_data: ${a.type.value};`;\n for (let i = 0; i < aComponents; i++) {\n calcStr += `\n let b_data${i} = b[(b_offset + (k + ${i}) * uniforms.N + col) / ${components}];`;\n }\n for (let i = 0; i < outputNumber; i++) {\n calcStr += `a_data = a[(a_offset + (row + ${i}) * uniforms.K + k) / ${aComponents}];`;\n\n for (let j = 0; j < aComponents; j++) {\n calcStr += `\n values[${i}] = fma(${b.type.value}(a_data${aComponents === 1 ? '' : `[${j}]`}), b_data${j}, values[${\n i}]);\\n`;\n }\n }\n return calcStr;\n };\n\n return `\n ${\n shaderHelper.registerUniforms(uniforms).registerInternalVariables(batchDims).declareVariables(\n ...inputVariables, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n let col = (global_idx % (uniforms.N / ${components})) * ${components};\n var index1 = global_idx / (uniforms.N / ${components});\n let stride1 = uniforms.M / ${outputNumber};\n let row = (index1 % stride1) * ${outputNumber};\n let batch = index1 / stride1;\n\n ${outputShape.length === 2 ? '' : `let batch_indices = ${batchDims.offsetToIndices('batch')};`}\n ${getIndices(a, broadCastADims)}\n let a_offset = ${a.indicesToOffset('a_indices')};\n ${getIndices(b, broadCastBDims)}\n let b_offset = ${b.indicesToOffset('b_indices')};\n var values: array<${output.type.value}, ${outputNumber}>;\n for (var k: u32 = 0u; k < uniforms.K; k = k + ${aComponents}) {\n ${calcResult()}\n }\n for (var i = 0u; i < ${outputNumber}u; i++) {\n var value = values[i];\n ${processBias}\n ${applyActivation}\n let cur_indices = ${output.type.indices}(batch, row + i, col);\n let offset = ${output.indicesToOffset('cur_indices')};\n ${output.setByOffset(`offset / ${components}`, 'value')};\n }\n }\n `;\n };\n return {\n name: 'MatMulNaive',\n shaderCache: {\n hint: `${activationAttributes.activation};${components};${aComponents};${outputNumber};${isChannelsLast}`,\n inputDependencies: hasBias ? ['rank', 'rank', 'rank'] : ['rank', 'rank']\n },\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource\n };\n };\n\nconst validateInputs = (inputs: readonly TensorView[]): 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\nexport const matMul = (context: ComputeContext): void => {\n validateInputs(context.inputs);\n const outputShape = BroadcastUtil.calcShape(context.inputs[0].dims, context.inputs[1].dims, true);\n if (!outputShape) {\n throw new Error('Can\\'t use matmul on the given tensors');\n }\n const N = outputShape[outputShape.length - 1];\n const K = context.inputs[0].dims[context.inputs[0].dims.length - 1];\n if (N < 8 && K < 8) {\n context.compute(createNaiveMatmulProgramInfo(context.inputs, {activation: ''}, outputShape));\n } else {\n context.compute(createMatmulProgramInfo(context.inputs, {activation: ''}, outputShape));\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TensorView} from '../../tensor-view';\nimport {PoolConvUtil} from '../../util';\nimport {AttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext} from '../types';\n\nimport {createConv2DMatMulProgramInfo} from './3rd-party/conv2d_mm_webgpu';\nimport {createMatmulProgramInfo} from './3rd-party/matmul_packed_webgpu';\nimport {createGroupedConvProgramInfo, createGroupedConvVectorizeProgramInfo} from './conv-grouped';\nimport {InternalActivationAttributes, parseInternalActivationAttributes} from './fuse-utils';\nimport {createNaiveMatmulProgramInfo} from './matmul';\nimport {createTransposeProgramInfo} from './transpose';\n\nexport const calculateOutputShape =\n (inputShape: readonly number[], kernelShape: readonly number[], dilations: readonly number[],\n adjustPads: readonly number[], strides: readonly number[], isChannelLast: boolean): number[] => {\n const batchSize = inputShape[0];\n const inputSpatialShape = inputShape.slice(isChannelLast ? 1 : 2, isChannelLast ? 3 : 4);\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 outputShape =\n inputSpatialShapeWithPad.map((v, i) => Math.floor((v - dilatedKernelShape[i] + strides[i]) / strides[i]));\n outputShape.splice(0, 0, batchSize);\n outputShape.splice(isChannelLast ? 3 : 1, 0, outChannels);\n return outputShape;\n };\n\nexport interface ConvAttributes extends InternalActivationAttributes, AttributeWithCacheKey {\n readonly autoPad: string;\n readonly dilations: readonly number[];\n readonly format: 'NHWC'|'NCHW';\n readonly group: number;\n readonly kernelShape: readonly number[];\n readonly pads: readonly number[];\n readonly strides: readonly number[];\n readonly wIsConst: boolean;\n}\n\n// for transposing weight tensor from [M, C/group, KH, KW] to [KH, KW, C/group, M]\nconst weightTransposeAttribute = [2, 3, 1, 0];\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: ConvAttributes): void => {\n // Refer to the below link for all input checks\n // https://github.com/onnx/onnx/blob/master/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[0].dims.length !== 3) {\n throw new Error('currently only support conv 1D and 2D');\n }\n\n if (inputs[0].dims.length !== inputs[1].dims.length) {\n throw new Error('filter does not have same dimension as input');\n }\n\n // FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\n const dataChannel = inputs[0].dims[attributes.format === 'NHWC' ? inputs[0].dims.length - 1 : 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\nconst getAdjustedConvAttributes = (attributes: T, inputs: readonly TensorView[]): 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 for (let i = 2; i < inputs[1].dims.length; ++i) {\n if (kernelShape[i - 2] === 0) {\n kernelShape[i - 2] = 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.format === 'NHWC',\n 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});\n return newAttributes;\n};\n\nexport const parseConvAttributes = (attributes: Record): ConvAttributes => {\n const activationAttributes = parseInternalActivationAttributes(attributes);\n // TODO : Make this generic enough to compute default attributes for multi-dimensional conv\n const format = attributes.format as 'NHWC' | 'NCHW';\n const autoPad = ['NOTSET', 'VALID', 'SAME_UPPER', 'SAME_LOWER'][attributes.auto_pad as number];\n const dilations = attributes.dilations as [number, number];\n const group = attributes.group as number;\n const kernelShape = attributes.kernel_shape as [number, number];\n const pads = attributes.pads as [number, number, number, number];\n const strides = attributes.strides as [number, number];\n const wIsConst = (attributes.w_is_const as () => boolean)();\n\n return {\n autoPad,\n format,\n dilations,\n group,\n kernelShape,\n pads,\n strides,\n wIsConst,\n ...activationAttributes,\n cacheKey: `${attributes.format};${activationAttributes.activation};`\n };\n};\n\nconst conv2d = (context: ComputeContext, inputs: readonly TensorView[], attributes: ConvAttributes): void => {\n const adjustedAttributes = getAdjustedConvAttributes(attributes, inputs);\n\n // check attributes\n\n // const hasPreluActivationWeights = false; /* TODO: add support for prelu activation weights */\n const isChannelsLast = attributes.format === 'NHWC';\n if (attributes.group !== 1) {\n // NVIDIA GPU with ampere architecture fails with below 2 cases, but we couldn't repro them with any other\n // GPUs. So just disable vectorize on NVIDIA ampere to ensure always correct outputs.\n // [webgpu]Conv - conv - vectorize group - B\n // [webgpu]Conv - conv - vectorize group - D\n const enableGroupedConvVectorize = !context.adapterInfo.isArchitecture('ampere');\n if (enableGroupedConvVectorize && isChannelsLast && inputs[1].dims[0] === attributes.group &&\n inputs[1].dims[1] === 1 && attributes.dilations[0] === 1 && attributes.dilations[1] === 1) {\n const outputShape = calculateOutputShape(\n inputs[0].dims, inputs[1].dims, attributes.dilations, adjustedAttributes.pads, attributes.strides,\n isChannelsLast);\n const transposedWeight = (context.kernelCustomData.wT as TensorView | undefined) ??\n context.compute(\n createTransposeProgramInfo(inputs[1], weightTransposeAttribute),\n {inputs: [1], outputs: [attributes.wIsConst ? -2 : -1]})[0];\n if (attributes.wIsConst && !context.kernelCustomData.wT) {\n context.kernelCustomData.wT = transposedWeight;\n }\n const convInputs = [inputs[0], transposedWeight];\n if (inputs.length === 3) {\n convInputs.push(inputs[2]);\n }\n context.compute(\n createGroupedConvVectorizeProgramInfo(convInputs, adjustedAttributes, outputShape), {inputs: convInputs});\n } else {\n context.compute(createGroupedConvProgramInfo(inputs, adjustedAttributes));\n }\n return;\n }\n\n const hasBias = inputs.length === 3;\n const inputHeight = inputs[0].dims[isChannelsLast ? 1 : 2];\n const inputWidth = inputs[0].dims[isChannelsLast ? 2 : 3];\n const inputChannels = inputs[0].dims[isChannelsLast ? 3 : 1];\n const weightHeight = inputs[1].dims[2];\n const weightWidth = inputs[1].dims[3];\n\n const outputShape = calculateOutputShape(\n inputs[0].dims, inputs[1].dims, attributes.dilations, adjustedAttributes.pads, attributes.strides,\n isChannelsLast);\n const outHeight = outputShape[isChannelsLast ? 1 : 2];\n const outWidth = outputShape[isChannelsLast ? 2 : 3];\n const outChannels = outputShape[isChannelsLast ? 3 : 1];\n\n const sameSize = isChannelsLast && weightHeight === inputHeight && weightWidth === inputWidth &&\n attributes.pads[0] === 0 && attributes.pads[1] === 0;\n if (sameSize ||\n (weightHeight === 1 && weightWidth === 1 && attributes.dilations[0] === 1 && attributes.dilations[1] === 1 &&\n attributes.strides[0] === 1 && attributes.strides[1] === 1 && attributes.pads[0] === 0 &&\n attributes.pads[1] === 0)) {\n // conv2dByMatMul\n const batch = outputShape[0];\n let xReshaped, wReshaped, matmulOutputShape;\n const matmulInputs = [];\n if (isChannelsLast) {\n const transposedWeight = (context.kernelCustomData.wT as TensorView | undefined) ??\n context.compute(\n createTransposeProgramInfo(inputs[1], weightTransposeAttribute),\n {inputs: [1], outputs: [attributes.wIsConst ? -2 : -1]})[0];\n if (attributes.wIsConst && !context.kernelCustomData.wT) {\n context.kernelCustomData.wT = transposedWeight;\n }\n if (sameSize) {\n const sharedDim = inputHeight * inputWidth * inputChannels;\n xReshaped = inputs[0].reshape([1, batch, sharedDim]);\n wReshaped = transposedWeight.reshape([1, sharedDim, outChannels]);\n matmulOutputShape = [1, batch, outChannels];\n } else {\n xReshaped = inputs[0].reshape([batch, inputHeight * inputWidth, inputChannels]);\n wReshaped = transposedWeight.reshape([1, inputChannels, outChannels]);\n matmulOutputShape = [batch, outHeight * outWidth, outChannels];\n }\n matmulInputs.push(xReshaped);\n matmulInputs.push(wReshaped);\n } else {\n xReshaped = inputs[0].reshape([batch, inputChannels, inputHeight * inputWidth]);\n wReshaped = inputs[1].reshape([1, outChannels, inputChannels]);\n matmulOutputShape = [batch, outChannels, outHeight * outWidth];\n matmulInputs.push(wReshaped);\n matmulInputs.push(xReshaped);\n }\n if (hasBias) {\n matmulInputs.push(inputs[2]);\n }\n const N = matmulOutputShape[2];\n const K = matmulInputs[0].dims[matmulInputs[0].dims.length - 1];\n // Tune the threshold.\n if (N < 8 && K < 8) {\n context.compute(\n createNaiveMatmulProgramInfo(\n matmulInputs, adjustedAttributes, outputShape, matmulOutputShape, isChannelsLast),\n {inputs: matmulInputs});\n } else {\n context.compute(\n createMatmulProgramInfo(matmulInputs, adjustedAttributes, outputShape, matmulOutputShape, isChannelsLast),\n {inputs: matmulInputs});\n }\n return;\n }\n\n // TODO: implement conv2dWithIm2Col()\n\n const sequentialAccessByThreads = /* backend.adapterInfo.isIntel() */ true;\n\n // STEP.1: transpose weight\n const transposedWeight = (context.kernelCustomData.wT as TensorView | undefined) ??\n context.compute(\n createTransposeProgramInfo(inputs[1], weightTransposeAttribute),\n {inputs: [1], outputs: [attributes.wIsConst ? -2 : -1]})[0];\n if (attributes.wIsConst && !context.kernelCustomData.wT) {\n context.kernelCustomData.wT = transposedWeight;\n }\n\n // STEP.2: prepare reshaped inputs\n const convInputs = [inputs[0], transposedWeight];\n if (hasBias) {\n convInputs.push(inputs[2]);\n }\n\n // STEP.3: compute matmul\n const dimAOuter = isChannelsLast ? outHeight * outWidth : outChannels;\n const dimBOuter = isChannelsLast ? outChannels : outHeight * outWidth;\n const dimInner = weightHeight * weightWidth * inputChannels;\n context.compute(\n createConv2DMatMulProgramInfo(\n convInputs, adjustedAttributes, outputShape, dimAOuter, dimBOuter, dimInner, hasBias,\n sequentialAccessByThreads),\n {inputs: convInputs});\n};\n\nconst conv1d = (context: ComputeContext, attributes: ConvAttributes): void => {\n // extend the input to 2D by adding H dimension\n const isChannelLast = attributes.format === 'NHWC';\n const inputs = [\n context.inputs[0].reshape(\n isChannelLast ?\n // [N, W, C] -> [N, H=1, W, C]\n [context.inputs[0].dims[0], 1, context.inputs[0].dims[1], context.inputs[0].dims[2]] :\n // [N, C, W] -> [N, C, H=1, W]\n [context.inputs[0].dims[0], context.inputs[0].dims[1], 1, context.inputs[0].dims[2]]),\n //[FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, kW] -> [FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, kH=1, kW]\n context.inputs[1].reshape([context.inputs[1].dims[0], context.inputs[1].dims[1], 1, context.inputs[1].dims[2]])\n ];\n if (context.inputs.length === 3) {\n inputs.push(context.inputs[2]);\n }\n const pads = [0, attributes.pads[0], 0, attributes.pads[1]];\n const strides = [1].concat(attributes.strides);\n const dilations = [1].concat(attributes.dilations);\n const kernelShape = [1].concat(attributes.kernelShape);\n const adjustedAttributes = getAdjustedConvAttributes({...attributes, pads, strides, dilations, kernelShape}, inputs);\n context.compute(createGroupedConvProgramInfo(\n inputs, adjustedAttributes,\n outputShape => isChannelLast ? [outputShape[0], outputShape[2], outputShape[3]] : []));\n};\n\nexport const conv = (context: ComputeContext, attributes: ConvAttributes): void => {\n validateInputs(context.inputs, attributes); // currently will fail if not conv1D/2D\n if (context.inputs[0].dims.length === 3) {\n conv1d(context, attributes);\n } else {\n conv2d(context, context.inputs, attributes);\n }\n};\n", "/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\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 */\n\n// sampled from [@tensorflow/tfjs] tfjs-backend-webgpu/src/conv_backprop_mm_webgpu.ts\n//\n// modified to fit the needs of the project\n\nimport {DataType} from '../../../../wasm-common';\nimport {LOG_DEBUG} from '../../../log';\nimport {TensorView} from '../../../tensor-view';\nimport {ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../../types';\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from '../common';\nimport {ConvTransposeAttributes} from '../conv-transpose';\nimport {appendActivationUniforms, appendActivationUniformsData, getActivationSnippet} from '../fuse-utils';\n\nimport {biasSnippet} from './activation_util';\nimport {utilFunctions} from './conv_util';\nimport {makeMatMulPackedSource, makeMatMulPackedVec4Source} from './matmul_packed_webgpu';\n\nconst conv2dTransposeCommonSnippet =\n (isChannelsLast: boolean, addBias = false, attributes: ConvTransposeAttributes, type: string,\n innerElementSize = 4): string => {\n const getWSnippet = (innerElementSize: number) => {\n switch (innerElementSize) {\n case 1:\n return 'return w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];';\n case 4:\n return `\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\n let v0 = w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\n let v1 = w[getIndexFromCoords4D(coord1, vec4(uniforms.w_shape))];\n let v2 = w[getIndexFromCoords4D(coord2, vec4(uniforms.w_shape))];\n let v3 = w[getIndexFromCoords4D(coord3, vec4(uniforms.w_shape))];\n return ${type}(v0, v1, v2, v3);\n `;\n default:\n throw new Error(`innerElementSize ${innerElementSize} is not supported.`);\n }\n };\n const coordASnippet = isChannelsLast ? `\n let coord = vec4(batch, iXR, iXC, xCh);\n ` :\n `\n let coord = vec4(batch, xCh, iXR, iXC);\n `;\n\n const coordResSnippet = isChannelsLast ? `\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n ` :\n `\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `;\n\n const xHeight = isChannelsLast ? 'i32(uniforms.x_shape[1])' : 'i32(uniforms.x_shape[2])';\n const xWidth = isChannelsLast ? 'i32(uniforms.x_shape[2])' : 'i32(uniforms.x_shape[3])';\n const row = isChannelsLast ? 'row' : 'col';\n const col = isChannelsLast ? 'col' : 'row';\n\n const readASnippet = `\n let inChannels = ${isChannelsLast ? 'i32(uniforms.x_shape[3])' : 'i32(uniforms.x_shape[1])'};\n let outWidth = ${isChannelsLast ? 'i32(uniforms.result_shape[2])' : 'i32(uniforms.result_shape[3])'};\n let outRow = ${row} / outWidth;\n let outCol = ${row} % outWidth;\n\n let WRow = ${col} / (uniforms.filter_dims[1] * inChannels);\n let WCol = ${col} / inChannels % uniforms.filter_dims[1];\n let xR = f32(outRow - uniforms.pads[0] + uniforms.dilations[0] * WRow) / f32(uniforms.strides[0]);\n let xC = f32(outCol - uniforms.pads[1] + uniforms.dilations[1] * WCol) / f32(uniforms.strides[1]);\n if (xR < 0.0 || xR >= f32(${xHeight}) || fract(xR) > 0.0) {\n return ${type}(0.0);\n }\n if (xC < 0.0 || xC >= f32(${xWidth}) || fract(xC) > 0.0) {\n return ${type}(0.0);\n }\n let iXR = i32(xR);\n let iXC = i32(xC);\n let xCh = ${col} % inChannels;\n ${coordASnippet}\n return x[getIndexFromCoords4D(coord, vec4(uniforms.x_shape))/${innerElementSize}];`;\n\n const sampleA = isChannelsLast ? `\n let col = colIn * ${innerElementSize};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\n ${readASnippet}\n }\n return ${type}(0.0);` :\n `\n let col = colIn * ${innerElementSize};\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\n ${readASnippet}\n }\n return ${type}(0.0);`;\n\n const sampleW = `\n let col = colIn * ${innerElementSize};\n let inChannels = ${isChannelsLast ? 'i32(uniforms.x_shape[3])' : 'i32(uniforms.x_shape[1])'};\n let coordX = uniforms.filter_dims[0] - 1 - row / (uniforms.filter_dims[1] * inChannels);\n let coordY = uniforms.filter_dims[1] - 1 - (row / inChannels) % uniforms.filter_dims[1];\n if (${\n isChannelsLast ? 'row < uniforms.dim_inner && col < uniforms.dim_b_outer' :\n 'row < uniforms.dim_inner && col < uniforms.dim_a_outer'} && coordX >= 0 && coordY >= 0) {\n let rowInner = row % inChannels;\n let coord = vec4(coordX, coordY, col, rowInner);\n ${getWSnippet(innerElementSize)}\n }\n return ${type}(0.0);\n `;\n\n const applyActivation = getActivationSnippet(attributes, type);\n const userCode = `\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${type} {\n ${isChannelsLast ? sampleA : sampleW}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${type} {\n ${isChannelsLast ? sampleW : sampleA}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueInput : ${type}) {\n let col = colIn * ${innerElementSize};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\n var value = valueInput;\n let outWidth = ${isChannelsLast ? 'i32(uniforms.result_shape[2])' : 'i32(uniforms.result_shape[3])'};\n ${coordResSnippet}\n ${biasSnippet(addBias)}\n ${applyActivation}\n result[getIndexFromCoords4D(coords, vec4(uniforms.result_shape))/${innerElementSize}] = value;\n }\n }`;\n return userCode;\n };\n\nexport const createConv2DTransposeMatMulProgramInfo =\n (inputs: readonly TensorView[], attributes: ConvTransposeAttributes, outputShape: readonly number[],\n dimAOuter: number, dimBOuter: number, dimInner: number, hasBias: boolean,\n sequentialAccessByThreads: boolean): ProgramInfo => {\n const isChannelsLast = attributes.format === 'NHWC';\n const inChannels = isChannelsLast ? inputs[0].dims[3] : inputs[0].dims[1];\n const batchSize = outputShape[0];\n const outWidth = isChannelsLast ? outputShape[2] : outputShape[3];\n const outHeight = isChannelsLast ? outputShape[1] : outputShape[2];\n const outChannels = isChannelsLast ? outputShape[3] : outputShape[1];\n // TODO: enable vec4 for NCHW\n const isVec4 = isChannelsLast && (inChannels % 4 === 0 && inChannels % 3) && outChannels % 4 === 0;\n\n // TODO: fine tune size\n const dispatchX = isChannelsLast ? outChannels : outWidth * outHeight;\n const dispatchY = isChannelsLast ? outWidth * outHeight : outChannels;\n const workGroupSize: [number, number, number] = [8, 8, 1];\n const elementsPerThread = dimAOuter <= 8 ? [4, 1, 1] : [4, 4, 1];\n const dispatch = [\n Math.ceil(dispatchX / workGroupSize[0] / elementsPerThread[0]),\n Math.ceil(dispatchY / workGroupSize[1] / elementsPerThread[1]),\n Math.ceil(batchSize / workGroupSize[2] / elementsPerThread[2])\n ];\n\n LOG_DEBUG('verbose', () => `[conv_backprop_mm_webgpu] dispatch = ${dispatch}`);\n\n const innerElementSize = isVec4 ? 4 : 1;\n const tileInner = Math.max(workGroupSize[0] * innerElementSize, workGroupSize[1]);\n const components = isVec4 ? 4 : 1;\n const filterDims =\n [attributes.kernelShape[isChannelsLast ? 1 : 2], attributes.kernelShape[isChannelsLast ? 2 : 3]];\n const effectiveFilterDims = [\n filterDims[0] + (attributes.dilations[0] <= 1 ? 0 : (filterDims[0] - 1) * (attributes.dilations[0] - 1)),\n filterDims[1] + (attributes.dilations[1] <= 1 ? 0 : (filterDims[1] - 1) * (attributes.dilations[1] - 1))\n ];\n const pads = [\n effectiveFilterDims[0] - 1 - Math.floor((attributes.pads[0] + attributes.pads[2]) / 2),\n effectiveFilterDims[1] - 1 - Math.floor((attributes.pads[1] + attributes.pads[3]) / 2)\n ];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.int32, data: dimAOuter}, {type: DataType.int32, data: dimBOuter},\n {type: DataType.int32, data: dimInner}, {type: DataType.int32, data: attributes.strides},\n {type: DataType.int32, data: attributes.dilations}, {type: DataType.int32, data: filterDims},\n {type: DataType.int32, data: pads}\n ];\n appendActivationUniformsData(attributes, programUniforms);\n programUniforms.push(...createTensorShapeVariables(inputs[0].dims, inputs[1].dims));\n\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'rank'];\n if (hasBias) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n inputDependencies.push('rank');\n }\n programUniforms.push(...createTensorShapeVariables(outputShape));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const x = inputVariable('x', inputs[0].dataType, inputs[0].dims.length, components);\n const w = inputVariable('w', inputs[1].dataType, inputs[1].dims.length, 1);\n const output = outputVariable('result', inputs[0].dataType, outputShape.length, components);\n const inputVariables = [x, w];\n\n let declareFunctions = '';\n if (hasBias) {\n const bias = inputVariable('bias', inputs[2].dataType, inputs[2].dims.length, components);\n inputVariables.push(bias);\n declareFunctions += `\n fn getBiasByOutputCoords(coords : vec4) -> ${bias.type.value} {\n return bias[coords.${isChannelsLast ? 'w' : 'y'}${isVec4 ? '/ 4' : ''}];\n }`;\n }\n\n const uniforms: UniformsArrayType = [\n {name: 'dim_a_outer', type: 'i32'}, {name: 'dim_b_outer', type: 'i32'}, {name: 'dim_inner', type: 'i32'},\n {name: 'strides', type: 'i32', length: 2}, {name: 'dilations', type: 'i32', length: 2},\n {name: 'filter_dims', type: 'i32', length: filterDims.length},\n {name: 'pads', type: 'i32', length: pads.length}\n ];\n appendActivationUniforms(attributes, uniforms);\n const elemType = tensorTypeToWsglStorageType(inputs[0].dataType, 1);\n if (elemType !== 'f16' && elemType !== 'f32') {\n throw new Error(`elemType ${elemType} is not supported.`);\n }\n return `\n ${utilFunctions('uniforms.result_strides')}\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVariables, output)};\n ${declareFunctions}\n ${conv2dTransposeCommonSnippet(isChannelsLast, hasBias, attributes, x.type.value, innerElementSize)}\n ${\n isVec4 ? makeMatMulPackedVec4Source(\n elementsPerThread, workGroupSize, elemType, undefined, !isChannelsLast, tileInner) :\n makeMatMulPackedSource(\n elementsPerThread, workGroupSize, elemType, undefined, !isChannelsLast, tileInner, false,\n undefined, sequentialAccessByThreads)}`;\n };\n\n return {\n name: 'Conv2DTransposeMatMul',\n shaderCache:\n {hint: `${attributes.cacheKey};${elementsPerThread};${workGroupSize};${isVec4}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: dispatch[0], y: dispatch[1], z: dispatch[2]},\n programUniforms\n }),\n getShaderSource\n };\n };\n", "/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\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 */\n\n// sampled from [@tensorflow/tfjs] tfjs-backend-webgpu/src/conv_backprop_webgpu.ts\n\nimport {DataType} from '../../../../wasm-common';\nimport {LOG_DEBUG} from '../../../log';\nimport {TensorView} from '../../../tensor-view';\nimport {ShapeUtil} from '../../../util';\nimport {ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../../types';\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from '../common';\nimport {ConvTransposeAttributes} from '../conv-transpose';\n\nconst createConvTranspose2DOpProgramShaderSource =\n (shaderHelper: ShaderHelper, inputs: readonly TensorView[], outputShape: readonly number[], hasBias: boolean,\n is1DimensionDispatch: boolean, isVec4 = false, dataType: string, uniforms: UniformsArrayType,\n isChannelsLast = false): string => {\n const rowDim = isChannelsLast ? 1 : 2;\n const colDim = isChannelsLast ? 2 : 3;\n const channelDim = isChannelsLast ? 3 : 1;\n const workPerThread = isVec4 ? 2 : 1;\n\n let declareFunctions = `\n fn setOutputAtIndex(flatIndex : u32, value : ${isVec4 ? `vec4<${dataType}>` : dataType}) {\n result[flatIndex] = ${isVec4 ? `vec4<${dataType}>` : dataType}(value);\n }`;\n if (hasBias) {\n declareFunctions += `\n fn getBiasByOutputCoords(coords : vec4) -> ${isVec4 ? `vec4<${dataType}>` : dataType} {\n return bias[coords.${isChannelsLast ? 'w' : 'y'}${isVec4 ? '/ 4' : ''}];\n }`;\n }\n const components = isVec4 ? 4 : 1;\n const w = inputVariable('W', inputs[1].dataType, inputs[1].dims.length, components);\n const dy = inputVariable('Dy', inputs[0].dataType, inputs[0].dims.length, components);\n const inputVariables = [dy, w];\n if (hasBias) {\n inputVariables.push(inputVariable('bias', inputs[2].dataType, [outputShape[channelDim]].length, components));\n }\n const output = outputVariable('result', inputs[0].dataType, outputShape.length, components);\n\n const codeSnippet4 = `{\n let batch: u32 = ${is1DimensionDispatch ? 'global_id.z' : 'workgroup_id.z'} / uniforms.result_shape[1];\n let r = ${is1DimensionDispatch ? 'global_id.z' : 'workgroup_id.z'} % uniforms.result_shape[1];\n let c = ${is1DimensionDispatch ? 'global_id.y' : 'workgroup_id.y'} * ${workPerThread};\n let d1: u32 = ${is1DimensionDispatch ? 'global_id.x' : 'workgroup_id.x'} * 4;\n\n let dyCorner = vec2(i32(r), i32(c)) - vec2(uniforms.pads);\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd: array, ${workPerThread}>;\n for (var i = 0; i < ${workPerThread}; i++) {\n dotProd[i] = vec4<${dataType}>(0.0);\n }\n for (var wR: u32 = 0; wR < uniforms.filter_dims[0]; wR = wR + 1) {\n var dyR = (${dataType}(dyCorner.x) + ${dataType}(wR)) / ${dataType}(uniforms.strides.x);\n let wRPerm = uniforms.filter_dims[0] - 1 - wR;\n if (dyR < 0.0 || dyR >= ${dataType}(uniforms.Dy_shape[1]) ||\n fract(dyR) > 0.0 || wRPerm < 0) {\n continue;\n }\n let idyR: u32 = u32(dyR);\n\n for (var wC: u32 = 0; wC < uniforms.filter_dims[1]; wC = wC + 1) {\n let dyC = (${dataType}(dyCorner.y) + ${dataType}(wC)) / ${dataType}(uniforms.strides.y);\n let dyC2 = (${dataType}(dyCorner.y) + 1.0 + ${dataType}(wC)) / ${dataType}(uniforms.strides.y);\n let wCPerm = uniforms.filter_dims[1] - 1 - wC;\n if (wCPerm < 0) {\n continue;\n }\n var bDyCVal = true;\n var bDyCVal2 = true;\n if (dyC < 0.0 || dyC >= ${dataType}(uniforms.Dy_shape[2]) ||\n fract(dyC) > 0.0) {\n bDyCVal = false;\n }\n if (dyC2 < 0.0 || dyC2 >= ${dataType}(uniforms.Dy_shape[2]) ||\n fract(dyC2) > 0.0) {\n bDyCVal2 = false;\n }\n\n let idyC: u32 = u32(dyC);\n let idyC2: u32 = u32(dyC2);\n if (bDyCVal && bDyCVal2) {\n let d2Length = uniforms.Dy_shape[3];\n for (var d2 :u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1', 'd2')};\n let wValue1 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 1', 'd2')};\n let wValue2 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 2', 'd2')};\n let wValue3 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 3', 'd2')};\n\n var xValue = ${dy.get('batch', 'idyR', 'idyC', 'd2')};\n let tmpval = vec4<${dataType}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n\n xValue = ${dy.get('batch', 'idyR', 'idyC2', 'd2')};\n\n dotProd[1] = dotProd[1] + vec4<${dataType}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n }\n } else if (bDyCVal) {\n let d2Length = uniforms.Dy_shape[${channelDim}];\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1', 'd2')};\n let wValue1 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 1', 'd2')};\n let wValue2 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 2', 'd2')};\n let wValue3 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 3', 'd2')};\n\n var xValue = ${dy.get('batch', 'idyR', 'idyC', 'd2')};\n let tmpval = vec4<${dataType}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n }\n } else if (bDyCVal2) {\n let d2Length = uniforms.Dy_shape[3];\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1', 'd2')};\n let wValue1 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 1', 'd2')};\n let wValue2 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 2', 'd2')};\n let wValue3 = ${w.get('u32(wRPerm)', 'u32(wCPerm)', 'd1 + 3', 'd2')};\n\n var xValue = ${dy.get('batch', 'idyR', 'idyC2', 'd2')};\n let tmpval = vec4<${dataType}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[1] = dotProd[1] + tmpval;\n }\n }\n }\n }\n\n for (var i: u32 = 0; i < ${workPerThread}; i = i + 1) {\n let value = dotProd[i] + ${hasBias ? 'bias[c+i]' : `vec4<${dataType}>(0.0)`};\n ${output.set('batch', 'r', 'c + i', 'd1', 'value')};\n }\n }`;\n const codeSnippet = `\n let outputIndices = ${output.offsetToIndices('global_idx')};\n let batch = ${output.indicesGet('outputIndices', 0)};\n let d1 = ${output.indicesGet('outputIndices', channelDim)};\n let r = ${output.indicesGet('outputIndices', rowDim)};\n let c = ${output.indicesGet('outputIndices', colDim)};\n let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n let groupId = d1 / uniforms.output_channels_per_group;\n let wOutChannel = d1 - groupId * uniforms.output_channels_per_group;\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = ${dataType}(0.0);\n for (var wR: u32 = 0; wR < uniforms.effective_filter_dims.x; wR = wR + 1) {\n if (wR % uniforms.dilations.x != 0) {\n continue;\n }\n let dyR = (${dataType}(dyRCorner) + ${dataType}(wR)) / ${dataType}(uniforms.strides[0]);\n let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x;\n if (dyR < 0.0 || dyR >= ${dataType}(uniforms.Dy_shape[${rowDim}]) || fract(dyR) > 0.0 ||\n wRPerm < 0) {\n continue;\n }\n let idyR: u32 = u32(dyR);\n\n for (var wC: u32 = 0; wC < uniforms.effective_filter_dims.y; wC = wC + 1) {\n if (wC % uniforms.dilations.y != 0) {\n continue;\n }\n let dyC = (${dataType}(dyCCorner) + ${dataType}(wC)) / ${dataType}(uniforms.strides.y);\n let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y;\n if (dyC < 0.0 || dyC >= ${dataType}(uniforms.Dy_shape[${colDim}]) ||\n fract(dyC) > 0.0 || wCPerm < 0) {\n continue;\n }\n let idyC: u32 = u32(dyC);\n var inputChannel = groupId * uniforms.input_channels_per_group;\n for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group; d2 = d2 + 1) {\n let xValue = ${\n isChannelsLast ? dy.get('batch', 'idyR', 'idyC', 'inputChannel') :\n dy.get('batch', 'inputChannel', 'idyR', 'idyC')};\n let wValue = ${w.get('inputChannel', 'wOutChannel', 'u32(wRPerm)', 'u32(wCPerm)')};\n dotProd = dotProd + xValue * wValue;\n inputChannel = inputChannel + 1;\n }\n }\n }\n let value = dotProd + ${hasBias ? 'bias[d1]' : `${dataType}(0.0)`};\n ${output.setByOffset('global_idx', 'value')};\n `;\n\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVariables, output)}\n ${declareFunctions}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')};\n ${isVec4 ? codeSnippet4 : codeSnippet}}`;\n };\n\nexport const createConvTranspose2DProgramInfo =\n (inputs: readonly TensorView[], attributes: ConvTransposeAttributes,\n squeezeOutputShapeFunction?: (shape: readonly number[]) => number[]): ProgramInfo => {\n const hasBias = inputs.length > 2;\n // const isChannelsLast = attributes.format === 'NHWC';\n const outputShape = attributes.outputShape;\n const outputSize = ShapeUtil.size(outputShape);\n\n // const inChannels = inputs[0].dims[isChannelsLast ? 3 : 1];\n // TODO Enable isVec4 for performance\n // Disabled due to weight matrix layout issue\n // const isVec4 = attributes.group === 1 && isChannelsLast && inChannels % 4 === 0 && outChannels % 4 === 0;\n const dispatch = [\n Math.ceil(outputSize / 64),\n 1,\n 1,\n ];\n LOG_DEBUG('verbose', () => `[conv2d_backprop_webgpu] dispatch = ${dispatch}`);\n\n const isChannelsLast = attributes.format === 'NHWC';\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'rank'];\n const strides = [attributes.strides[0], attributes.strides[1]];\n const filterDims =\n [attributes.kernelShape[isChannelsLast ? 1 : 2], attributes.kernelShape[isChannelsLast ? 2 : 3]];\n const dilations = [attributes.dilations[0], attributes.dilations[1]];\n const effectiveFilterDims = [\n filterDims[0] +\n (attributes.dilations[0] <= 1 ?\n 0 :\n (attributes.kernelShape[isChannelsLast ? 1 : 2] - 1) * (attributes.dilations[0] - 1)),\n filterDims[1] +\n (attributes.dilations[1] <= 1 ?\n 0 :\n (attributes.kernelShape[isChannelsLast ? 2 : 3] - 1) * (attributes.dilations[1] - 1))\n ];\n const pads = [\n effectiveFilterDims[0] - 1 - Math.floor((attributes.pads[0] + attributes.pads[2]) / 2),\n effectiveFilterDims[1] - 1 - Math.floor(attributes.pads[1] + attributes.pads[3]) / 2\n ];\n\n const isVec4 = false;\n const group = attributes.group;\n const wShape = inputs[1].dims;\n const inputChannelsPerGroup = wShape[0] / group;\n const outputChannelsPerGroup = wShape[1];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: strides},\n {type: DataType.uint32, data: filterDims}, {type: DataType.uint32, data: dilations},\n {type: DataType.uint32, data: effectiveFilterDims}, {type: DataType.int32, data: pads},\n {type: DataType.uint32, data: inputChannelsPerGroup}, {type: DataType.uint32, data: outputChannelsPerGroup},\n ...createTensorShapeVariables(inputs[0].dims, inputs[1].dims)\n ];\n if (hasBias) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n inputDependencies.push('rank');\n }\n programUniforms.push(...createTensorShapeVariables(outputShape));\n\n const is1DimensionDispatch = dispatch[1] === 1 && dispatch[2] === 1;\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const uniforms: UniformsArrayType = [\n {name: 'output_size', type: 'u32'}, {name: 'strides', type: 'u32', length: strides.length},\n {name: 'filter_dims', type: 'u32', length: filterDims.length},\n {name: 'dilations', type: 'u32', length: filterDims.length},\n {name: 'effective_filter_dims', type: 'u32', length: effectiveFilterDims.length},\n {name: 'pads', type: 'i32', length: pads.length}, {name: 'input_channels_per_group', type: 'u32'},\n {name: 'output_channels_per_group', type: 'u32'}\n ];\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n return `${\n createConvTranspose2DOpProgramShaderSource(\n shaderHelper, inputs, outputShape, hasBias, is1DimensionDispatch, isVec4, dataType, uniforms,\n isChannelsLast)}`;\n };\n return {\n name: 'ConvTranspose2D',\n shaderCache: {hint: `${attributes.cacheKey};`, inputDependencies},\n getRunData: () => ({\n dispatchGroup: {x: dispatch[0], y: dispatch[1], z: dispatch[2]},\n outputs: [{\n dims: squeezeOutputShapeFunction ? squeezeOutputShapeFunction(outputShape) : outputShape,\n dataType: inputs[0].dataType\n }],\n programUniforms\n }),\n getShaderSource\n };\n };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TensorView} from '../../tensor-view';\nimport {ComputeContext} from '../types';\n\nimport {createConv2DTransposeMatMulProgramInfo} from './3rd-party/conv_backprop_mm_webgpu';\nimport {createConvTranspose2DProgramInfo} from './3rd-party/conv_backprop_webgpu';\nimport {ConvAttributes} from './conv';\nimport {parseInternalActivationAttributes} from './fuse-utils';\nimport {createTransposeProgramInfo} from './transpose';\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 group: number, pads: number[], strides: readonly number[], isChannelLast: boolean, outputPadding: number[],\n outputShape: number[]) => {\n const spatialRank = inputShape.length - 2;\n const updateOutputShape = outputShape.length === 0;\n if (outputPadding.length === 0) {\n for (let i = 0; i < spatialRank; ++i) {\n outputPadding.push(0);\n }\n }\n const batchSize = inputShape[0];\n const outChannels = kernelShape[isChannelLast ? 3 : 1] * group;\n for (let i = 0, j = inputShape.length - spatialRank - (isChannelLast ? 1 : 0); i < spatialRank; ++i, ++j) {\n const inSize = inputShape[j];\n const outSize = updateOutputShape ? inSize * strides[i] : outputShape[i];\n const totalPad = computeTotalPad(inSize, strides[i], pads[i], kernelShape[j], dilations[i], outSize);\n distributePadding(totalPad, autoPad, pads, i, i + spatialRank);\n if (updateOutputShape) {\n outputShape.push(\n strides[i] * (inSize - 1) + outputPadding[i] + (kernelShape[j] - 1) * dilations[i] + 1 - pads[i] -\n pads[i + spatialRank]);\n }\n }\n outputShape.splice(0, 0, batchSize);\n outputShape.splice(isChannelLast ? 3 : 1, 0, outChannels);\n };\n\nexport interface ConvTransposeAttributes extends ConvAttributes {\n readonly outputPadding: readonly number[];\n readonly outputShape: readonly number[];\n}\n\nconst getAdjustedConvTransposeAttributes =\n (attributes: T, inputs: readonly TensorView[]): 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 || attributes.kernelShape.reduce((a, b) => a * b, 1) === 0) {\n 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 isChannelsLast = attributes.format === 'NHWC';\n kernelShape.splice(0, 0, inputs[1].dims[0]);\n kernelShape.splice(isChannelsLast ? 3 : 1, 0, inputs[1].dims[1]);\n\n const pads = attributes.pads.slice();\n const outputShape = attributes.outputShape.slice();\n const outputPadding = attributes.outputPadding.slice();\n const inputShape = inputs[0].dims;\n let dilations = attributes.dilations.slice();\n if (dilations.reduce((a, b) => a + b, 0) === 0) {\n const spatialRank = inputs[0].dims.length - 2;\n dilations = new Array(spatialRank).fill(1);\n }\n let strides = attributes.strides.slice();\n if (strides.reduce((a, b) => a + b, 0) === 0) {\n const spatialRank = inputs[0].dims.length - 2;\n strides = new Array(spatialRank).fill(1);\n }\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, dilations, attributes.autoPad, attributes.group, pads, strides, isChannelsLast,\n 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, outputPadding, outputShape, dilations, strides});\n return newAttributes;\n };\n\nexport const parseConvTransposeAttributes = (attributes: Record): ConvTransposeAttributes => {\n const activationAttributes = parseInternalActivationAttributes(attributes);\n // TODO : Make this generic enough to compute default attributes for multi-dimensional conv\n const format = attributes.format as 'NHWC' | 'NCHW';\n const autoPad =\n ['NOTSET', 'VALID', 'SAME_UPPER',\n 'SAME_LOWER'][typeof attributes.autoPad == 'undefined' ? 0 : attributes.autoPad as number];\n const dilations = attributes.dilations as [number, number];\n const group = attributes.group as number;\n const kernelShape = attributes.kernelShape as [number, number];\n const pads = attributes.pads as [number, number, number, number];\n const strides = attributes.strides as [number, number];\n const wIsConst = (attributes.wIsConst as () => boolean)();\n const outputPadding = attributes.outputPadding as [number, number, number, number];\n const outputShape = attributes.outputShape as [number, number];\n return {\n autoPad,\n format,\n dilations,\n group,\n kernelShape,\n outputPadding,\n outputShape,\n pads,\n strides,\n wIsConst,\n ...activationAttributes,\n cacheKey: `${attributes.format};${activationAttributes.activation};`\n };\n};\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: ConvTransposeAttributes): void => {\n // Refer to the below link for all input checks\n // https://github.com/onnx/onnx/blob/main/docs/Operators.md#ConvTranspose\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[0].dims.length !== 3) {\n throw new Error('currently only support 2-dimensional conv');\n }\n\n if (inputs[0].dims.length !== inputs[1].dims.length) {\n throw new Error('filter does not have same dimension as input');\n }\n\n // FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\n const dataChannel = inputs[0].dims[attributes.format === 'NHWC' ? inputs[0].dims.length - 1 : 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 const dilationsSet = attributes.dilations.reduce((a, b) => a + b, 0) > 0;\n // wrong dilations dimension\n if (dilationsSet && attributes.dilations.length !== spatialRank) {\n throw new Error(`dilations should be ${spatialRank}D`);\n }\n\n const stridesSet = attributes.strides.reduce((a, b) => a + b, 0) > 0;\n // Wrong strides dimension\n if (stridesSet && attributes.strides.length !== spatialRank) {\n throw new Error(`strides should be ${spatialRank}D`);\n }\n\n // Wrong pads dimension\n const padsSet = attributes.pads.reduce((a, b) => a + b, 0) > 0;\n if (padsSet && 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 && attributes.outputPadding.length !== 0) {\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 const kernelShapeSet = attributes.kernelShape.reduce((a, b) => a + b, 0) > 0;\n if (kernelShapeSet && attributes.kernelShape.length !== 0 &&\n 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\n// for transposing weight tensor from [C, M/group, KH, KW] to [KH, KW, M/group, C]\nconst weightTransposePerm = [2, 3, 1, 0];\n\nconst convTranspose2d =\n (context: ComputeContext, inputs: readonly TensorView[], attributes: ConvTransposeAttributes): void => {\n const adjustedAttributes = getAdjustedConvTransposeAttributes(attributes, inputs);\n const isChannelsLast = attributes.format === 'NHWC';\n const outputShape = adjustedAttributes.outputShape;\n const outChannels = outputShape[isChannelsLast ? 3 : 1];\n const inputChannels = inputs[0].dims[isChannelsLast ? 3 : 1];\n // Switch to naive method when outChannels and inputChannels are very small. It's because that in this case it's\n // not suitable for matmul version since matmul uses tile size 32x32 resulting the underlying execution unit\n // utilization rate is very low.\n if (adjustedAttributes.group !== 1 || (outChannels === 1 && inputChannels === 1)) {\n context.compute(createConvTranspose2DProgramInfo(inputs, adjustedAttributes));\n return;\n }\n const outHeight = outputShape[isChannelsLast ? 1 : 2];\n const outWidth = outputShape[isChannelsLast ? 2 : 3];\n const weightHeight = inputs[1].dims[2];\n const weightWidth = inputs[1].dims[3];\n\n const dimAOuter = isChannelsLast ? outHeight * outWidth : outChannels;\n const dimBOuter = isChannelsLast ? outChannels : outHeight * outWidth;\n const dimInner = weightHeight * weightWidth * inputChannels;\n\n const sequentialAccessByThreads = /* backend.adapterInfo.isIntel() */ true;\n\n\n // STEP.1: transpose weight\n const transposedWeight = (context.kernelCustomData.wT as TensorView | undefined) ??\n context.compute(\n createTransposeProgramInfo(inputs[1], weightTransposePerm),\n {inputs: [1], outputs: [attributes.wIsConst ? -2 : -1]})[0];\n if (attributes.wIsConst && !context.kernelCustomData.wT) {\n context.kernelCustomData.wT = transposedWeight;\n }\n\n // STEP.2: prepare reshaped inputs\n const convTransposeInputs = [inputs[0], transposedWeight];\n const hasBias = inputs.length === 3;\n if (hasBias) {\n if (!isChannelsLast && inputs[2].dims.length === 1) {\n convTransposeInputs.push(inputs[2].reshape([inputs[2].dims[0], 1, 1]));\n } else {\n convTransposeInputs.push(inputs[2]);\n }\n }\n\n // STEP.3: compute matmul\n context.compute(\n createConv2DTransposeMatMulProgramInfo(\n convTransposeInputs, adjustedAttributes, outputShape, dimAOuter, dimBOuter, dimInner, hasBias,\n sequentialAccessByThreads),\n {inputs: convTransposeInputs});\n };\n\nconst convTranspose1d = (context: ComputeContext, attributes: ConvTransposeAttributes): void => {\n // extend the input to 2D by adding H dimension\n const isChannelLast = attributes.format === 'NHWC';\n\n const inputs = [\n context.inputs[0].reshape(\n isChannelLast ?\n // [N, W, C] -> [N, H=1, W, C]\n [context.inputs[0].dims[0], 1, context.inputs[0].dims[1], context.inputs[0].dims[2]] :\n // [N, C, W] -> [N, C, H=1, W]\n [context.inputs[0].dims[0], context.inputs[0].dims[1], 1, context.inputs[0].dims[2]]),\n //[FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, kW] -> [FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, kH=1, kW]\n context.inputs[1].reshape([context.inputs[1].dims[0], context.inputs[1].dims[1], 1, context.inputs[1].dims[2]])\n ];\n if (context.inputs.length === 3) {\n inputs.push(context.inputs[2]);\n }\n let kernelShape = attributes.kernelShape;\n if (kernelShape.length === 0 || kernelShape[0] === 0) {\n kernelShape = [context.inputs[1].dims[2]];\n }\n let dilations = attributes.dilations;\n if (dilations.length === 0 || dilations[0] === 0) {\n dilations = [1];\n }\n let strides = attributes.strides;\n if (strides.length === 0 || strides[0] === 0) {\n strides = [1];\n }\n let pads = attributes.pads;\n if (pads.length === 0) {\n pads = [0, 0];\n }\n pads = [0, pads[0], 0, pads[1]];\n strides = [1].concat(strides);\n dilations = [1].concat(dilations);\n kernelShape = [1].concat(kernelShape);\n const adjustedAttributes =\n getAdjustedConvTransposeAttributes({...attributes, pads, strides, dilations, kernelShape}, inputs);\n context.compute(createConvTranspose2DProgramInfo(\n inputs, adjustedAttributes,\n outputShape => isChannelLast ? [outputShape[0], outputShape[2], outputShape[3]] :\n [outputShape[0], outputShape[1], outputShape[3]]));\n};\n\nexport const convTranspose = (context: ComputeContext, attributes: ConvTransposeAttributes): void => {\n validateInputs(context.inputs, attributes);\n if (context.inputs[0].dims.length === 3) {\n convTranspose1d(context, attributes);\n } else {\n convTranspose2d(context, context.inputs, attributes);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, getElementAt, inputVariable, outputVariable, ShaderHelper} from './common';\n\n\nexport interface CumSumAttributes extends AttributeWithCacheKey {\n readonly exclusive: boolean;\n readonly reverse: boolean;\n}\nconst createCumsumProgramInfo =\n (inputType: number, inputShape: readonly number[], axisInput: TensorView, attributes: CumSumAttributes):\n ProgramInfo => {\n const outputSize = ShapeUtil.size(inputShape); // outputShape is same as inputShape.\n const rank = inputShape.length; // input/output rank\n const input = inputVariable('input', inputType, rank);\n const output = outputVariable('output', inputType, rank);\n const axisValue = axisInput.dataType === DataType.int32 ? axisInput.getInt32Array()[0] :\n Number(axisInput.getBigInt64Array()[0]);\n const axis = ShapeUtil.normalizeAxis(axisValue, rank);\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const index = ` i32(${input.indicesGet('inputIndices', 'uniforms.axis')}) `;\n const max = getElementAt('uniforms.input_shape', 'uniforms.axis', rank);\n const lowerLimit = attributes.reverse ? index + (attributes.exclusive ? ' + 1' : '') : '0';\n const upperLimit = attributes.reverse ? max : index + (attributes.exclusive ? '' : ' + 1');\n return `\n ${\n shaderHelper.registerUniform('outputSize', 'u32')\n .registerUniform('axis', 'u32')\n .declareVariables(input, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n var inputIndices = ${output.offsetToIndices('global_idx')};\n var sum = ${output.type.value}(0);\n let first : i32 = ${lowerLimit};\n let last : i32 = ${upperLimit};\n for (var i : i32 = first; i < last; i++) {\n ${input.indicesSet('inputIndices', 'uniforms.axis', 'u32(i)')};\n sum = sum + ${input.getByIndices('inputIndices')};\n }\n ${output.setByOffset('global_idx', 'sum')};\n }`;\n };\n return {\n name: 'CumSum',\n shaderCache: {hint: attributes.cacheKey, inputDependencies: ['rank']},\n getRunData: () => ({\n outputs: [{dims: inputShape, dataType: inputType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms: [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: axis},\n ...createTensorShapeVariables(inputShape, inputShape)\n ]\n\n }),\n getShaderSource\n };\n };\n\n\nexport const cumsum = (context: ComputeContext, attributes: CumSumAttributes): void => {\n const inputShape = context.inputs[0].dims;\n const inputType = context.inputs[0].dataType;\n const axis = context.inputs[1];\n context.compute(createCumsumProgramInfo(inputType, inputShape, axis, attributes), {inputs: [0]});\n};\n\nexport const parseCumSumAttributes = (attributes: Record): CumSumAttributes => {\n const exclusive = attributes.exclusive as number === 1;\n const reverse = attributes.reverse as number === 1;\n return createAttributeWithCacheKey({exclusive, reverse});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, IndicesHelper, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface FormatAttributes {\n readonly format: 'NHWC'|'NCHW';\n}\n\nexport interface DepthToSpaceAttributes extends FormatAttributes, AttributeWithCacheKey {\n readonly blocksize: number;\n readonly mode: string;\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('DepthToSpace requires 1 input.');\n }\n if (inputs[0].dims.length !== 4) {\n throw new Error('DepthToSpace requires 4D input.');\n }\n};\n\nconst permFunctionBody = (perm: number[], rank: number, input: IndicesHelper, output: IndicesHelper): string => {\n const reverseFunc = [];\n reverseFunc.push(`fn perm(i: ${output.type.indices}) -> ${input.type.indices} {\n var a: ${input.type.indices};`);\n for (let i = 0; i < rank; ++i) {\n reverseFunc.push(input.indicesSet('a', perm[i], `i[${i}]`));\n }\n reverseFunc.push('return a;}');\n return reverseFunc.join('\\n');\n};\n\nconst createDepthToSpaceProgramInfo = (inputTensor: TensorView, attributes: DepthToSpaceAttributes): ProgramInfo => {\n let n: number, h: number, w: number, c: number;\n let shape: number[];\n let perm: number[];\n const isChannelLast = attributes.format === 'NHWC';\n const blocksize = attributes.blocksize;\n const isDCRmode = attributes.mode === 'DCR';\n if (isChannelLast) {\n [n, h, w, c] = inputTensor.dims;\n shape = isDCRmode ? [n, h, w, blocksize, blocksize, c / (blocksize ** 2)] :\n [n, h, w, c / (blocksize ** 2), blocksize, blocksize];\n perm = isDCRmode ? [0, 1, 3, 2, 4, 5] : [0, 1, 4, 2, 5, 3];\n } else {\n [n, h, w, c] = [inputTensor.dims[0], inputTensor.dims[2], inputTensor.dims[3], inputTensor.dims[1]];\n shape = isDCRmode ? [n, blocksize, blocksize, c / (blocksize ** 2), h, w] :\n [n, c / (blocksize ** 2), blocksize, blocksize, h, w];\n perm = isDCRmode ? [0, 3, 4, 1, 5, 2] : [0, 1, 4, 2, 5, 3];\n }\n const reshapedInputTensor = inputTensor.reshape(shape);\n const reshapedInputRank = reshapedInputTensor.dims.length;\n const inputDataType = inputTensor.dataType;\n\n const reshapedInput = inputVariable('a', inputDataType, reshapedInputRank);\n const permedOutput = outputVariable('output', inputDataType, reshapedInputRank);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${shaderHelper.registerUniform('output_size', 'u32').declareVariables(reshapedInput, permedOutput)}\n\n ${permFunctionBody(perm, reshapedInputRank, reshapedInput, permedOutput)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n\n let indices = ${permedOutput.offsetToIndices('global_idx')};\n let aIndices = perm(indices);\n\n ${permedOutput.setByOffset('global_idx', reshapedInput.getByIndices('aIndices'))}\n }`;\n\n return {\n name: 'DepthToSpace',\n shaderCache: {hint: `${inputTensor.dims};${attributes.blocksize};${attributes.mode}`, inputDependencies: ['rank']},\n getRunData: (inputs) => {\n const outputShape = isChannelLast ? [n, h * blocksize, w * blocksize, c / (blocksize ** 2)] :\n [n, c / (blocksize ** 2), h * blocksize, w * blocksize];\n const outputSize = ShapeUtil.size(outputShape);\n const shapeBeforePerm = reshapedInputTensor.dims;\n const shapeAfterPerm = ShapeUtil.sortBasedOnPerm(shapeBeforePerm, perm);\n return {\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms:\n [{type: DataType.uint32, data: outputSize}, ...createTensorShapeVariables(shapeBeforePerm, shapeAfterPerm)],\n };\n },\n getShaderSource,\n };\n};\n\nexport const depthToSpace = (context: ComputeContext, attributes: DepthToSpaceAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createDepthToSpaceProgramInfo(context.inputs[0], attributes));\n};\n\nexport const parseDepthToSpaceAttributes = (attributes: Record): DepthToSpaceAttributes =>\n createAttributeWithCacheKey({\n blocksize: attributes.blocksize as number,\n mode: attributes.mode as string,\n format: attributes.format as 'NHWC' | 'NCHW'\n });\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface EinsumAttributes extends AttributeWithCacheKey {\n readonly equation: string;\n}\n// The equation attribute value is a string which consists of left hand side (LHS) and optionally right hand side (RHS)\n// separated by '->'. Ex. \"ij,jk -> ik\" expresses matrix multiplication\n// \"ij->ji\" expresses matrix transpose\n// \"ii->i\" diagonal elements of a square matrix\n// LHS consists of a sequence of terms separated by commas. Each term corresponds to an input variable.\n// Each symbol corresponds to a dimension in the input variable. The symbol can be either a letter, 'a' to 'z' or 'A' to\n// 'Z' or '...' to represent arbitrary dimensions.\n\nconst symbolPattern =\n '[a-zA-Z]|\\\\.\\\\.\\\\.'; // The pattern each symbol in each term in the symbolic equation should match\nconst termPattern = '(' + symbolPattern + ')+'; // The pattern each term in the symbolic equation should match\nconst termPatternOnly = '^' + termPattern + '$'; // The patterns only matchs a term begin to end.\nconst lhsPattern = '(' + termPattern + ',)*' + termPattern; // The pattern the LHS should match\nconst lhsPatternOnly = '^' + lhsPattern + '$'; // The patterns only matchs a LHS begin to end.\n\ninterface SymbolInfo {\n count: number; // Symbol corresponding to a dimmension of an input\n inputIndices: number[]; // Number of input variables the symbol corresponds to\n dimValue: number; // Number of dimensions the symbol corresponds to\n}\n\nclass EinsumTerm {\n constructor(inputIndex = -1) {\n this.symbolToIndices = new Map();\n this.inputIndex = inputIndex;\n }\n\n // Add a symbol to the term\n addSymbol(symbol: string, index: number) {\n let value = this.symbolToIndices.get(symbol);\n if (value === undefined) {\n value = [index];\n } else {\n value.push(index);\n }\n this.symbolToIndices.set(symbol, value);\n }\n\n symbolToIndices: Map; // Map from symbol to dimensions of the input corresponding to the term\n inputIndex: number; // -1 for output and 0, 1, 2, ... for inputs\n}\n\nclass EinsumEquation {\n constructor(inputs: readonly TensorView[], public readonly equation: string) {\n this.hasEllipsis = false;\n this.symbolToInfo = new Map();\n this.lhs = new Array();\n this.outputDims = [];\n // As rhs needs to be updated allow using let instead of const for both lhs and rhs.\n // eslint-disable-next-line prefer-const\n let [lhs, rhs] = equation.includes('->') ? equation.split('->', 2) : [equation, ''];\n if (!lhs.match(RegExp(lhsPatternOnly))) {\n throw new Error('Invalid LHS term');\n }\n const inputTerms = lhs.split(',');\n inputTerms.forEach((inputTerm, index) => {\n const dims = inputs[index].dims.slice();\n if (!inputTerm.match(RegExp(termPatternOnly))) {\n throw new Error('Invalid LHS term');\n }\n const einsumTerm = this.processTerm(inputTerm, true, dims, index);\n this.lhs.push(einsumTerm);\n });\n\n // Initialize the RHS if not specified\n if (rhs === '') {\n // Construct RHS from LHS terms/symbols\n rhs += [...this.symbolToInfo.entries()]\n .filter(([sym, info]) => (info.count === 1 || sym === '...'))\n .map(([sym]) => sym)\n .join('');\n } else {\n if (!rhs.match(RegExp(termPattern))) {\n throw new Error('Invalid RHS');\n }\n }\n\n // Compute output dims\n const rhsSymbols = rhs.match(RegExp(symbolPattern, 'g'));\n rhsSymbols?.forEach((symbol) => {\n if (symbol === '...') {\n this.outputDims = this.outputDims.concat(this.ellipsisDims);\n } else {\n const info = this.symbolToInfo.get(symbol);\n if (info === undefined) {\n throw new Error('Invalid RHS symbol');\n }\n this.outputDims.push(info.dimValue);\n }\n });\n this.rhs = this.processTerm(rhs, false, this.outputDims);\n } // End of EinsumEqation constructor\n\n // Add a symbol to the equation\n addSymbol(symbol: string, dimValue: number, inputIndex: number) {\n let info = this.symbolToInfo.get(symbol);\n if (info !== undefined) {\n if (info.dimValue !== dimValue && info.count !== 1) {\n throw new Error('Dimension mismatch');\n } else {\n info.count++;\n info.inputIndices.push(inputIndex);\n }\n } else {\n info = {count: 1, dimValue, inputIndices: [inputIndex]};\n }\n this.symbolToInfo.set(symbol, info);\n }\n\n // Process one input/output term\n processTerm(term: string, isInput: boolean, dims: readonly number[], index = -1): EinsumTerm {\n const rank = dims.length;\n let ellipsis = false;\n let ellipsisDims = [];\n let nextDim = 0;\n // For output empty string is allowed because the output may be reduced to a scalar value\n if (!term.match(RegExp(termPatternOnly)) && (!isInput && term !== '')) {\n throw new Error('Invalid LHS term');\n }\n const indexSymbols = term.match(RegExp(symbolPattern, 'g'));\n const einsumTerm = new EinsumTerm(index);\n // symbol can be either a lettre, 'a' to 'z' or 'A' to 'Z', or '...'\n indexSymbols?.forEach((symbol: string, i: number) => {\n if (symbol === '...') {\n if (ellipsis) {\n throw new Error('Only one ellipsis is allowed per input term');\n }\n ellipsis = true;\n const ellipsisDimLength = rank - indexSymbols.length + 1;\n if (ellipsisDimLength < 0) {\n throw new Error('Ellipsis out of bounds');\n }\n ellipsisDims = dims.slice(nextDim, nextDim + ellipsisDimLength);\n if (this.hasEllipsis) {\n if (this.ellipsisDims.length !== ellipsisDims.length ||\n this.ellipsisDims.toString() !== ellipsisDims.toString()) {\n throw new Error('Ellipsis dimensions mismatch');\n }\n } else if (isInput) {\n this.hasEllipsis = true;\n this.ellipsisDims = ellipsisDims;\n } else {\n throw new Error('Ellipsis must be specified in the LHS');\n }\n // Add '0', '1', '2', '3', '4', etc to represent ellipsis dimensions to avoid special handling\n for (let j = 0; j < ellipsisDims.length; j++) {\n const symbol = String.fromCharCode('0'.charCodeAt(0) + j);\n einsumTerm.addSymbol(symbol, i + j);\n this.addSymbol(symbol, dims[nextDim++], index);\n }\n } else {\n einsumTerm.addSymbol(symbol, i + (this.hasEllipsis ? this.ellipsisDims.length - 1 : 0));\n this.addSymbol(symbol, dims[nextDim++], index);\n }\n });\n return einsumTerm;\n }\n\n symbolToInfo: Map; // All symbols in the equation\n hasEllipsis: boolean; // The equation has ellipsis or not\n ellipsisDims: number[]; // The dimensions of the equation ellipsis corresponds to.\n lhs: EinsumTerm[]; // Terms on the left-hand side of the equation\n rhs: EinsumTerm; // Term on the right-hand side of the equation\n outputDims: number[]; // Output dimensions of the equation\n} // End of class EinsumEquation\n\nconst appendMax = (name: string): string => name + '_max';\n\nconst createEinsumProgramInfo =\n (inputShapes: Array, dataType: number, einsumEquation: EinsumEquation,\n outputShape: readonly number[]): ProgramInfo => {\n const ranks = inputShapes.map((dims) => dims.length);\n const inputVars = ranks.map((rank, index) => inputVariable(`input${index}`, dataType, rank));\n const outputSize = ShapeUtil.size(outputShape);\n const output = outputVariable('output', dataType, outputShape.length);\n const uniformsSymbols =\n [...einsumEquation.symbolToInfo.keys()].filter((symbol) => !einsumEquation.rhs.symbolToIndices.has(symbol));\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const idxCopy: string[] = [];\n const initProd = 'var prod = 1.0;';\n const initSum = 'var sum = 0.0;';\n const updateSum = 'sum += prod;';\n const reduceOpsSetIndices: string[] = [];\n const reduceOpsLoopHeaders: string[] = [];\n const reduceOpsLoopFooters: string[] = [];\n const reduceOpCompute: string[] = [];\n const isReduceOpsWithoutLoop = einsumEquation.symbolToInfo.size === einsumEquation.rhs.symbolToIndices.size;\n einsumEquation.symbolToInfo.forEach((info, symbol) => {\n if (einsumEquation.rhs.symbolToIndices.has(symbol)) {\n const outputIndex = einsumEquation.rhs.symbolToIndices.get(symbol)?.[0];\n if (outputIndex !== undefined) {\n einsumEquation.lhs.forEach((term, i) => {\n if (info.inputIndices.includes(i)) {\n const indices = term.symbolToIndices.get(symbol);\n if (indices === undefined) {\n throw new Error('Invalid symbol error');\n }\n indices.forEach((index) => {\n idxCopy.push(`${\n inputVars[i].indicesSet(\n `input${i}Indices`, index, output.indicesGet('outputIndices', outputIndex))}`);\n });\n }\n });\n }\n } else {\n einsumEquation.lhs.forEach((term, i) => {\n if (info.inputIndices.includes(i)) {\n const indices = term.symbolToIndices.get(symbol);\n if (indices === undefined) {\n throw new Error('Invalid symbol error');\n }\n indices.forEach((index) => {\n reduceOpsSetIndices.push(`${inputVars[i].indicesSet(`input${i}Indices`, index, `${symbol}`)}`);\n });\n reduceOpCompute.push(`prod *= ${inputVars[i].getByIndices(`input${i}Indices`)};`);\n }\n });\n reduceOpsLoopHeaders.push(\n `for(var ${symbol}: u32 = 0; ${symbol} < uniforms.${appendMax(symbol)}; ${symbol}++) {`);\n reduceOpsLoopFooters.push('}');\n }\n });\n const reduceOps = isReduceOpsWithoutLoop ?\n [\n ...idxCopy,\n `let sum = ${inputVars.map((inputVar, i) => inputVar.getByIndices(`input${i}Indices`)).join(' * ')};`\n ] :\n [\n ...idxCopy,\n initSum,\n ...reduceOpsLoopHeaders,\n ...reduceOpsSetIndices,\n initProd,\n ...reduceOpCompute,\n updateSum,\n ...reduceOpsLoopFooters,\n ];\n return `\n ${\n shaderHelper\n .registerUniforms(uniformsSymbols.map((symbol) => ({name: `${appendMax(symbol)}`, type: 'u32'})))\n .registerUniform('outputSize', 'u32')\n .declareVariables(...inputVars, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n var outputIndices = ${output.offsetToIndices('global_idx')};\n ${inputVars.map((_var, i) => `var input${i}Indices: ${inputVars[i].type.indices};`).join('\\n')}\n ${reduceOps.join('\\n')};\n ${output.setByOffset('global_idx', 'sum')};\n }`;\n };\n return {\n name: 'Einsum',\n shaderCache: {hint: einsumEquation.equation, inputDependencies: inputShapes.map(() => 'rank')},\n getRunData: () => {\n // The symbols from uniformSymbols array are guaranteed to exist in einsumEquations.symbolToInfo map. The\n // filter is added to make sure that dimValue is never 0.\n const programUniformsInit: ProgramUniform[] =\n uniformsSymbols.filter((symbol) => einsumEquation.symbolToInfo.has(symbol))\n .map(\n (symbol) =>\n ({type: DataType.uint32, data: einsumEquation.symbolToInfo.get(symbol)?.dimValue || 0}));\n programUniformsInit.push({type: DataType.uint32, data: outputSize});\n const programUniforms: ProgramUniform[] =\n inputShapes.map((dims, _) => [...createTensorShapeVariables(dims)])\n .reduce((acc, inputProgramUniforms) => acc.concat(inputProgramUniforms), programUniformsInit);\n programUniforms.push(...createTensorShapeVariables(outputShape));\n return ({\n outputs: [{dims: outputShape, dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n });\n },\n getShaderSource,\n };\n };\n\nexport const einsum = (context: ComputeContext, attributes: EinsumAttributes): void => {\n const einsumEquation = new EinsumEquation(context.inputs, attributes.equation);\n const outputShape = einsumEquation.outputDims;\n const inputShapes = context.inputs.map((input, _) => input.dims);\n context.compute(createEinsumProgramInfo(inputShapes, context.inputs[0].dataType, einsumEquation, outputShape));\n};\n\nexport const parseEinsumAttributes = (attributes: Record): EinsumAttributes => {\n const equation = (attributes.equation as string).replace(/\\s+/g, '');\n return createAttributeWithCacheKey({equation});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Expand requires 2 input.');\n }\n const inputShape = inputs[0].dims;\n const shape = Array.from(inputs[1].getBigInt64Array(), Number);\n\n let shapeIndex = shape.length < inputShape.length ? 0 : shape.length - inputShape.length;\n let inputShapeIndex = inputShape.length < shape.length ? 0 : inputShape.length - shape.length;\n for (; shapeIndex < shape.length && inputShapeIndex < inputShape.length; ++shapeIndex, ++inputShapeIndex) {\n if (shape[shapeIndex] !== inputShape[inputShapeIndex] && shape[shapeIndex] !== 1 &&\n inputShape[inputShapeIndex] !== 1) {\n throw new Error('Expand requires shape to be broadcastable to input');\n }\n }\n};\n\nconst getAdjustedShape = (shape1: readonly number[], shape2: readonly number[]): number[] => {\n const diff = shape1.length - shape2.length;\n const shape: number[] = [];\n for (let i = 0; i < diff; ++i) {\n shape.push(shape1[i]);\n }\n for (let i = 0; i < shape2.length; ++i) {\n shape.push(shape2[i] === 1 ? shape1[i + diff] : shape2[i]);\n }\n return shape;\n};\n\nconst calculateOutputShape = (inputShape: readonly number[], shape: readonly number[]): number[] =>\n (inputShape.length > shape.length) ? getAdjustedShape(inputShape, shape) : getAdjustedShape(shape, inputShape);\n\n\nconst createExpandProgramInfo = (inputs: readonly TensorView[]): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const shape = Array.from(inputs[1].getBigInt64Array(), Number);\n const outputShape: number[] = calculateOutputShape(inputShape, shape);\n const dataType = inputs[0].dataType;\n const components = dataType === DataType.bool ? 4 : 1;\n const outputSize = Math.ceil(ShapeUtil.size(outputShape) / components);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const input = inputVariable('input', dataType, inputShape.length, components);\n const output = outputVariable('output', dataType, outputShape.length, components);\n let assignment: string;\n if (dataType === DataType.bool) {\n const singleAssignment = (resStr: string, x: number, typeCast = '') => `\n let outputIndices${x} = ${output.offsetToIndices(`outputOffset + ${x}u`)};\n let offset${x} = ${input.broadcastedIndicesToOffset(`outputIndices${x}`, output)};\n let index${x} = offset${x} / 4u;\n let component${x} = offset${x} % 4u;\n ${resStr}[${x}] = ${typeCast}(${input.getByOffset(`index${x}`)}[component${x}]);\n `;\n assignment = `\n let outputOffset = global_idx * ${components};\n var data = vec4(0);\n ${singleAssignment('data', 0, 'u32')}\n ${singleAssignment('data', 1, 'u32')}\n ${singleAssignment('data', 2, 'u32')}\n ${singleAssignment('data', 3, 'u32')}\n ${output.setByOffset('global_idx', 'data')}\n }`;\n } else {\n assignment = `\n let outputIndices = ${output.offsetToIndices('global_idx')};\n let inputOffset = ${input.broadcastedIndicesToOffset('outputIndices', output)};\n ${output.setByOffset('global_idx', input.getByOffset('inputOffset'))}\n }`;\n }\n return `\n ${shaderHelper.registerUniform('vec_size', 'u32').declareVariables(input, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.vec_size')}\n ${assignment}`;\n };\n\n const programUniforms: ProgramUniform[] =\n [{type: DataType.uint32, data: outputSize}, ...createTensorShapeVariables(inputShape, outputShape)];\n return {\n name: 'Expand',\n shaderCache: {hint: `${outputShape.length}`, inputDependencies: ['rank']},\n getShaderSource,\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n })\n };\n};\n\nexport const expand = (context: ComputeContext): void => {\n validateInputs(context.inputs);\n context.compute(createExpandProgramInfo(context.inputs), {inputs: [0]});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglValueType, UniformsArrayType, WORKGROUP_SIZE} from './common';\nimport * as unary from './unary-op';\n\n// GELU is defined as Y=0.5*X*(1+tanh(0.797885*X+0.035677*X*X*X)), where X may pre-add a bias.\n\nconst createFastGeluProgramInfo = (inputTensors: readonly TensorView[]): ProgramInfo => {\n const dataType = inputTensors[0].dataType;\n const outputSize = ShapeUtil.size(inputTensors[0].dims);\n const biasLength = ShapeUtil.size(inputTensors[1].dims);\n // can only use vec4 when bias length is multiple of 4\n const useVec4 = biasLength % 4 === 0;\n const getShaderSource = (shaderHelper: ShaderHelper): string => {\n const x = inputVariable('x', dataType, [1], 4);\n const bias = inputVariable('bias', dataType, [1], 4);\n const y = outputVariable('y', dataType, [1], 4);\n\n const uniforms: UniformsArrayType = [{name: 'output_vec_size', type: 'u32'}, {name: 'bias_size', type: 'u32'}];\n\n const singleElementBias = (i: 0|1|2|3) => `\n let bias${i}_offset: u32 = (global_idx * 4 + ${i}) % uniforms.bias_size;\n let bias${i} = ${bias.getByOffset(`bias${i}_offset / 4`)}[bias${i}_offset % 4];`;\n const biasGetExpression = useVec4 ?\n `\n let bias = ${bias.getByOffset('global_idx % (uniforms.bias_size / 4)')};` :\n `${singleElementBias(0)}${singleElementBias(1)}${singleElementBias(2)}${singleElementBias(3)}\n let bias = ${x.type.value}(bias0, bias1, bias2, bias3);`;\n\n return `${shaderHelper.registerUniforms(uniforms).declareVariables(x, bias, y)}\n\n ${unary.fastGeluImpl(tensorTypeToWsglValueType(dataType))}\n\n ${shaderHelper.mainStart(WORKGROUP_SIZE)}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_vec_size')}\n\n let x = ${x.getByOffset('global_idx')};\n ${biasGetExpression}\n let x_in = x + bias;\n ${y.setByOffset('global_idx', unary.fastGeluExpression('x_in'))}\n }`;\n };\n\n return {\n name: 'FastGeluWithBias',\n shaderCache: {hint: `${useVec4}`, inputDependencies: ['type', 'type']},\n getShaderSource,\n getRunData: (inputs) => ({\n outputs: [{dims: inputs[0].dims, dataType: inputs[0].dataType}],\n programUniforms:\n [{type: DataType.uint32, data: Math.ceil(outputSize / 4)}, {type: DataType.uint32, data: biasLength}],\n dispatchGroup: {x: Math.ceil(outputSize / WORKGROUP_SIZE / 4)}\n })\n };\n};\n\nexport const fastGelu = (context: ComputeContext): void => {\n if (context.inputs.length < 2 || ShapeUtil.size(context.inputs[1].dims) === 0) {\n unary.fastGelu(context);\n } else {\n context.compute(createFastGeluProgramInfo(context.inputs));\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface GatherAttributes extends AttributeWithCacheKey {\n axis: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Gather requires 2 inputs.');\n }\n};\n\nconst createGatherProgramInfo = (inputs: readonly TensorView[], attributes: GatherAttributes): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const indicesShape = inputs[1].dims;\n\n const inputRank = inputShape.length;\n const axis = ShapeUtil.normalizeAxis(attributes.axis, inputRank);\n\n const outputShape = inputShape.slice(0);\n outputShape.splice(axis, 1, ...indicesShape);\n\n const axisDimLimit = inputShape[axis];\n const components = inputs[0].dataType === DataType.bool ? 4 : 1;\n const outputSize = Math.ceil(ShapeUtil.size(outputShape) / components);\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.int32, data: axisDimLimit},\n {type: DataType.uint32, data: axis}, ...createTensorShapeVariables(inputs[0].dims, inputs[1].dims, outputShape)\n ];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const data = inputVariable('data', inputs[0].dataType, inputs[0].dims.length, components);\n const indices = inputVariable('inputIndices', inputs[1].dataType, inputs[1].dims.length);\n const output = outputVariable('output', inputs[0].dataType, outputShape.length, components);\n\n const calcDataIndices = (x: number|string): string => {\n const indicesRank = indicesShape.length;\n let calcStr = `var indicesIndices${x} = ${indices.type.indices}(0);`;\n for (let i = 0; i < indicesRank; i++) {\n calcStr += `${indicesRank > 1 ? `indicesIndices${x}[${i}]` : `indicesIndices${x}`} = ${\n outputShape.length > 1 ? `outputIndices${x}[uniforms.axis + ${i}]` : `outputIndices${x}`};`;\n }\n calcStr += `\n var idx${x} = ${indices.getByIndices(`indicesIndices${x}`)};\n if (idx${x} < 0) {\n idx${x} = idx${x} + uniforms.axisDimLimit;\n }\n var dataIndices${x} : ${data.type.indices};\n `;\n for (let i = 0, j = 0; i < inputRank; i++) {\n if (i === axis) {\n calcStr += `${inputRank > 1 ? `dataIndices${x}[${i}]` : `dataIndices${x}`} = u32(idx${x});`;\n j += indicesRank;\n } else {\n calcStr += `${inputRank > 1 ? `dataIndices${x}[${i}]` : `dataIndices${x}`} = ${\n outputShape.length > 1 ? `outputIndices${x}[${j}]` : `outputIndices${x}`};`;\n j++;\n }\n }\n return calcStr;\n };\n let assignment: string;\n if (inputs[0].dataType === DataType.bool) {\n const singleAssignment = (resStr: string, x: number, typeCast = '') => `\n let outputIndices${x} = ${output.offsetToIndices(`outputOffset + ${x}u`)};\n ${calcDataIndices(x)};\n let offset${x} = ${data.indicesToOffset(`dataIndices${x}`)};\n let index${x} = offset${x} / 4u;\n let component${x} = offset${x} % 4u;\n ${resStr}[${x}] = ${typeCast}(${data.getByOffset(`index${x}`)}[component${x}]);\n `;\n assignment = `\n let outputOffset = global_idx * ${components};\n var value = vec4(0);\n ${singleAssignment('value', 0, 'u32')}\n ${singleAssignment('value', 1, 'u32')}\n ${singleAssignment('value', 2, 'u32')}\n ${singleAssignment('value', 3, 'u32')}\n ${output.setByOffset('global_idx', 'value')}\n `;\n } else {\n assignment = `\n let outputIndices = ${output.offsetToIndices('global_idx')};\n ${calcDataIndices('')};\n let value = ${data.getByIndices('dataIndices')};\n ${output.setByOffset('global_idx', 'value')};\n `;\n }\n return `\n ${\n shaderHelper.registerUniform('outputSize', 'u32')\n .registerUniform('axisDimLimit', 'i32')\n .registerUniform('axis', 'u32')\n .declareVariables(data, indices, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n ${assignment}\n }`;\n };\n return {\n name: 'Gather',\n shaderCache: {hint: attributes.cacheKey, inputDependencies: ['rank', 'rank']},\n getRunData: () => ({\n outputs: [\n {dims: outputShape, dataType: inputs[0].dataType},\n ],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n };\n};\n\nexport const parseGatherAttributes = (attributes: Record): GatherAttributes =>\n createAttributeWithCacheKey({axis: attributes.axis as number});\n\nexport const gather = (context: ComputeContext, attributes: GatherAttributes): void => {\n const inputs = context.inputs;\n validateInputs(inputs);\n context.compute(createGatherProgramInfo(context.inputs, attributes));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface GatherElementsAttributes extends AttributeWithCacheKey {\n axis: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('GatherElements requires 2 inputs.');\n }\n\n if (inputs[0].dims.length < 1) {\n throw new Error('GatherElements requires that the data input be rank >= 1.');\n }\n\n if (inputs[0].dims.length !== inputs[1].dims.length) {\n throw new Error(`GatherElements requires that the data input and\n indices input tensors be of same rank.`);\n }\n};\n\nconst createGatherElementsProgramInfo =\n (inputs: readonly TensorView[], attributes: GatherElementsAttributes): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const inputOutputDataType = inputs[0].dataType;\n const inputRank = inputShape.length;\n\n const indicesShape = inputs[1].dims;\n const indicesDataType = inputs[1].dataType;\n const axis = ShapeUtil.normalizeAxis(attributes.axis, inputRank);\n const axisDimLimit = inputShape[axis];\n\n const outputShape = indicesShape.slice(0);\n const outputSize = ShapeUtil.size(outputShape);\n\n const input = inputVariable('input', inputOutputDataType, inputRank);\n const indices = inputVariable('indicesInput', indicesDataType, indicesShape.length);\n const output = outputVariable('output', inputOutputDataType, outputShape.length);\n\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.int32, data: axisDimLimit},\n {type: DataType.uint32, data: axis}\n ];\n programUniforms.push(...createTensorShapeVariables(inputShape, indicesShape, outputShape));\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'rank'];\n\n // int64 indices would be treated as little endian i32 with assumption they fall in i32 limits\n // That assumption is safe as it's not possible to allocate >2gb buffer for input tensor\n // Input data will be treated as u32 or two u32 for 8-byte tensors\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${\n shaderHelper.registerUniform('outputSize', 'u32')\n .registerUniform('axisDimLimit', 'i32')\n .registerUniform('axis', 'u32')\n .declareVariables(input, indices, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n\n let outputIndices = ${output.offsetToIndices('global_idx')};\n\n var idx = ${indices.getByOffset('global_idx')};\n if (idx < 0) {\n idx = idx + uniforms.axisDimLimit;\n }\n var inputIndices = ${input.type.indices}(outputIndices);\n ${input.indicesSet('inputIndices', 'uniforms.axis', 'u32(idx)')};\n let value = ${input.getByIndices('inputIndices')};\n\n ${output.setByOffset('global_idx', 'value')};\n }`;\n\n return {\n name: 'GatherElements',\n shaderCache: {inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n };\n };\n\nexport const parseGatherElementsAttributes = (attributes: Record): GatherElementsAttributes =>\n createAttributeWithCacheKey({axis: attributes.axis as number});\n\nexport const gatherElements = (context: ComputeContext, attributes: GatherElementsAttributes): void => {\n const inputs = context.inputs;\n validateInputs(inputs);\n context.compute(createGatherElementsProgramInfo(context.inputs, attributes));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {GemmUtil, ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, IndicesHelper, inputVariable, outputVariable, ShaderHelper, UniformsArrayType} from './common';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs) {\n throw new Error('Input is missing');\n }\n if (inputs.length < 2 || inputs.length > 3) {\n throw new Error('Invaid input number.');\n }\n\n // 'C' can be of dimensionality 0, 1 or 2 only\n if (inputs.length === 3 && inputs[2].dims.length > 2) {\n throw new Error('Invalid input shape of C');\n }\n\n if ((inputs[0].dataType !== inputs[1].dataType) ||\n (inputs.length === 3 && inputs[0].dataType !== inputs[2].dataType)) {\n throw new Error('Input types are mismatched');\n }\n};\n\nexport interface GemmAttributes extends AttributeWithCacheKey {\n transA: boolean;\n transB: boolean;\n alpha: number;\n beta: number;\n}\n\nconst createGemmProgramInfo = (inputs: readonly TensorView[], attributes: GemmAttributes): ProgramInfo => {\n const aShape = inputs[0].dims.slice();\n const bShape = inputs[1].dims.slice();\n const [M, N, K] = 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 const outputSize = ShapeUtil.size(outputShape);\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: M}, {type: DataType.uint32, data: N},\n {type: DataType.uint32, data: K}, {type: DataType.float, data: attributes.alpha},\n {type: DataType.float, data: attributes.beta}\n ];\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['type', 'type'];\n if (inputs.length === 3) {\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n inputDependencies.push('rank');\n }\n programUniforms.push(...createTensorShapeVariables(outputShape));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n let line = '';\n if (attributes.transA && attributes.transB) {\n line = 'value += a[k * uniforms.M + m] * b[n * uniforms.K + k];';\n } else if (attributes.transA && !attributes.transB) {\n line = 'value += a[k * uniforms.M + m] * b[k * uniforms.N + n];';\n } else if (!attributes.transA && attributes.transB) {\n line = 'value += a[m * uniforms.K + k] * b[n * uniforms.K + k];';\n } else if (!attributes.transA && !attributes.transB) {\n line = 'value += a[m * uniforms.K + k] * b[k * uniforms.N + n];';\n }\n\n const calculateAlpha = attributes.alpha === 1 ? '' : 'value *= uniforms.alpha;';\n const a = inputVariable('a', inputs[0].dataType, inputs[0].dims);\n const b = inputVariable('b', inputs[1].dataType, inputs[1].dims);\n const dataType = a.type.value;\n let c: IndicesHelper|null = null;\n const variables = [a, b];\n if (inputs.length === 3) {\n c = inputVariable('c', inputs[2].dataType, inputs[2].dims.length);\n variables.push(c);\n }\n const output = outputVariable('output', inputs[0].dataType, outputShape.length);\n variables.push(output);\n const uniforms: UniformsArrayType = [\n {name: 'output_size', type: 'u32'}, {name: 'M', type: 'u32'}, {name: 'N', type: 'u32'}, {name: 'K', type: 'u32'},\n {name: 'alpha', type: 'f32'}, {name: 'beta', type: 'f32'}\n ];\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...variables)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n\n let m = global_idx / uniforms.N;\n let n = global_idx % uniforms.N;\n\n var value = ${dataType}(0);\n for (var k: u32 = 0u; k < uniforms.K; k++) {\n ${line}\n }\n\n ${calculateAlpha}\n ${(() => {\n if (c != null) {\n return `let cOffset = ${c.broadcastedIndicesToOffset('vec2(m, n)', output)}; value += ${\n dataType}(uniforms.beta) * ${c.getByOffset('cOffset')};`;\n }\n return '';\n })()}\n output[global_idx] = value;\n }`;\n };\n\n return {\n name: 'Gemm',\n shaderCache: {hint: `${attributes.cacheKey}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n };\n};\n\nexport const parseGemmAttributes = (attributes: Record): GemmAttributes => {\n const transA = attributes.transA as boolean;\n const transB = attributes.transB as boolean;\n const alpha = attributes.alpha as number;\n const beta = attributes.beta as number;\n return {transA, transB, alpha, beta, cacheKey: `${attributes.transA};${attributes.transB};${attributes.alpha === 1}`};\n};\n\nexport const gemm = (context: ComputeContext, attributes: GemmAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createGemmProgramInfo(context.inputs, attributes));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, fillVector, getMaxComponents, inputVariable, outputVariable, ShaderHelper, sumVector, tensorTypeToWsglStorageType, UniformsArrayType} from './common';\n\nexport interface InstanceNormAttributes {\n epsilon: number;\n format: 'NHWC'|'NCHW';\n}\n\nconst createInstanceNormProgramInfo =\n (inputs: readonly TensorView[], attributes: InstanceNormAttributes): ProgramInfo => {\n const xShape = inputs[0].dims;\n const outputShape = xShape;\n const axis = 2;\n const normCount = ShapeUtil.sizeToDimension(xShape, axis);\n const normSize = ShapeUtil.sizeFromDimension(xShape, axis);\n const components = getMaxComponents(normSize);\n const normPackedSize = normSize / components;\n const inputShape = [xShape[0], xShape[1], normPackedSize];\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank', 'type', 'type'];\n const programUniforms: ProgramUniform[] =\n [{type: DataType.uint32, data: normSize}, {type: DataType.uint32, data: normPackedSize}];\n programUniforms.push(...createTensorShapeVariables(inputShape, inputShape));\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const x = inputVariable('x', inputs[0].dataType, inputShape.length, components);\n const scale = inputVariable('scale', inputs[1].dataType, inputs[1].dims);\n const bias = inputVariable('bias', inputs[2].dataType, inputs[2].dims);\n const output = outputVariable('output', inputs[0].dataType, inputShape.length, components);\n const variables = [x, scale, bias, output];\n const dataType = x.type.value;\n const f32Type = components === 1 ? 'f32' : `vec${components}`;\n const workgroupSize = 64;\n\n const uniforms: UniformsArrayType = [{name: 'normSize', type: 'u32'}, {name: 'normPackedSize', type: 'u32'}];\n return `\n var meanShared : f32;\n var squaredNormShared : f32;\n var workgroupShared : array<${f32Type}, ${workgroupSize}>;\n const workgroupSize = ${workgroupSize}u;\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...variables)}\n ${shaderHelper.mainStart(workgroupSize)}\n let norm = global_idx / workgroupSize;\n let batch = norm / uniforms.x_shape[1];\n let channel = norm % uniforms.x_shape[1];\n let localIndex = local_id.x;\n\n // initialize workgroup memory\n var initial = ${f32Type}(0);\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n initial = initial + ${f32Type}(${x.get('batch', 'channel', 'h')});\n }\n workgroupShared[localIndex] = initial;\n workgroupBarrier();\n\n // Calculate the mean of current channel data.\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (localIndex < currSize) {\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\n }\n workgroupBarrier();\n }\n if (localIndex == 0) {\n meanShared = ${sumVector('workgroupShared[0]', components)} / f32(uniforms.normSize);\n }\n workgroupBarrier();\n\n // reinitialize workgroup memory.\n initial = ${f32Type}(0);\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n let deviation = ${f32Type}(${x.get('batch', 'channel', 'h')}) - ${f32Type}(meanShared);\n initial = initial + deviation * deviation;\n }\n workgroupShared[localIndex] = initial;\n workgroupBarrier();\n\n // Calculate the sum of square of deviation of current channel data.\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (localIndex < currSize) {\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\n }\n workgroupBarrier();\n }\n if (localIndex == 0) {\n squaredNormShared = ${sumVector('workgroupShared[0]', components)};\n }\n workgroupBarrier();\n\n let invStdDev = inverseSqrt(squaredNormShared / f32(uniforms.normSize) + f32(${attributes.epsilon}));\n let channelScale = invStdDev * f32(${scale.getByOffset('channel')});\n let channelShift = f32(${bias.getByOffset('channel')}) - meanShared * channelScale;\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n let value = ${x.get('batch', 'channel', 'h')} * ${dataType}(${f32Type}(channelScale)) + ${dataType}(${\n f32Type}(channelShift));\n ${output.set('batch', 'channel', 'h', 'value')};\n }\n }`;\n };\n return {\n ...{name: 'InstanceNormalization'},\n // TODO: use epsilon as uniform. Currently epsilon as uniform fails test_instancenorm_epsilon.\n shaderCache: {hint: `${attributes.epsilon};${components}`, inputDependencies},\n getRunData: () => ({\n outputs: [\n {dims: outputShape, dataType: inputs[0].dataType},\n ],\n dispatchGroup: {x: normCount},\n programUniforms\n }),\n getShaderSource,\n };\n };\n\nconst computeMean =\n (context: ComputeContext, input: TensorView, scale: TensorView, bias: TensorView, n: number, h: number, c: number,\n epsilon: number) => {\n const components = getMaxComponents(c);\n const WG = 64;\n // we will store channel scale and channel shift in [2, components] matrix\n // or in vec2 when components == 1\n const outputType = components === 1 ? 'vec2f' : `mat2x${components}f`;\n const sumCastType = components === 1 ? 'f32' : `vec${components}f`;\n const setOutputValue = (var1: string, var2: string) => `${outputType}(${var1}, ${var2})`;\n const unitsOfWork = n * c / components;\n const wgSize = Math.ceil(h / WG);\n\n const meanInputDependencies: ProgramInputTensorInfoDependency[] = ['type'];\n const meanProgramUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: wgSize}, {type: DataType.uint32, data: h},\n {type: DataType.uint32, data: Math.floor(c / components)},\n {type: DataType.uint32, data: Math.floor(h * c / components)}\n ];\n\n const getMeanShaderSource = (shaderHelper: ShaderHelper) => {\n const inputHelper = inputVariable('input', input.dataType, input.dims, components);\n return `\n ${shaderHelper.declareVariables(inputHelper)}\n @group(0) @binding(1) var output : array<${outputType}>;\n struct Uniforms {wg_size:u32, H:u32, C:u32, image_size:u32};\n @group(0) @binding(2) var uniforms: Uniforms;\n\n ${shaderHelper.mainStart(WG)}\n let currentImageNumber = global_idx / ${WG} / uniforms.C;\n let currentChannelNumber = (global_idx / ${WG}) % uniforms.C;\n let wgOffset = local_id.x * uniforms.wg_size;\n if (wgOffset >= uniforms.H) {\n return;\n }\n let wgMax = min(wgOffset + uniforms.wg_size, uniforms.H);\n\n let offset = currentImageNumber * uniforms.image_size + currentChannelNumber;\n var sum = ${fillVector('f32', components)};\n var squaredSum = ${fillVector('f32', components)};\n for (var i: u32 = wgOffset; i < wgMax; i++) {\n let value = ${sumCastType}(input[offset + i * uniforms.C]);\n sum += value;\n squaredSum += value * value;\n }\n output[global_idx] = ${setOutputValue('sum', 'squaredSum')};\n }`;\n };\n\n const meanValues = context.compute(\n {\n name: 'InstanceNormComputeMean',\n shaderCache: {hint: `${components}`, inputDependencies: meanInputDependencies},\n getRunData: () => ({\n outputs: [\n {dims: [n, c, WG, 2], dataType: DataType.float},\n ],\n dispatchGroup: {x: n * c / components},\n programUniforms: meanProgramUniforms\n }),\n getShaderSource: getMeanShaderSource,\n },\n {inputs: [input], outputs: [-1]})[0];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: unitsOfWork}, {type: DataType.uint32, data: h},\n {type: DataType.uint32, data: Math.floor(c / components)},\n {type: DataType.uint32, data: Math.floor(WG * c / components)}\n ];\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['type', 'type', 'type'];\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const scaleHelper = inputVariable('scale', scale.dataType, scale.dims, components);\n const biasHelper = inputVariable('bias', bias.dataType, bias.dims, components);\n return `\n @group(0) @binding(0) var input : array<${outputType}>;\n @group(0) @binding(1) var scale : array<${scaleHelper.type.storage}>;\n @group(0) @binding(2) var bias : array<${biasHelper.type.storage}>;\n @group(0) @binding(3) var output : array<${outputType}>;\n struct Uniforms {units_of_work : u32, H: u32, C : u32, image_size : u32};\n @group(0) @binding(4) var uniforms: Uniforms;\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.units_of_work')}\n let currentImageNumber = global_idx / uniforms.C;\n let currentChannelNumber = global_idx % uniforms.C;\n\n let offset = currentImageNumber * uniforms.image_size;\n var sum = ${fillVector('f32', components)};\n var squaredSum = ${fillVector('f32', components)};\n for (var i: u32 = 0; i < min(${WG}, uniforms.H); i++) {\n let value = input[offset + i + currentChannelNumber * ${WG}];\n sum += value[0];\n squaredSum += value[1];\n }\n sum = sum / f32(uniforms.H);\n squaredSum = squaredSum / f32(uniforms.H);\n let invStdDev = inverseSqrt(squaredSum - sum * sum + f32(${epsilon}));\n let channelScale = invStdDev * ${sumCastType}(scale[currentChannelNumber]);\n let channelShift = ${sumCastType}(bias[currentChannelNumber]) - sum * channelScale;\n\n output[global_idx] = ${setOutputValue('channelScale', 'channelShift')};\n }`;\n };\n return context.compute(\n {\n name: 'InstanceNormComputeChannelScaleShift',\n // TODO: use epsilon as uniform. Currently epsilon as uniform fails test_instancenorm_epsilon.\n shaderCache: {hint: `${components};${epsilon}`, inputDependencies},\n getRunData: () => ({\n outputs: [\n {dims: [n, c, 2], dataType: DataType.float},\n ],\n dispatchGroup: {x: Math.ceil(unitsOfWork / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n },\n {inputs: [meanValues, scale, bias], outputs: [-1]})[0];\n };\n\nconst createInstanceNormNHWCProgramInfo =\n (context: ComputeContext, inputs: readonly TensorView[], attributes: InstanceNormAttributes) => {\n const xShape = inputs[0].dims;\n const outputShape = xShape;\n const N = xShape[0];\n const C = xShape[xShape.length - 1];\n const H = ShapeUtil.sizeFromDimension(xShape, 1) / C;\n const components = getMaxComponents(C);\n const outputSize = ShapeUtil.size(outputShape) / components;\n const programUniforms: ProgramUniform[] =\n [{type: DataType.uint32, data: H}, {type: DataType.uint32, data: Math.floor(C / components)}];\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['type', 'type'];\n // first compute mean\n const channelScaleShift = computeMean(context, inputs[0], inputs[1], inputs[2], N, H, C, attributes.epsilon);\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n const scaleType = components === 1 ? 'vec2f' : `mat2x${components}f`;\n const scaleCastType = components === 1 ? dataType : `vec${components}<${dataType}>`;\n\n const inputHelper = inputVariable('input', inputs[0].dataType, inputs[0].dims, components);\n const outputHelper = outputVariable('output', inputs[0].dataType, outputShape, components);\n\n return `\n @group(0) @binding(0) var input : array<${inputHelper.type.storage}>;\n @group(0) @binding(1) var scaleInput : array<${scaleType}>;\n @group(0) @binding(2) var output : array<${outputHelper.type.storage}>;\n struct Uniforms {H: u32, C : u32};\n @group(0) @binding(3) var uniforms: Uniforms;\n\n ${shaderHelper.mainStart()}\n let currentImageNumber = global_idx / (uniforms.C * uniforms.H);\n let currentChannelNumber = global_idx % uniforms.C;\n\n let scaleOffset = currentImageNumber * uniforms.C + currentChannelNumber;\n let scale = scaleInput[scaleOffset];\n output[global_idx] = fma(input[global_idx], ${scaleCastType}(scale[0]), ${scaleCastType}(scale[1]));\n }`;\n };\n context.compute(\n {\n name: 'InstanceNormalizationNHWC',\n shaderCache: {hint: `${components}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n },\n {inputs: [inputs[0], channelScaleShift]});\n };\n\nexport const instanceNorm = (context: ComputeContext, attributes: InstanceNormAttributes): void => {\n if (attributes.format === 'NHWC') {\n createInstanceNormNHWCProgramInfo(context, context.inputs, attributes);\n } else {\n context.compute(createInstanceNormProgramInfo(context.inputs, attributes));\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {castToF32, fillVector, getMaxComponents, inputVariable, outputVariable, ShaderHelper, sumVector, tensorTypeToWsglStorageType, UniformsArrayType,} from './common';\n\ninterface LayerNormAttributes {\n simplified: boolean;\n axis: number;\n epsilon: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length < 2) {\n throw new Error('layerNorm requires at least 2 inputs.');\n }\n};\n\nconst createLayerNormProgramInfo =\n (inputs: readonly TensorView[], attributes: LayerNormAttributes, outputCount: number): ProgramInfo => {\n const simplified = attributes.simplified;\n\n const xShape = inputs[0].dims;\n const scale = inputs[1];\n const bias = !simplified && inputs[2];\n\n const outputShape = xShape;\n const axis = ShapeUtil.normalizeAxis(attributes.axis, xShape.length);\n const normCount = ShapeUtil.sizeToDimension(xShape, axis);\n const normSize = ShapeUtil.sizeFromDimension(xShape, axis);\n\n const scaleSize = ShapeUtil.size(scale.dims);\n const biasSize = bias ? ShapeUtil.size(bias.dims) : 0;\n if (scaleSize !== normSize || (bias && biasSize !== normSize)) {\n throw new Error(`Size of X.shape()[axis:] == ${normSize}.\n Size of scale and bias (if provided) must match this.\n Got scale size of ${scaleSize} and bias size of ${biasSize}`);\n }\n\n const meanInvStdDevDim: number[] = [];\n for (let i = 0; i < xShape.length; ++i) {\n if (i < axis) {\n meanInvStdDevDim.push(xShape[i]);\n } else {\n meanInvStdDevDim.push(1);\n }\n }\n const components = getMaxComponents(normSize);\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['type', 'type'];\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: normCount}, {type: DataType.float, data: normSize},\n {type: DataType.uint32, data: Math.floor(normSize / components)},\n {type: DataType.float, data: attributes.epsilon}\n ];\n if (bias) {\n inputDependencies.push('type');\n }\n const hasMeanDataOutput = outputCount > 1;\n const hasInvStdOutput = outputCount > 2;\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n const variables = [\n inputVariable('x', inputs[0].dataType, inputs[0].dims, components),\n inputVariable('scale', scale.dataType, scale.dims, components),\n ];\n if (bias) {\n variables.push(inputVariable('bias', bias.dataType, bias.dims, components));\n }\n variables.push(outputVariable('output', inputs[0].dataType, outputShape, components));\n if (hasMeanDataOutput) {\n variables.push(outputVariable('mean_data_output', DataType.float, meanInvStdDevDim));\n }\n if (hasInvStdOutput) {\n variables.push(outputVariable('inv_std_output', DataType.float, meanInvStdDevDim));\n }\n\n const uniforms: UniformsArrayType = [\n {name: 'norm_count', type: 'u32'}, {name: 'norm_size', type: 'f32'},\n {name: 'norm_size_vectorized', type: 'u32'}, {name: 'epsilon', type: 'f32'}\n ];\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...variables)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.norm_count')}\n let offset = global_idx * uniforms.norm_size_vectorized;\n var mean_vector = ${fillVector('f32', components)};\n var mean_square_vector = ${fillVector('f32', components)};\n\n for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) {\n let value = ${castToF32(dataType, components, 'x[h + offset]')};\n mean_vector += value;\n mean_square_vector += value * value;\n }\n let mean = ${sumVector('mean_vector', components)} / uniforms.norm_size;\n let inv_std_dev = inverseSqrt(${sumVector('mean_square_vector', components)} / uniforms.norm_size ${\n simplified ? '' : '- mean * mean'} + uniforms.epsilon);\n\n for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) {\n let f32input = ${castToF32(dataType, components, 'x[j + offset]')};\n let f32scale = ${castToF32(dataType, components, 'scale[j]')};\n output[j + offset] = ${variables[0].type.value}((f32input ${simplified ? '' : '- mean'}) * inv_std_dev * f32scale\n ${bias ? `+ ${castToF32(dataType, components, 'bias[j]')}` : ''}\n );\n }\n\n ${hasMeanDataOutput ? 'mean_data_output[global_idx] = mean' : ''};\n ${hasInvStdOutput ? 'inv_std_output[global_idx] = inv_std_dev' : ''};\n }`;\n };\n const outputs = [{dims: outputShape, dataType: inputs[0].dataType}];\n if (hasMeanDataOutput) {\n outputs.push({dims: meanInvStdDevDim, dataType: DataType.float});\n }\n if (hasInvStdOutput) {\n outputs.push({dims: meanInvStdDevDim, dataType: DataType.float});\n }\n\n return {\n name: 'LayerNormalization',\n shaderCache: {hint: `${components};${outputCount};${simplified}`, inputDependencies},\n getRunData: () =>\n ({outputs, dispatchGroup: {x: Math.ceil(normCount / 64 /* workgroup size */)}, programUniforms}),\n getShaderSource,\n };\n };\n\nexport const layerNorm = (context: ComputeContext, attributes: LayerNormAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createLayerNormProgramInfo(context.inputs, attributes, context.outputCount));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType, getTensorElementSize} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, getMaxComponents, inputVariable, outputVariable, ShaderHelper, tensorTypeToWsglStorageType, UniformsArrayType} from './common';\n\n// TODO support quantization bits not equal to 4\nexport interface MatMulNBitsAttributes extends AttributeWithCacheKey {\n k: number;\n n: number;\n accuracyLevel: number;\n bits: number;\n blockSize: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: MatMulNBitsAttributes): void => {\n if (inputs.length < 3 || inputs.length > 4) {\n throw new Error('MatMulNBits requires 3 or 4 inputs');\n }\n const a = inputs[0];\n const aRank = a.dims.length;\n if (a.dims[aRank - 1] !== attributes.k) {\n throw new Error('The last dim of input shape does not match the k value');\n }\n const nBlocksPerCol = Math.floor((attributes.k + attributes.blockSize - 1) / attributes.blockSize);\n const blobSize = attributes.blockSize / 8 * attributes.bits;\n const b = inputs[1];\n if (!ShapeUtil.areEqual(b.dims, [attributes.n, nBlocksPerCol, blobSize])) {\n throw new Error('The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize');\n }\n const scales = inputs[2];\n const scalesShape = scales.dims;\n if (ShapeUtil.size(scalesShape) !== attributes.n * nBlocksPerCol) {\n throw new Error('scales input size error.');\n }\n if (inputs.length === 4) {\n const zeroPoints = inputs[3];\n const zeroPointsShape = zeroPoints.dims;\n const expectedZeroPointsSize =\n attributes.bits > 4 ? (attributes.n * nBlocksPerCol) : attributes.n * Math.floor((nBlocksPerCol + 1) / 2);\n if (ShapeUtil.size(zeroPointsShape) !== expectedZeroPointsSize) {\n throw new Error('zeroPoints input size error.');\n }\n }\n};\n\nexport const createMatMulNBitsProgramInfo =\n (inputs: readonly TensorView[], attributes: MatMulNBitsAttributes,\n maxComputeWorkgroupSizes: [number, number, number], maxComputeWorkgroupStorageSize: number): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const aRank = inputShape.length;\n const nBlocksPerCol = Math.floor((attributes.k + attributes.blockSize - 1) / attributes.blockSize);\n const dimAOuter = inputShape[aRank - 2];\n const dimInner = attributes.k;\n const dimBOuter = attributes.n;\n const batchDims = inputShape.slice(0, aRank - 2);\n const batchSize = ShapeUtil.size(batchDims);\n const blobSize = attributes.blockSize / 8 * attributes.bits;\n const blobSizeInWords = blobSize / 4;\n const dataType = inputs[0].dataType;\n const outputNumber = getMaxComponents(dimAOuter);\n const aComponents = getMaxComponents(attributes.k);\n const bComponents = getMaxComponents(blobSizeInWords);\n const elementSize = getTensorElementSize(dataType)!;\n const workgroupOutputSize = dimAOuter * nBlocksPerCol * elementSize;\n const maxNumberOfComponents = Math.floor(maxComputeWorkgroupStorageSize / workgroupOutputSize);\n const useBlockwiseMatMulNBits = nBlocksPerCol <= maxComputeWorkgroupSizes[0] && maxNumberOfComponents > 0;\n const components = (!useBlockwiseMatMulNBits || maxNumberOfComponents >= 4) ? getMaxComponents(dimBOuter) :\n ((maxNumberOfComponents >= 2) && getMaxComponents(dimBOuter) >= 2) ? 2 :\n 1;\n const outputShape = batchDims.concat([dimAOuter, dimBOuter]);\n const outputSize = ShapeUtil.size(outputShape) / components / outputNumber;\n\n const programUniforms: ProgramUniform[] = useBlockwiseMatMulNBits ?\n [] :\n [{type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: attributes.blockSize}];\n const inputShapeTemp = [batchSize, dimAOuter, dimInner / aComponents];\n const bShape = ShapeUtil.convertShape(inputs[1].dims).slice();\n bShape.splice(-1, 1, blobSizeInWords / bComponents);\n programUniforms.push(...createTensorShapeVariables(inputShapeTemp));\n programUniforms.push(...createTensorShapeVariables(bShape));\n programUniforms.push(...createTensorShapeVariables(inputs[2].dims));\n if (inputs.length === 4) {\n programUniforms.push(...createTensorShapeVariables(ShapeUtil.convertShape(inputs[3].dims)));\n }\n const outputShapeTemp = [batchSize, dimAOuter, dimBOuter / components];\n programUniforms.push(...createTensorShapeVariables(outputShapeTemp));\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const inputRank = inputShapeTemp.length;\n const a = inputVariable('a', inputs[0].dataType, inputRank, aComponents);\n const b = inputVariable('b', DataType.uint32, bShape.length, bComponents);\n const scales = inputVariable('scales', inputs[2].dataType, inputs[2].dims.length);\n const inputVariables = [a, b, scales];\n const zeroPoints =\n inputs.length === 4 ? inputVariable('zero_points', DataType.uint32, inputs[3].dims.length) : undefined;\n if (zeroPoints) {\n inputVariables.push(zeroPoints);\n }\n const outputRank = outputShapeTemp.length;\n const output = outputVariable('output', inputs[0].dataType, outputRank, components);\n const uniforms: UniformsArrayType = [{name: 'output_size', type: 'u32'}, {name: 'block_size', type: 'u32'}];\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n\n const qDqDataType = (() => {\n switch (aComponents) {\n case 1:\n return `array<${dataType}, 8>`;\n case 2:\n return `mat4x2<${dataType}>`;\n case 4:\n return `mat2x4<${dataType}>`;\n default:\n throw new Error(`${aComponents}-component is not supported.`);\n }\n })();\n\n const processOneBlock = `\n for (var word: u32 = 0; word < ${blobSizeInWords}; word += ${bComponents}) {\n ${b.indicesSet('b_indices', '2', 'word')};\n let b_data = ${b.getByIndices('b_indices')};\n for (var i: u32 = 0; i < ${bComponents}; i++) {\n let b_value: u32 = ${bComponents === 1 ? 'b_data' : 'b_data[word + i]'};\n let b_mask: u32 = 0x0F0F0F0Fu;\n let b_value_lower: vec4 = unpack4xU8(b_value & b_mask);\n let b_value_upper: vec4 = unpack4xU8((b_value >> 4) & b_mask);\n let b_quantized_values = ${qDqDataType}(${\n Array.from({length: 4}, (_, i) => `${dataType}(b_value_lower[${i}]), ${dataType}(b_value_upper[${i}])`)\n .join(', ')});\n let b_dequantized_values = ${(() => {\n if (aComponents === 1) {\n return `${qDqDataType}(${\n Array.from({length: 8}, (_, i) => `(b_quantized_values[${i}] - zero_point) * scale`).join(', ')});`;\n } else {\n return `(b_quantized_values - ${qDqDataType}(${Array(8).fill('zero_point').join(',')})) * scale;`;\n }\n })()};\n // Number of B elements per 32-bit word is 32/bits = 32/4 = 8\n for (var m: u32 = 0; m < ${useBlockwiseMatMulNBits ? dimAOuter : outputNumber}u; m++) {\n ${a.indicesSet('a_indices', inputRank - 2, useBlockwiseMatMulNBits ? 'm' : `row * ${outputNumber} + m`)};\n ${a.indicesSet('a_indices', inputRank - 1, 'word_offset')};\n var input_offset = ${a.indicesToOffset('a_indices')};\n var a_data: ${qDqDataType};\n for (var j: u32 = 0; j < ${8 / aComponents}; j++) {\n a_data[j] = ${a.getByOffset('input_offset')};\n input_offset++;\n }\n ${useBlockwiseMatMulNBits ? 'workgroup_shared[workgroup_shared_offset + m]' : 'output_values[m]'}${\n components > 1 ? '[c]' : ''} += ${\n Array\n .from(\n {length: 8 / aComponents},\n (_, i) => `${\n aComponents === 1 ? `a_data[${i}] * b_dequantized_values[${i}]` :\n `dot(a_data[${i}], b_dequantized_values[${i}])`}`)\n .join(' + ')};\n }\n word_offset += ${8 / aComponents};\n }\n }`;\n const updateZeroPointIndex = zeroPoints ? `\n zero_point_offset += 4;\n if (zero_point_offset == 32) {\n zero_point_offset = 0;\n zero_point_index++;\n zero_point_word = ${zeroPoints.getByOffset('zero_point_index')};\n }` :\n '';\n\n return useBlockwiseMatMulNBits ? `\n var workgroup_shared: array<${output.type.value}, ${dimAOuter * nBlocksPerCol}>;\n ${shaderHelper.declareVariables(...inputVariables, output)}\n ${shaderHelper.mainStart([\n nBlocksPerCol, 1, 1\n ])}\n var a_indices: ${a.type.indices};\n var block = local_id.x;\n var col = workgroup_id.y;\n var batch = workgroup_id.z;\n ${a.indicesSet('a_indices', '0', 'batch')};\n // Two zero points are packed into one byte when uniforms.bits is 4.\n for (var c: u32 = 0; c < ${components}; c++) {\n let col_times_components_plus_c = col * ${components} + c;\n ${\n zeroPoints ? `\n var zero_point_bytes_per_col: u32 = (${nBlocksPerCol} + 1) / 2;\n var zero_point_byte_count: u32 = col_times_components_plus_c * zero_point_bytes_per_col + (block >> 0x1u);\n var zero_point_word_index: u32 = zero_point_byte_count >> 0x2u;\n var zero_point_byte_offset: u32 = zero_point_byte_count & 0x3u;\n var zero_point_nibble_offset: u32 = block & 0x1u;\n var zero_point_bits_offset: u32 = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2);\n var zero_point_word: u32 = ${zeroPoints.getByOffset('zero_point_word_index')} >> zero_point_bits_offset;` :\n ''}\n var b_indices: ${b.type.indices};\n ${b.indicesSet('b_indices', '0', 'col_times_components_plus_c')};\n // The scale and zero points are computed per block.\n var scales_index = col_times_components_plus_c * ${nBlocksPerCol} + block;\n let scale = ${scales.getByOffset('scales_index')};\n // The default zero point is 8 for unsigned 4-bit quantization.\n let zero_point = ${dataType}(${zeroPoints ? '(zero_point_word) & 0xFu' : 8.0});\n ${b.indicesSet('b_indices', '1', 'block')};\n var word_offset: u32 = block * ${attributes.blockSize / aComponents};\n var workgroup_shared_offset: u32 = block * ${dimAOuter};\n ${processOneBlock}\n }\n workgroupBarrier();\n if (local_id.x == 0u) {\n var output_indices: ${output.type.indices};\n ${output.indicesSet('output_indices', '0', 'batch')};\n ${output.indicesSet('output_indices', outputRank - 1, 'col')};\n ${output.indicesSet('output_indices', outputRank - 2, '0')};\n var output_offset = ${output.indicesToOffset('output_indices')};\n for (var m: u32 = 0u; m < ${dimAOuter}u; m++) {\n var output_value: ${output.type.value} = ${output.type.value}(0);\n var workgroup_shared_offset: u32 = m;\n for (var b: u32 = 0u; b < ${nBlocksPerCol}u; b++) {\n output_value += workgroup_shared[workgroup_shared_offset];\n workgroup_shared_offset += ${dimAOuter};\n }\n ${output.setByOffset('output_offset', 'output_value')};\n output_offset += ${dimBOuter / components};\n }\n }\n }` :\n `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(...inputVariables, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n var output_values: array<${output.type.value}, ${outputNumber}>;\n var output_indices = ${output.offsetToIndices('global_idx')};\n var col = ${output.indicesGet('output_indices', outputRank - 1)};\n var row = ${output.indicesGet('output_indices', outputRank - 2)};\n var a_indices: ${a.type.indices} = output_indices;\n // Two zero points are packed into one byte because uniforms.bits <= 4.\n // zero_point_offset is either 0 or 4. It is bit offset within one byte.\n // TODO support zero_point_offset for bits > 4\n ${\n zeroPoints ? `\n var zero_point_abs_offset = col * ${components} * ((${nBlocksPerCol} + 1) / 2);\n var zero_point_index: u32 = zero_point_abs_offset / 4;\n var zero_point_word: u32 = ${zeroPoints.getByOffset('zero_point_index')};\n var zero_point_offset: u32 = (zero_point_abs_offset % 4) * 8;` :\n ''}\n var scale_index = col * ${nBlocksPerCol * components};\n var b_indices: ${b.type.indices};\n for (var c: u32 = 0; c < ${components}; c++) {\n ${b.indicesSet('b_indices', '0', `col * ${components} + c`)};\n var block_offset: u32 = 0;\n for (var block: u32 = 0; block < ${nBlocksPerCol}; block++) {\n // The scale and zero points are computed per block.\n let scale = ${scales.getByOffset('scale_index')};\n // The default zero point is 8 for unsigned 4-bit quantization.\n let zero_point = ${dataType}(${zeroPoints ? 'extractBits(zero_point_word, zero_point_offset, 4)' : 8.0});\n ${b.indicesSet('b_indices', '1', 'block')};\n var word_offset: u32 = block_offset;\n ${processOneBlock}\n scale_index++;\n ${updateZeroPointIndex}\n block_offset += uniforms.block_size / ${aComponents};\n }\n // Drop the trailing 4 bits if the zero_poit_offset is not a byte boundary to align with the next byte.\n ${\n zeroPoints ? `if (zero_point_offset % 8 > 0) {\n ${updateZeroPointIndex}\n }` :\n ''}\n }\n for (var k: u32 = 0u; k < ${outputNumber}u; k++) {\n ${output.indicesSet('output_indices', outputRank - 2, `${outputNumber} * row + k`)};\n ${output.setByIndices('output_indices', 'output_values[k]')}\n }\n }`;\n };\n return {\n name: useBlockwiseMatMulNBits ? 'BlockwiseMatMulNBits' : 'MatMulNBits',\n shaderCache: {\n hint: `${attributes.cacheKey};${dimAOuter};${dataType};${inputs.length}`,\n inputDependencies: Array(inputs.length).fill('rank')\n },\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType}],\n name: useBlockwiseMatMulNBits ? 'BlockwiseMatMulNBits' : 'MatMulNBits',\n dispatchGroup: useBlockwiseMatMulNBits ? {x: 1, y: Math.ceil(dimBOuter / components), z: batchSize} :\n {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource\n };\n };\n\nexport const matMulNBits = (context: ComputeContext, attributes: MatMulNBitsAttributes): void => {\n validateInputs(context.inputs, attributes);\n const maxComputeWorkgroupSizes: [number, number, number] = context.getMaxComputeWorkgroupSizes();\n const maxComputeWorkgroupStorageSize = context.getMaxComputeWorkgroupStoragesize();\n context.compute(createMatMulNBitsProgramInfo(\n context.inputs, attributes, maxComputeWorkgroupSizes, maxComputeWorkgroupStorageSize));\n};\n\nexport const parseMatMulNBitsAttributes = (attributes: Record): MatMulNBitsAttributes =>\n createAttributeWithCacheKey(attributes as Omit);\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, GpuDataType, ProgramUniform} from '../types';\n\nimport {applyAttention, AttentionAttrs, AttentionMaskType, AttentionParameters, AttentionQkvFormat} from './attention';\nimport {inputVariable, outputVariable, ShaderHelper, UniformsArrayType} from './common';\nimport {createTransposeProgramInfo, TransposeAttributes} from './transpose';\n\nconst getInput = (inputs: readonly TensorView[], i: number) =>\n (inputs.length > i) && (inputs[i].dims.length > 0) && (ShapeUtil.size(inputs[i].dims)) > 0 ? inputs[i] : undefined;\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: AttentionAttrs): AttentionParameters => {\n const query = inputs[0];\n const key = getInput(inputs, 1);\n const value = getInput(inputs, 2);\n const bias = getInput(inputs, 3);\n const keyPaddingMask = getInput(inputs, 4);\n const relativePositionBias = getInput(inputs, 5);\n const pastKey = getInput(inputs, 6);\n const pastValue = getInput(inputs, 7);\n\n // Abbreviation and Meanings:\n // B: batch_size\n // S: sequence_length (input sequence length of query)\n // P: past_sequence_length (past sequence length of key or value)\n // L: kv_sequence_length (input sequence length of key or value)\n // M: max_sequence_length\n // T: total_sequence_length = past_sequence_length + kv_sequence_length\n // N: num_heads\n // H: head size for Q and K, aka q_head_size or k_head_size or qk_head_size\n // H_v: v_head_size\n // D_i: input hidden size\n // D: hidden size for Q and K (D = N * H), aka q_hidden_size or k_hidden_size or qk_hidden_size\n // D_v: v_hidden_size = num_heads * v_head_size\n\n // key_padding_mask (K/V) : (B) or (2*B + 1) or (B, L) or None\n // relative_position_bias : (B, 1, S, L)\n // past_key : (B, N, S*, H)\n // past_value : (B, N, S*, H)\n // When no packing for q/k/v:\n // query (Q) : (B, S, D)\n // key (K) : (B, L, D) or (B, N, S*, H)\n // value (V) : (B, L, D_v) or (B, N, S*, H)\n // bias (Q/K/V) : (D + D + D_v)\n // When packed kv is used:\n // query (Q) : (B, S, D)\n // key (K) : (B, L, N, 2, H)\n // value (V) : None\n // bias (Q/K/V) : None\n // When packed qkv is used:\n // query (Q) : (B, L, N, 3, H) or (B, S, 3*D)\n // key (K) : None\n // value (V) : None\n // bias (Q/K/V) : None or (D + D + D_v)\n\n if (query.dims.length !== 3 && query.dims.length !== 5) {\n throw new Error('Input query is expected to have 3 or 5 dimensions');\n }\n\n const dmmhaPacking = false;\n const batchSize = query.dims[0];\n const sequenceLength = query.dims[1];\n const hiddenSize = query.dims.length === 3 ? (dmmhaPacking ? query.dims[2] / 3 : query.dims[2]) :\n attributes.numHeads * query.dims[4];\n let kvSequenceLength = sequenceLength;\n\n let pastSequenceLength = 0;\n let maxSequenceLength = 0;\n const headSize = Math.floor(hiddenSize / attributes.numHeads);\n if (pastKey && pastValue) {\n if (pastKey.dims.length !== 4) {\n throw new Error('Input \"past_key\" is expected to have 4 dimensions');\n }\n if (pastKey.dims[0] !== batchSize || pastKey.dims[1] !== attributes.numHeads || pastKey.dims[3] !== headSize) {\n throw new Error('Input \"past_key\" shape (batch_size, num_heads, past_sequence_length, head_size)');\n }\n if (pastValue.dims[0] !== batchSize || pastValue.dims[1] !== attributes.numHeads ||\n pastValue.dims[3] !== headSize) {\n throw new Error('Input \"past_value\" shape (batch_size, num_heads, past_sequence_length, head_size)');\n }\n if (pastKey.dims[2] !== pastValue.dims[2]) {\n throw new Error('Input \"past_key\" and \"past_value\" shall have same dim 2 (past_sequence_length)');\n }\n if (pastValue.dims.length !== 4) {\n throw new Error('Input \"past_value\" is expected to have 4 dimensions');\n }\n pastSequenceLength = pastKey.dims[2];\n maxSequenceLength = pastKey.dims[2];\n } else if (pastKey || pastValue) {\n throw new Error('Input \"past_key\" and \"past_value\" shall be both present or both absent');\n }\n\n let qkvFormat: AttentionQkvFormat;\n if (key) {\n if (query.dims.length !== 3) {\n throw new Error('Input \"query\" is expected to have 3 dimensions when key is given');\n }\n if (key.dims.length < 3 || key.dims.length > 5) {\n throw new Error('Input \"key\" is expected to have 3, 4, or 5 dimensions');\n }\n if (query.dims[0] !== key.dims[0]) {\n throw new Error('Input \"query\" and \"key\" shall have same dim 0 (batch size)');\n }\n\n if (key.dims.length === 3) {\n if (key.dims[2] !== query.dims[2]) {\n throw new Error('Input \"query\" and \"key\" shall have same dim 2 (hidden_size)');\n }\n qkvFormat = AttentionQkvFormat.qkvBSNH;\n kvSequenceLength = key.dims[1];\n } else if (key.dims.length === 5) {\n if (key.dims[2] !== attributes.numHeads || key.dims[3] !== 2 || key.dims[4] !== headSize) {\n throw new Error('Expect \"key\" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');\n }\n if (value) {\n throw new Error('Expect \"value\" be none when \"key\" has packed kv format.');\n }\n qkvFormat = AttentionQkvFormat.qKvBSNHxBSN2H;\n kvSequenceLength = key.dims[1];\n } else { // key_dims.size() == 4 (cross-attention with past_key)\n if (key.dims[1] !== attributes.numHeads || key.dims[3] !== headSize) {\n throw new Error('Expect \"key\" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');\n }\n\n qkvFormat = AttentionQkvFormat.unknown;\n kvSequenceLength = key.dims[2];\n }\n } else { // packed QKV\n if (query.dims.length !== 3 && query.dims.length !== 5) {\n throw new Error('Input \"query\" is expected to have 3 or 5 dimensions when key is empty');\n }\n if (query.dims.length === 5 && (query.dims[2] !== attributes.numHeads || query.dims[3] !== 3)) {\n throw new Error('Expect \"query\" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');\n }\n\n qkvFormat = AttentionQkvFormat.qkvBSN3H;\n }\n\n if (bias) {\n if (bias.dims.length !== 1) {\n throw new Error('Input \"bias\" is expected to have 1 dimension');\n }\n\n if (value) {\n if (query.dims.length === 5 && query.dims[3] === 2) {\n throw new Error('bias is not allowed for packed kv.');\n }\n }\n }\n\n let maskType: AttentionMaskType = AttentionMaskType.none;\n if (keyPaddingMask) {\n maskType = AttentionMaskType.maskUnknown;\n const maskDims = keyPaddingMask.dims;\n if (maskDims.length === 1) {\n if (maskDims[0] === batchSize) {\n maskType = AttentionMaskType.mask1dKeySeqLen;\n } else if (maskDims[0] === 3 * batchSize + 2) {\n maskType = AttentionMaskType.mask1DKeySeqLenStart;\n }\n } else if (maskDims.length === 2 && maskDims[0] === batchSize && maskDims[1] === kvSequenceLength) {\n maskType = AttentionMaskType.mask2dKeyPadding;\n }\n if (maskType === AttentionMaskType.maskUnknown) {\n throw new Error('Input \"key_padding_mask\" shape shall be (batch_size) or (batch_size, kv_sequence_length)');\n }\n throw new Error('Mask not supported');\n }\n\n let passPastInKv = false;\n let vHiddenSize = hiddenSize;\n if (value) {\n if (value.dims.length !== 3 && value.dims.length !== 4) {\n throw new Error('Input \"value\" is expected to have 3 or 4 dimensions');\n }\n\n if (query.dims[0] !== value.dims[0]) {\n throw new Error('Input \"query\" and \"value\" shall have same dim 0 (batch_size)');\n }\n\n if (value.dims.length === 3) {\n if (kvSequenceLength !== value.dims[1]) {\n throw new Error('Input \"key\" and \"value\" shall have the same dim 1 (kv_sequence_length)');\n }\n vHiddenSize = value.dims[2];\n } else {\n if (kvSequenceLength !== value.dims[2]) {\n throw new Error('Input \"past_key\" and \"past_value\" shall have the same dim 2 (kv_sequence_length)');\n }\n vHiddenSize = value.dims[1] * value.dims[3];\n passPastInKv = true;\n }\n }\n\n const totalSequenceLength = pastSequenceLength + kvSequenceLength;\n const broadcastResPosBias = false;\n\n if (keyPaddingMask) {\n throw new Error('Key padding mask is not supported');\n }\n\n if (relativePositionBias) {\n if (relativePositionBias.dims.length !== 4) {\n throw new Error('Input \"relative_position_bias\" is expected to have 4 dimensions');\n }\n if ((relativePositionBias.dims[0] !== batchSize && relativePositionBias.dims[0] !== 1) ||\n relativePositionBias.dims[1] !== attributes.numHeads || relativePositionBias.dims[2] !== sequenceLength ||\n relativePositionBias.dims[3] !== totalSequenceLength) {\n throw new Error('Input \"relative_position_bias\" shape (batch_size, 1, sequence_length, kv_sequence_length)');\n }\n }\n\n return {\n batchSize,\n sequenceLength,\n pastSequenceLength,\n kvSequenceLength,\n totalSequenceLength,\n maxSequenceLength,\n inputHiddenSize: 0,\n hiddenSize,\n vHiddenSize,\n headSize,\n vHeadSize: Math.floor(vHiddenSize / attributes.numHeads),\n numHeads: attributes.numHeads,\n isUnidirectional: false,\n pastPresentShareBuffer: false,\n maskFilterValue: attributes.maskFilterValue,\n maskType,\n scale: attributes.scale,\n broadcastResPosBias,\n passPastInKv,\n qkvFormat,\n };\n};\n\nexport const parseMultiHeadAttentionAttributes = (attributes: AttentionAttrs): AttentionAttrs =>\n createAttributeWithCacheKey({...attributes});\n\nconst weightTransposeAttribute: TransposeAttributes = createAttributeWithCacheKey({perm: [0, 2, 1, 3]});\n\nconst addBiasTranspose =\n (context: ComputeContext, qkv: TensorView, bias: TensorView, batchSize: number, sequenceLength: number,\n hiddenSize: number, biasOffset: number) => {\n const outputShape = [batchSize, sequenceLength, hiddenSize];\n const outputSize = ShapeUtil.size(outputShape);\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: biasOffset},\n {type: DataType.uint32, data: hiddenSize}\n ];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const output = outputVariable('qkv_with_bias', qkv.dataType, outputShape);\n const qkvInput = inputVariable('qkv', qkv.dataType, outputShape);\n const biasInput = inputVariable('bias', bias.dataType, outputShape);\n\n const uniforms: UniformsArrayType = [\n {name: 'output_size', type: 'u32'}, {name: 'bias_offset', type: 'u32'}, {name: 'hidden_size', type: 'u32'}\n ];\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(qkvInput, biasInput, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset;\n\n qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx];\n }`;\n };\n\n return context.compute(\n {\n name: 'MultiHeadAttentionAddBias',\n shaderCache: {inputDependencies: ['type', 'type']},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: qkv.dataType, gpuDataType: GpuDataType.default}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n },\n {inputs: [qkv, bias], outputs: [-1]})[0];\n };\n\nconst maybeTransposeToBNSHAndAddBias =\n (context: ComputeContext, batchSize: number, numHeads: number, sequenceLength: number, headSize: number,\n input: TensorView, bias?: TensorView, biasOffset?: number) => {\n // const newDims = [];\n\n let reshapedInput = input;\n if (!bias) {\n if (input.dims.length === 3) {\n reshapedInput = input.reshape([batchSize, sequenceLength, numHeads, headSize]);\n }\n return context.compute(\n createTransposeProgramInfo(reshapedInput, weightTransposeAttribute.perm),\n {inputs: [reshapedInput], outputs: [-1]})[0];\n } else {\n if (sequenceLength === 1) {\n throw new Error('AddBiasReshape is not implemented. Please export your model with packed QKV or KV');\n } else {\n reshapedInput =\n addBiasTranspose(context, input, bias, batchSize, sequenceLength, numHeads * headSize, biasOffset!);\n reshapedInput = reshapedInput.reshape([batchSize, sequenceLength, numHeads, headSize]);\n return context.compute(\n createTransposeProgramInfo(reshapedInput, weightTransposeAttribute.perm),\n {inputs: [reshapedInput], outputs: [-1]})[0];\n }\n }\n };\n\nexport const multiHeadAttention = (context: ComputeContext, attributes: AttentionAttrs): void => {\n const params = validateInputs(context.inputs, attributes);\n const query = context.inputs[0];\n const key = getInput(context.inputs, 1);\n const value = getInput(context.inputs, 2);\n const bias = getInput(context.inputs, 3);\n const keyPaddingMask = getInput(context.inputs, 4);\n const relativePositionBias = getInput(context.inputs, 5);\n const pastKey = getInput(context.inputs, 6);\n const pastValue = getInput(context.inputs, 7);\n if (query.dims.length === 5) {\n throw new Error('Packed QKV is not implemented');\n }\n\n if (key?.dims.length === 5) {\n throw new Error('Packed KV is not implemented');\n }\n\n // applyAttention expects BNSH inputs\n const kvBNSH = key && value && key.dims.length === 4 && value.dims.length === 4;\n\n const Q = maybeTransposeToBNSHAndAddBias(\n context, params.batchSize, params.numHeads, params.sequenceLength, params.headSize, query, bias, 0);\n\n if (kvBNSH) {\n return applyAttention(\n context, Q, key, value, keyPaddingMask, undefined, pastKey, pastValue, relativePositionBias, params,\n attributes);\n }\n if (!key || !value) {\n throw new Error('key and value must be provided');\n }\n const K = maybeTransposeToBNSHAndAddBias(\n context, params.batchSize, params.numHeads, params.kvSequenceLength, params.headSize, key, bias,\n params.hiddenSize);\n\n const V = maybeTransposeToBNSHAndAddBias(\n context, params.batchSize, params.numHeads, params.kvSequenceLength, params.vHeadSize, value, bias,\n 2 * params.hiddenSize);\n\n applyAttention(\n context, Q, K, V, keyPaddingMask, undefined, pastKey, pastValue, relativePositionBias, params, attributes);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, getElementAt, IndicesHelper, inputVariable, outputVariable, ShaderHelper, UniformDataElementType, UniformsArrayType} from './common';\n\ninterface PadAttributes {\n // 0-constant, 1-reflect, 2-edge, 3-wrap\n readonly mode: number;\n readonly value: number;\n readonly pads: number[];\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length < 1) {\n throw new Error('Too few inputs');\n }\n if (inputs[0].dataType !== DataType.float && inputs[0].dataType !== DataType.float16) {\n throw new Error('Input type must be float or float16.');\n }\n\n if (inputs.length >= 2) {\n let validPads = inputs[0].dims.length * 2 === inputs[1].dims[0];\n if (inputs.length === 4) {\n validPads = inputs[3].dims[0] * 2 === inputs[1].dims[0];\n }\n if (!validPads) {\n throw new Error('The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].');\n }\n }\n};\n\nconst getPadConstant = (output: IndicesHelper, inputRank: number, padsLength: number): string => {\n let block = '';\n for (let i = inputRank - 1; i >= 0; --i) {\n block += `\n k = i32(${output.indicesGet('indices', i)}) - ${getElementAt('uniforms.pads', i, padsLength)};\n if (k < 0) {\n break;\n }\n if (k >= i32(${getElementAt('uniforms.x_shape', i, inputRank)})) {\n break;\n }\n offset += k * i32(${getElementAt('uniforms.x_strides', i, inputRank)});\n `;\n }\n\n return `\n value = ${output.type.value}(uniforms.constant_value);\n for (var i = 0; i < 1; i++) {\n var offset = 0;\n var k = 0;\n ${block}\n value = x[offset];\n }\n `;\n};\n\nconst getPadReflect = (output: IndicesHelper, inputRank: number, padsLength: number): string => {\n let block = '';\n for (let i = inputRank - 1; i >= 0; --i) {\n block += `\n k = i32(${output.indicesGet('indices', i)}) - ${getElementAt('uniforms.pads', i, padsLength)};\n if (k < 0) {\n k = -k;\n }\n {\n let _2n_1 = 2 * (i32(${getElementAt('uniforms.x_shape', i, inputRank)}) - 1);\n k = k % _2n_1;\n if(k >= i32(${getElementAt('uniforms.x_shape', i, inputRank)})) {\n k = _2n_1 - k;\n }\n }\n offset += k * i32(${getElementAt('uniforms.x_strides', i, inputRank)});\n `;\n }\n\n return `\n var offset = 0;\n var k = 0;\n ${block}\n value = x[offset];\n `;\n};\n\nconst getPadEdge = (output: IndicesHelper, inputRank: number, padsLength: number): string => {\n let block = '';\n for (let i = inputRank - 1; i >= 0; --i) {\n block += `\n k = i32(${output.indicesGet('indices', i)}) - ${getElementAt('uniforms.pads', i, padsLength)};\n if (k < 0) {\n k = 0;\n }\n if (k >= i32(${getElementAt('uniforms.x_shape', i, inputRank)})) {\n k = i32(${getElementAt('uniforms.x_shape', i, inputRank)}) - 1;\n }\n offset += k * i32(${getElementAt('uniforms.x_strides', i, inputRank)});\n `;\n }\n\n return `\n var offset = 0;\n var k = 0;\n ${block}\n value = x[offset];\n `;\n};\n\nconst getPadWrap = (output: IndicesHelper, inputRank: number, padsLength: number): string => {\n let block = '';\n for (let i = inputRank - 1; i >= 0; --i) {\n block += `\n k = i32(${output.indicesGet('indices', i)}) - ${getElementAt('uniforms.pads', i, padsLength)};\n if (k < 0) {\n k += i32(${getElementAt('uniforms.x_shape', i, inputRank)}]);\n }\n if (k >= i32(${getElementAt('uniforms.x_shape', i, inputRank)})) {\n k -= i32(${getElementAt('uniforms.x_shape', i, inputRank)});\n }\n offset += k * i32(${getElementAt('uniforms.x_strides', i, inputRank)});\n `;\n }\n\n return `\n var offset = 0;\n var k = 0;\n ${block}\n value = x[offset];\n `;\n};\n\nconst getPadSnippet = (output: IndicesHelper, inputRank: number, attributes: PadAttributes): string => {\n switch (attributes.mode) {\n case 0:\n return getPadConstant(output, inputRank, attributes.pads.length);\n case 1:\n return getPadReflect(output, inputRank, attributes.pads.length);\n case 2:\n return getPadEdge(output, inputRank, attributes.pads.length);\n case 3:\n return getPadWrap(output, inputRank, attributes.pads.length);\n default:\n throw new Error('Invalid mode');\n }\n};\n\nconst createPadProgramInfo = (inputs: readonly TensorView[], attributes: PadAttributes): ProgramInfo => {\n const outputShape = ShapeUtil.padShape(inputs[0].dims.slice(), attributes.pads);\n const inputDims = inputs[0].dims;\n const outputSize = ShapeUtil.size(outputShape);\n const programUniforms: ProgramUniform[] =\n [{type: DataType.uint32, data: outputSize}, {type: DataType.int32, data: attributes.pads}];\n if (attributes.mode === 0) {\n programUniforms.push({type: inputs[0].dataType, data: attributes.value});\n }\n\n programUniforms.push(...createTensorShapeVariables(inputs[0].dims, outputShape));\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank'];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const output = outputVariable('output', inputs[0].dataType, outputShape.length);\n const input = inputVariable('x', inputs[0].dataType, inputDims.length);\n const dataType = input.type.value;\n const padSnippet = getPadSnippet(output, inputDims.length, attributes);\n const uniforms: UniformsArrayType =\n [{name: 'output_size', type: 'u32'}, {name: 'pads', type: 'i32', length: attributes.pads.length}];\n if (attributes.mode === 0) {\n uniforms.push({name: 'constant_value', type: dataType as UniformDataElementType});\n }\n\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(input, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n\n let indices = ${output.offsetToIndices('global_idx')};\n\n var value = ${dataType}(0);\n ${padSnippet}\n output[global_idx] = value;\n }`;\n };\n\n return {\n name: 'Pad',\n shaderCache: {hint: `${attributes.mode}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(ShapeUtil.size(outputShape) / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource,\n };\n};\n\nconst createPadAttributesFromInputs = (inputs: readonly TensorView[], attributes: PadAttributes): PadAttributes => {\n if (inputs.length > 1) {\n const bigInt64Pads = inputs[1].getBigInt64Array();\n const value = (inputs.length >= 3 && inputs[2].data) ? inputs[2].getFloat32Array()[0] : 0.0;\n\n const inputRank = inputs[0].dims.length;\n const updatePads = new Int32Array(2 * inputRank).fill(0);\n if (inputs.length >= 4) {\n const axes = inputs[3].getBigInt64Array();\n for (let i = 0; i < axes.length; i++) {\n updatePads[Number(axes[i])] = Number(bigInt64Pads[i]);\n updatePads[Number(axes[i]) + inputRank] = Number(bigInt64Pads[i + axes.length]);\n }\n } else {\n bigInt64Pads.forEach((v, i) => updatePads[Number(i)] = (Number(v)));\n }\n\n const pads: number[] = [];\n updatePads.forEach(v => pads.push(v));\n\n return {mode: attributes.mode, value, pads};\n } else {\n return attributes;\n }\n};\n\nexport const pad = (context: ComputeContext, attributes: PadAttributes): void => {\n validateInputs(context.inputs);\n const updatedAttributes = createPadAttributesFromInputs(context.inputs, attributes);\n context.compute(createPadProgramInfo(context.inputs, updatedAttributes), {inputs: [0]});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from 'onnxruntime-common';\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {PoolConvUtil, ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramInputTensorInfoDependency, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, getElementAt, IndicesHelper, inputVariable, outputVariable, ShaderHelper, UniformsArrayType} from './common';\n\n// TODO: support:\n// - ceil_mode \"test_maxpool_2d_ceil\"\n// - storage_order \"test_maxpool_with_argmax_2d_precomputed_strides\"\n// - [MaxPool] dilations \"test_maxpool_2d_dilations\"\n// - [MaxPool] output[1] \"test_maxpool_with_argmax_2d_precomputed_pads\"\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (env.webgpu.validateInputContent && (!inputs || inputs.length !== 1)) {\n throw new Error('Pool ops requires 1 input.');\n }\n};\n\nconst getAdjustedPoolAttributesAndOutputShape = (\n input: TensorView, attributes: AttributeType, isGlobalOperator: boolean): [AttributeType, number[]] => {\n const isChannelsLast = attributes.format === 'NHWC';\n const inputShapeAsChannelFirst = input.dims.slice();\n if (isChannelsLast) {\n inputShapeAsChannelFirst.splice(1, 0, inputShapeAsChannelFirst.pop()!); // Move channel to the second position.\n }\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, inputShapeAsChannelFirst, kernelShape, strides, dilations, pads);\n\n const outputShapeAsChannelFirst = PoolConvUtil.computePoolOutputShape(\n isGlobalOperator, inputShapeAsChannelFirst, 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 const outputShapeAsChannelLast = outputShapeAsChannelFirst.slice();\n outputShapeAsChannelLast.push(outputShapeAsChannelLast.splice(1, 1)[0]);\n return [newAttributes, isChannelsLast ? outputShapeAsChannelLast : outputShapeAsChannelFirst];\n};\n\nconst getUniformAndPadInfo = (\n outputShape: readonly number[],\n attributes: AttributeType): [ProgramUniform[], UniformsArrayType, boolean, boolean, boolean] => {\n const isChannelsLast = attributes.format === 'NHWC';\n const outputSize = ShapeUtil.size(outputShape);\n const kernelSize = ShapeUtil.size(attributes.kernelShape);\n const programUniforms: ProgramUniform[] =\n [{type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: kernelSize}];\n const uniforms: UniformsArrayType = [{name: 'outputSize', type: 'u32'}, {name: 'kernelSize', type: 'u32'}];\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 pwStartEndNotZero = !!(pwStart + pwEnd);\n programUniforms.push(\n {type: DataType.uint32, data: kw},\n {type: DataType.uint32, data: sw},\n {type: DataType.uint32, data: pwStart},\n {type: DataType.uint32, data: pwEnd},\n );\n uniforms.push(\n {name: 'kw', type: 'u32'}, {name: 'sw', type: 'u32'}, {name: 'pwStart', type: 'u32'},\n {name: 'pwEnd', type: 'u32'});\n\n let phStartEndNotZero = false;\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 phStartEndNotZero = !!(phStart + phEnd);\n programUniforms.push(\n {type: DataType.uint32, data: kh}, {type: DataType.uint32, data: sh}, {type: DataType.uint32, data: phStart},\n {type: DataType.uint32, data: phEnd});\n\n uniforms.push(\n {name: 'kh', type: 'u32'}, {name: 'sh', type: 'u32'}, {name: 'phStart', type: 'u32'},\n {name: 'phEnd', type: 'u32'});\n }\n return [programUniforms, uniforms, true, pwStartEndNotZero, phStartEndNotZero];\n } else {\n if (isChannelsLast) {\n throw new Error('Pooling with kernelShape.length > 2 is not supported for NHWC format.');\n }\n const kernelStrides = ShapeUtil.computeStrides(attributes.kernelShape);\n programUniforms.push(\n {type: DataType.uint32, data: kernelStrides}, {type: DataType.uint32, data: attributes.pads},\n {type: DataType.uint32, data: attributes.strides});\n uniforms.push(\n {name: 'kernelStrides', type: 'u32', length: kernelStrides.length},\n {name: 'pads', type: 'u32', length: attributes.pads.length},\n {name: 'strides', type: 'u32', length: attributes.strides.length});\n\n const hasPads = attributes.pads.reduce((sum, cur) => sum + cur);\n return [programUniforms, uniforms, !!hasPads, false, false];\n }\n};\n\nconst generatePoolingCode = (\n shaderHelper: ShaderHelper, x: IndicesHelper, rank: number, outputShapeRank: number, attributes: AttributeType,\n op1: string, op2: string, start: number, uniforms: UniformsArrayType, hasPads: boolean, pwStartEndNotZero: boolean,\n phStartEndNotZero: boolean): string => {\n const isChannelsLast = attributes.format === 'NHWC';\n const dataType = x.type.value;\n const output = outputVariable('output', x.type.tensor, outputShapeRank);\n\n if (attributes.kernelShape.length <= 2) {\n let codeW = '';\n let codeH = '';\n let codeHEnd = '';\n const dimIdxW = rank - (isChannelsLast ? 2 : 1);\n if (pwStartEndNotZero) {\n codeW = `\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\n xIndices[${dimIdxW}] = indices[${dimIdxW}] * uniforms.sw - uniforms.pwStart + i;\n if (xIndices[${dimIdxW}] < 0 || xIndices[${dimIdxW}]\n >= uniforms.x_shape[${dimIdxW}]) {\n pad++;\n continue;\n }\n let x_val = x[${x.indicesToOffset('xIndices')}];\n ${op1}\n }`;\n } else {\n codeW = `\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\n xIndices[${dimIdxW}] = indices[${dimIdxW}] * uniforms.sw - uniforms.pwStart + i;\n let x_val = x[${x.indicesToOffset('xIndices')}];\n ${op1}\n }`;\n }\n\n if (attributes.kernelShape.length === 2) {\n const dimIdxH = rank - (isChannelsLast ? 3 : 2);\n if (phStartEndNotZero) {\n codeH = `\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\n xIndices[${dimIdxH}] = indices[${dimIdxH}] * uniforms.sh - uniforms.phStart + j;\n if (xIndices[${dimIdxH}] < 0 || xIndices[${dimIdxH}] >= uniforms.x_shape[${dimIdxH}]) {\n pad += i32(uniforms.kw);\n continue;\n }\n `;\n } else {\n codeH = `\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\n xIndices[${dimIdxH}] = indices[${dimIdxH}] * uniforms.sh - uniforms.phStart + j;\n `;\n }\n codeHEnd = `\n }\n `;\n }\n\n const poolingCode = `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(x, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n\n let indices = ${output.offsetToIndices('global_idx')};\n var xIndices = ${output.offsetToIndices('global_idx')};\n\n var value = ${dataType}(${start});\n var pad = 0;\n ${codeH}\n ${codeW}\n ${codeHEnd}\n ${op2}\n\n output[global_idx] = value;\n }`;\n return poolingCode;\n } else {\n if (isChannelsLast) {\n throw new Error('Pooling with kernelShape.length > 2 is not supported for NHWC format.');\n }\n const stridesRank = attributes.kernelShape.length;\n const padsRank = attributes.pads.length;\n let padCode = '';\n if (hasPads) {\n padCode = `\n if (xIndices[j] >= uniforms.x_shape[j]) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n let x_val = x[${x.indicesToOffset('xIndices')}];\n ${op1}\n }`;\n } else {\n padCode = `\n }\n let x_val = x[${x.indicesToOffset('xIndices')}];\n ${op1}\n `;\n }\n const poolingCode = `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(x, output)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n let indices = ${output.offsetToIndices('global_idx')};\n var xIndices = ${output.offsetToIndices('global_idx')};\n\n var offsets: array;\n\n var value = ${dataType}(${start});\n var pad = 0;\n var isPad = false;\n\n for (var i: u32 = 0u; i < uniforms.kernelSize; i++) {\n var offset = i;\n for (var j = 0u; j < ${stridesRank - 1}u; j++) {\n offsets[j] = offset / ${getElementAt('uniforms.kernelStrides', 'j', stridesRank)};\n offset -= offsets[j] * ${getElementAt('uniforms.kernelStrides', 'j', stridesRank)};\n }\n offsets[${stridesRank - 1}] = offset;\n\n isPad = false;\n for (var j = ${rank - stridesRank}u; j < ${rank}u; j++) {\n xIndices[j] = indices[j] * ${\n getElementAt('uniforms.strides', `j - ${rank - stridesRank}u`, stridesRank)}\n + offsets[j - ${rank - stridesRank}u] - ${getElementAt('uniforms.pads', 'j - 2u', padsRank)};\n ${padCode}\n }\n ${op2}\n\n output[global_idx] = value;\n }`;\n return poolingCode;\n }\n};\n\nexport interface FormatAttributes {\n readonly format: 'NHWC'|'NCHW';\n}\n\nexport interface PoolCommonAttributes extends FormatAttributes {\n readonly autoPad: string;\n readonly ceilMode: number;\n readonly kernelShape: readonly number[];\n readonly strides: readonly number[];\n readonly pads: readonly number[];\n}\n\nconst createShaderKeyFromAttributes = (attributes: PoolCommonAttributes): string =>\n (`${attributes.format};${attributes.ceilMode};${attributes.autoPad};${attributes.kernelShape.length}`);\n\nconst createAveragePoolShaderKeyFromAttributes = (attributes: AveragePoolAttributes): string =>\n (`${createShaderKeyFromAttributes(attributes)};${attributes.countIncludePad}`);\n\nconst createMaxPoolShaderKeyFromAttributes = (attributes: MaxPoolAttributes): string =>\n (`${createShaderKeyFromAttributes(attributes)};${attributes.storageOrder};${attributes.dilations}`);\n\nconst parsePoolCommonAttributes = (attributes: Record): PoolCommonAttributes => ({\n format: attributes.format as FormatAttributes['format'],\n autoPad: ['NOTSET', 'VALID', 'SAME_UPPER', 'SAME_LOWER'][attributes.auto_pad as number],\n ceilMode: attributes.ceil_mode as number,\n kernelShape: attributes.kernel_shape as [number, number],\n strides: attributes.strides as [number, number],\n pads: attributes.pads as [number, number, number, number]\n});\n\nexport interface AveragePoolAttributes extends PoolCommonAttributes, AttributeWithCacheKey {\n readonly countIncludePad: boolean;\n}\n\nconst createAveragePoolProgramInfo =\n (name: string, input: TensorView, isGlobalOperator: boolean, attributes: AveragePoolAttributes): ProgramInfo => {\n const [adjustedAttributes, outputShape] =\n getAdjustedPoolAttributesAndOutputShape(input, attributes, isGlobalOperator);\n const x = inputVariable('x', input.dataType, input.dims.length);\n const dataType = x.type.value;\n\n const op1 = 'value += x_val;';\n let op2 = '';\n if (adjustedAttributes.countIncludePad) {\n op2 += `value /= ${dataType}(uniforms.kernelSize);`;\n } else {\n op2 += `value /= ${dataType}(i32(uniforms.kernelSize) - pad);`;\n }\n const [programUniforms, uniforms, hasPads, pwStartEndNotZero, phStartEndNotZero] =\n getUniformAndPadInfo(outputShape, adjustedAttributes);\n programUniforms.push(...createTensorShapeVariables(input.dims, outputShape));\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank'];\n return {\n name,\n shaderCache:\n {hint: `${attributes.cacheKey};${hasPads};${pwStartEndNotZero};${phStartEndNotZero}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: input.dataType}],\n dispatchGroup: {x: Math.ceil(ShapeUtil.size(outputShape) / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource: shaderHelper => generatePoolingCode(\n shaderHelper, x, input.dims.length, outputShape.length, adjustedAttributes, op1, op2, 0.0, uniforms,\n hasPads, pwStartEndNotZero, phStartEndNotZero),\n };\n };\n\nexport const parseAveragePoolAttributes = (attributes: Record): AveragePoolAttributes => {\n const countIncludePad = (attributes.count_include_pad as number) === 0 ? false : true;\n\n const attr = parsePoolCommonAttributes(attributes);\n // TODO: support attribute 'ceil_mode'\n if (attr.ceilMode !== 0) {\n throw new Error('using ceil() in shape computation is not yet supported for AveragePool');\n }\n const averagePoolAttributes = {countIncludePad, ...attr, cacheKey: ''};\n return {...averagePoolAttributes, cacheKey: createAveragePoolShaderKeyFromAttributes(averagePoolAttributes)};\n};\n\nexport const averagePool = (context: ComputeContext, attributes: AveragePoolAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createAveragePoolProgramInfo('AveragePool', context.inputs[0], false, attributes));\n};\n\nconst globalPoolAttributes = {\n autoPad: '',\n ceilMode: 0,\n countIncludePad: false,\n kernelShape: [],\n strides: [],\n pads: [],\n storageOrder: 0,\n dilations: []\n};\n\nexport const parseGlobalAveragePoolAttributes = (attributes: Record): AveragePoolAttributes => {\n const format = attributes.format as FormatAttributes['format'];\n return {format, ...globalPoolAttributes, cacheKey: format};\n};\n\nexport const globalAveragePool = (context: ComputeContext, attributes: AveragePoolAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createAveragePoolProgramInfo('GlobalAveragePool', context.inputs[0], true, attributes));\n};\n\nexport interface MaxPoolAttributes extends PoolCommonAttributes, AttributeWithCacheKey {\n readonly storageOrder: number;\n readonly dilations: number[];\n}\n\nconst createMaxPoolProgramInfo =\n (name: string, input: TensorView, isGlobalOperator: boolean, attributes: MaxPoolAttributes): ProgramInfo => {\n const [adjustedAttributes, outputShape] =\n getAdjustedPoolAttributesAndOutputShape(input, attributes, isGlobalOperator);\n const op1 = `\n value = max(x_val, value);\n `;\n const op2 = '';\n const x = inputVariable('x', input.dataType, input.dims.length);\n const inputDependencies: ProgramInputTensorInfoDependency[] = ['rank'];\n const [programUniforms, uniforms, hasPads, pwStartEndNotZero, phStartEndNotZero] =\n getUniformAndPadInfo(outputShape, adjustedAttributes);\n programUniforms.push(...createTensorShapeVariables(input.dims, outputShape));\n return {\n name,\n shaderCache:\n {hint: `${attributes.cacheKey};${hasPads};${pwStartEndNotZero};${phStartEndNotZero}`, inputDependencies},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: input.dataType}],\n dispatchGroup: {x: Math.ceil(ShapeUtil.size(outputShape) / 64 /* workgroup size */)},\n programUniforms\n }),\n getShaderSource: shaderHelper => generatePoolingCode(\n shaderHelper, x, input.dims.length, outputShape.length, adjustedAttributes, op1, op2,\n (input.dataType === DataType.float16) ? -65504 : -1e5, uniforms, hasPads, pwStartEndNotZero,\n phStartEndNotZero),\n };\n };\n\nexport const maxPool = (context: ComputeContext, attributes: MaxPoolAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createMaxPoolProgramInfo('MaxPool', context.inputs[0], false, attributes));\n};\n\nexport const parseMaxPoolAttributes = (attributes: Record): MaxPoolAttributes => {\n const storageOrder = attributes.storage_order as number;\n const dilations = attributes.dilations as [number, number];\n\n const attr = parsePoolCommonAttributes(attributes);\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 (attr.ceilMode !== 0) {\n throw new Error('using ceil() in shape computation is not yet supported for MaxPool');\n }\n const maxPoolAttributes = {storageOrder, dilations, ...attr, cacheKey: ''};\n return {...maxPoolAttributes, cacheKey: createMaxPoolShaderKeyFromAttributes(maxPoolAttributes)};\n};\n\nexport const parseGlobalMaxPoolAttributes = (attributes: Record): MaxPoolAttributes => {\n const format = attributes.format as FormatAttributes['format'];\n return {format, ...globalPoolAttributes, cacheKey: format};\n};\n\nexport const globalMaxPool = (context: ComputeContext, attributes: MaxPoolAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createMaxPoolProgramInfo('GlobalMaxPool', context.inputs[0], true, attributes));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env} from 'onnxruntime-common';\n\nimport {DataType} from '../../../wasm-common';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, outputVariable, ShaderHelper, UniformDataElementType, UniformsArrayType} from './common';\n\nconst validateInputsContent = (start: number, limit: number, delta: number): void => {\n const sameStartLimit = start === limit;\n const increasingRangeNegativeStep = start < limit && delta < 0;\n const decreasingRangePositiveStep = start > limit && delta > 0;\n\n if (sameStartLimit || increasingRangeNegativeStep || decreasingRangePositiveStep) {\n throw new Error('Range these inputs\\' contents are invalid.');\n }\n};\n\nconst createRangeProgramInfo = (start: number, limit: number, delta: number, dataType: DataType): ProgramInfo => {\n const numElements = Math.abs(Math.ceil((limit - start) / delta));\n const outputShape: number[] = [numElements];\n const outputSize = numElements;\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: dataType, data: start}, {type: dataType, data: delta},\n ...createTensorShapeVariables(outputShape)\n ];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const output = outputVariable('output', dataType, outputShape.length);\n const wgslType = output.type.value;\n const uniforms: UniformsArrayType = [\n {name: 'outputSize', type: 'u32'}, {name: 'start', type: wgslType as UniformDataElementType},\n {name: 'delta', type: wgslType as UniformDataElementType}\n ];\n return `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n output[global_idx] = uniforms.start + ${wgslType}(global_idx) * uniforms.delta;\n }`;\n };\n\n return {\n name: 'Range',\n shaderCache: {hint: `${dataType}`},\n getShaderSource,\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms\n })\n };\n};\n\nexport const range = (context: ComputeContext): void => {\n let start = 0;\n let limit = 0;\n let delta = 0;\n if (context.inputs[0].dataType === DataType.int32) {\n start = context.inputs[0].getInt32Array()[0];\n limit = context.inputs[1].getInt32Array()[0];\n delta = context.inputs[2].getInt32Array()[0];\n } else if (context.inputs[0].dataType === DataType.float) {\n start = context.inputs[0].getFloat32Array()[0];\n limit = context.inputs[1].getFloat32Array()[0];\n delta = context.inputs[2].getFloat32Array()[0];\n }\n if (env.webgpu.validateInputContent) {\n validateInputsContent(start, limit, delta);\n }\n\n context.compute(createRangeProgramInfo(start, limit, delta, context.inputs[0].dataType), {inputs: []});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, getElementAt, IndicesHelper, inputVariable, outputVariable, ShaderHelper} from './common';\n\ntype CoordinateTransformMode = 'half_pixel'|'asymmetric'|'pytorch_half_pixel'|'tf_half_pixel_for_nn'|'align_corners'|\n 'tf_crop_and_resize'|'half_pixel_symmetric';\n\ntype KeepAspectRatioPolicy = 'stretch'|'not_smaller'|'not_larger';\n\ntype Mode = 'nearest'|'linear'|'cubic';\n\ntype NearestMode = 'round_prefer_floor'|'round_prefer_ceil'|'floor'|'ceil'|'simple';\n\nexport interface ResizeAttributes extends AttributeWithCacheKey {\n antialias: number;\n axes: number[];\n coordinateTransformMode: CoordinateTransformMode;\n cubicCoeffA: number;\n excludeOutside: boolean;\n extrapolationValue: number;\n keepAspectRatioPolicy: KeepAspectRatioPolicy;\n mode: Mode;\n nearestMode: NearestMode;\n}\n\nconst validateScales = (scales: number[], attributes: ResizeAttributes): void => {\n scales.every((value) => value > 0 || (() => {\n throw new Error('Resize requires scales input values to be positive');\n }));\n // Check scales dims based on mode: LINEAR, CUBIC\n if (scales.length > 0) {\n if (attributes.mode === 'linear') {\n if (!(scales.length === 2 || scales.length === 3 || (scales.length === 4 && scales[0] === 1 && scales[1] === 1) ||\n (scales.length === 4 && scales[0] === 1 && scales[3] === 1) ||\n (scales.length === 5 && scales[0] === 1 && scales[1] === 1))) {\n throw new Error(\n `For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and\n one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`);\n }\n } else if (attributes.mode === 'cubic') {\n if (!(scales.length === 2 || (scales.length === 4 && scales[0] === 1 && scales[1] === 1) ||\n (scales.length === 4 && scales[0] === 1 && scales[3] === 1))) {\n throw new Error('Resize requires scales input size to be 2 or 4 for cubic mode');\n }\n }\n }\n};\n\nconst updateScales = (scales: readonly number[], axes: readonly number[], rank: number): number[] => {\n axes.every((value) => value >= 0 && value < rank || (() => {\n throw new Error('Resize requires axes input values to be positive and less than rank');\n }));\n const newScales = new Array(rank).fill(1.0);\n axes.forEach((value, index) => newScales[value] = scales[index]);\n return newScales;\n};\n\nconst validateInputs =\n (inputs: readonly TensorView[], attributes: ResizeAttributes, opsetVersion: number, scales: number[],\n sizes: number[], roi: number[]): void => {\n const [roiInputIndex, scalesInputIndex, sizesInputIndex] =\n (opsetVersion > 10) ? [1, 2, 3] : [-1, (inputs.length > 1) ? 1 : -1, -1];\n const rank = inputs[0].dims.length;\n if (roiInputIndex > 0 && inputs.length > roiInputIndex && inputs[roiInputIndex].dims.length > 0) {\n inputs[roiInputIndex].getFloat32Array().forEach((value) => roi.push(value));\n } else if (attributes.coordinateTransformMode === 'tf_crop_and_resize') {\n throw new Error('Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize');\n }\n\n if (scalesInputIndex > 0 && inputs.length > scalesInputIndex && inputs[scalesInputIndex].dims.length > 0) {\n inputs[scalesInputIndex].getFloat32Array().forEach((value) => scales.push(value));\n if (scales.length !== 0 &&\n (scales.length !== rank && (opsetVersion >= 18 && scales.length !== attributes.axes.length))) {\n throw new Error(\n 'Resize requires scales input size to be same as input rank or axes size for opset 18 and up');\n }\n validateScales(scales, attributes);\n if (attributes.axes.length > 0) {\n updateScales(scales, attributes.axes, rank).forEach((value, index) => scales[index] = value);\n }\n }\n if (sizesInputIndex > 0 && inputs.length > sizesInputIndex) {\n inputs[sizesInputIndex].getBigInt64Array().forEach((value) => sizes.push(Number(value)));\n if (sizes.length !== rank || (opsetVersion >= 18 && sizes.length === attributes.axes.length)) {\n throw new Error('Resize requires sizes input size to be same as input rank or axes size for opset 18 and up');\n }\n }\n\n if (attributes.axes.length > 0) {\n if (scales.length !== attributes.axes.length) {\n throw new Error('Resize requires \"scales\" input size to be of axes rank when axes attributes is specified');\n }\n if (sizes.length !== attributes.axes.length) {\n throw new Error(\n 'Resize requires \"sizes\" input size to be of rank axes rank when axes attributes is specified');\n }\n }\n if (typeof scales !== 'undefined' && typeof sizes !== 'undefined' && scales.length > 0 && sizes.length > rank) {\n throw new Error('Resize requires only of scales or sizes to be specified');\n }\n };\n\nconst getOriginalCoordinateFromResizedCoordinate =\n (coordinateTransferMode: CoordinateTransformMode, dType: string): string =>\n `fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32,\n lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${dType} { ` +\n (() => {\n switch (coordinateTransferMode) {\n case 'asymmetric':\n return `return ${dType}(xResized) / ${dType}(xScale);`;\n case 'pytorch_half_pixel':\n return `if (lengthResized > 1) {\n return (${dType}(xResized) + 0.5) / ${dType}(xScale) - 0.5;\n } else {\n return 0.0;\n }`;\n case 'tf_half_pixel_for_nn':\n return `return (${dType}(xResized) + 0.5) / ${dType}(xScale);`;\n case 'align_corners':\n return `if (lengthResized == 1) {\n return 0.0;\n } else {\n // The whole part and the fractional part are calculated separately due to inaccuracy of floating\n // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an\n // offset-by-one error later in floor().\n let whole = ${dType}(xResized * (lengthOriginal - 1) / (lengthResized - 1));\n let fract =\n ${dType}(xResized * (lengthOriginal - 1) % (lengthResized - 1)) / ${dType}(lengthResized - 1);\n return whole + fract;\n }`;\n case 'tf_crop_and_resize':\n return `if (lengthResized > 1) {\n return ${dType}(roiStart) * ${dType}(lengthOriginal - 1) +\n (${dType}(xResized) * ${dType}(roiEnd - roiStart) * ${dType}(lengthOriginal - 1)) /\n ${dType}(lengthResized - 1);\n } else {\n return 0.5 * ${dType}(roiStart + roiEnd) * ${dType}(lengthOriginal - 1);\n }`;\n case 'half_pixel_symmetric':\n return `const outputWidth = ${dType}xScale * ${dType}(lengthResized);\n const adjustment = ${dType}(lengthResized) / outputWidth;\n const center = ${dType}(lengthOriginal) / 2;\n const offset = center * (1 - adjustment);\n return offset + ((${dType}(xResized) + 0.5) / ${dType}(xScale)) - 0.5;`;\n case 'half_pixel':\n return `return ((${dType}(xResized) + 0.5) / ${dType}(xScale)) - 0.5;`;\n default:\n throw new Error(`Coordinate transform mode ${coordinateTransferMode} is not supported`);\n }\n })() +\n '}';\n\nconst getNearestPixelFromOriginal = (nearestMode: NearestMode, opsetVersion: number, dType: string): string =>\n `fn getNearestPixelFromOriginal(xOriginal: ${dType}, isDownSample: bool) -> ${dType} {` + (() => {\n switch (nearestMode) {\n case 'round_prefer_ceil':\n return 'if (fract(xOriginal) == 0.5) { \\\n return ceil(xOriginal); \\\n } else { \\\n return round(xOriginal); \\\n }';\n case 'floor':\n return 'return floor(xOriginal);';\n case 'ceil':\n return 'return ceil(xOriginal);';\n case 'round_prefer_floor':\n return 'if (fract(xOriginal) == 0.5) { \\\n return floor(xOriginal); \\\n } else { \\\n return round(xOriginal); \\\n }';\n case 'simple':\n default:\n if (opsetVersion < 11) {\n return 'if (isDownSample) \\\n { \\\n return ceil(xOriginal); \\\n } else { \\\n return xOriginal; \\\n }';\n }\n throw new Error(`Nearest mode ${nearestMode} is not supported`);\n }\n })() +\n '}';\n\nconst updateRoI = (roi: readonly number[], axes: readonly number[], rank: number): number[] => {\n const roiTmp = new Array(rank).fill(0).concat(new Array(rank).fill(1));\n const roiLocal = roi.length === 0 ? roiTmp : roi.slice();\n if (axes.length > 0) {\n axes.forEach((v, i) => {\n roiTmp[v] = roiLocal[i];\n roiTmp[i + rank] = roiLocal[axes.length + i];\n });\n return roiTmp;\n }\n return roiLocal;\n};\n\nconst initOutputShape =\n (inputShape: readonly number[], scales: readonly number[], sizes: readonly number[], axes: readonly number[]):\n number[] => {\n let outputShape: number[] = [];\n if (sizes.length > 0) {\n if (axes.length > 0) {\n inputShape.forEach((v) => outputShape.push(v));\n if (Math.max(...axes) > inputShape.length) {\n throw new Error('axes is out of bound');\n }\n axes.forEach((v, i) => outputShape[v] = sizes[i]);\n } else {\n sizes.forEach((v) => outputShape.push(v));\n }\n } else {\n if (scales.length === 0) {\n throw new Error('Resize requires either scales or sizes.');\n } else {\n outputShape = inputShape.map((value, index) => Math.round(value * scales[index]));\n }\n }\n return outputShape;\n };\n\nconst adjustOutputShape = (inputShape: readonly number[], scales: number[], attributes: ResizeAttributes) => {\n const scaleInPolicy = (() => {\n switch (attributes.keepAspectRatioPolicy) {\n case 'not_larger':\n return attributes.axes.length > 0 ? Math.min(...attributes.axes.map(i => scales[i]), Number.MAX_VALUE) :\n Math.min(...scales, Number.MAX_VALUE);\n case 'not_smaller':\n return attributes.axes.length > 0 ? Math.max(...attributes.axes.map(i => scales[i]), Number.MIN_VALUE) :\n Math.max(...scales, Number.MIN_VALUE);\n default:\n throw new Error(`Keep aspect ratio policy ${attributes.keepAspectRatioPolicy} is not supported`);\n }\n })();\n scales.fill(1.0, 0, scales.length);\n const adjustedOutputShape = inputShape.slice();\n if (attributes.axes.length > 0) {\n attributes.axes.forEach((v) => scales[v] = scaleInPolicy);\n attributes.axes.forEach((v) => adjustedOutputShape[v] = Math.round(inputShape[v] * scales[v]));\n } else {\n scales.fill(scaleInPolicy, 0, scales.length);\n adjustedOutputShape.forEach((v, i) => adjustedOutputShape[i] = Math.round(v * scales[i]));\n }\n return adjustedOutputShape;\n};\n\nconst calculateOriginalIndicesFromOutputIndices =\n (output: IndicesHelper, inputShape: readonly number[], outputShape: readonly number[], scalesLength: number,\n roiLength: number): string => `\n fn calculateOriginalIndicesFromOutputIndices(output_indices: ${output.type.indices}) -> array<${\n output.type.value}, ${outputShape.length}> {\n var original_indices: array<${output.type.value}, ${outputShape.length}>;\n for (var i:u32 = 0; i < ${outputShape.length}; i++) {\n var output_index = ${output.indicesGet('output_indices', 'i')};\n var scale = ${getElementAt('uniforms.scales', 'i', scalesLength)};\n var roi_low = ${getElementAt('uniforms.roi', 'i', roiLength)};\n var roi_hi = ${getElementAt('uniforms.roi', `i + ${inputShape.length}`, roiLength)};\n if (scale == 1.0) {\n original_indices[i] = ${output.type.value}(output_index);\n } else {\n var input_shape_i = ${getElementAt('uniforms.input_shape', 'i', inputShape.length)};\n var output_shape_i = ${getElementAt('uniforms.output_shape', 'i', outputShape.length)};\n original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\n input_shape_i, roi_low, roi_hi);\n }\n }\n return original_indices;\n }`;\n\nconst calculateInputIndicesFromOutputIndices =\n (input: IndicesHelper, output: IndicesHelper, inputShape: readonly number[], outputShape: readonly number[],\n scalesLength: number, roiLength: number, useExtrapolation: boolean): string => `\n fn calculateInputIndicesFromOutputIndices(output_indices: ${output.type.indices}) -> ${input.type.indices} {\n var input_indices: ${input.type.indices};\n for (var i:u32 = 0; i < ${outputShape.length}; i++) {\n var output_index = ${output.indicesGet('output_indices', 'i')};\n var input_index: u32;\n var scale = ${getElementAt('uniforms.scales', 'i', scalesLength)};\n if (scale == 1.0) {\n input_index = output_index;\n } else {\n var roi_low = ${getElementAt('uniforms.roi', 'i', roiLength)};\n var roi_hi = ${getElementAt('uniforms.roi', `i + ${inputShape.length}`, roiLength)};\n var input_shape_i = ${getElementAt('uniforms.input_shape', 'i', inputShape.length)};\n var output_shape_i = ${getElementAt('uniforms.output_shape', 'i', outputShape.length)};\n var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\n input_shape_i, roi_low, roi_hi);\n if (!${useExtrapolation} || (original_idx >= 0 && original_idx < ${output.type.value}(input_shape_i))) {\n if (original_idx < 0) {\n input_index = 0;\n } else if (original_idx > ${output.type.value}(input_shape_i - 1)) {\n input_index = input_shape_i - 1;\n } else {\n input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1));\n }\n } else {\n input_index = u32(original_idx);\n }\n }\n ${input.indicesSet('input_indices', 'i', ' input_index')}\n }\n return input_indices;\n }`;\nconst checkInputIndices = (input: IndicesHelper, inputShape: readonly number[]): string => `\n fn checkInputIndices(input_indices: ${input.type.indices}) -> bool {\n for (var i:u32 = 0; i < ${inputShape.length}; i++) {\n var input_index = ${input.indicesGet('input_indices', 'i')};\n if (input_index < 0 || input_index >= ${getElementAt('uniforms.input_shape', 'i', inputShape.length)}) {\n return false;\n }\n }\n return true;\n }`;\n\nconst setChannelAndBatchIndices =\n (input: IndicesHelper, channelIdx: number, batchIdx: number, spacialDims: number): string =>\n input.rank > spacialDims ? `\n ${input.indicesSet('input_indices', channelIdx, 'channel')};\n ${input.indicesSet('input_indices', batchIdx, 'batch')};\n` :\n '';\n\nconst bilinearInterpolation =\n (input: IndicesHelper, output: IndicesHelper, inputShape: readonly number[], useExtrapolation: boolean,\n extrapolationValue: number): string => {\n const isNchw = true;\n const [batchIdx, heightIdx, widthIdx, channelIdx] =\n inputShape.length === 2 ? [-1, 0, 1, -1] : (isNchw ? [0, 2, 3, 1] : [0, 1, 2, 3]);\n const dType = input.type.value;\n return `\n fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${dType} {\n var input_indices: ${input.type.indices};\n ${input.indicesSet('input_indices', heightIdx, `max(0, min(row, ${inputShape[heightIdx]} - 1))`)};\n ${input.indicesSet('input_indices', widthIdx, `max(0, min(col, ${inputShape[widthIdx]} - 1))`)};\n ${setChannelAndBatchIndices(input, channelIdx, batchIdx, 2)}\n return ${input.getByIndices('input_indices')};\n }\n\n fn bilinearInterpolation(output_indices: ${output.type.indices}) -> ${dType} {\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\n var row:${dType} = originalIndices[${heightIdx}];\n var col:${dType} = originalIndices[${widthIdx}];\n ${\n useExtrapolation ?\n `if (row < 0 || row > (${inputShape[heightIdx]} - 1) || col < 0 || col > (${inputShape[widthIdx]} - 1)) {\n return ${extrapolationValue};\n }` :\n ''};\n row = max(0, min(row, ${inputShape[heightIdx]} - 1));\n col = max(0, min(col, ${inputShape[widthIdx]} - 1));\n var row1: u32 = u32(row);\n var col1: u32 = u32(col);\n var row2: u32 = u32(row + 1);\n var col2: u32 = u32(col + 1);\n var channel: u32 = ${inputShape.length > 2 ? `u32(originalIndices[${channelIdx}])` : '0'};\n var batch: u32 = ${inputShape.length > 2 ? `u32(originalIndices[${batchIdx}])` : '0'};\n var x11: ${dType} = getInputValue(batch, channel, row1, col1);\n var x12: ${dType} = getInputValue(batch, channel, row1, col2);\n var x21: ${dType} = getInputValue(batch, channel, row2, col1);\n var x22: ${dType} = getInputValue(batch, channel, row2, col2);\n var dx1: ${dType} = abs(row - ${dType}(row1));\n var dx2: ${dType} = abs(${dType}(row2) - row);\n var dy1: ${dType} = abs(col - ${dType}(col1));\n var dy2: ${dType} = abs(${dType}(col2) - col);\n if (row1 == row2) {\n dx1 = 0.5;\n dx2 = 0.5;\n }\n if (col1 == col2) {\n dy1 = 0.5;\n dy2 = 0.5;\n }\n return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1);\n }`;\n };\n\nconst bicubicInterpolation =\n (input: IndicesHelper, output: IndicesHelper, inputShape: readonly number[], outputShape: readonly number[],\n scales: readonly number[], roi: readonly number[], cubicCoeffA: number, useExtrapolation: boolean,\n extrapolationValue: number, excludeOutside: boolean): string => {\n const is2D = inputShape.length === 2;\n const isNchw = true;\n const [heightIdx, widthIdx] = is2D ? [0, 1] : isNchw ? [2, 3] : [1, 2];\n const dType = input.type.value;\n const createCubicInterpolationFunction = (idx: number): string => {\n const direction = idx === heightIdx ? 'row' : 'col';\n return `\n fn ${direction}CubicInterpolation(input_indices: ${input.type.indices}, output_indices: ${\n output.type.indices}) -> ${dType} {\n var output_index = ${output.indicesGet('output_indices', idx)};\n var originalIdx: ${dType} = getOriginalCoordinateFromResizedCoordinate(output_index, ${scales[idx]},\n ${outputShape[idx]}, ${inputShape[idx]}, ${roi[idx]}, ${roi[idx]} + ${inputShape.length});\n var fractOriginalIdx: ${dType} = originalIdx - floor(originalIdx);\n var coefs = getCubicInterpolationCoefs(fractOriginalIdx);\n\n if (${useExtrapolation} && (originalIdx < 0 || originalIdx > (${inputShape[idx]} - 1))) {\n return ${extrapolationValue};\n }\n var data: array<${dType}, 4> = array<${dType}, 4>(0.0, 0.0, 0.0, 0.0);\n for (var i: i32 = -1; i < 3; i++) {\n var ${direction}: ${dType} = originalIdx + ${dType}(i);\n if (${direction} < 0 || ${direction} >= ${inputShape[idx]}) {\n ${(() => {\n if (excludeOutside) {\n return `coefs[i + 1] = 0.0;\n continue;`;\n } else if (useExtrapolation) {\n return `return ${extrapolationValue};`;\n } else {\n return `${direction} = max(0, min(${direction}, ${inputShape[idx]} - 1));`;\n }\n })()};\n }\n var input_indices_copy: ${input.type.indices} = input_indices;\n ${input.indicesSet('input_indices_copy', idx, `u32(${direction})`)};\n data[i + 1] = ${\n idx === heightIdx ? input.getByIndices('input_indices_copy') :\n 'rowCubicInterpolation(input_indices_copy, output_indices)'};\n }\n return cubicInterpolation1D(data, coefs);\n }`;\n };\n\n return `\n ${createCubicInterpolationFunction(heightIdx)};\n ${createCubicInterpolationFunction(widthIdx)};\n fn getCubicInterpolationCoefs(s: ${dType}) -> array<${dType}, 4> {\n var absS = abs(s);\n var coeffs: array<${dType}, 4> = array<${dType}, 4>(0.0, 0.0, 0.0, 0.0);\n var oneMinusAbsS: ${dType} = 1.0 - absS;\n var twoMinusAbsS: ${dType} = 2.0 - absS;\n var onePlusAbsS: ${dType} = 1.0 + absS;\n coeffs[0] = ((${cubicCoeffA} * onePlusAbsS - 5 * ${cubicCoeffA}) * onePlusAbsS + 8 * ${\n cubicCoeffA}) * onePlusAbsS - 4 * ${cubicCoeffA};\n coeffs[1] = ((${cubicCoeffA} + 2) * absS - (${cubicCoeffA} + 3)) * absS * absS + 1;\n coeffs[2] = ((${cubicCoeffA} + 2) * oneMinusAbsS - (${cubicCoeffA} + 3)) * oneMinusAbsS * oneMinusAbsS + 1;\n coeffs[3] = ((${cubicCoeffA} * twoMinusAbsS - 5 * ${cubicCoeffA}) * twoMinusAbsS + 8 * ${\n cubicCoeffA}) * twoMinusAbsS - 4 * ${cubicCoeffA};\n return coeffs;\n }\n\n fn cubicInterpolation1D(x: array<${dType}, 4>, coefs: array<${dType}, 4>) -> ${dType} {\n var coefsSum: ${dType} = coefs[0] + coefs[1] + coefs[2] + coefs[3];\n return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum;\n }\n\n fn bicubicInterpolation(output_indices: ${output.type.indices}) -> ${dType} {\n var input_indices: ${input.type.indices} = output_indices;\n return colCubicInterpolation(input_indices, output_indices);\n }\n `;\n };\n\nconst trilinearInterpolation =\n (input: IndicesHelper, output: IndicesHelper, inputShape: readonly number[], useExtrapolation: boolean,\n extrapolationValue: number): string => {\n const isNchw = true;\n const [batchIdx, depthIdx, heightIdx, widthIdx, channelIdx] =\n inputShape.length === 3 ? [-1, 0, 1, 2, -1] : (isNchw ? [0, 2, 3, 4, 1] : [0, 1, 2, 3, 4]);\n const dType = input.type.value;\n return `\n fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${dType} {\n var input_indices: ${input.type.indices};\n ${input.indicesSet('input_indices', depthIdx, `max(0, min(depth, ${inputShape[depthIdx]} - 1))`)};\n ${input.indicesSet('input_indices', heightIdx, `max(0, min(height, ${inputShape[heightIdx]} - 1))`)};\n ${input.indicesSet('input_indices', widthIdx, `max(0, min(width, ${inputShape[widthIdx]} - 1))`)};\n ${setChannelAndBatchIndices(input, channelIdx, batchIdx, 3)}\n return ${input.getByIndices('input_indices')};\n }\n\n fn trilinearInterpolation(output_indices: ${output.type.indices}) -> ${dType} {\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\n var depth:${dType} = originalIndices[${depthIdx}];\n var height:${dType} = originalIndices[${heightIdx}];\n var width:${dType} = originalIndices[${widthIdx}];\n ${\n useExtrapolation ? `if (depth < 0 || depth > (${inputShape[depthIdx]} - 1) || height < 0 || height > (${\n inputShape[heightIdx]} - 1) || width < 0 || (width > ${inputShape[widthIdx]} - 1)) {\n return ${extrapolationValue};\n }` :\n ''};\n\n depth = max(0, min(depth, ${inputShape[depthIdx]} - 1));\n height = max(0, min(height, ${inputShape[heightIdx]} - 1));\n width = max(0, min(width, ${inputShape[widthIdx]} - 1));\n var depth1: u32 = u32(depth);\n var height1: u32 = u32(height);\n var width1: u32 = u32(width);\n var depth2: u32 = u32(depth + 1);\n var height2: u32 = u32(height + 1);\n var width2: u32 = u32(width + 1);\n var channel: u32 = ${inputShape.length > 3 ? `u32(originalIndices[${channelIdx}])` : '0'};\n var batch: u32 = ${inputShape.length > 3 ? `u32(originalIndices[${batchIdx}])` : '0'};\n\n var x111: ${dType} = getInputValue(batch, channel, depth1, height1, width1);\n var x112: ${dType} = getInputValue(batch, channel, depth1, height1, width2);\n var x121: ${dType} = getInputValue(batch, channel, depth1, height2, width1);\n var x122: ${dType} = getInputValue(batch, channel, depth1, height2, width2);\n var x211: ${dType} = getInputValue(batch, channel, depth2, height1, width1);\n var x212: ${dType} = getInputValue(batch, channel, depth2, height1, width2);\n var x221: ${dType} = getInputValue(batch, channel, depth2, height2, width1);\n var x222: ${dType} = getInputValue(batch, channel, depth2, height2, width2);\n var dx1: ${dType} = abs(depth - ${dType}(depth1));\n var dx2: ${dType} = abs(${dType}(depth2) - depth);\n var dy1: ${dType} = abs(height - ${dType}(height1));\n var dy2: ${dType} = abs(${dType}(height2) - height);\n var dz1: ${dType} = abs(width - ${dType}(width1));\n var dz2: ${dType} = abs(${dType}(width2) - width);\n if (depth1 == depth2) {\n dx1 = 0.5;\n dx2 = 0.5;\n }\n if (height1 == height2) {\n dy1 = 0.5;\n dy2 = 0.5;\n }\n if (width1 == width2) {\n dz1 = 0.5;\n dz2 = 0.5;\n }\n return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 +\n x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1);\n }`;\n };\n\nconst createResizeProgramInfo =\n (inputTensor: TensorView, attributes: ResizeAttributes, opsetVersion: number, scalesInput: readonly number[],\n sizes: readonly number[], roiInput: readonly number[]): ProgramInfo => {\n const inputShape = inputTensor.dims;\n const roi = updateRoI(roiInput, attributes.axes, inputShape.length);\n\n let outputShape = initOutputShape(inputShape, scalesInput, sizes, attributes.axes);\n let scales = scalesInput.slice();\n if (scalesInput.length === 0) {\n scales = inputShape.map((value, index) => value === 0 ? 1.0 : outputShape[index] / value);\n if (attributes.keepAspectRatioPolicy !== 'stretch') {\n outputShape = adjustOutputShape(inputShape, scales, attributes);\n }\n }\n const output = outputVariable('output', inputTensor.dataType, outputShape.length);\n const input = inputVariable('input', inputTensor.dataType, inputShape.length);\n const outputSize = ShapeUtil.size(outputShape);\n const noScale = inputShape.length === outputShape.length && inputShape.every((d, i) => d === outputShape[i]);\n const useExtrapolation = attributes.coordinateTransformMode === 'tf_crop_and_resize';\n const extrapolationValue = attributes.extrapolationValue;\n const dataType = input.type.value;\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${noScale ? '' : `\n ${getOriginalCoordinateFromResizedCoordinate(attributes.coordinateTransformMode, dataType)};\n ${(() => {\n switch (attributes.mode) {\n case 'nearest':\n return `\n ${checkInputIndices(input, inputShape)};\n ${getNearestPixelFromOriginal(attributes.nearestMode, opsetVersion, dataType)};\n ${\n calculateInputIndicesFromOutputIndices(\n input, output, inputShape, outputShape, scales.length, roi.length, useExtrapolation)};\n `;\n case 'linear':\n return `\n ${calculateOriginalIndicesFromOutputIndices(output, inputShape, outputShape, scales.length, roi.length)};\n ${(() => {\n if (inputShape.length === 2 || inputShape.length === 4) {\n return `${bilinearInterpolation(input, output, inputShape, useExtrapolation, extrapolationValue)}`;\n } else if (inputShape.length === 3 || inputShape.length === 5) {\n return `${trilinearInterpolation(input, output, inputShape, useExtrapolation, extrapolationValue)}`;\n } else {\n throw Error('Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.');\n }\n })()};\n `;\n case 'cubic':\n return `\n ${(() => {\n if (inputShape.length === 2 || inputShape.length === 4) {\n return `${\n bicubicInterpolation(\n input, output, inputShape, outputShape, scales, roi, attributes.cubicCoeffA, useExtrapolation,\n attributes.extrapolationValue, attributes.excludeOutside)}`;\n } else {\n throw Error('Cubic mode only supports input dims 2 and 4 are supported in linear mode.');\n }\n })()};\n `;\n default:\n throw Error('Invalid resize mode');\n }\n })()};\n `}\n ${\n shaderHelper.registerUniform('output_size', 'u32')\n .registerUniform('scales', 'f32', scales.length)\n .registerUniform('roi', 'f32', roi.length)\n .declareVariables(input, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n ${noScale ? 'output[global_idx] = input[global_idx];' : `\n let output_indices = ${output.offsetToIndices('global_idx')};\n var input_indices: ${input.type.indices};\n ${(() => {\n switch (attributes.mode) {\n case 'nearest':\n return `input_indices = calculateInputIndicesFromOutputIndices(output_indices);\n if (checkInputIndices(input_indices)) {\n output[global_idx] = ${input.getByIndices('input_indices')};\n } else {\n output[global_idx] = ${attributes.extrapolationValue};\n }`;\n case 'linear':\n return `output[global_idx] = ${\n (inputShape.length === 2 || inputShape.length === 4) ? 'bilinearInterpolation' :\n 'trilinearInterpolation'}(output_indices);`;\n case 'cubic':\n return 'output[global_idx] = bicubicInterpolation(output_indices);';\n default:\n throw Error(`Unsupported resize mode: ${attributes.mode}`);\n }\n })()};\n`}\n }`;\n\n return {\n name: 'Resize',\n shaderCache: {\n hint: `${attributes.cacheKey}|${opsetVersion}|${scales.length > 0 ? scales : ''}|${\n sizes.length > 0 ? sizes : ''}|${roi.length > 0 ? roi : ''}|${noScale}|${inputShape}`,\n inputDependencies: ['rank']\n },\n getShaderSource,\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputTensor.dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms: [\n {type: DataType.uint32, data: outputSize}, {type: DataType.float, data: scales},\n {type: DataType.float, data: roi}, ...createTensorShapeVariables(inputShape, outputShape)\n ]\n })\n };\n };\n\nconst getOpsetVersionFromCustomDataBuffer = (context: ComputeContext): number => {\n const customDataBuffer = context.customDataBuffer;\n const customDataBuffer32 = new Uint32Array(customDataBuffer, customDataBuffer.byteOffset, 1);\n const opsetVersion = customDataBuffer32[0];\n return opsetVersion;\n};\n\nexport const resize = (context: ComputeContext, attributes: ResizeAttributes): void => {\n const scales: number[] = [];\n const sizes: number[] = [];\n const roi: number[] = [];\n\n // Note that scales in resize are always f32. roi can be f32 or f16.\n // TODO: Currently this code does not support f16 for roi when passed as optional input.\n\n const opsetVersion = getOpsetVersionFromCustomDataBuffer(context);\n if (attributes.antialias !== 0) {\n throw Error('Only default value (0) for Antialias attribute is supported');\n }\n validateInputs(context.inputs, attributes, opsetVersion, scales, sizes, roi);\n context.compute(\n createResizeProgramInfo(context.inputs[0], attributes, opsetVersion, scales, sizes, roi), {inputs: [0]});\n};\n\nexport const parseResizeAttributes = (attributes: Record): ResizeAttributes => {\n const antialias = attributes.antialias as number;\n const axes = attributes.axes as number[];\n const coordinateTransformMode: CoordinateTransformMode =\n attributes.coordinateTransformMode as CoordinateTransformMode;\n const cubicCoeffA = attributes.cubicCoeffA as number;\n const excludeOutside = attributes.excludeOutside as number !== 0;\n const extrapolationValue = attributes.extrapolationValue as number;\n const keepAspectRatioPolicy: KeepAspectRatioPolicy = attributes.keepAspectRatioPolicy as KeepAspectRatioPolicy;\n const mode: Mode = attributes.mode as Mode;\n // If nearestMode is not specified, use simple mode.\n const nearestMode: NearestMode = (attributes.nearestMode === '' ? 'simple' : attributes.nearestMode) as NearestMode;\n return createAttributeWithCacheKey({\n antialias,\n axes,\n coordinateTransformMode,\n cubicCoeffA,\n excludeOutside,\n extrapolationValue,\n keepAspectRatioPolicy,\n mode,\n nearestMode\n });\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper, WORKGROUP_SIZE} from './common';\n\nexport interface RotaryEmbeddingAttributes {\n readonly interleaved: boolean;\n readonly numHeads: number;\n readonly rotaryEmbeddingDim: number;\n readonly scale: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: RotaryEmbeddingAttributes): void => {\n const [input, positionIds, cosCache, sinCache] = inputs;\n const {numHeads, rotaryEmbeddingDim} = attributes;\n\n if (input.dims.length !== 3 && input.dims.length !== 4) {\n throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${input.dims.length}`);\n }\n if (!ShapeUtil.areEqual(positionIds.dims, []) && !ShapeUtil.areEqual(positionIds.dims, [1]) &&\n positionIds.dims.length !== 2) {\n throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${positionIds.dims.length}`);\n }\n if (cosCache.dims.length !== 2) {\n throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${cosCache.dims.length}`);\n }\n if (sinCache.dims.length !== 2) {\n throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${sinCache.dims.length}`);\n }\n if (!ShapeUtil.areEqual(cosCache.dims, sinCache.dims)) {\n throw new Error('Inputs \\'cos_cache\\' and \\'sin_cache\\' are expected to have the same shape');\n }\n\n if (rotaryEmbeddingDim > 0 && numHeads === 0) {\n throw new Error('num_heads must be provided if rotary_embedding_dim is specified');\n }\n\n const batchSize = input.dims[0];\n const sequenceLength = input.dims[input.dims.length - 2];\n const maxSequenceLength = cosCache.dims[0];\n const hiddenSize = ShapeUtil.sizeFromDimension(input.dims, 1) / sequenceLength;\n const headSize = rotaryEmbeddingDim === 0 ? cosCache.dims[1] * 2 : hiddenSize / numHeads;\n if (rotaryEmbeddingDim > headSize) {\n throw new Error('rotary_embedding_dim must be less than or equal to head_size');\n }\n\n if (positionIds.dims.length === 2) {\n if (batchSize !== positionIds.dims[0]) {\n throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${positionIds.dims[0]}`);\n }\n if (sequenceLength !== positionIds.dims[1]) {\n throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${positionIds.dims[1]}`);\n }\n }\n\n if (headSize / 2 !== cosCache.dims[1] && rotaryEmbeddingDim / 2 !== cosCache.dims[1]) {\n throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${\n cosCache.dims[1]}`);\n }\n\n if (sequenceLength > maxSequenceLength) {\n throw new Error('Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported');\n }\n};\n\nconst createRotaryEmbeddingProgramInfo =\n (inputs: readonly TensorView[], attributes: RotaryEmbeddingAttributes): ProgramInfo => {\n const {interleaved, numHeads, rotaryEmbeddingDim, scale} = attributes;\n const batchSize = inputs[0].dims[0];\n const batchStride = ShapeUtil.sizeFromDimension(inputs[0].dims, 1);\n const sequenceLength = inputs[0].dims[inputs[0].dims.length - 2];\n const hiddenSize = batchStride / sequenceLength;\n const halfRotaryEmbeddingDim = inputs[2].dims[1];\n const headSize = rotaryEmbeddingDim === 0 ? halfRotaryEmbeddingDim * 2 : hiddenSize / numHeads;\n\n // Rotary embeddings will be calculated in a pair-wise fashion. In accordance, use the shape\n // [batch size, sequence length, num of heads, num of pairs to rotate + num of dims to copy]\n // to unfold the global index in shader.\n const globalShape =\n new Array(batchSize, sequenceLength, hiddenSize / headSize, headSize - halfRotaryEmbeddingDim);\n const globalStrides = ShapeUtil.computeStrides(globalShape);\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.float, data: scale},\n {type: DataType.uint32, data: globalShape},\n {type: DataType.uint32, data: globalStrides},\n\n // strides for addressing the input/output tensor, in permutated order to align with the unfolded global index,\n // i.e. BSNH\n ...(inputs[0].dims.length === 3 ?\n new Array({type: DataType.uint32, data: [batchStride, hiddenSize, headSize, 1]}) :\n []),\n ...(inputs[0].dims.length === 4 ?\n new Array(\n {type: DataType.uint32, data: [batchStride, headSize, sequenceLength * headSize, 1]}) :\n []),\n\n ...createTensorShapeVariables(inputs[0].dims, inputs[1].dims, inputs[2].dims, inputs[3].dims, inputs[0].dims),\n ];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const input = inputVariable('input', inputs[0].dataType, inputs[0].dims.length);\n const positionIds = inputVariable('position_ids', inputs[1].dataType, inputs[1].dims.length);\n const cosCache = inputVariable('cos_cache', inputs[2].dataType, inputs[2].dims.length);\n const sinCache = inputVariable('sin_cache', inputs[3].dataType, inputs[3].dims.length);\n const output = outputVariable('output', inputs[0].dataType, inputs[0].dims.length);\n\n shaderHelper.registerUniforms([\n {name: 'scale', type: 'f32'},\n {name: 'global_shape', type: 'u32', length: globalShape.length},\n {name: 'global_strides', type: 'u32', length: globalStrides.length},\n {name: 'input_output_strides', type: 'u32', length: globalStrides.length},\n ]);\n\n return `\n ${shaderHelper.declareVariables(input, positionIds, cosCache, sinCache, output)}\n\n ${shaderHelper.mainStart(WORKGROUP_SIZE)}\n let half_rotary_emb_dim = uniforms.${cosCache.name}_shape[1];\n let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape;\n let size = uniforms.global_shape[0] * uniforms.global_strides[0];\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('size')}\n\n if (bsnh[3] < half_rotary_emb_dim) {\n let position_ids_idx =\n ${positionIds.broadcastedIndicesToOffset('bsnh.xy', outputVariable('', positionIds.type.tensor, 2))};\n let position_id =\n u32(${positionIds.getByOffset('position_ids_idx')}) + select(0, bsnh[1], position_ids_idx == 0);\n let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${interleaved});\n let j = i + select(half_rotary_emb_dim, 1, ${interleaved});\n let re = ${input.getByOffset('i')} * ${cosCache.get('position_id', 'bsnh[3]')} -\n ${input.getByOffset('j')} * ${sinCache.get('position_id', 'bsnh[3]')};\n ${output.setByOffset('i', 're')}\n let im = ${input.getByOffset('i')} * ${sinCache.get('position_id', 'bsnh[3]')} +\n ${input.getByOffset('j')} * ${cosCache.get('position_id', 'bsnh[3]')};\n ${output.setByOffset('j', 'im')}\n } else {\n let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim;\n ${output.setByOffset('k', input.getByOffset('k'))}\n }\n }`;\n };\n\n return {\n name: 'RotaryEmbedding',\n shaderCache: {\n hint: createAttributeWithCacheKey({\n interleaved,\n }).cacheKey,\n inputDependencies: ['rank', 'rank', 'rank', 'rank'],\n },\n getShaderSource,\n getRunData: () => ({\n outputs: [{dims: inputs[0].dims, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(ShapeUtil.size(globalShape) / WORKGROUP_SIZE)},\n programUniforms,\n }),\n };\n };\n\nexport const rotaryEmbedding = (context: ComputeContext, attributes: RotaryEmbeddingAttributes): void => {\n validateInputs(context.inputs, attributes);\n context.compute(createRotaryEmbeddingProgramInfo(context.inputs, attributes));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo, ProgramUniform} from '../types';\n\nimport {castToF32, fillVector, getMaxComponents, inputVariable, outputVariable, ShaderHelper, sumVector, tensorTypeToWsglStorageType, UniformsArrayType} from './common';\n\nexport interface SkipLayerNormAttributes {\n simplified: boolean;\n epsilon: number;\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length < 3) {\n throw new Error('layerNorm requires at least 3 inputs.');\n }\n\n const input: TensorView = inputs[0];\n const skip: TensorView = inputs[1];\n const gamma: TensorView = inputs[2];\n\n if (input.dataType !== skip.dataType || input.dataType !== gamma.dataType) {\n throw new Error('All inputs must have the same data type');\n }\n\n if (input.dims.length !== 3 && input.dims.length !== 2) {\n throw new Error('Input must be 2D or 3D');\n }\n\n if (skip.dims.length !== 3 && skip.dims.length !== 2) {\n throw new Error('Skip must be 2D or 3D');\n }\n\n const hiddenSize = input.dims[input.dims.length - 1];\n const sequenceLength = input.dims[input.dims.length - 2];\n if (skip.dims[skip.dims.length - 1] !== hiddenSize) {\n throw new Error('Skip must have the same hidden size as input');\n }\n if (skip.dims[skip.dims.length - 2] !== sequenceLength) {\n throw new Error('Skip must have the same sequence length as input');\n }\n\n if (gamma.dims.length !== 1) {\n throw new Error('Gamma must be 1D');\n }\n if (gamma.dims[gamma.dims.length - 1] !== hiddenSize) {\n throw new Error('Gamma must have the same hidden size as input');\n }\n if (inputs.length > 3) {\n const beta: TensorView = inputs[3];\n if (beta.dims.length !== 1) {\n throw new Error('Beta must be 1D');\n }\n if (beta.dims[beta.dims.length - 1] !== hiddenSize) {\n throw new Error('Beta must have the same hidden size as input');\n }\n }\n\n if (inputs.length > 4) {\n const bias: TensorView = inputs[4];\n if (bias.dims.length !== 1) {\n throw new Error('Bias must be 1D');\n }\n if (bias.dims[bias.dims.length - 1] !== hiddenSize) {\n throw new Error('Bias must have the same hidden size as input');\n }\n }\n};\n\nconst createSkipLayerNormProgramInfo =\n (inputs: readonly TensorView[], attributes: SkipLayerNormAttributes, outputCount: number, isTraining: boolean):\n ProgramInfo => {\n const simplified = attributes.simplified;\n\n const inputShape = inputs[0].dims;\n const inputSize = ShapeUtil.size(inputShape);\n const outputShape = inputShape;\n const outputSize = inputSize;\n const hiddenSize = inputShape.slice(-1)[0];\n const meanInvStdDevDim = isTraining ? inputShape.slice(0, -1).concat(1) : [];\n const hasBetaInput = !simplified && inputs.length > 3;\n const hasBiasInput = inputs.length > 4;\n const hasMeanOutput = isTraining && outputCount > 1;\n const hasInvStdDevOutput = isTraining && outputCount > 2;\n const hasInputSkipBiasSumOutput = outputCount > 3;\n\n const components = getMaxComponents(hiddenSize);\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize},\n {type: DataType.uint32, data: components},\n {type: DataType.uint32, data: hiddenSize},\n {type: DataType.float, data: attributes.epsilon},\n ];\n const getShaderSource = (shaderHelper: ShaderHelper) => {\n const uniformsArray: UniformsArrayType = [\n {name: 'output_size', type: 'u32'},\n {name: 'components', type: 'u32'},\n {name: 'hidden_size', type: 'u32'},\n {name: 'epsilon', type: 'f32'},\n ];\n const variables = [\n inputVariable('x', inputs[0].dataType, inputs[0].dims, components),\n inputVariable('skip', inputs[1].dataType, inputs[1].dims, components),\n inputVariable('gamma', inputs[2].dataType, inputs[2].dims, components),\n ];\n if (hasBetaInput) {\n variables.push(inputVariable('beta', inputs[3].dataType, inputs[3].dims, components));\n }\n if (hasBiasInput) {\n variables.push(inputVariable('bias', inputs[4].dataType, inputs[4].dims, components));\n }\n variables.push(outputVariable('output', inputs[0].dataType, outputShape, components));\n if (hasMeanOutput) {\n variables.push(outputVariable('mean_output', DataType.float, meanInvStdDevDim));\n }\n if (hasInvStdDevOutput) {\n variables.push(outputVariable('inv_std_output', DataType.float, meanInvStdDevDim));\n }\n if (hasInputSkipBiasSumOutput) {\n variables.push(outputVariable('input_skip_bias_sum', inputs[0].dataType, outputShape, components));\n }\n const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);\n return `\n\n ${shaderHelper.registerUniforms(uniformsArray).declareVariables(...variables)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size / uniforms.hidden_size')}\n let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components;\n let offset = global_idx * hidden_size_vectorized;\n var sum = ${fillVector('f32', components)};\n var squareSum = ${fillVector('f32', components)};\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\n let skip_value = skip[offset + i];\n let bias_value = ${hasBiasInput ? 'bias[i]' : dataType + '(0.0)'};\n let input_value = x[offset + i];\n let value = input_value + skip_value + bias_value;\n ${hasInputSkipBiasSumOutput ? 'input_skip_bias_sum[offset + i] = value;' : ''}\n output[offset + i] = value;\n let f32_value = ${castToF32(dataType, components, 'value')};\n sum += f32_value;\n squareSum += f32_value * f32_value;\n }\n let mean = ${sumVector('sum', components)} / f32(uniforms.hidden_size);\n let inv_std_dev = inverseSqrt(${sumVector('squareSum', components)} / f32(uniforms.hidden_size) ${\n simplified ? '' : '- mean * mean'} + uniforms.epsilon);\n ${hasMeanOutput ? 'mean_output[global_idx] = mean;' : ''}\n ${hasInvStdDevOutput ? 'inv_std_output[global_idx] = inv_std_dev;' : ''}\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\n output[offset + i] = (output[offset + i] ${simplified ? '' : `- ${dataType}(mean)`}) * ${\n dataType}(inv_std_dev) * gamma[i] ${hasBetaInput ? '+ beta[i]' : ''};\n }\n }`;\n };\n const outputs = [{dims: outputShape, dataType: inputs[0].dataType}];\n if (outputCount > 1) {\n outputs.push({dims: meanInvStdDevDim, dataType: DataType.float});\n }\n if (outputCount > 2) {\n outputs.push({dims: meanInvStdDevDim, dataType: DataType.float});\n }\n if (outputCount > 3) {\n outputs.push({dims: inputShape, dataType: inputs[0].dataType});\n }\n return {\n name: 'SkipLayerNormalization',\n shaderCache: {\n hint: `${components};${hasMeanOutput};${hasInvStdDevOutput};${hasInputSkipBiasSumOutput}`,\n inputDependencies: inputs.map((_input, _index) => 'type')\n },\n getShaderSource,\n getRunData: () => ({outputs, dispatchGroup: {x: Math.ceil(outputSize / hiddenSize / 64)}, programUniforms}),\n };\n };\n\nexport const skipLayerNorm = (context: ComputeContext, attributes: SkipLayerNormAttributes): void => {\n // TODO: initialize isTraining from ComputeContext\n const isTraining = false;\n validateInputs(context.inputs);\n // Mean and InvStdDev are only used in training mode and are not required for inference.\n // They are added here for completeness only.\n const outputs = [0];\n if (context.outputCount > 1) {\n outputs.push(isTraining ? 1 : -3);\n }\n if (context.outputCount > 2) {\n outputs.push(isTraining ? 2 : -3);\n }\n if (context.outputCount > 3) {\n outputs.push(3);\n }\n context.compute(\n createSkipLayerNormProgramInfo(context.inputs, attributes, context.outputCount, isTraining), {outputs});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramUniform, TensorInfo} from '../types';\n\nimport {createTensorShapeVariables, getElementAt, IndicesHelper, inputVariable, outputVariable, ShaderHelper, UniformsArrayType} from './common';\n\nexport interface SliceAttributes extends AttributeWithCacheKey {\n readonly starts: number[];\n readonly ends: number[];\n readonly axes: number[];\n}\n\nconst validateInputs = (inputs: readonly TensorView[], attributes: SliceAttributes): void => {\n if (!inputs || inputs.length < 1) {\n throw new Error('too few inputs');\n }\n if (attributes.axes.length !== 0) {\n if (attributes.axes.length !== attributes.starts.length || attributes.axes.length !== attributes.ends.length) {\n throw new Error('axes, starts and ends must have the same length');\n }\n } else if (attributes.starts.length !== attributes.ends.length) {\n throw new Error('starts and ends must have the same length');\n }\n inputs.slice(1).forEach((_, idx) => {\n if (inputs[idx + 1].dataType !== DataType.int32 && inputs[idx + 1].dataType !== DataType.int64) {\n throw new Error(`Input ${idx} must be an array of int32 or int64`);\n }\n });\n};\n\nconst readInput = (inputs: readonly TensorView[], idx: number): number[] => {\n const input: number[] = [];\n if (inputs.length > idx) {\n if (inputs[idx].dataType === DataType.int64) {\n inputs[idx].getBigInt64Array().forEach(v => input.push(Number(v)));\n } else if (inputs[idx].dataType === DataType.int32) {\n inputs[idx].getInt32Array().forEach(v => input.push(Number(v)));\n } else {\n throw new Error(`Input ${idx} must be an array of int32 or int64`);\n }\n }\n return input;\n};\n\nconst createSliceAttributesFromInputs =\n (inputs: readonly TensorView[], attributes: SliceAttributes): SliceAttributes => {\n if (inputs.length > 1) {\n const starts: number[] = readInput(inputs, 1);\n const ends: number[] = readInput(inputs, 2);\n let axes: number[] = readInput(inputs, 3);\n if (axes.length === 0) {\n axes = [...Array(inputs[0].dims.length).keys()];\n }\n return createAttributeWithCacheKey({starts, ends, axes});\n } else {\n return attributes;\n }\n };\n\nconst fixStartEndValues =\n (value: number, index: number, inputShape: readonly number[], axes: readonly number[], steps: readonly number[]):\n number => {\n let newValue = value;\n if (value < 0) {\n newValue += inputShape[axes[index]];\n }\n if (steps[index] < 0) {\n return Math.max(0, Math.min(newValue, inputShape[axes[index]] - 1));\n } else {\n return Math.max(0, Math.min(newValue, inputShape[axes[index]]));\n }\n };\n\nconst calculateInputIndicesImpl =\n (input: IndicesHelper, output: IndicesHelper, inputShape: readonly number[]): string =>\n `fn calculateInputIndices(output_indices: ${output.type.indices}) -> ${input.type.indices} {\n var input_indices: ${input.type.indices};\n var carry = 0u;\n for (var i = ${inputShape.length}; i >= 0; i--) {\n let input_shape_i = ${getElementAt('uniforms.input_shape', 'i', inputShape.length)};\n let steps_i = ${getElementAt('uniforms.steps', 'i', inputShape.length)};\n let signs_i = ${getElementAt('uniforms.signs', 'i', inputShape.length)};\n let starts_i = ${getElementAt('uniforms.starts', 'i', inputShape.length)};\n var output_index = ${output.indicesGet('output_indices', 'i')};\n var input_index = output_index * steps_i + starts_i + carry;\n carry = input_index / input_shape_i;\n input_index = input_index % input_shape_i;\n if (signs_i < 0) {\n input_index = input_shape_i - input_index - 1u + starts_i;\n }\n ${input.indicesSet('input_indices', 'i', 'input_index')};\n }\n return input_indices;\n }`;\n\nconst createSliceProgramInfo = (inputs: readonly TensorView[], attributes: SliceAttributes): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const inputSize = ShapeUtil.size(inputShape);\n const axes = (attributes.axes.length > 0) ? ShapeUtil.normalizeAxes(attributes.axes, inputShape.length) :\n [...Array(inputShape.length).keys()];\n let steps = readInput(inputs, 4);\n steps.forEach((step) => step !== 0 || (() => {\n throw new Error('step cannot be 0');\n }));\n if (steps.length === 0) {\n steps = Array(axes.length).fill(1);\n }\n const starts = attributes.starts.map((start, i) => fixStartEndValues(start, i, inputShape, axes, steps));\n\n const ends = attributes.ends.map((end, i) => fixStartEndValues(end, i, inputShape, axes, steps));\n\n if (axes.length !== starts.length || axes.length !== ends.length) {\n throw new Error('start, ends and axes should have the same number of elements');\n }\n\n if (axes.length !== inputShape.length) {\n for (let i = 0; i < inputShape.length; ++i) {\n if (!axes.includes(i)) {\n starts.splice(i, 0, 0);\n ends.splice(i, 0, inputShape[i]);\n steps.splice(i, 0, 1);\n }\n }\n }\n const signs = steps.map(step => Math.sign(step));\n // Convert negative steps to positive steps and reverse starts and ends\n steps.forEach((step, i, array) => {\n if (step < 0) {\n const numSteps = (ends[i] - starts[i]) / step;\n const newEnd = starts[i];\n const newStart = newEnd + numSteps * steps[i];\n starts[i] = newStart;\n ends[i] = newEnd;\n array[i] = -step;\n }\n });\n // Output rank is expected to be less than or equal to the input rank.\n const outputShape = inputShape.slice(0);\n axes.forEach((axis, _) => {\n outputShape[axis] = Math.ceil((ends[axis] - starts[axis]) / steps[axis]);\n });\n const outputTensorInfo: TensorInfo = {dims: outputShape, dataType: inputs[0].dataType};\n\n const output = outputVariable('output', inputs[0].dataType, outputShape.length);\n const input = inputVariable('input', inputs[0].dataType, inputs[0].dims.length);\n const outputSize = ShapeUtil.size(outputShape);\n const uniforms: UniformsArrayType = [\n {name: 'outputSize', type: 'u32'}, {name: 'starts', type: 'u32', length: starts.length},\n {name: 'signs', type: 'i32', length: signs.length}, {name: 'steps', type: 'u32', length: steps.length}\n ];\n\n const programUniforms: ProgramUniform[] = [\n {type: DataType.uint32, data: outputSize}, {type: DataType.uint32, data: starts},\n {type: DataType.int32, data: signs}, {type: DataType.uint32, data: steps},\n ...createTensorShapeVariables(inputs[0].dims, outputShape)\n ];\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${shaderHelper.registerUniforms(uniforms).declareVariables(input, output)}\n ${calculateInputIndicesImpl(input, output, inputShape)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.outputSize')}\n let output_indices = ${output.offsetToIndices('global_idx')};\n let input_indices = calculateInputIndices(output_indices);\n ${output.setByOffset('global_idx', input.getByIndices('input_indices'))}\n }`;\n return {\n name: 'Slice',\n shaderCache: {hint: `${signs.length}_${starts.length}_${steps.length}`, inputDependencies: ['rank']},\n getShaderSource,\n getRunData: () => ({\n outputs: [outputTensorInfo],\n dispatchGroup: {x: Math.ceil(inputSize / 64 /* workgroup size */)},\n programUniforms\n })\n };\n};\n\nexport const slice = (context: ComputeContext, attributes: SliceAttributes): void => {\n validateInputs(context.inputs, attributes);\n const updatedAttributes = createSliceAttributesFromInputs(context.inputs, attributes);\n context.compute(createSliceProgramInfo(context.inputs, updatedAttributes), {inputs: [0]});\n // if (ShapeUtil.size(program.outputs[0].dims) > 0) {\n // context.compute(programInfoLoader, {inputs: [0]});\n // } else {\n // // TODO: support empty output\n // throw new Error('slice: output size is 0');\n // }\n};\n\nexport const parseSliceAttributes = (attributes: Record): SliceAttributes => {\n const starts = attributes.starts as number[];\n const ends = attributes.ends as number[];\n const axes = attributes.axes as number[];\n return createAttributeWithCacheKey({starts, ends, axes});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// TODO: this is the same naive implementation we use for reduce that has\n// performance limitations when the reduced axis is long. Need to add\n// a optimized codepath for this.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {getMaxComponents, inputVariable, outputVariable, ShaderHelper, sumVector, tensorTypeToWsglStorageType} from './common';\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 1) {\n throw new Error('Softmax op requires 1 input.');\n }\n};\n\nexport interface SoftmaxAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n}\n\nconst createSoftmaxProgramInfo = (input: TensorView, attributes: SoftmaxAttributes): ProgramInfo => {\n const shape = input.dims;\n const outputSize = ShapeUtil.size(shape);\n const WG = 64;\n let axis = attributes.axis;\n if (axis < 0) {\n axis = shape.length + axis;\n }\n if (axis < shape.length - 1) {\n throw new Error('softmax only supports last axis for now.');\n }\n\n const cols = shape[axis];\n const rows = outputSize / cols;\n const components = getMaxComponents(cols);\n const packedCols = cols / components;\n\n const maxVector = (name: string, components: number) => {\n if (components === 4) {\n return `max(max(${name}.x, ${name}.y), max(${name}.z, ${name}.w))`;\n } else if (components === 2) {\n return `max(${name}.x, ${name}.y)`;\n } else if (components === 3) {\n return `max(max(${name}.x, ${name}.y), ${name}.z)`;\n }\n\n return name;\n };\n const x = inputVariable('x', input.dataType, input.dims, components);\n const output = outputVariable('result', input.dataType, input.dims, components);\n const valueType = x.type.value;\n // 6.2.4 in wgsl spec\n const threadMaxDecl = tensorTypeToWsglStorageType(input.dataType) === 'f32' ?\n `var threadMax = ${valueType}(-3.402823e+38f);` :\n `var threadMax = ${valueType}(-65504.0h);`;\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n var rowMaxShared : ${valueType};\n var rowSumShared : ${valueType};\n var threadShared : array<${valueType}, ${WG}>;\n\n fn getValue(row: i32, col: i32, row_stride: i32) -> ${valueType} {\n let index = row * row_stride + col;\n return x[index];\n }\n\n fn setValue(row: i32, col: i32, row_stride: i32, value: ${valueType}) {\n let index = row * row_stride + col;\n result[index] = value;\n }\n ${shaderHelper.registerUniform('packedCols', 'i32').declareVariables(x, output)}\n ${shaderHelper.mainStart()}\n let gindex = i32(global_idx);\n let lindex = i32(local_idx);\n const wg = ${WG};\n let row = gindex / wg;\n let cols = uniforms.packedCols;\n let row_stride : i32 = uniforms.packedCols;\n\n // find the rows max\n ${threadMaxDecl}\n for (var col = lindex; col < cols; col += wg) {\n let value = getValue(row, col, row_stride);\n threadMax = max(threadMax, value);\n }\n if (lindex < cols) {\n threadShared[lindex] = threadMax;\n }\n workgroupBarrier();\n\n var reduceSize = min(cols, wg);\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\n reduceSize = currSize + (reduceSize & 1);\n if (lindex < currSize) {\n threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]);\n }\n workgroupBarrier();\n }\n if (lindex == 0) {\n rowMaxShared = ${valueType}(${maxVector('threadShared[0]', components)});\n }\n workgroupBarrier();\n\n // find the rows sum\n var threadSum = ${valueType}(0.0);\n for (var col = lindex; col < cols; col += wg) {\n let subExp = exp(getValue(row, col, row_stride) - rowMaxShared);\n threadSum += subExp;\n }\n threadShared[lindex] = threadSum;\n workgroupBarrier();\n\n for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) {\n if (lindex < currSize) {\n threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize];\n }\n workgroupBarrier();\n }\n if (lindex == 0) {\n rowSumShared = ${valueType}(${sumVector('threadShared[0]', components)});\n }\n workgroupBarrier();\n\n // calculate final value for each element in the row\n for (var col = lindex; col < cols; col += wg) {\n let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared;\n setValue(row, col, row_stride, value);\n }\n }`;\n return {\n name: 'Softmax',\n shaderCache: {hint: `${components}`, inputDependencies: ['type']},\n getRunData: () => ({\n outputs: [{dims: shape, dataType: input.dataType}],\n dispatchGroup: {x: rows},\n programUniforms: [{type: DataType.int32, data: packedCols}]\n }),\n getShaderSource,\n };\n};\n\nexport const softmax = (context: ComputeContext, attributes: SoftmaxAttributes): void => {\n validateInputs(context.inputs);\n context.compute(createSoftmaxProgramInfo(context.inputs[0], attributes));\n};\n\nexport const parseSoftmaxAttributes = (attributes: Record): SoftmaxAttributes =>\n createAttributeWithCacheKey({axis: attributes.axis as number});\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';\nimport {ComputeContext, ProgramInfo, ProgramUniform, TensorInfo} from '../types';\n\nimport {createTensorShapeVariables, getElementAt, IndicesHelper, inputVariable, outputVariable, ShaderHelper} from './common';\n\nexport interface SplitAttributes extends AttributeWithCacheKey {\n readonly axis: number;\n readonly numOutputs: number;\n readonly splitSizes: number[];\n}\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length < 1) {\n throw new Error('too few inputs');\n }\n};\n\nconst createSplitAttributesFromInputs =\n (inputs: readonly TensorView[], attributes: SplitAttributes): SplitAttributes => {\n const splitSizes: number[] = [];\n let numOutputs: number = attributes.numOutputs;\n if (inputs[1].dims[0] > 0) {\n inputs[1].getBigInt64Array().forEach(v => splitSizes.push(Number(v)));\n numOutputs = splitSizes.length;\n }\n return createAttributeWithCacheKey({numOutputs, axis: attributes.axis, splitSizes});\n };\n\nconst calculateOutputIndexImpl = (numberOfTensors: number): string => `\nfn calculateOutputIndex(index: u32) -> u32 {\n for (var i: u32 = 0u; i < ${numberOfTensors}u; i += 1u ) {\n if (index < ${getElementAt('uniforms.size_in_split_axis', 'i', numberOfTensors)}) {\n return i;\n }\n }\n return ${numberOfTensors}u;\n}`;\nconst writeBufferDataImpl = (outputs: readonly IndicesHelper[]) => {\n const numberOfTensors = outputs.length;\n const codeLines: string[] = [];\n for (let i = 0; i < numberOfTensors; ++i) {\n const returnSnippet = outputs[i].setByIndices('indices', 'input[global_idx]');\n if (numberOfTensors === 1) {\n codeLines.push(returnSnippet);\n } else if (i === 0) {\n codeLines.push(`if (output_number == ${i}u) { ${returnSnippet} }`);\n } else if (i === numberOfTensors - 1) {\n codeLines.push(`else { ${returnSnippet} }`);\n } else {\n codeLines.push(`else if (output_number == ${i}) { ${returnSnippet} }`);\n }\n }\n return `\n fn writeBufferData(output_number: u32, indices: ${outputs[0].type.indices}, global_idx: u32) {\n ${codeLines.join('\\n')}\n }`;\n};\n\nconst createSplitProgramInfo = (inputs: readonly TensorView[], attributes: SplitAttributes): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const inputSize = ShapeUtil.size(inputShape);\n const dataType = inputs[0].dataType;\n const axis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);\n const outputs = new Array(attributes.numOutputs);\n const input = inputVariable('input', dataType, inputShape.length);\n const sizeInSplitAxis = new Array(attributes.numOutputs);\n const outputsTensorInfo: TensorInfo[] = [];\n const outputShapes: number[][] = [];\n let previousSum = 0;\n const programUniforms: ProgramUniform[] = [{type: DataType.uint32, data: inputSize}];\n for (let i = 0; i < attributes.numOutputs; i++) {\n previousSum += attributes.splitSizes[i];\n sizeInSplitAxis[i] = previousSum;\n const outputShape = inputShape.slice();\n outputShape[attributes.axis] = attributes.splitSizes[i];\n outputShapes.push(outputShape);\n outputs[i] = outputVariable(`output${i}`, dataType, outputShape.length);\n outputsTensorInfo.push({dims: outputShapes[i], dataType: inputs[0].dataType});\n }\n programUniforms.push(\n {type: DataType.uint32, data: sizeInSplitAxis}, ...createTensorShapeVariables(inputShape, ...outputShapes));\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n ${\n shaderHelper.registerUniform('input_size', 'u32')\n .registerUniform('size_in_split_axis', 'u32', sizeInSplitAxis.length)\n .declareVariables(input, ...outputs)}\n ${calculateOutputIndexImpl(sizeInSplitAxis.length)}\n ${writeBufferDataImpl(outputs)}\n\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.input_size')}\n\n var indices = ${input.offsetToIndices('global_idx')};\n var index = ${input.indicesGet('indices', axis)};\n let output_number = calculateOutputIndex(index);\n if (output_number != 0) {\n index -= ${getElementAt('uniforms.size_in_split_axis', 'output_number - 1u', sizeInSplitAxis.length)};\n ${input.indicesSet('indices', axis, 'index')};\n }\n writeBufferData(output_number, indices, global_idx);\n }`;\n return {\n name: 'Split',\n shaderCache: {hint: attributes.cacheKey, inputDependencies: ['rank']},\n getShaderSource,\n getRunData: () => ({\n outputs: outputsTensorInfo,\n dispatchGroup: {x: Math.ceil(inputSize / 64 /* workgroup size */)},\n programUniforms\n })\n };\n};\n\nexport const split = (context: ComputeContext, attributes: SplitAttributes): void => {\n validateInputs(context.inputs);\n const updatedAttributes =\n context.inputs.length === 1 ? attributes : createSplitAttributesFromInputs(context.inputs, attributes);\n context.compute(createSplitProgramInfo(context.inputs, updatedAttributes), {inputs: [0]});\n};\n\nexport const parseSplitAttributes = (attributes: Record): SplitAttributes => {\n const axis = attributes.axis as number;\n const splitSizes: number[] = attributes.splitSizes as number[];\n const numOutputs = attributes.numOutputs as number < 0 ? splitSizes.length : attributes.numOutputs as number;\n if (numOutputs !== splitSizes.length) {\n throw new Error('numOutputs and splitSizes lengh must be equal');\n }\n return createAttributeWithCacheKey({axis, numOutputs, splitSizes});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\nconst getRepeats = (repeatsTensorView: TensorView): readonly number[] =>\n Array.from(repeatsTensorView.getBigInt64Array(), Number);\n\n\nconst validateInputs = (inputs: readonly TensorView[]): void => {\n if (!inputs || inputs.length !== 2) {\n throw new Error('Tile requires 2 inputs.');\n }\n\n if (inputs[0].dataType !== DataType.float && inputs[0].dataType !== DataType.int32 &&\n inputs[0].dataType !== DataType.uint32) {\n throw new Error('Tile only support float, int32, and uint32 data types');\n }\n\n if (inputs[1].dataType !== DataType.int64) {\n throw new Error('Tile `repeats` input should be of int64 data type');\n }\n\n if (inputs[1].dims.length !== 1) {\n throw new Error('Tile `repeats` input should be 1-D');\n }\n\n const repeats: readonly number[] = getRepeats(inputs[1]);\n\n if (repeats.length !== inputs[0].dims.length) {\n throw new Error('Tile `repeats` input should have same number of elements as rank of input data tensor');\n }\n};\n\nconst getOutputShape = (inputShape: readonly number[], repeats: readonly number[]): readonly number[] => {\n const outputShape: number[] = [];\n\n for (let i = 0; i < inputShape.length; ++i) {\n outputShape.push(inputShape[i] * repeats[i]);\n }\n\n return outputShape;\n};\n\nexport const createTileProgramInfo = (inputs: readonly TensorView[]): ProgramInfo => {\n const inputShape = inputs[0].dims;\n const repeats: readonly number[] = getRepeats(inputs[1]);\n const outputShape = getOutputShape(inputShape, repeats);\n const outputSize = ShapeUtil.size(outputShape);\n\n const dataType = inputs[0].dataType;\n const input = inputVariable('input', dataType, inputShape.length);\n const output = outputVariable('output', dataType, outputShape.length);\n\n const getShaderSource = (shaderHelper: ShaderHelper) => `\n const inputShape = ${input.indices(...inputShape)};\n ${shaderHelper.registerUniform('output_size', 'u32').declareVariables(input, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.output_size')}\n let output_indices = ${output.offsetToIndices('global_idx')};\n var input_indices: ${input.type.indices};\n for (var i = 0; i < ${inputShape.length}; i++) {\n let input_dim_i = ${input.indicesGet('uniforms.input_shape', 'i')};\n let input_dim_value = ${output.indicesGet('output_indices', 'i')} % input_dim_i;\n\n ${input.indicesSet('input_indices', 'i', 'input_dim_value')}\n }\n ${output.setByOffset('global_idx', input.getByIndices('input_indices'))}\n }`;\n\n return {\n name: 'Tile',\n shaderCache: {hint: `${repeats}`, inputDependencies: ['rank']},\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: inputs[0].dataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */)},\n programUniforms:\n [{type: DataType.uint32, data: outputSize}, ...createTensorShapeVariables(inputs[0].dims, outputShape)],\n }),\n getShaderSource,\n };\n};\n\nexport const tile = (context: ComputeContext): void => {\n validateInputs(context.inputs);\n context.compute(createTileProgramInfo(context.inputs), {inputs: [0]});\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {DataType} from '../../../wasm-common';\nimport {TensorView} from '../../tensor-view';\nimport {BroadcastUtil, ShapeUtil} from '../../util';\nimport {ComputeContext, ProgramInfo} from '../types';\n\nimport {createTensorShapeVariables, inputVariable, outputVariable, ShaderHelper} from './common';\n\nconst createWhereOpProgramShader =\n (shaderHelper: ShaderHelper, inputs: readonly TensorView[], dimsOutput: readonly number[], isBroadcast: boolean,\n typeOutput: number) => {\n const output = outputVariable('output_data', typeOutput, dimsOutput.length, 4);\n const a = inputVariable('a_data', inputs[1].dataType, inputs[1].dims.length, 4);\n const b = inputVariable('b_data', inputs[2].dataType, inputs[2].dims.length, 4);\n const c = inputVariable('c_data', inputs[0].dataType, inputs[0].dims.length, 4);\n\n let assignment: string;\n const expression = (a: string, b: string, c: string) => `select(${b}, ${a}, ${c})`;\n if (!isBroadcast) {\n assignment = output.setByOffset(\n 'global_idx',\n expression(a.getByOffset('global_idx'), b.getByOffset('global_idx'), c.getByOffset('global_idx')));\n } else {\n const singleAssignment = (resStr: string, x: number, typeCast = '') => {\n const expressionA = `a_data[index_a${x}][component_a${x}]`;\n const expressionB = `b_data[index_b${x}][component_b${x}]`;\n // eslint-disable-next-line no-bitwise\n const expressionC = `bool(c_data[index_c${x}] & (0xffu << (component_c${x} * 8)))`;\n return `\n let output_indices${x} = ${output.offsetToIndices(`global_idx * 4u + ${x}u`)};\n let offset_a${x} = ${a.broadcastedIndicesToOffset(`output_indices${x}`, output)};\n let offset_b${x} = ${b.broadcastedIndicesToOffset(`output_indices${x}`, output)};\n let offset_c${x} = ${c.broadcastedIndicesToOffset(`output_indices${x}`, output)};\n let index_a${x} = offset_a${x} / 4u;\n let index_b${x} = offset_b${x} / 4u;\n let index_c${x} = offset_c${x} / 4u;\n let component_a${x} = offset_a${x} % 4u;\n let component_b${x} = offset_b${x} % 4u;\n let component_c${x} = offset_c${x} % 4u;\n ${resStr}[${x}] = ${typeCast}(${expression(expressionA, expressionB, expressionC)});\n `;\n };\n if (typeOutput === DataType.bool) {\n assignment = `\n var data = vec4(0);\n ${singleAssignment('data', 0, 'u32')}\n ${singleAssignment('data', 1, 'u32')}\n ${singleAssignment('data', 2, 'u32')}\n ${singleAssignment('data', 3, 'u32')}\n output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`;\n } else {\n assignment = `\n ${singleAssignment('output_data[global_idx]', 0)}\n ${singleAssignment('output_data[global_idx]', 1)}\n ${singleAssignment('output_data[global_idx]', 2)}\n ${singleAssignment('output_data[global_idx]', 3)}\n `;\n }\n }\n\n return `\n ${shaderHelper.registerUniform('vec_size', 'u32').declareVariables(c, a, b, output)}\n ${shaderHelper.mainStart()}\n ${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes('uniforms.vec_size')}\n ${assignment}\n }`;\n };\n\nconst createWhereOpProgramInfo = (inputs: readonly TensorView[]): ProgramInfo => {\n const dimsA = inputs[1].dims;\n const dimsB = inputs[2].dims;\n const dimsC = inputs[0].dims;\n const outputDataType = inputs[1].dataType;\n\n const isBroadcast = !(ShapeUtil.areEqual(dimsA, dimsB) && ShapeUtil.areEqual(dimsB, dimsC));\n let outputShape = dimsA;\n let outputSize = ShapeUtil.size(dimsA);\n // TODO: deal with zero-sized tensors (eg. dims=[1,0])\n\n if (isBroadcast) {\n const calculatedShape = BroadcastUtil.calcShape(BroadcastUtil.calcShape(dimsA, dimsB, false)!, dimsC, false);\n if (!calculatedShape) {\n throw new Error('Can\\'t perform where op on the given tensors');\n }\n outputShape = calculatedShape;\n outputSize = ShapeUtil.size(outputShape);\n }\n\n const vecSize = Math.ceil(outputSize / 4);\n\n return {\n name: 'Where',\n shaderCache: {inputDependencies: ['rank', 'rank', 'rank']},\n getShaderSource: (shaderHelper) =>\n createWhereOpProgramShader(shaderHelper, inputs, outputShape, isBroadcast, outputDataType),\n getRunData: () => ({\n outputs: [{dims: outputShape, dataType: outputDataType}],\n dispatchGroup: {x: Math.ceil(outputSize / 64 /* workgroup size */ / 4 /* vec size */)},\n programUniforms:\n [{type: DataType.uint32, data: vecSize}, ...createTensorShapeVariables(dimsC, dimsA, dimsB, outputShape)],\n }),\n };\n};\n\nexport const where = (context: ComputeContext): void => {\n context.compute(createWhereOpProgramInfo(context.inputs));\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {argMax, argMin, parseArgMinMaxAttributes} from './ops/argminmax';\nimport {attention} from './ops/attention';\nimport {batchNorm} from './ops/batch-norm';\nimport {biasAdd} from './ops/bias-add';\nimport {biasSplitGelu} from './ops/bias-split-gelu';\nimport * as binaryOps from './ops/binary-op';\nimport {concat, parseConcatAttributes} from './ops/concat';\nimport {conv, parseConvAttributes} from './ops/conv';\nimport {convTranspose, parseConvTransposeAttributes} from './ops/conv-transpose';\nimport {cumsum, parseCumSumAttributes} from './ops/cumsum';\nimport {depthToSpace, parseDepthToSpaceAttributes} from './ops/depth-to-space';\nimport {einsum, parseEinsumAttributes} from './ops/einsum';\nimport {expand} from './ops/expand';\nimport {fastGelu} from './ops/fast-gelu';\nimport {gather, parseGatherAttributes} from './ops/gather';\nimport {gatherElements, parseGatherElementsAttributes} from './ops/gather-elements';\nimport {gemm, parseGemmAttributes} from './ops/gemm';\nimport {instanceNorm} from './ops/instance-norm';\nimport {layerNorm} from './ops/layer-norm';\nimport {matMul} from './ops/matmul';\nimport {matMulNBits, parseMatMulNBitsAttributes} from './ops/matmulnbits';\nimport {multiHeadAttention, parseMultiHeadAttentionAttributes} from './ops/multihead-attentiion';\nimport {pad} from './ops/pad';\nimport * as pool from './ops/pool';\nimport {range} from './ops/range';\nimport {reduceL1, reduceL2, reduceLogSum, reduceLogSumExp, reduceMax, reduceMean, reduceMin, reduceProd, reduceSum, reduceSumSquare} from './ops/reduce';\nimport {parseResizeAttributes, resize} from './ops/resize';\nimport {rotaryEmbedding} from './ops/rotary-embedding';\nimport {skipLayerNorm} from './ops/skip-layer-norm';\nimport {parseSliceAttributes, slice} from './ops/slice';\nimport {parseSoftmaxAttributes, softmax} from './ops/softmax';\nimport {parseSplitAttributes, split} from './ops/split';\nimport {tile} from './ops/tile';\nimport {parseTransposeAttributes, transpose} from './ops/transpose';\nimport * as unaryOps from './ops/unary-op';\nimport {where} from './ops/where';\nimport {ComputeContext} from './types';\n\nexport type RunFunction = (context: ComputeContext, attribute?: unknown) => void;\nexport type ParseAttributeFunction = (attributeRaw: unknown) => unknown;\nexport type OperatorImplementation = [RunFunction]|[RunFunction, ParseAttributeFunction];\n\nexport const WEBGPU_OP_RESOLVE_RULES: Map = new Map([\n ['Abs', [unaryOps.abs]],\n ['Acos', [unaryOps.acos]],\n ['Acosh', [unaryOps.acosh]],\n ['Add', [binaryOps.add]],\n ['ArgMax', [argMax, parseArgMinMaxAttributes]],\n ['ArgMin', [argMin, parseArgMinMaxAttributes]],\n ['Asin', [unaryOps.asin]],\n ['Asinh', [unaryOps.asinh]],\n ['Atan', [unaryOps.atan]],\n ['Atanh', [unaryOps.atanh]],\n ['Attention', [attention]],\n // TODO: support new attributes for AveragePool-10\n ['AveragePool', [pool.averagePool, pool.parseAveragePoolAttributes]],\n ['BatchNormalization', [batchNorm]],\n ['BiasAdd', [biasAdd]],\n ['BiasSplitGelu', [biasSplitGelu]],\n ['Cast', [unaryOps.cast, unaryOps.parseCastAttributes]],\n ['Ceil', [unaryOps.ceil]],\n ['Clip', [unaryOps.clip]],\n ['Concat', [concat, parseConcatAttributes]],\n ['Conv', [conv, parseConvAttributes]],\n ['ConvTranspose', [convTranspose, parseConvTransposeAttributes]],\n ['Cos', [unaryOps.cos]],\n ['Cosh', [unaryOps.cosh]],\n ['CumSum', [cumsum, parseCumSumAttributes]],\n ['DepthToSpace', [depthToSpace, parseDepthToSpaceAttributes]],\n ['Div', [binaryOps.div]],\n ['Einsum', [einsum, parseEinsumAttributes]],\n ['Elu', [unaryOps.elu, unaryOps.parseAlphaAttributes]],\n ['Equal', [binaryOps.equal]],\n ['Erf', [unaryOps.erf]],\n ['Exp', [unaryOps.exp]],\n ['Expand', [expand]],\n ['FastGelu', [fastGelu]],\n ['Floor', [unaryOps.floor]],\n ['FusedConv', [conv, parseConvAttributes]],\n ['Gather', [gather, parseGatherAttributes]],\n ['GatherElements', [gatherElements, parseGatherElementsAttributes]],\n ['Gelu', [unaryOps.gelu]],\n ['Gemm', [gemm, parseGemmAttributes]],\n ['GlobalAveragePool', [pool.globalAveragePool, pool.parseGlobalAveragePoolAttributes]],\n ['GlobalMaxPool', [pool.globalMaxPool, pool.parseGlobalMaxPoolAttributes]],\n ['Greater', [binaryOps.greater]],\n ['GreaterOrEqual', [binaryOps.greaterOrEqual]],\n ['HardSigmoid', [unaryOps.hardSigmoid, unaryOps.parseHardSigmoidAttributes]],\n ['InstanceNormalization', [instanceNorm]],\n ['LayerNormalization', [layerNorm]],\n ['LeakyRelu', [unaryOps.leakyRelu, unaryOps.parseAlphaAttributes]],\n ['Less', [binaryOps.less]],\n ['LessOrEqual', [binaryOps.lessOrEqual]],\n ['Log', [unaryOps.log]],\n ['MatMul', [matMul]],\n ['MatMulNBits', [matMulNBits, parseMatMulNBitsAttributes]],\n // TODO: support new attributes for MaxPool-8 and MaxPool-10\n ['MaxPool', [pool.maxPool, pool.parseMaxPoolAttributes]],\n ['Mul', [binaryOps.mul]],\n ['MultiHeadAttention', [multiHeadAttention, parseMultiHeadAttentionAttributes]],\n ['Neg', [unaryOps.neg]],\n ['Not', [unaryOps.not]],\n ['Pad', [pad]],\n ['Pow', [binaryOps.pow]],\n ['Range', [range]],\n ['Reciprocal', [unaryOps.reciprocal]],\n ['ReduceMin', [reduceMin]],\n ['ReduceMean', [reduceMean]],\n ['ReduceMax', [reduceMax]],\n ['ReduceSum', [reduceSum]],\n ['ReduceProd', [reduceProd]],\n ['ReduceL1', [reduceL1]],\n ['ReduceL2', [reduceL2]],\n ['ReduceLogSum', [reduceLogSum]],\n ['ReduceLogSumExp', [reduceLogSumExp]],\n ['ReduceSumSquare', [reduceSumSquare]],\n ['Relu', [unaryOps.relu]],\n ['Resize', [resize, parseResizeAttributes]],\n ['RotaryEmbedding', [rotaryEmbedding]],\n ['Sigmoid', [unaryOps.sigmoid]],\n ['Sin', [unaryOps.sin]],\n ['Sinh', [unaryOps.sinh]],\n ['Slice', [slice, parseSliceAttributes]],\n ['SkipLayerNormalization', [skipLayerNorm]],\n ['Split', [split, parseSplitAttributes]],\n ['Sqrt', [unaryOps.sqrt]],\n ['Softmax', [softmax, parseSoftmaxAttributes]],\n ['Sub', [binaryOps.sub]],\n ['Tan', [unaryOps.tan]],\n ['Tanh', [unaryOps.tanh]],\n ['ThresholdedRelu', [unaryOps.thresholdedRelu, unaryOps.parseAlphaAttributes]],\n ['Tile', [tile]],\n ['Transpose', [transpose, parseTransposeAttributes]],\n ['Where', [where]],\n]);\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {TRACE_FUNC_BEGIN, TRACE_FUNC_END} from 'onnxruntime-common';\n\nimport {WebGpuBackend} from '../backend-webgpu';\nimport {LOG_DEBUG} from '../log';\n\nimport {createShaderHelper} from './ops/common';\nimport {Artifact, GpuData, ProgramInfo} from './types';\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 attributesBound: boolean;\n\n constructor(private backend: WebGpuBackend) {\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: GpuData[], outputs: GpuData[], dispatchGroup: [number, number, number],\n uniformBufferBinding: GPUBindingResource|undefined): void {\n TRACE_FUNC_BEGIN(buildArtifact.programInfo.name);\n const device = this.backend.device;\n const computePassEncoder = this.backend.getComputePassEncoder();\n this.backend.writeTimestamp(this.backend.pendingDispatchNumber * 2);\n const entries = [];\n for (const input of inputs) {\n entries.push({binding: entries.length, resource: {buffer: input.buffer}});\n }\n for (const output of outputs) {\n entries.push({binding: entries.length, resource: {buffer: output.buffer}});\n }\n if (uniformBufferBinding) {\n entries.push({binding: entries.length, resource: uniformBufferBinding});\n }\n const bindGroup = device.createBindGroup(\n {layout: buildArtifact.computePipeline.getBindGroupLayout(0), entries, label: buildArtifact.programInfo.name});\n\n if (this.backend.sessionStatus === 'capturing') {\n const commandInfo = {\n kernelId: this.backend.currentKernelId!,\n computePipeline: buildArtifact.computePipeline,\n bindGroup,\n dispatchGroup\n };\n const sessionCommandList = this.backend.capturedCommandList.get(this.backend.currentSessionId!);\n sessionCommandList!.push(commandInfo);\n }\n\n computePassEncoder.setPipeline(buildArtifact.computePipeline);\n computePassEncoder.setBindGroup(0, bindGroup);\n computePassEncoder.dispatchWorkgroups(...dispatchGroup);\n this.backend.writeTimestamp(this.backend.pendingDispatchNumber * 2 + 1);\n this.backend.pendingDispatchNumber++;\n\n if (this.backend.pendingDispatchNumber >= this.backend.maxDispatchNumber ||\n this.backend.queryType === 'at-passes') {\n this.backend.endComputePass();\n }\n if (this.backend.pendingDispatchNumber >= this.backend.maxDispatchNumber) {\n this.backend.flush();\n }\n TRACE_FUNC_END(buildArtifact.programInfo.name);\n }\n dispose(): void {\n // this.repo.forEach(a => this.glContext.deleteProgram(a.program));\n }\n build(programInfo: ProgramInfo, normalizedDispatchGroupSize: [number, number, number]): Artifact {\n TRACE_FUNC_BEGIN(programInfo.name);\n const device = this.backend.device;\n const extensions: string[] = [];\n if (device.features.has('shader-f16')) {\n extensions.push('enable f16;');\n }\n const shaderHelper = createShaderHelper(normalizedDispatchGroupSize, this.backend.device.limits);\n const userCode = programInfo.getShaderSource(shaderHelper);\n const code = `${extensions.join('\\n')}\\n${shaderHelper.additionalImplementations}\\n${userCode}`;\n const shaderModule = device.createShaderModule({code, label: programInfo.name});\n LOG_DEBUG('verbose', () => `[WebGPU] ${programInfo.name} shader code: ${code}`);\n\n const computePipeline = device.createComputePipeline(\n {compute: {module: shaderModule, entryPoint: 'main'}, layout: 'auto', label: programInfo.name});\n\n TRACE_FUNC_END(programInfo.name);\n return {programInfo, computePipeline, uniformVariablesInfo: shaderHelper.variablesInfo};\n }\n\n normalizeDispatchGroupSize(dispatchGroup: ReturnType['dispatchGroup']):\n [number, number, number] {\n const x = typeof dispatchGroup === 'number' ? dispatchGroup : dispatchGroup.x;\n const y = typeof dispatchGroup === 'number' ? 1 : (dispatchGroup.y || 1);\n const z = typeof dispatchGroup === 'number' ? 1 : (dispatchGroup.z || 1);\n const limitPerDimension = this.backend.device.limits.maxComputeWorkgroupsPerDimension;\n if (x <= limitPerDimension && y <= limitPerDimension && z <= limitPerDimension) {\n return [x, y, z];\n }\n const size = x * y * z;\n let dispatchAverage = Math.ceil(Math.sqrt(size));\n if (dispatchAverage > limitPerDimension) {\n dispatchAverage = Math.ceil(Math.cbrt(size));\n if (dispatchAverage > limitPerDimension) {\n throw new Error('Total dispatch size exceeds WebGPU maximum.');\n }\n return [dispatchAverage, dispatchAverage, dispatchAverage];\n } else {\n return [dispatchAverage, dispatchAverage, 1];\n }\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Env, Tensor, TRACE, TRACE_FUNC_BEGIN, TRACE_FUNC_END} from 'onnxruntime-common';\n\nimport {DataType, tensorDataTypeEnumToString} from '../wasm-common';\n\nimport {configureLogger, LOG_DEBUG} from './log';\nimport {createView, TensorView} from './tensor-view';\nimport {createGpuDataManager, downloadGpuData, GpuDataManager} from './webgpu/gpu-data-manager';\nimport {RunFunction, WEBGPU_OP_RESOLVE_RULES} from './webgpu/op-resolve-rules';\nimport {ProgramManager} from './webgpu/program-manager';\nimport {AdapterInfo, ComputeContext, GpuArchitecture, GpuData, GpuVendor, ProgramInfo, ProgramInputTensorInfoDependency, SessionState, TimestampQuery} from './webgpu/types';\n\ninterface CommandInfo {\n readonly kernelId: number;\n readonly computePipeline: GPUComputePipeline;\n readonly bindGroup: GPUBindGroup;\n readonly dispatchGroup: [number, number, number];\n}\n\ninterface KernelInfo {\n readonly kernelType: string;\n readonly kernelName: string;\n readonly kernelEntry: RunFunction;\n readonly attributes: [((attribute: unknown) => unknown)|undefined, unknown];\n}\n\ninterface PendingKernelInfo {\n readonly kernelId: number;\n readonly programName: string;\n readonly inputTensorViews: readonly TensorView[];\n readonly outputTensorViews: readonly TensorView[];\n}\n\nconst getProgramInputTensorInfoDependencyKey =\n (inputTensors: readonly TensorView[], inputDependencies: readonly ProgramInputTensorInfoDependency[]): string => {\n if (inputDependencies.length !== inputTensors.length) {\n throw new Error(`inputDependencies length ${inputDependencies.length} is not equal to inputTensors length ${\n inputTensors.length}.`);\n }\n\n const inputInfos: string[] = [];\n for (let i = 0; i < inputTensors.length; ++i) {\n const type = inputTensors[i].dataType;\n switch (inputDependencies[i]) {\n case 'none': {\n inputInfos.push('');\n break;\n }\n case 'type': {\n inputInfos.push(`${type}`);\n break;\n }\n case 'rank': {\n const rank = inputTensors[i].dims.length;\n inputInfos.push(`${type};${rank}`);\n break;\n }\n case 'dims': {\n const dims = inputTensors[i].dims.join(',');\n inputInfos.push(`${type};${dims}`);\n break;\n }\n default:\n throw new Error(`unsupported input dependency: ${inputDependencies[i]}`);\n }\n }\n\n return inputInfos.join('|');\n };\n\n/**\n * get a unique key representing the program from the program info, input shapes and types.\n *\n * @returns a unique key is a shorter string than the shader source, which contains all the information to identify a\n * program. if the key is the same, the program shader source should be the same, so we can reuse the program.\n *\n */\nconst getProgramInfoUniqueKey =\n (programInfo: ProgramInfo, inputTensors: readonly TensorView[], is1DimensionDispatch: boolean): string => {\n // final key format:\n // []:is1DimensionDispatch:||...\n let key = programInfo.name;\n if (programInfo.shaderCache?.hint) {\n key += '[' + programInfo.shaderCache.hint + ']';\n }\n key += ':' + is1DimensionDispatch +\n `:${\n getProgramInputTensorInfoDependencyKey(\n inputTensors,\n programInfo.shaderCache?.inputDependencies ??\n new Array(inputTensors.length).fill('dims'))}`;\n return key;\n };\n\nclass AdapterInfoImpl implements AdapterInfo {\n readonly architecture?: string;\n readonly vendor?: string;\n\n constructor(adapterInfo: GPUAdapterInfo) {\n if (adapterInfo) {\n this.architecture = adapterInfo.architecture;\n this.vendor = adapterInfo.vendor;\n }\n }\n\n isArchitecture(architecture: GpuArchitecture): boolean {\n return this.architecture === architecture;\n }\n\n isVendor(vendor: GpuVendor): boolean {\n return this.vendor === vendor;\n }\n}\n\n/**\n * this class is designed to store status and being used as a singleton for JSEP. It will be passed to jsepInit() as\n * the first parameter so that it is stored for future use.\n */\nexport class WebGpuBackend {\n adapterInfo: AdapterInfoImpl;\n device: GPUDevice;\n /**\n * an instance of GpuDataManager to manage a GpuDataId -> GpuBuffer mapping\n */\n gpuDataManager: GpuDataManager;\n /**\n * an instance of ProgramManager to build and run WebGPU compute shader program, and manage a ProgramKey -> Program\n * artifacts mapping\n */\n programManager: ProgramManager;\n\n /**\n * representing the session ID of which is currently being run.\n * `null` means no session is being run.\n * only valid when session.run is executed.\n */\n currentSessionId: number|null = null;\n\n /**\n * representing the kernel ID of which is currently being computed (CPU code perspective).\n * `null` means no kernel is being computed.\n * only one kernel can be computed at a moment.\n */\n currentKernelId: number|null = null;\n /**\n * a list of temporary GPU data for the current kernel. should release when the kernel done computation.\n */\n private temporaryData: GpuData[];\n /**\n * a KernelID -> a GPU data list, which stores persistent GPU data owned by the specific kernel.\n */\n private kernelPersistentData: Map;\n /**\n * a KernelID -> a custom data, which stores custom data owned by the specific kernel.\n */\n private kernelCustomData: Map;\n /**\n * get the custom data of the current kernel\n */\n get currentKernelCustomData(): {[key: string]: unknown} {\n if (this.currentKernelId === null) {\n throw new Error('currentKernelCustomData(): currentKernelId is null. (should not happen)');\n }\n\n let data = this.kernelCustomData.get(this.currentKernelId);\n if (!data) {\n data = {};\n this.kernelCustomData.set(this.currentKernelId, data);\n }\n\n return data;\n }\n\n // KernelID -> kernelInfo mapping\n kernels: Map;\n private commandEncoder: GPUCommandEncoder|null = null;\n private computePassEncoder: GPUComputePassEncoder|null = null;\n maxDispatchNumber = 16;\n pendingDispatchNumber = 0;\n\n // info of kernels pending submission for a single batch\n private pendingKernels: PendingKernelInfo[] = [];\n // queryReadBuffer -> pendingKernels mapping for all the batches\n private pendingQueries: Map = new Map();\n private queryResolveBuffer?: GPUBuffer;\n private querySet?: GPUQuerySet;\n private queryTimeBase?: bigint;\n queryType: TimestampQuery;\n\n env: Env;\n sessionStatus: SessionState = 'default';\n /**\n * a SessionID -> CommandInfo[] mapping. It's used to record all GPU commands for corresponding session.\n */\n capturedCommandList: Map = new Map();\n\n /**\n * a SessionID -> PendingKernelInfo[] mapping for profiling.\n */\n private capturedPendingKernels: Map = new Map();\n\n /**\n * a SessionID -> a Map of (InputOutputIndex -> [ID, GPUBuffer]) mapping.\n */\n sessionExternalDataMapping: Map> = new Map();\n\n async initialize(env: Env, adapter: GPUAdapter): Promise {\n this.env = env;\n const requiredFeatures: GPUFeatureName[] = [];\n const deviceDescriptor: GPUDeviceDescriptor = {\n requiredLimits: {\n maxComputeWorkgroupStorageSize: adapter.limits.maxComputeWorkgroupStorageSize,\n maxComputeWorkgroupsPerDimension: adapter.limits.maxComputeWorkgroupsPerDimension,\n maxStorageBufferBindingSize: adapter.limits.maxStorageBufferBindingSize,\n maxBufferSize: adapter.limits.maxBufferSize,\n maxComputeInvocationsPerWorkgroup: adapter.limits.maxComputeInvocationsPerWorkgroup,\n maxComputeWorkgroupSizeX: adapter.limits.maxComputeWorkgroupSizeX,\n maxComputeWorkgroupSizeY: adapter.limits.maxComputeWorkgroupSizeY,\n maxComputeWorkgroupSizeZ: adapter.limits.maxComputeWorkgroupSizeZ,\n },\n requiredFeatures,\n };\n\n if (adapter.features.has('chromium-experimental-timestamp-query-inside-passes')) {\n requiredFeatures.push('chromium-experimental-timestamp-query-inside-passes' as GPUFeatureName);\n } else if (adapter.features.has('timestamp-query')) {\n requiredFeatures.push('timestamp-query');\n }\n if (adapter.features.has('shader-f16')) {\n requiredFeatures.push('shader-f16');\n }\n\n this.device = await adapter.requestDevice(deviceDescriptor);\n this.adapterInfo = new AdapterInfoImpl(await adapter.requestAdapterInfo());\n this.gpuDataManager = createGpuDataManager(this);\n this.programManager = new ProgramManager(this);\n this.kernels = new Map();\n this.kernelPersistentData = new Map();\n this.kernelCustomData = new Map();\n\n // set up flags for logger\n configureLogger(env.logLevel!, !!env.debug);\n\n // TODO: set up flags\n\n this.device.onuncapturederror = ev => {\n if (ev.error instanceof GPUValidationError) {\n // eslint-disable-next-line no-console\n console.error(`An uncaught WebGPU validation error was raised: ${ev.error.message}`);\n }\n };\n\n Object.defineProperty(\n this.env.webgpu, 'device', {value: this.device, writable: false, enumerable: true, configurable: false});\n Object.defineProperty(\n this.env.webgpu, 'adapter', {value: adapter, writable: false, enumerable: true, configurable: false});\n\n // init queryType, which is necessary for InferenceSession.create\n this.setQueryType();\n }\n\n dispose(): void {\n if (typeof this.querySet !== 'undefined') {\n this.querySet.destroy();\n }\n this.gpuDataManager.dispose();\n }\n\n getCommandEncoder(): GPUCommandEncoder {\n if (!this.commandEncoder) {\n this.commandEncoder = this.device.createCommandEncoder();\n }\n return this.commandEncoder;\n }\n\n getComputePassEncoder(): GPUComputePassEncoder {\n if (!this.computePassEncoder) {\n const commandEncoder = this.getCommandEncoder();\n const computePassDescriptor: GPUComputePassDescriptor = {};\n\n if (this.queryType === 'at-passes') {\n computePassDescriptor.timestampWrites = {\n querySet: this.querySet!,\n beginningOfPassWriteIndex: this.pendingDispatchNumber * 2,\n endOfPassWriteIndex: this.pendingDispatchNumber * 2 + 1,\n };\n }\n\n this.computePassEncoder = commandEncoder.beginComputePass(computePassDescriptor);\n }\n return this.computePassEncoder;\n }\n\n endComputePass(): void {\n if (this.computePassEncoder) {\n this.computePassEncoder.end();\n this.computePassEncoder = null;\n }\n }\n\n flush(): void {\n if (!this.commandEncoder) {\n return;\n }\n\n TRACE_FUNC_BEGIN();\n\n this.endComputePass();\n let queryReadBuffer: GPUBuffer;\n if (this.queryType !== 'none') {\n this.commandEncoder.resolveQuerySet(\n this.querySet!, 0, this.pendingDispatchNumber * 2, this.queryResolveBuffer!, 0);\n\n queryReadBuffer = this.device.createBuffer(\n // eslint-disable-next-line no-bitwise\n {size: this.pendingDispatchNumber * 2 * 8, usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST});\n\n this.pendingQueries.set(queryReadBuffer, this.pendingKernels);\n this.pendingKernels = [];\n this.commandEncoder.copyBufferToBuffer(\n this.queryResolveBuffer!, 0, queryReadBuffer, 0, this.pendingDispatchNumber * 2 * 8);\n }\n\n this.device.queue.submit([this.commandEncoder.finish()]);\n this.gpuDataManager.refreshPendingBuffers();\n this.commandEncoder = null;\n this.pendingDispatchNumber = 0;\n\n if (this.queryType !== 'none') {\n void queryReadBuffer!.mapAsync(GPUMapMode.READ).then(() => {\n const mappedData = new BigUint64Array(queryReadBuffer.getMappedRange());\n const pendingKernels = this.pendingQueries.get(queryReadBuffer)!;\n for (let i = 0; i < mappedData.length / 2; i++) {\n const pendingKernelInfo = pendingKernels[i];\n const kernelId = pendingKernelInfo.kernelId;\n const kernelInfo = this.kernels.get(kernelId)!;\n const kernelType = kernelInfo.kernelType;\n const kernelName = kernelInfo.kernelName;\n const programName = pendingKernelInfo.programName;\n const inputTensorViews = pendingKernelInfo.inputTensorViews;\n const outputTensorViews = pendingKernelInfo.outputTensorViews;\n const startTimeU64 = mappedData[i * 2];\n const endTimeU64 = mappedData[i * 2 + 1];\n\n if (typeof this.queryTimeBase === 'undefined') {\n this.queryTimeBase = startTimeU64;\n }\n\n const startTime = Number(startTimeU64 - this.queryTimeBase);\n const endTime = Number(endTimeU64 - this.queryTimeBase);\n\n if (!Number.isSafeInteger(startTime) || !Number.isSafeInteger(endTime)) {\n throw new RangeError('incorrect timestamp range');\n }\n\n if (this.env.webgpu.profiling?.ondata) {\n this.env.webgpu.profiling.ondata({\n version: 1,\n inputsMetadata: inputTensorViews.map(\n value => ({dims: value.dims, dataType: tensorDataTypeEnumToString(value.dataType)})),\n outputsMetadata: outputTensorViews.map(\n value => ({dims: value.dims, dataType: tensorDataTypeEnumToString(value.dataType)})),\n kernelId,\n kernelType,\n kernelName,\n programName,\n startTime,\n endTime,\n });\n } else {\n // if no callback is provided, print the profiling message to console\n let inputShapes = '';\n inputTensorViews.forEach((value, i) => {\n inputShapes += `input[${i}]: [${value.dims}] | ${tensorDataTypeEnumToString(value.dataType)}, `;\n });\n let outputShapes = '';\n outputTensorViews.forEach((value, i) => {\n outputShapes += `output[${i}]: [${value.dims}] | ${tensorDataTypeEnumToString(value.dataType)}, `;\n });\n // eslint-disable-next-line no-console\n console.log(`[profiling] kernel \"${kernelId}|${kernelType}|${kernelName}|${programName}\" ${inputShapes}${\n outputShapes}execution time: ${endTime - startTime} ns`);\n }\n TRACE('GPU', `${programName}::${startTimeU64}::${endTimeU64}`);\n }\n queryReadBuffer.unmap();\n this.pendingQueries.delete(queryReadBuffer);\n });\n }\n TRACE_FUNC_END();\n }\n\n /**\n * run a WebGPU program.\n * @param program a ProgramInfo instance\n * @param inputTensorViews a TensorView array. each element represents a value already exists in GPU.\n * @param outputIndices an indices array. each element can be either -1 (temporary data), -2 (persistent data) or an\n * index to the kernel's output.\n * @param createKernelOutput a callback function that create a value to kernel's output with the given index\n * @param createIntermediateOutput a callback function that create a value as a intermediate value, either temporary\n * or persistent (owned by the current kernel)\n * @returns a TensorView array representing the result.\n */\n run(program: ProgramInfo, inputTensorViews: readonly TensorView[], outputIndices: readonly number[],\n createKernelOutput: (index: number, dataType: number, dims: readonly number[]) => TensorView,\n createIntermediateOutput: (dataType: number, dims: readonly number[]) => TensorView,\n outputCount: number): TensorView[] {\n TRACE_FUNC_BEGIN(program.name);\n // create info for inputs\n const inputDatas: GpuData[] = [];\n for (let i = 0; i < inputTensorViews.length; ++i) {\n const data = inputTensorViews[i].data;\n // if tensor view data is 0, it means the output is zero-sized tensor, and there is no GPU data for it.\n if (data === 0) {\n continue;\n }\n const gpuData = this.gpuDataManager.get(data);\n if (!gpuData) {\n throw new Error(`no GPU data for input: ${data}`);\n }\n inputDatas.push(gpuData);\n }\n\n const {outputs, dispatchGroup, programUniforms} = program.getRunData(inputTensorViews);\n\n // check output indices\n const validatedOutputIndices = outputIndices.length === 0 ? outputs.map((_, i) => i) : outputIndices;\n if (validatedOutputIndices.length !== outputs.length) {\n throw new Error(`Output size ${validatedOutputIndices.length} must be equal to ${outputs.length}.`);\n }\n\n // create info for outputs\n const outputTensorViews: TensorView[] = [];\n const outputDatas: GpuData[] = [];\n for (let i = 0; i < outputs.length; ++i) {\n // value -1 and -2 are used for creating temporary and persistent outputs.\n // value -3 is used for placeholder output. So -3, -2, -1 and 0, 1, 2, ... are valid\n // output indices. see type definition of ComputeContextInputsOutputsMapping for more details.\n if (!Number.isInteger(validatedOutputIndices[i]) || validatedOutputIndices[i] < -3 ||\n validatedOutputIndices[i] >= outputCount) {\n throw new Error(`Invalid output index: ${validatedOutputIndices[i]}`);\n }\n if (validatedOutputIndices[i] === -3) {\n continue;\n }\n const isTemporary = validatedOutputIndices[i] === -1;\n const isPersistent = validatedOutputIndices[i] === -2;\n const tensorView = (isTemporary || isPersistent) ?\n createIntermediateOutput(outputs[i].dataType, outputs[i].dims) :\n createKernelOutput(validatedOutputIndices[i], outputs[i].dataType, outputs[i].dims);\n outputTensorViews.push(tensorView);\n // if tensor view data is 0, it means the output is zero-sized tensor, and there is no GPU data for it.\n if (tensorView.data === 0) {\n continue;\n }\n const gpuData = this.gpuDataManager.get(tensorView.data);\n if (!gpuData) {\n throw new Error(`no GPU data for output: ${tensorView.data}`);\n }\n if (isTemporary) {\n this.temporaryData.push(gpuData);\n }\n if (isPersistent) {\n let persistentData = this.kernelPersistentData.get(this.currentKernelId!);\n if (!persistentData) {\n persistentData = [];\n this.kernelPersistentData.set(this.currentKernelId!, persistentData);\n }\n persistentData.push(gpuData);\n }\n outputDatas.push(gpuData);\n }\n\n // when there are any zero-sized tensor in the inputs or outputs, we should report error unless all outputs are\n // zero-sized tensors.\n if (inputDatas.length !== inputTensorViews.length || outputDatas.length !== outputTensorViews.length) {\n // if all outputs are zero-sized tensors, there is no need to run the program.\n if (outputDatas.length === 0) {\n TRACE_FUNC_END(program.name);\n return outputTensorViews;\n }\n // if some outputs are zero-sized tensors, report an error.\n //\n // TODO: so far we don't see any use case that outputs include both zero-sized tensors and non-zero-sized tensors.\n // If we see such use case, we need to make a change here to support it.\n throw new Error(\n `Program ${program.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`);\n }\n\n // load uniforms\n // TODO: add cache for uniform (is it necessary?)\n //\n let uniformBufferBinding: GPUBindingResource|undefined;\n if (programUniforms) {\n let currentOffset = 0;\n const offsets: number[] = [];\n\n programUniforms.forEach(v => {\n const data = typeof v.data === 'number' ? [v.data] : v.data;\n if (data.length === 0) {\n return;\n }\n // https://www.w3.org/TR/WGSL/#alignof\n const sizeOfElement = v.type === DataType.float16 ? 2 : 4;\n let sizeOfVecOrMat;\n let baseAlignment;\n if (v.type === DataType.float16) {\n baseAlignment = data.length > 4 ? 16 : (data.length > 2 ? 8 : data.length * sizeOfElement);\n sizeOfVecOrMat = data.length > 4 ? 16 : sizeOfElement * data.length;\n } else {\n baseAlignment = data.length <= 2 ? data.length * sizeOfElement : 16;\n sizeOfVecOrMat = 16;\n }\n currentOffset = Math.ceil(currentOffset / baseAlignment) * baseAlignment;\n offsets.push(currentOffset);\n // For non-float16 type, when data.length > 4, the uniform variable is of type array,N>, where\n // N = Math.ceil(data.length / 4) and SizeOf(vec4) = 16. The total byte length is N *\n // SizeOf(vec4). For float16 type, when data.length > 4, the uniform variable is of type\n // array,N>, where N = Math.ceil(data.length / 8) and SizeOf(mat2x4) = 16. The total byte\n // length is N * SizeOf(mat2x4).\n const elementPerVecOrMat = v.type === DataType.float16 ? 8 : 4;\n currentOffset += data.length > 4 ? Math.ceil(data.length / elementPerVecOrMat) * sizeOfVecOrMat :\n data.length * sizeOfElement;\n });\n\n // Meet alignment of struct here: https://www.w3.org/TR/WGSL/#alignment-and-size. For simplicity, set\n // maxAlignmentOfField to 16 since the underlying buffer has been rounded up to 16.\n const maxAlignmentOfField = 16;\n currentOffset = Math.ceil(currentOffset / maxAlignmentOfField) * maxAlignmentOfField;\n const arrayBuffer = new ArrayBuffer(currentOffset);\n programUniforms.forEach((v, i) => {\n const offset = offsets[i];\n const data = typeof v.data === 'number' ? [v.data] : v.data;\n if (v.type === DataType.int32) {\n new Int32Array(arrayBuffer, offset, data.length).set(data);\n } else if (v.type === DataType.uint32) {\n new Uint32Array(arrayBuffer, offset, data.length).set(data);\n } else if (v.type === DataType.float16) {\n // TODO: use Float16Array.\n new Uint16Array(arrayBuffer, offset, data.length).set(data);\n } else if (v.type === DataType.float) {\n new Float32Array(arrayBuffer, offset, data.length).set(data);\n } else {\n throw new Error(`Unsupported uniform type: ${tensorDataTypeEnumToString(v.type)}`);\n }\n });\n\n const uniformBufferData =\n // eslint-disable-next-line no-bitwise\n this.gpuDataManager.create(currentOffset, GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM);\n this.device.queue.writeBuffer(uniformBufferData.buffer, 0, arrayBuffer, 0, currentOffset);\n this.gpuDataManager.release(uniformBufferData.id);\n uniformBufferBinding = {offset: 0, size: currentOffset, buffer: uniformBufferData.buffer};\n }\n\n const normalizedDispatchGroup = this.programManager.normalizeDispatchGroupSize(dispatchGroup);\n const is1DimensionDispatch = normalizedDispatchGroup[1] === 1 && normalizedDispatchGroup[2] === 1;\n // get program info\n const key = getProgramInfoUniqueKey(program, inputTensorViews, is1DimensionDispatch);\n let artifact = this.programManager.getArtifact(key);\n if (!artifact) {\n artifact = this.programManager.build(program, normalizedDispatchGroup);\n this.programManager.setArtifact(key, artifact);\n LOG_DEBUG('info', () => `[artifact] key: ${key}, programName: ${program.name}`);\n }\n\n // validate uniform variables\n if (programUniforms && artifact.uniformVariablesInfo) {\n if (programUniforms.length !== artifact.uniformVariablesInfo.length) {\n throw new Error(`Uniform variables count mismatch: expect ${artifact.uniformVariablesInfo.length}, got ${\n programUniforms.length} in program \"${artifact.programInfo.name}\".`);\n }\n for (let i = 0; i < programUniforms.length; i++) {\n const uniform = programUniforms[i];\n const actualType = uniform.type;\n const actualLength = typeof uniform.data === 'number' ? 1 : uniform.data.length;\n const [type, length] = artifact.uniformVariablesInfo[i];\n if (actualType !== type || actualLength !== length) {\n throw new Error(`Uniform variable ${i} mismatch: expect type ${type} with size ${length}, got type ${\n actualType} with size ${actualLength} in program \"${artifact.programInfo.name}\".`);\n }\n }\n }\n\n LOG_DEBUG(\n 'info',\n () => `[ProgramManager] run \"${program.name}\" (key=${key}) with ${normalizedDispatchGroup[0]}x${\n normalizedDispatchGroup[1]}x${normalizedDispatchGroup[2]}`);\n\n if (this.queryType !== 'none' || this.sessionStatus === 'capturing') {\n const pendingKernelInfo: PendingKernelInfo = {\n kernelId: this.currentKernelId!,\n programName: artifact.programInfo.name,\n inputTensorViews,\n outputTensorViews,\n };\n this.pendingKernels.push(pendingKernelInfo);\n\n if (this.sessionStatus === 'capturing') {\n const sessionPendingKernels = this.capturedPendingKernels.get(this.currentSessionId!);\n sessionPendingKernels!.push(pendingKernelInfo);\n }\n }\n\n this.programManager.run(artifact, inputDatas, outputDatas, normalizedDispatchGroup, uniformBufferBinding);\n\n TRACE_FUNC_END(program.name);\n return outputTensorViews;\n }\n\n upload(gpuDataId: number, data: Uint8Array): void {\n this.gpuDataManager.upload(gpuDataId, data);\n }\n\n memcpy(src: number, dst: number): void {\n this.gpuDataManager.memcpy(src, dst);\n }\n\n async download(gpuDataId: number, getTargetBuffer: () => Uint8Array): Promise {\n // the underlying buffer may be changed after the async function is called. so we use a getter function to make sure\n // the buffer is up-to-date.\n await this.gpuDataManager.download(gpuDataId, getTargetBuffer);\n }\n\n alloc(size: number): number {\n return this.gpuDataManager.create(size).id;\n }\n\n free(ptr: number): number {\n return this.gpuDataManager.release(ptr);\n }\n\n createKernel(kernelType: string, kernelId: number, attribute: unknown, kernelName: string): void {\n const op = WEBGPU_OP_RESOLVE_RULES.get(kernelType);\n if (!op) {\n throw new Error(`kernel not implemented: ${kernelType}`);\n }\n\n const kernelInfo: KernelInfo = {\n kernelType,\n kernelName,\n kernelEntry: op[0],\n attributes: [op[1], attribute],\n };\n this.kernels.set(kernelId, kernelInfo);\n }\n\n releaseKernel(kernelId: number): void {\n const persistentData = this.kernelPersistentData.get(kernelId);\n if (persistentData) {\n for (const data of persistentData) {\n this.gpuDataManager.release(data.id);\n }\n this.kernelPersistentData.delete(kernelId);\n }\n\n this.kernelCustomData.delete(kernelId);\n this.kernels.delete(kernelId);\n }\n\n computeKernel(kernelId: number, context: ComputeContext, errors: Array>): number {\n const kernel = this.kernels.get(kernelId);\n if (!kernel) {\n throw new Error(`kernel not created: ${kernelId}`);\n }\n const kernelType = kernel.kernelType;\n const kernelName = kernel.kernelName;\n const kernelEntry = kernel.kernelEntry;\n const attributes = kernel.attributes;\n if (this.currentKernelId !== null) {\n throw new Error(`kernel \"[${kernelType}] ${kernelName}\" is not allowed to be called recursively`);\n }\n this.currentKernelId = kernelId;\n\n // parse attributes if necessary\n if (attributes[0]) {\n attributes[1] = attributes[0](attributes[1]);\n attributes[0] = undefined;\n }\n\n LOG_DEBUG('info', () => `[WebGPU] Start to run kernel \"[${kernelType}] ${kernelName}\"...`);\n\n const useErrorScope = this.env.debug;\n\n this.temporaryData = [];\n try {\n if (useErrorScope) {\n this.device.pushErrorScope('validation');\n }\n\n kernelEntry(context, attributes[1]);\n return 0; // ORT_OK\n } catch (e) {\n errors.push(Promise.resolve(`[WebGPU] Kernel \"[${kernelType}] ${kernelName}\" failed. ${e}`));\n return 1; // ORT_FAIL\n } finally {\n if (useErrorScope) {\n errors.push(this.device.popErrorScope().then(\n err => err ? `GPU validation error for kernel \"[${kernelType}] ${kernelName}\": ${err.message}` : null));\n }\n\n for (const data of this.temporaryData) {\n this.gpuDataManager.release(data.id);\n }\n this.temporaryData = [];\n this.currentKernelId = null;\n }\n }\n\n // #region external buffer\n registerBuffer(sessionId: number, index: number, buffer: GPUBuffer, size: number): number {\n let sessionInputOutputMapping = this.sessionExternalDataMapping.get(sessionId);\n if (!sessionInputOutputMapping) {\n sessionInputOutputMapping = new Map();\n this.sessionExternalDataMapping.set(sessionId, sessionInputOutputMapping);\n }\n\n const previousBuffer = sessionInputOutputMapping.get(index);\n const id = this.gpuDataManager.registerExternalBuffer(buffer, size, previousBuffer?.[1]);\n sessionInputOutputMapping.set(index, [id, buffer]);\n return id;\n }\n unregisterBuffers(sessionId: number): void {\n const sessionInputOutputMapping = this.sessionExternalDataMapping.get(sessionId);\n if (sessionInputOutputMapping) {\n sessionInputOutputMapping.forEach(bufferInfo => this.gpuDataManager.unregisterExternalBuffer(bufferInfo[1]));\n this.sessionExternalDataMapping.delete(sessionId);\n }\n }\n getBuffer(gpuDataId: number): GPUBuffer {\n const gpuData = this.gpuDataManager.get(gpuDataId);\n if (!gpuData) {\n throw new Error(`no GPU data for buffer: ${gpuDataId}`);\n }\n return gpuData.buffer;\n }\n createDownloader(gpuBuffer: GPUBuffer, size: number, type: Tensor.GpuBufferDataTypes):\n () => Promise {\n return async () => {\n const data = await downloadGpuData(this, gpuBuffer, size);\n return createView(data.buffer, type);\n };\n }\n // #endregion\n writeTimestamp(index: number): void {\n if (this.queryType !== 'inside-passes') {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.computePassEncoder as any).writeTimestamp(this.querySet, index);\n }\n setQueryType(): void {\n this.queryType = 'none';\n if (this.env.webgpu.profiling?.mode === 'default' ||\n (typeof this.env.trace === 'undefined' ? this.env.wasm.trace : this.env.trace)) {\n if (this.device.features.has('chromium-experimental-timestamp-query-inside-passes')) {\n this.queryType = 'inside-passes';\n } else if (this.device.features.has('timestamp-query')) {\n this.queryType = 'at-passes';\n }\n\n if (this.queryType !== 'none' && typeof this.querySet === 'undefined') {\n this.querySet = this.device.createQuerySet({\n type: 'timestamp',\n count: this.maxDispatchNumber * 2,\n });\n this.queryResolveBuffer = this.device.createBuffer(\n // eslint-disable-next-line no-bitwise\n {size: this.maxDispatchNumber * 2 * 8, usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.QUERY_RESOLVE});\n }\n }\n }\n\n captureBegin(): void {\n LOG_DEBUG('info', 'captureBegin');\n if (!this.capturedCommandList.get(this.currentSessionId!)) {\n this.capturedCommandList.set(this.currentSessionId!, []);\n }\n if (!this.capturedPendingKernels.get(this.currentSessionId!)) {\n this.capturedPendingKernels.set(this.currentSessionId!, []);\n }\n // flush the left commands before we change the status.\n this.flush();\n this.sessionStatus = 'capturing';\n }\n captureEnd(): void {\n LOG_DEBUG('info', 'captureEnd');\n // flush the left commands before we change the status.\n this.flush();\n this.sessionStatus = 'default';\n }\n replay(): void {\n LOG_DEBUG('info', 'replay');\n this.sessionStatus = 'replaying';\n const sessionCommandList = this.capturedCommandList.get(this.currentSessionId!);\n const sessionPendingKernels = this.capturedPendingKernels.get(this.currentSessionId!);\n const length = sessionCommandList!.length;\n this.pendingKernels = [];\n for (let i = 0; i < length; i++) {\n const computePassEncoder = this.getComputePassEncoder();\n const command = sessionCommandList![i];\n this.writeTimestamp(this.pendingDispatchNumber * 2);\n computePassEncoder.setPipeline(command.computePipeline);\n computePassEncoder.setBindGroup(0, command.bindGroup);\n computePassEncoder.dispatchWorkgroups(...command.dispatchGroup);\n this.writeTimestamp(this.pendingDispatchNumber * 2 + 1);\n this.pendingDispatchNumber++;\n if (this.queryType !== 'none') {\n this.pendingKernels.push(sessionPendingKernels![i]);\n }\n if (this.pendingDispatchNumber >= this.maxDispatchNumber || this.queryType === 'at-passes') {\n this.endComputePass();\n }\n if (this.pendingDispatchNumber >= this.maxDispatchNumber) {\n this.flush();\n }\n }\n // flush the left commands before we change the status.\n this.flush();\n this.sessionStatus = 'default';\n }\n\n onReleaseSession(sessionId: number): void {\n this.unregisterBuffers(sessionId);\n if (this.capturedCommandList.has(sessionId)) {\n this.capturedCommandList.delete(sessionId);\n }\n if (this.capturedPendingKernels.has(sessionId)) {\n this.capturedPendingKernels.delete(sessionId);\n }\n this.gpuDataManager.onReleaseSession(sessionId);\n }\n\n onRunStart(sessionId: number): void {\n this.currentSessionId = sessionId;\n this.setQueryType();\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Env} from 'onnxruntime-common';\n\nimport {OrtWasmModule} from '../binding/ort-wasm';\nimport {DataType, getTensorElementSize} from '../wasm-common';\n\nimport {WebGpuBackend} from './backend-webgpu';\nimport {LOG_DEBUG} from './log';\nimport {TensorView} from './tensor-view';\nimport {ShapeUtil} from './util';\nimport {AdapterInfo, ComputeContext, ComputeContextInputsOutputsMapping, ProgramInfo} from './webgpu/types';\n\n/* eslint-disable no-bitwise */\n\nclass TensorViewImpl implements TensorView {\n constructor(\n private module: OrtWasmModule, public readonly dataType: number, public readonly data: number,\n public readonly dims: readonly number[]) {}\n\n getFloat32Array(): Float32Array {\n if (this.dataType !== DataType.float) {\n throw new Error('Invalid data type');\n }\n const elementCount = ShapeUtil.size(this.dims);\n return elementCount === 0 ? new Float32Array() :\n new Float32Array(this.module.HEAP8.buffer, this.data, elementCount);\n }\n\n getBigInt64Array(): BigInt64Array {\n if (this.dataType !== DataType.int64) {\n throw new Error('Invalid data type');\n }\n const elementCount = ShapeUtil.size(this.dims);\n return elementCount === 0 ? new BigInt64Array() :\n new BigInt64Array(this.module.HEAP8.buffer, this.data, elementCount);\n }\n\n getInt32Array(): Int32Array {\n if (this.dataType !== DataType.int32) {\n throw new Error('Invalid data type');\n }\n const elementCount = ShapeUtil.size(this.dims);\n return elementCount === 0 ? new Int32Array() : new Int32Array(this.module.HEAP8.buffer, this.data, elementCount);\n }\n\n reshape(newDims: readonly number[]): TensorView {\n if (ShapeUtil.size(newDims) !== ShapeUtil.size(this.dims)) {\n throw new Error('Invalid new shape');\n }\n return new TensorViewImpl(this.module, this.dataType, this.data, newDims);\n }\n}\n\nclass ComputeContextImpl implements ComputeContext {\n readonly adapterInfo: AdapterInfo;\n readonly opKernelContext: number;\n readonly inputs: readonly TensorView[];\n readonly outputCount: number;\n get kernelCustomData(): {[key: string]: unknown} {\n return this.backend.currentKernelCustomData;\n }\n get customDataBuffer(): Uint8Array {\n return this.module.HEAPU8.subarray(this.customDataOffset, this.customDataOffset + this.customDataSize);\n }\n private customDataOffset = 0;\n private customDataSize = 0;\n constructor(private module: OrtWasmModule, private backend: WebGpuBackend, contextDataOffset: number) {\n this.adapterInfo = backend.adapterInfo;\n const heapU32 = module.HEAPU32;\n\n // extract context data\n let dataIndex = (contextDataOffset >>> 2);\n this.opKernelContext = heapU32[dataIndex++];\n const inputCount = heapU32[dataIndex++];\n this.outputCount = heapU32[dataIndex++];\n this.customDataOffset = heapU32[dataIndex++];\n this.customDataSize = heapU32[dataIndex++];\n\n const inputs: TensorView[] = [];\n for (let i = 0; i < inputCount; i++) {\n const dataType = heapU32[dataIndex++];\n const data = heapU32[dataIndex++];\n const dim = heapU32[dataIndex++];\n const dims: number[] = [];\n for (let d = 0; d < dim; d++) {\n dims.push(heapU32[dataIndex++]);\n }\n inputs.push(new TensorViewImpl(module, dataType, data, dims));\n }\n this.inputs = inputs;\n }\n\n getMaxComputeWorkgroupSizes(): [number, number, number] {\n return [\n this.backend.device.limits.maxComputeWorkgroupSizeX, this.backend.device.limits.maxComputeWorkgroupSizeY,\n this.backend.device.limits.maxComputeWorkgroupSizeZ\n ];\n }\n\n getMaxComputeWorkgroupStoragesize(): number {\n return this.backend.device.limits.maxComputeWorkgroupStorageSize;\n }\n\n compute(program: ProgramInfo, inputsOutputsMapping?: ComputeContextInputsOutputsMapping): TensorView[] {\n // prepare inputs. inputs should always be valid data.\n const mappedInputs =\n inputsOutputsMapping?.inputs?.map(i => typeof i === 'number' ? this.inputs[i] : i) ?? this.inputs;\n // prepare outputs.\n const outputIndices = inputsOutputsMapping?.outputs ?? [];\n const createKernelOutput = (index: number, dataType: number, dims: readonly number[]): TensorView =>\n new TensorViewImpl(this.module, dataType, this.output(index, dims), dims);\n const createTemporaryOutput = (dataType: number, dims: readonly number[]): TensorView => {\n const elementSize = getTensorElementSize(dataType);\n if (!elementSize) {\n throw new Error(`Unsupported data type: ${dataType}`);\n }\n const bufferSize = elementSize * ShapeUtil.size(dims);\n const gpuDataId = bufferSize > 0 ? this.backend.gpuDataManager.create(bufferSize).id : 0;\n return new TensorViewImpl(this.module, dataType, gpuDataId, dims);\n };\n return this.backend.run(\n program, mappedInputs, outputIndices, createKernelOutput, createTemporaryOutput, this.outputCount);\n }\n\n output(index: number, dims: readonly number[]): number {\n const stack = this.module.stackSave();\n try {\n const data = this.module.stackAlloc((1 + dims.length) * 4 /* sizeof(size_t) */);\n let offset = data >> 2;\n this.module.HEAPU32[offset++] = dims.length;\n for (let i = 0; i < dims.length; i++) {\n this.module.HEAPU32[offset++] = dims[i];\n }\n return this.module._JsepOutput!(this.opKernelContext, index, data);\n } catch (e) {\n throw new Error(\n `Failed to generate kernel's output[${index}] with dims [${dims}]. ` +\n 'If you are running with pre-allocated output, please make sure the output type/dims are correct. ' +\n `Error: ${e}`);\n } finally {\n this.module.stackRestore(stack);\n }\n }\n}\n\n/**\n * Initialize JSEP with WebGPU backend.\n *\n * This function will be called after the WebAssembly module is loaded and initialized (\"_OrtInit\" is called), once for\n * each of the following EPs if they are specified:\n * - \"webgpu\"\n * - \"webnn\"\n *\n * For WebGPU, this function expects:\n * - WebGPU is enabled in build (BUILD_DEFS.DISABLE_WEBGPU === false).\n * - WebGPU is available in current environment. (a valid GPUAdapter is passed in)\n *\n * For WebNN, this function expects:\n * - WebNN is enabled in build (BUILD_DEFS.DISABLE_WEBGPU === false).\n * - WebNN is available in current environment. (navigator.ml is not undefined)\n *\n * If the WebAssembly module is not built with JSEP support, this function will throw an error. This will invalidate\n * 'webgpu'/'webnn' backend.\n *\n * @param name - the name of the EP, either \"webgpu\" or \"webnn\"\n * @param module - the ORT WebAssembly module\n * @param env - the ORT environment variable (ort.env)\n * @param gpuAdapter - the pre-created GPU adapter\n */\nexport const init =\n async(name: 'webgpu'|'webnn', module: OrtWasmModule, env: Env, gpuAdapter?: GPUAdapter): Promise => {\n const jsepInit = module.jsepInit;\n if (!jsepInit) {\n throw new Error('Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.');\n }\n\n if (name === 'webgpu') {\n const backend = new WebGpuBackend();\n await backend.initialize(env, gpuAdapter!);\n\n jsepInit('webgpu', [\n // backend\n backend,\n\n // jsepAlloc()\n (size: number) => backend.alloc(size),\n\n // jsepFree()\n (ptr: number) => backend.free(ptr),\n\n // jsepCopy(src, dst, size, isSourceGpu)\n (src: number, dst: number, size: number, isSourceGpu = false) => {\n if (isSourceGpu) {\n LOG_DEBUG('verbose', () => `[WebGPU] jsepCopyGpuToGpu: src=${src}, dst=${dst}, size=${size}`);\n backend.memcpy(src, dst);\n } else {\n LOG_DEBUG('verbose', () => `[WebGPU] jsepCopyCpuToGpu: dataOffset=${src}, gpuDataId=${dst}, size=${size}`);\n const data = module.HEAPU8.subarray(src >>> 0, (src >>> 0) + size);\n backend.upload(dst, data);\n }\n },\n\n // jsepCopyAsync(src, dst, size)\n async(gpuDataId: number, dataOffset: number, size: number):\n Promise => {\n LOG_DEBUG(\n 'verbose',\n () => `[WebGPU] jsepCopyGpuToCpu: gpuDataId=${gpuDataId}, dataOffset=${dataOffset}, size=${size}`);\n\n await backend.download(\n gpuDataId, () => module.HEAPU8.subarray(dataOffset >>> 0, (dataOffset >>> 0) + size));\n },\n\n // jsepCreateKernel\n (kernelType: string, kernelId: number, attribute: unknown) => backend.createKernel(\n kernelType, kernelId, attribute, module.UTF8ToString(module._JsepGetNodeName!(kernelId))),\n\n // jsepReleaseKernel\n (kernel: number) => backend.releaseKernel(kernel),\n\n // jsepRun\n (kernel: number, contextDataOffset: number, sessionHandle: number, errors: Array>) => {\n LOG_DEBUG(\n 'verbose',\n () => `[WebGPU] jsepRun: sessionHandle=${sessionHandle}, kernel=${kernel}, contextDataOffset=${\n contextDataOffset}`);\n const context = new ComputeContextImpl(module, backend, contextDataOffset);\n return backend.computeKernel(kernel, context, errors);\n },\n // jsepCaptureBegin\n () => backend.captureBegin(),\n // jsepCaptureEnd\n () => backend.captureEnd(),\n // jsepReplay\n () => backend.replay()\n ]);\n } else {\n jsepInit('webnn');\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 Ai=Object.defineProperty;var kh=Object.getOwnPropertyDescriptor;var Oh=Object.getOwnPropertyNames;var Rh=Object.prototype.hasOwnProperty;var ae=(e,r)=>()=>(e&&(r=e(e=0)),r);var un=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Hn=(e,r)=>{for(var t in r)Ai(e,t,{get:r[t],enumerable:!0})},Bh=(e,r,t,u)=>{if(r&&typeof r==\"object\"||typeof r==\"function\")for(let s of Oh(r))!Rh.call(e,s)&&s!==t&&Ai(e,s,{get:()=>r[s],enumerable:!(u=kh(r,s))||u.enumerable});return e};var ir=e=>Bh(Ai({},\"__esModule\",{value:!0}),e);var Ln={};Hn(Ln,{createReadStream:()=>qs,readFile:()=>Dh,readFileSync:()=>zh});var Dh,zh,qs,Fn=ae(()=>{Dh=void 0,zh=void 0,qs=void 0});var Ti={};Hn(Ti,{join:()=>Mh});var Mh,Ei=ae(()=>{Mh=void 0});var Zs=un((Ys,Pi)=>{\"use strict\";var Ks=(()=>{var e=typeof document<\"u\"?document.currentScript?.src:void 0;return typeof __filename<\"u\"&&(e||=__filename),function(r={}){var t=r,u,s,c=new Promise((n,i)=>{u=n,s=i});t.mountExternalData=(n,i)=>{(t.Ph||(t.Ph=new Map)).set(n,i)},t.unmountExternalData=()=>{delete t.Ph};let f=()=>{let n=(o,a,l)=>(...p)=>{let h=yt,y=a?.();p=o(...p);let b=a?.();return y!==b&&(o=b,l(y),a=l=null),yt!=h?Tn():p},i=o=>async(...a)=>{try{if(t.Oh)throw Error(\"Session already started\");let l=t.Oh={gi:a[0],errors:[]},p=await o(...a);if(t.Oh!==l)throw Error(\"Session mismatch\");t.Uh?.flush();let h=l.errors;if(0b),0t._OrtCreateSession,o=>t._OrtCreateSession=o),t._OrtRun=i(n(t._OrtRun,()=>t._OrtRun,o=>t._OrtRun=o)),t._OrtRunWithBinding=i(n(t._OrtRunWithBinding,()=>t._OrtRunWithBinding,o=>t._OrtRunWithBinding=o)),t._OrtBindInput=n(t._OrtBindInput,()=>t._OrtBindInput,o=>t._OrtBindInput=o),f=void 0};t.jsepInit=(n,i)=>{if(f?.(),n===\"webgpu\"){[t.Uh,t.Zh,t.ci,t.Vh,t.bi,t.je,t.di,t.fi,t.$h,t.ai,t.ei]=i;let o=t.Uh;t.jsepRegisterBuffer=(a,l,p,h)=>o.registerBuffer(a,l,p,h),t.jsepGetBuffer=a=>o.getBuffer(a),t.jsepCreateDownloader=(a,l,p)=>o.createDownloader(a,l,p),t.jsepOnReleaseSession=a=>{o.onReleaseSession(a)},t.jsepOnRunStart=a=>o.onRunStart(a)}};var d=Object.assign({},t),g=\"./this.program\",w=(n,i)=>{throw i},C=typeof window==\"object\",$=typeof importScripts==\"function\",A=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",P=\"\",x,E,O;if(A){var B=(Fn(),ir(Ln)),R=(Ei(),ir(Ti));P=$?R.dirname(P)+\"/\":__dirname+\"/\",x=(n,i)=>(n=tt(n)?new URL(n):R.normalize(n),B.readFileSync(n,i?void 0:\"utf8\")),O=n=>(n=x(n,!0),n.buffer||(n=new Uint8Array(n)),n),E=(n,i,o,a=!0)=>{n=tt(n)?new URL(n):R.normalize(n),B.readFile(n,a?void 0:\"utf8\",(l,p)=>{l?o(l):i(a?p.buffer:p)})},!t.thisProgram&&1{throw process.exitCode=n,i}}else(C||$)&&($?P=self.location.href:typeof document<\"u\"&&document.currentScript&&(P=document.currentScript.src),e&&(P=e),P.startsWith(\"blob:\")?P=\"\":P=P.substr(0,P.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1),x=n=>{var i=new XMLHttpRequest;return i.open(\"GET\",n,!1),i.send(null),i.responseText},$&&(O=n=>{var i=new XMLHttpRequest;return i.open(\"GET\",n,!1),i.responseType=\"arraybuffer\",i.send(null),new Uint8Array(i.response)}),E=(n,i,o)=>{var a=new XMLHttpRequest;a.open(\"GET\",n,!0),a.responseType=\"arraybuffer\",a.onload=()=>{a.status==200||a.status==0&&a.response?i(a.response):o()},a.onerror=o,a.send(null)});var j=console.log.bind(console),U=console.error.bind(console);Object.assign(t,d),d=null;var L,F=!1,te,J,oe,le,ge,X,pe,we,ue,me,Ee;function Pe(){var n=L.buffer;t.HEAP8=J=new Int8Array(n),t.HEAP16=le=new Int16Array(n),t.HEAPU8=oe=new Uint8Array(n),t.HEAPU16=ge=new Uint16Array(n),t.HEAP32=X=new Int32Array(n),t.HEAPU32=pe=new Uint32Array(n),t.HEAPF32=we=new Float32Array(n),t.HEAPF64=Ee=new Float64Array(n),t.HEAP64=ue=new BigInt64Array(n),t.HEAPU64=me=new BigUint64Array(n)}var Ce=[],be=[],Ae=[],_e=0,Je=null,ee=null;function ce(n){throw n=\"Aborted(\"+n+\")\",U(n),F=!0,te=1,n=new WebAssembly.RuntimeError(n+\". Build with -sASSERTIONS for more info.\"),s(n),n}var Be=n=>n.startsWith(\"data:application/octet-stream;base64,\"),tt=n=>n.startsWith(\"file://\"),Ye;if(Ye=\"ort-wasm-simd.wasm\",!Be(Ye)){var Ke=Ye;Ye=t.locateFile?t.locateFile(Ke,P):P+Ke}function Pt(n){if(O)return O(n);throw\"both async and sync fetching of the wasm failed\"}function Ze(n){if(C||$){if(typeof fetch==\"function\"&&!tt(n))return fetch(n,{credentials:\"same-origin\"}).then(i=>{if(!i.ok)throw`failed to load wasm binary file at '${n}'`;return i.arrayBuffer()}).catch(()=>Pt(n));if(E)return new Promise((i,o)=>{E(n,a=>i(new Uint8Array(a)),o)})}return Promise.resolve().then(()=>Pt(n))}function rt(n,i,o){return Ze(n).then(a=>WebAssembly.instantiate(a,i)).then(o,a=>{U(`failed to asynchronously prepare wasm: ${a}`),ce(a)})}function ct(n,i){var o=Ye;return typeof WebAssembly.instantiateStreaming!=\"function\"||Be(o)||tt(o)||A||typeof fetch!=\"function\"?rt(o,n,i):fetch(o,{credentials:\"same-origin\"}).then(a=>WebAssembly.instantiateStreaming(a,n).then(i,function(l){return U(`wasm streaming compile failed: ${l}`),U(\"falling back to ArrayBuffer instantiation\"),rt(o,n,i)}))}var Ut={1261504:(n,i,o,a)=>{if(typeof t>\"u\"||!t.Ph)return 1;if(n=qe(n>>>0),n.startsWith(\"./\")&&(n=n.substring(2)),n=t.Ph.get(n),!n)return 2;if(i>>>=0,o>>>=0,i+o>n.byteLength)return 3;try{return oe.set(n.subarray(i,i+o),a>>>0>>>0),0}catch{return 4}},1262005:(n,i,o)=>{o=qe(o);let a=new Uint8Array(i);a.set(oe.subarray(n>>>0,n+i>>>0)),typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\"?(Fn(),ir(Ln)).writeFileSync(o,a):(n=new File([a],o,{type:\"application/octet-stream\"}),n=URL.createObjectURL(n),window.open(n,\"_blank\"))},1262513:()=>{t.$h()},1262544:()=>{t.ai()},1262573:()=>{t.ei()},1262598:n=>t.Zh(n),1262631:n=>t.ci(n),1262663:(n,i,o)=>{t.Vh(n,i,o,!0)},1262702:(n,i,o)=>{t.Vh(n,i,o)},1262735:n=>{t.je(\"Abs\",n,void 0)},1262786:n=>{t.je(\"Neg\",n,void 0)},1262837:n=>{t.je(\"Floor\",n,void 0)},1262890:n=>{t.je(\"Ceil\",n,void 0)},1262942:n=>{t.je(\"Reciprocal\",n,void 0)},1263e3:n=>{t.je(\"Sqrt\",n,void 0)},1263052:n=>{t.je(\"Exp\",n,void 0)},1263103:n=>{t.je(\"Erf\",n,void 0)},1263154:n=>{t.je(\"Sigmoid\",n,void 0)},1263209:(n,i,o)=>{t.je(\"HardSigmoid\",n,{alpha:i,beta:o})},1263288:n=>{t.je(\"Log\",n,void 0)},1263339:n=>{t.je(\"Sin\",n,void 0)},1263390:n=>{t.je(\"Cos\",n,void 0)},1263441:n=>{t.je(\"Tan\",n,void 0)},1263492:n=>{t.je(\"Asin\",n,void 0)},1263544:n=>{t.je(\"Acos\",n,void 0)},1263596:n=>{t.je(\"Atan\",n,void 0)},1263648:n=>{t.je(\"Sinh\",n,void 0)},1263700:n=>{t.je(\"Cosh\",n,void 0)},1263752:n=>{t.je(\"Asinh\",n,void 0)},1263805:n=>{t.je(\"Acosh\",n,void 0)},1263858:n=>{t.je(\"Atanh\",n,void 0)},1263911:n=>{t.je(\"Tanh\",n,void 0)},1263963:n=>{t.je(\"Not\",n,void 0)},1264014:(n,i,o)=>{t.je(\"Clip\",n,{min:i,max:o})},1264083:n=>{t.je(\"Clip\",n,void 0)},1264135:(n,i)=>{t.je(\"Elu\",n,{alpha:i})},1264193:n=>{t.je(\"Relu\",n,void 0)},1264245:(n,i)=>{t.je(\"LeakyRelu\",n,{alpha:i})},1264309:(n,i)=>{t.je(\"ThresholdedRelu\",n,{alpha:i})},1264379:(n,i)=>{t.je(\"Cast\",n,{to:i})},1264437:n=>{t.je(\"Add\",n,void 0)},1264488:n=>{t.je(\"Sub\",n,void 0)},1264539:n=>{t.je(\"Mul\",n,void 0)},1264590:n=>{t.je(\"Div\",n,void 0)},1264641:n=>{t.je(\"Pow\",n,void 0)},1264692:n=>{t.je(\"Equal\",n,void 0)},1264745:n=>{t.je(\"Greater\",n,void 0)},1264800:n=>{t.je(\"GreaterOrEqual\",n,void 0)},1264862:n=>{t.je(\"Less\",n,void 0)},1264914:n=>{t.je(\"LessOrEqual\",n,void 0)},1264973:(n,i,o,a,l)=>{t.je(\"ReduceMean\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1265132:(n,i,o,a,l)=>{t.je(\"ReduceMax\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1265290:(n,i,o,a,l)=>{t.je(\"ReduceMin\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1265448:(n,i,o,a,l)=>{t.je(\"ReduceProd\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1265607:(n,i,o,a,l)=>{t.je(\"ReduceSum\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1265765:(n,i,o,a,l)=>{t.je(\"ReduceL1\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1265922:(n,i,o,a,l)=>{t.je(\"ReduceL2\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1266079:(n,i,o,a,l)=>{t.je(\"ReduceLogSum\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1266240:(n,i,o,a,l)=>{t.je(\"ReduceSumSquare\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1266404:(n,i,o,a,l)=>{t.je(\"ReduceLogSumExp\",n,{keepDims:!!i,noopWithEmptyAxes:!!o,axes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1266568:n=>{t.je(\"Where\",n,void 0)},1266621:(n,i,o)=>{t.je(\"Transpose\",n,{perm:i?Array.from(X.subarray(i>>>0,o>>>0)):[]})},1266729:(n,i,o,a)=>{t.je(\"DepthToSpace\",n,{blocksize:i,mode:qe(o),format:a?\"NHWC\":\"NCHW\"})},1266862:(n,i,o,a)=>{t.je(\"DepthToSpace\",n,{blocksize:i,mode:qe(o),format:a?\"NHWC\":\"NCHW\"})},1266995:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)=>{t.je(\"ConvTranspose\",n,{format:b?\"NHWC\":\"NCHW\",autoPad:i,dilations:[o],group:a,kernelShape:[l],pads:[p,h],strides:[y],wIsConst:()=>!!J[_>>>0],outputPadding:S?Array.from(X.subarray(S>>>0,k>>>0)):[],outputShape:z?Array.from(X.subarray(z>>>0,T>>>0)):[],activation:qe(V)})},1267396:(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>{t.je(\"ConvTranspose\",n,{format:y?\"NHWC\":\"NCHW\",autoPad:i,dilations:Array.from(X.subarray(o>>>0,(o>>>0)+2>>>0)),group:a,kernelShape:Array.from(X.subarray(l>>>0,(l>>>0)+2>>>0)),pads:Array.from(X.subarray(p>>>0,(p>>>0)+4>>>0)),strides:Array.from(X.subarray(h>>>0,(h>>>0)+2>>>0)),wIsConst:()=>!!J[b>>>0],outputPadding:_?Array.from(X.subarray(_>>>0,S>>>0)):[],outputShape:k?Array.from(X.subarray(k>>>0,z>>>0)):[],activation:qe(T)})},1267961:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)=>{t.je(\"ConvTranspose\",n,{format:b?\"NHWC\":\"NCHW\",autoPad:i,dilations:[o],group:a,kernelShape:[l],pads:[p,h],strides:[y],wIsConst:()=>!!J[_>>>0],outputPadding:S?Array.from(X.subarray(S>>>0,k>>>0)):[],outputShape:z?Array.from(X.subarray(z>>>0,T>>>0)):[],activation:qe(V)})},1268362:(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>{t.je(\"ConvTranspose\",n,{format:y?\"NHWC\":\"NCHW\",autoPad:i,dilations:Array.from(X.subarray(o>>>0,(o>>>0)+2>>>0)),group:a,kernelShape:Array.from(X.subarray(l>>>0,(l>>>0)+2>>>0)),pads:Array.from(X.subarray(p>>>0,(p>>>0)+4>>>0)),strides:Array.from(X.subarray(h>>>0,(h>>>0)+2>>>0)),wIsConst:()=>!!J[b>>>0],outputPadding:_?Array.from(X.subarray(_>>>0,S>>>0)):[],outputShape:k?Array.from(X.subarray(k>>>0,z>>>0)):[],activation:qe(T)})},1268927:(n,i)=>{t.je(\"GlobalAveragePool\",n,{format:i?\"NHWC\":\"NCHW\"})},1269018:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)=>{t.je(\"AveragePool\",n,{format:Y?\"NHWC\":\"NCHW\",auto_pad:i,ceil_mode:o,count_include_pad:a,storage_order:l,dilations:[p,h],kernel_shape:[y,b],pads:[_,S,k,z],strides:[T,V]})},1269302:(n,i)=>{t.je(\"GlobalAveragePool\",n,{format:i?\"NHWC\":\"NCHW\"})},1269393:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)=>{t.je(\"AveragePool\",n,{format:Y?\"NHWC\":\"NCHW\",auto_pad:i,ceil_mode:o,count_include_pad:a,storage_order:l,dilations:[p,h],kernel_shape:[y,b],pads:[_,S,k,z],strides:[T,V]})},1269677:(n,i)=>{t.je(\"GlobalMaxPool\",n,{format:i?\"NHWC\":\"NCHW\"})},1269764:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)=>{t.je(\"MaxPool\",n,{format:Y?\"NHWC\":\"NCHW\",auto_pad:i,ceil_mode:o,count_include_pad:a,storage_order:l,dilations:[p,h],kernel_shape:[y,b],pads:[_,S,k,z],strides:[T,V]})},1270044:(n,i)=>{t.je(\"GlobalMaxPool\",n,{format:i?\"NHWC\":\"NCHW\"})},1270131:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)=>{t.je(\"MaxPool\",n,{format:Y?\"NHWC\":\"NCHW\",auto_pad:i,ceil_mode:o,count_include_pad:a,storage_order:l,dilations:[p,h],kernel_shape:[y,b],pads:[_,S,k,z],strides:[T,V]})},1270411:(n,i,o,a,l)=>{t.je(\"Gemm\",n,{alpha:i,beta:o,transA:a,transB:l})},1270515:n=>{t.je(\"MatMul\",n,void 0)},1270569:(n,i,o,a)=>{t.je(\"ArgMax\",n,{keepDims:!!i,selectLastIndex:!!o,axis:a})},1270677:(n,i,o,a)=>{t.je(\"ArgMin\",n,{keepDims:!!i,selectLastIndex:!!o,axis:a})},1270785:(n,i)=>{t.je(\"Softmax\",n,{axis:i})},1270848:(n,i)=>{t.je(\"Concat\",n,{axis:i})},1270908:(n,i,o,a,l)=>{t.je(\"Split\",n,{axis:i,numOutputs:o,splitSizes:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1271048:n=>{t.je(\"Expand\",n,void 0)},1271102:(n,i)=>{t.je(\"Gather\",n,{axis:Number(i)})},1271173:(n,i)=>{t.je(\"GatherElements\",n,{axis:Number(i)})},1271252:(n,i,o,a,l,p,h,y,b,_,S)=>{t.je(\"Resize\",n,{antialias:i,axes:o?Array.from(X.subarray(o>>>0,a>>>0)):[],coordinateTransformMode:qe(l),cubicCoeffA:p,excludeOutside:h,extrapolationValue:y,keepAspectRatioPolicy:qe(b),mode:qe(_),nearestMode:qe(S)})},1271598:(n,i,o,a,l,p,h)=>{t.je(\"Slice\",n,{starts:i?Array.from(X.subarray(i>>>0,o>>>0)):[],ends:a?Array.from(X.subarray(a>>>0,l>>>0)):[],axes:p?Array.from(X.subarray(p>>>0,h>>>0)):[]})},1271814:n=>{t.je(\"Tile\",n,void 0)},1271866:(n,i,o,a)=>{t.je(\"LayerNormalization\",n,{axis:i,epsilon:o,simplified:!!a})},1271977:(n,i,o)=>{t.je(\"InstanceNormalization\",n,{epsilon:i,format:o?\"NHWC\":\"NCHW\"})},1272091:(n,i,o)=>{t.je(\"InstanceNormalization\",n,{epsilon:i,format:o?\"NHWC\":\"NCHW\"})},1272205:n=>{t.je(\"Range\",n,void 0)},1272258:(n,i)=>{t.je(\"Einsum\",n,{equation:qe(i)})},1272339:(n,i,o,a,l)=>{t.je(\"Pad\",n,{mode:i,value:o,pads:a?Array.from(X.subarray(a>>>0,l>>>0)):[]})},1272466:(n,i,o,a,l,p)=>{t.je(\"BatchNormalization\",n,{epsilon:i,momentum:o,spatial:!!l,trainingMode:!!a,format:p?\"NHWC\":\"NCHW\"})},1272635:(n,i,o,a,l,p)=>{t.je(\"BatchNormalization\",n,{epsilon:i,momentum:o,spatial:!!l,trainingMode:!!a,format:p?\"NHWC\":\"NCHW\"})},1272804:(n,i,o)=>{t.je(\"CumSum\",n,{exclusive:Number(i),reverse:Number(o)})},1272901:(n,i,o,a,l,p,h,y,b)=>{t.je(\"Attention\",n,{numHeads:i,isUnidirectional:o,maskFilterValue:a,scale:l,doRotary:p,qkvHiddenSizes:h?Array.from(X.subarray(Number(y)>>>0,Number(y)+h>>>0)):[],pastPresentShareBuffer:!!b})},1273173:n=>{t.je(\"BiasAdd\",n,void 0)},1273228:n=>{t.je(\"BiasSplitGelu\",n,void 0)},1273289:n=>{t.je(\"FastGelu\",n,void 0)},1273345:(n,i,o,a,l,p,h,y,b,_,S,k,z)=>{t.je(\"Conv\",n,{format:b?\"NHWC\":\"NCHW\",auto_pad:i,dilations:[o],group:a,kernel_shape:[l],pads:p?Array.from(X.subarray(p>>>0,h>>>0)):[],strides:[y],w_is_const:()=>!!J[_>>>0],activation:qe(S),activation_params:k?Array.from(we.subarray(k>>>0,z>>>0)):[]})},1273715:(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)=>{t.je(\"Conv\",n,{format:k?\"NHWC\":\"NCHW\",auto_pad:i,dilations:[o,a],group:l,kernel_shape:[p,h],pads:y?Array.from(X.subarray(y>>>0,b>>>0)):[],strides:[_,S],w_is_const:()=>!!J[z>>>0],activation:qe(T),activation_params:V?Array.from(we.subarray(V>>>0,Y>>>0)):[]})},1274106:n=>{t.je(\"Gelu\",n,void 0)},1274158:(n,i,o,a,l,p)=>{t.je(\"MatMulNBits\",n,{k:i,n:o,accuracyLevel:a,bits:l,blockSize:p})},1274285:(n,i,o,a,l,p)=>{t.je(\"MultiHeadAttention\",n,{numHeads:i,isUnidirectional:o,maskFilterValue:a,scale:l,doRotary:p})},1274444:(n,i,o,a,l)=>{t.je(\"RotaryEmbedding\",n,{interleaved:!!i,numHeads:o,rotaryEmbeddingDim:a,scale:l})},1274583:(n,i,o)=>{t.je(\"SkipLayerNormalization\",n,{epsilon:i,simplified:!!o})},1274685:(n,i,o)=>{t.je(\"SkipLayerNormalization\",n,{epsilon:i,simplified:!!o})},1274787:(n,i,o,a)=>{t.je(\"LayerNormalization\",n,{axis:i,epsilon:o,simplified:!!a})},1274898:n=>{t.di(n)},1274932:(n,i)=>t.fi(n,i,t.Oh.gi,t.Oh.errors)};function Vt(n){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${n})`,this.status=n}var pt=[],qt=0,ut=0;class cr{constructor(i){this.Nh=i,this.Ih=i-24}}var fr=n=>{var i=ut;if(!i)return er(0),0;var o=new cr(i);pe[o.Ih+16>>>2>>>0]=i;var a=pe[o.Ih+4>>>2>>>0];if(!a)return er(0),i;for(var l in n){var p=n[l];if(p===0||p===a)break;if(Vn(p,a,o.Ih+16))return er(p),i}return er(a),i},zr=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,hn=(n,i,o)=>{i>>>=0;var a=i+o;for(o=i;n[o]&&!(o>=a);)++o;if(16l?a+=String.fromCharCode(l):(l-=65536,a+=String.fromCharCode(55296|l>>10,56320|l&1023))}}else a+=String.fromCharCode(l)}return a},qe=(n,i)=>(n>>>=0)?hn(oe,n,i):\"\",Kt=n=>{for(var i=0,o=0;o=a?i++:2047>=a?i+=2:55296<=a&&57343>=a?(i+=4,++o):i+=3}return i},vt=(n,i,o,a)=>{if(o>>>=0,!(0=h){var y=n.charCodeAt(++p);h=65536+((h&1023)<<10)|y&1023}if(127>=h){if(o>=a)break;i[o++>>>0]=h}else{if(2047>=h){if(o+1>=a)break;i[o++>>>0]=192|h>>6}else{if(65535>=h){if(o+2>=a)break;i[o++>>>0]=224|h>>12}else{if(o+3>=a)break;i[o++>>>0]=240|h>>18,i[o++>>>0]=128|h>>12&63}i[o++>>>0]=128|h>>6&63}i[o++>>>0]=128|h&63}}return i[o>>>0]=0,o-l},pr,mt=n=>{for(var i=\"\";oe[n>>>0];)i+=pr[oe[n++>>>0]];return i},mr={},hr={},gn={},it;function yn(n,i,o={}){var a=i.name;if(!n)throw new it(`type \"${a}\" must have a positive integer typeid pointer`);if(hr.hasOwnProperty(n)){if(o.Xh)return;throw new it(`Cannot register type '${a}' twice`)}hr[n]=i,delete gn[n],mr.hasOwnProperty(n)&&(i=mr[n],delete mr[n],i.forEach(l=>l()))}function ht(n,i,o={}){if(!(\"argPackAdvance\"in i))throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");return yn(n,i,o)}var Se=(n,i,o)=>{switch(i){case 1:return o?a=>J[a>>>0]:a=>oe[a>>>0];case 2:return o?a=>le[a>>>1>>>0]:a=>ge[a>>>1>>>0];case 4:return o?a=>X[a>>>2>>>0]:a=>pe[a>>>2>>>0];case 8:return o?a=>ue[a>>>3]:a=>me[a>>>3];default:throw new TypeError(`invalid integer width (${i}): ${n}`)}},Wt=[],wt=[];function Mr(n){n>>>=0,9{if(!n)throw new it(\"Cannot use deleted val. handle = \"+n);return wt[n]},gt=n=>{switch(n){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let i=Wt.pop()||wt.length;return wt[i]=n,wt[i+1]=1,i}};function gr(n){return this.fromWireType(pe[n>>>2>>>0])}var bn={name:\"emscripten::val\",fromWireType:n=>{var i=ot(n);return Mr(n),i},toWireType:(n,i)=>gt(i),argPackAdvance:8,readValueFromPointer:gr,Mh:null},vn=(n,i)=>{switch(i){case 4:return function(o){return this.fromWireType(we[o>>>2>>>0])};case 8:return function(o){return this.fromWireType(Ee[o>>>3>>>0])};default:throw new TypeError(`invalid float width (${i}): ${n}`)}},jr=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0,Ur=(n,i)=>{for(var o=n>>1,a=o+i/2;!(o>=a)&&ge[o>>>0];)++o;if(o<<=1,32>>0,o>>>0));for(o=\"\",a=0;!(a>=i/2);++a){var l=le[n+2*a>>>1>>>0];if(l==0)break;o+=String.fromCharCode(l)}return o},wn=(n,i,o)=>{if(o??=2147483647,2>o)return 0;o-=2;var a=i;o=o<2*n.length?o/2:n.length;for(var l=0;l>>1>>>0]=n.charCodeAt(l),i+=2;return le[i>>>1>>>0]=0,i-a},_n=n=>2*n.length,$n=(n,i)=>{for(var o=0,a=\"\";!(o>=i/4);){var l=X[n+4*o>>>2>>>0];if(l==0)break;++o,65536<=l?(l-=65536,a+=String.fromCharCode(55296|l>>10,56320|l&1023)):a+=String.fromCharCode(l)}return a},Cn=(n,i,o)=>{if(i>>>=0,o??=2147483647,4>o)return 0;var a=i;o=a+o-4;for(var l=0;l=p){var h=n.charCodeAt(++l);p=65536+((p&1023)<<10)|h&1023}if(X[i>>>2>>>0]=p,i+=4,i+4>o)break}return X[i>>>2>>>0]=0,i-a},Sn=n=>{for(var i=0,o=0;o=a&&++o,i+=4}return i},yr=(n,i)=>{var o=hr[n];if(o===void 0)throw n=qr(n),o=mt(n),_t(n),new it(`${i} has unknown type ${o}`);return o},Vr=(n,i,o)=>{var a=[];return n=n.toWireType(a,o),a.length&&(pe[i>>>2>>>0]=gt(a)),n},Yt=n=>{try{n()}catch(i){ce(i)}},xn=n=>{if(!F)try{n();try{te=te=n=te,t.onExit?.(n),F=!0,w(n,new Vt(n))}catch(i){i instanceof Vt||i==\"unwind\"||w(1,i)}}catch(i){i instanceof Vt||i==\"unwind\"||w(1,i)}};function In(){var n=M,i={};for(let[o,a]of Object.entries(n))i[o]=typeof a==\"function\"?(...l)=>{Zt.push(o);try{return a(...l)}finally{F||(Zt.pop(),yt&&Ct===1&&Zt.length===0&&(Ct=0,Yt(Gs),typeof Fibers<\"u\"&&Fibers.mi()))}}:a;return i}var Ct=0,yt=null,Wr=0,Zt=[],br={},Qt={},Nt=0,vr=null,An=[];function Tn(){return new Promise((n,i)=>{vr={resolve:n,reject:i}})}function En(){var n=Jt(65548),i=n+12;pe[n>>>2>>>0]=i,pe[n+4>>>2>>>0]=i+65536,i=Zt[0];var o=br[i];return o===void 0&&(o=Nt++,br[i]=o,Qt[o]=i),X[n+8>>>2>>>0]=o,n}function Pn(n){if(!F){if(Ct===0){var i=!1,o=!1;n((a=0)=>{if(!F&&(Wr=a,i=!0,o)){Ct=2,Yt(()=>Hs(yt)),typeof Browser<\"u\"&&Browser.Sh.Wh&&Browser.Sh.resume(),a=!1;try{var l=(0,M[Qt[X[yt+8>>>2>>>0]]])()}catch(y){l=y,a=!0}var p=!1;if(!yt){var h=vr;h&&(vr=null,(a?h.reject:h.resolve)(l),p=!0)}if(a&&!p)throw l}}),o=!0,i||(Ct=1,yt=En(),typeof Browser<\"u\"&&Browser.Sh.Wh&&Browser.Sh.pause(),Yt(()=>Ns(yt)))}else Ct===2?(Ct=0,Yt(Ls),_t(yt),yt=null,An.forEach(xn)):ce(`invalid state: ${Ct}`);return Wr}}function wr(n){return Pn(i=>{n().then(i)})}var Xt=[],_i={},Ge=n=>{var i=_i[n];return i===void 0?mt(n):i},_r=()=>typeof globalThis==\"object\"?globalThis:Function(\"return this\")(),Nr=n=>{var i=Xt.length;return Xt.push(n),i},kn=(n,i)=>{for(var o=Array(n),a=0;a>>2>>>0],\"parameter \"+a);return o},$r=(n,i)=>Object.defineProperty(i,\"name\",{value:n});function On(n){var i=Function;if(!(i instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof i} which is not a function`);var o=$r(i.name||\"unknownFunctionName\",function(){});return o.prototype=i.prototype,o=new o,n=i.apply(o,n),n instanceof Object?n:o}var jt=n=>n%4===0&&(n%100!==0||n%400===0),Gr=[0,31,60,91,121,152,182,213,244,274,305,335],Hr=[0,31,59,90,120,151,181,212,243,273,304,334],Cr=[],Rn=(n,i)=>{Cr.length=0;for(var o;o=oe[n++>>>0];){var a=o!=105;a&=o!=112,i+=a&&i%8?4:0,Cr.push(o==112?pe[i>>>2>>>0]:o==106?ue[i>>>3]:o==105?X[i>>>2>>>0]:Ee[i>>>3>>>0]),i+=a?8:4}return Cr},Sr={},Lr=()=>{if(!xr){var n={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 Sr)Sr[i]===void 0?delete n[i]:n[i]=Sr[i];var o=[];for(i in n)o.push(`${i}=${n[i]}`);xr=o}return xr},xr,$i=[null,[],[]],Bn=[31,29,31,30,31,30,31,31,30,31,30,31],Fr=[31,28,31,30,31,30,31,31,30,31,30,31];function Ir(n){var i=Array(Kt(n)+1);return vt(n,i,0,i.length),i}function Dn(n,i,o,a){function l(T,V,Y){for(T=typeof T==\"number\"?T.toString():T||\"\";T.lengthde?-1:0ie-T.getDate())V-=ie-T.getDate()+1,T.setDate(1),11>Y?T.setMonth(Y+1):(T.setMonth(0),T.setFullYear(T.getFullYear()+1));else{T.setDate(T.getDate()+V);break}}return Y=new Date(T.getFullYear()+1,0,4),V=y(new Date(T.getFullYear(),0,4)),Y=y(Y),0>=h(V,T)?0>=h(Y,T)?T.getFullYear()+1:T.getFullYear():T.getFullYear()-1}n>>>=0,i>>>=0,o>>>=0,a>>>=0;var _=pe[a+40>>>2>>>0];a={ji:X[a>>>2>>>0],ii:X[a+4>>>2>>>0],Qh:X[a+8>>>2>>>0],Th:X[a+12>>>2>>>0],Rh:X[a+16>>>2>>>0],Lh:X[a+20>>>2>>>0],Jh:X[a+24>>>2>>>0],Kh:X[a+28>>>2>>>0],li:X[a+32>>>2>>>0],hi:X[a+36>>>2>>>0],ki:_?qe(_):\"\"},o=qe(o),_={\"%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 S in _)o=o.replace(new RegExp(S,\"g\"),_[S]);var k=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),z=\"January February March April May June July August September October November December\".split(\" \");_={\"%a\":T=>k[T.Jh].substring(0,3),\"%A\":T=>k[T.Jh],\"%b\":T=>z[T.Rh].substring(0,3),\"%B\":T=>z[T.Rh],\"%C\":T=>p((T.Lh+1900)/100|0,2),\"%d\":T=>p(T.Th,2),\"%e\":T=>l(T.Th,2,\" \"),\"%g\":T=>b(T).toString().substring(2),\"%G\":b,\"%H\":T=>p(T.Qh,2),\"%I\":T=>(T=T.Qh,T==0?T=12:12{for(var V=0,Y=0;Y<=T.Rh-1;V+=(jt(T.Lh+1900)?Bn:Fr)[Y++]);return p(T.Th+V,3)},\"%m\":T=>p(T.Rh+1,2),\"%M\":T=>p(T.ii,2),\"%n\":()=>`\n`,\"%p\":T=>0<=T.Qh&&12>T.Qh?\"AM\":\"PM\",\"%S\":T=>p(T.ji,2),\"%t\":()=>\"\t\",\"%u\":T=>T.Jh||7,\"%U\":T=>p(Math.floor((T.Kh+7-T.Jh)/7),2),\"%V\":T=>{var V=Math.floor((T.Kh+7-(T.Jh+6)%7)/7);if(2>=(T.Jh+371-T.Kh-2)%7&&V++,V)V==53&&(Y=(T.Jh+371-T.Kh)%7,Y==4||Y==3&&jt(T.Lh)||(V=1));else{V=52;var Y=(T.Jh+7-T.Kh-1)%7;(Y==4||Y==5&&jt(T.Lh%400-1))&&V++}return p(V,2)},\"%w\":T=>T.Jh,\"%W\":T=>p(Math.floor((T.Kh+7-(T.Jh+6)%7)/7),2),\"%y\":T=>(T.Lh+1900).toString().substring(2),\"%Y\":T=>T.Lh+1900,\"%z\":T=>{T=T.hi;var V=0<=T;return T=Math.abs(T)/60,(V?\"+\":\"-\")+(\"0000\"+(T/60*100+T%60)).slice(-4)},\"%Z\":T=>T.ki,\"%%\":()=>\"%\"},o=o.replace(/%%/g,\"\\0\\0\");for(S in _)o.includes(S)&&(o=o.replace(new RegExp(S,\"g\"),_[S](a)));return o=o.replace(/\\0\\0/g,\"%\"),S=Ir(o),S.length>i?0:(J.set(S,n>>>0),S.length-1)}for(var St=Array(256),lt=0;256>lt;++lt)St[lt]=String.fromCharCode(lt);pr=St,it=t.BindingError=class extends Error{constructor(n){super(n),this.name=\"BindingError\"}},t.InternalError=class extends Error{constructor(n){super(n),this.name=\"InternalError\"}},wt.push(0,1,void 0,1,null,1,!0,1,!1,1),t.count_emval_handles=()=>wt.length/2-5-Wt.length;var zn={bd:function(n,i,o){return wr(async()=>{await t.bi(n,i,o)})},v:function(n){if(n=new cr(n>>>0),J[n.Ih+12>>>0]==0&&(J[n.Ih+12>>>0]=1,qt--),J[n.Ih+13>>>0]=0,pt.push(n),Un(n.Nh),Wn(pe[n.Ih+4>>>2>>>0]))n=pe[n.Nh>>>2>>>0];else{var i=pe[n.Ih+16>>>2>>>0];n=i!==0?i:n.Nh}return n},N:()=>{W(0,0);var n=pt.pop();jn(n.Nh),ut=0},a:function(){return fr([])},m:function(n){return fr([n>>>0])},x:function(n,i){return fr([n>>>0,i>>>0])},q:function(n,i,o){return fr([n>>>0,i>>>0,o>>>0])},Bb:()=>{var n=pt.pop();n||ce(\"no exception to throw\");var i=n.Nh;throw J[n.Ih+13>>>0]==0&&(pt.push(n),J[n.Ih+13>>>0]=1,J[n.Ih+12>>>0]=0,qt++),ut=i,ut},s:function(n,i,o){n>>>=0;var a=new cr(n);throw pe[a.Ih+16>>>2>>>0]=0,pe[a.Ih+4>>>2>>>0]=i>>>0,pe[a.Ih+8>>>2>>>0]=o>>>0,ut=n,qt++,ut},fb:()=>qt,g:function(n){throw ut||=n>>>0,ut},Cb:function(){return 0},$c:function(){},Mc:function(){},Oc:function(){},Gc:function(){return 0},Zc:function(){},Uc:function(){},Yc:function(){},_b:function(){},Nc:function(){},Kc:function(){},_c:function(){},Lc:function(){},Wb:function(n,i,o){i=mt(i>>>0),ht(n>>>0,{name:i,fromWireType:a=>a,toWireType:function(a,l){if(typeof l!=\"bigint\"&&typeof l!=\"number\")throw l===null?l=\"null\":(a=typeof l,l=a===\"object\"||a===\"array\"||a===\"function\"?l.toString():\"\"+l),new TypeError(`Cannot convert \"${l}\" to ${this.name}`);return typeof l==\"number\"&&(l=BigInt(l)),l},argPackAdvance:8,readValueFromPointer:Se(i,o>>>0,i.indexOf(\"u\")==-1),Mh:null})},Ec:function(n,i,o,a){i=mt(i>>>0),ht(n>>>0,{name:i,fromWireType:function(l){return!!l},toWireType:function(l,p){return p?o:a},argPackAdvance:8,readValueFromPointer:function(l){return this.fromWireType(oe[l>>>0])},Mh:null})},Cc:function(n){return ht(n>>>0,bn)},Vb:function(n,i,o){i=mt(i>>>0),ht(n>>>0,{name:i,fromWireType:a=>a,toWireType:(a,l)=>l,argPackAdvance:8,readValueFromPointer:vn(i,o>>>0),Mh:null})},Aa:function(n,i,o,a,l){if(n>>>=0,o>>>=0,i=mt(i>>>0),l===-1&&(l=4294967295),l=y=>y,a===0){var p=32-8*o;l=y=>y<

>>p}var h=i.includes(\"unsigned\")?function(y,b){return b>>>0}:function(y,b){return b};ht(n,{name:i,fromWireType:l,toWireType:h,argPackAdvance:8,readValueFromPointer:Se(i,o,a!==0),Mh:null})},_:function(n,i,o){function a(p){return new l(J.buffer,pe[p+4>>>2>>>0],pe[p>>>2>>>0])}var l=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][i];o=mt(o>>>0),ht(n>>>0,{name:o,fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{Xh:!0})},Xb:function(n,i){i=mt(i>>>0);var o=i===\"std::string\";ht(n>>>0,{name:i,fromWireType:function(a){var l=pe[a>>>2>>>0],p=a+4;if(o)for(var h=p,y=0;y<=l;++y){var b=p+y;if(y==l||oe[b>>>0]==0){if(h=qe(h,b-h),_===void 0)var _=h;else _+=String.fromCharCode(0),_+=h;h=b+1}}else{for(_=Array(l),y=0;y>>0]);_=_.join(\"\")}return _t(a),_},toWireType:function(a,l){l instanceof ArrayBuffer&&(l=new Uint8Array(l));var p=typeof l==\"string\";if(!(p||l instanceof Uint8Array||l instanceof Uint8ClampedArray||l instanceof Int8Array))throw new it(\"Cannot pass non-string to std::string\");var h=o&&p?Kt(l):l.length,y=Jt(4+h+1),b=y+4;if(pe[y>>>2>>>0]=h,o&&p)vt(l,oe,b,h+1);else if(p)for(p=0;p>>0]=_}else for(p=0;p>>0]=l[p];return a!==null&&a.push(_t,y),y},argPackAdvance:8,readValueFromPointer:gr,Mh(a){_t(a)}})},Ab:function(n,i,o){if(i>>>=0,o>>>=0,o=mt(o),i===2)var a=Ur,l=wn,p=_n,h=y=>ge[y>>>1>>>0];else i===4&&(a=$n,l=Cn,p=Sn,h=y=>pe[y>>>2>>>0]);ht(n>>>0,{name:o,fromWireType:y=>{for(var b=pe[y>>>2>>>0],_,S=y+4,k=0;k<=b;++k){var z=y+4+k*i;(k==b||h(z)==0)&&(S=a(S,z-S),_===void 0?_=S:(_+=String.fromCharCode(0),_+=S),S=z+i)}return _t(y),_},toWireType:(y,b)=>{if(typeof b!=\"string\")throw new it(`Cannot pass non-string to C++ string type ${o}`);var _=p(b),S=Jt(4+_+i);return pe[S>>>2>>>0]=_/i,l(b,S+4,_+i),y!==null&&y.push(_t,S),S},argPackAdvance:8,readValueFromPointer:gr,Mh(y){_t(y)}})},Fc:function(n,i){i=mt(i>>>0),ht(n>>>0,{Yh:!0,name:i,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},ad:()=>1,kd:function(n,i,o){return i>>>=0,o>>>=0,n=ot(n>>>0),i=yr(i,\"emval::as\"),Vr(i,o,n)},Cd:function(n){return n>>>=0,wr(()=>(n=ot(n),n.then(gt)))},ud:function(n,i,o,a){return o>>>=0,a>>>=0,n=Xt[n>>>0],i=ot(i>>>0),n(null,i,o,a)},ia:function(n,i,o,a,l){return o>>>=0,a>>>=0,l>>>=0,n=Xt[n>>>0],i=ot(i>>>0),o=Ge(o),n(i,i[o],a,l)},Bc:Mr,qd:function(n,i){return i>>>=0,n=ot(n>>>0),i=ot(i),n==i},zd:function(n){return n>>>=0,n===0?gt(_r()):(n=Ge(n),gt(_r()[n]))},ha:function(n,i,o){i=kn(n,i>>>0);var a=i.shift();n--;var l=`return function (obj, func, destructorsRef, args) {\n`,p=0,h=[];o===0&&h.push(\"obj\");for(var y=[\"retType\"],b=[a],_=0;_S.name).join(\", \")}) => ${a.name}>`,Nr($r(o,n))},yd:function(n,i){return i>>>=0,n=ot(n>>>0),i=ot(i),gt(n[i])},ba:function(n){n>>>=0,9>>0);for(var i=Array(n.length),o=0;o>>0))},Xa:function(){return gt({})},vd:function(n){n>>>=0;for(var i=ot(n);i.length;){var o=i.pop();i.pop()(o)}Mr(n)},sd:function(n,i,o){i>>>=0,o>>>=0,n=ot(n>>>0),i=ot(i),o=ot(o),n[i]=o},zb:function(n,i){return i>>>=0,n=yr(n>>>0,\"_emval_take_value\"),n=n.readValueFromPointer(i),gt(n)},Rc:function(n,i){n=-9007199254740992>n||9007199254740992>>=0,n=new Date(1e3*n),X[i>>>2>>>0]=n.getUTCSeconds(),X[i+4>>>2>>>0]=n.getUTCMinutes(),X[i+8>>>2>>>0]=n.getUTCHours(),X[i+12>>>2>>>0]=n.getUTCDate(),X[i+16>>>2>>>0]=n.getUTCMonth(),X[i+20>>>2>>>0]=n.getUTCFullYear()-1900,X[i+24>>>2>>>0]=n.getUTCDay(),X[i+28>>>2>>>0]=(n.getTime()-Date.UTC(n.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Sc:function(n,i){n=-9007199254740992>n||9007199254740992>>=0,n=new Date(1e3*n),X[i>>>2>>>0]=n.getSeconds(),X[i+4>>>2>>>0]=n.getMinutes(),X[i+8>>>2>>>0]=n.getHours(),X[i+12>>>2>>>0]=n.getDate(),X[i+16>>>2>>>0]=n.getMonth(),X[i+20>>>2>>>0]=n.getFullYear()-1900,X[i+24>>>2>>>0]=n.getDay(),X[i+28>>>2>>>0]=(jt(n.getFullYear())?Gr:Hr)[n.getMonth()]+n.getDate()-1|0,X[i+36>>>2>>>0]=-(60*n.getTimezoneOffset());var o=new Date(n.getFullYear(),6,1).getTimezoneOffset(),a=new Date(n.getFullYear(),0,1).getTimezoneOffset();X[i+32>>>2>>>0]=(o!=a&&n.getTimezoneOffset()==Math.min(a,o))|0},Tc:function(n){n>>>=0;var i=new Date(X[n+20>>>2>>>0]+1900,X[n+16>>>2>>>0],X[n+12>>>2>>>0],X[n+8>>>2>>>0],X[n+4>>>2>>>0],X[n>>>2>>>0],0),o=X[n+32>>>2>>>0],a=i.getTimezoneOffset(),l=new Date(i.getFullYear(),6,1).getTimezoneOffset(),p=new Date(i.getFullYear(),0,1).getTimezoneOffset(),h=Math.min(p,l);return 0>o?X[n+32>>>2>>>0]=+(l!=p&&h==a):0>>2>>>0]=i.getDay(),X[n+28>>>2>>>0]=(jt(i.getFullYear())?Gr:Hr)[i.getMonth()]+i.getDate()-1|0,X[n>>>2>>>0]=i.getSeconds(),X[n+4>>>2>>>0]=i.getMinutes(),X[n+8>>>2>>>0]=i.getHours(),X[n+12>>>2>>>0]=i.getDate(),X[n+16>>>2>>>0]=i.getMonth(),X[n+20>>>2>>>0]=i.getYear(),n=i.getTime(),BigInt(isNaN(n)?-1:n/1e3)},Pc:function(){return-52},Qc:function(){},Ic:function(n,i,o,a){o>>>=0,a>>>=0;var l=new Date().getFullYear(),p=new Date(l,0,1),h=new Date(l,6,1);l=p.getTimezoneOffset();var y=h.getTimezoneOffset();pe[n>>>0>>>2>>>0]=60*Math.max(l,y),X[i>>>0>>>2>>>0]=+(l!=y),n=b=>b.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:\"short\"}).split(\" \")[1],p=n(p),h=n(h),y{ce(\"\")},A:function(n,i,o){return n>>>=0,i=Rn(i>>>0,o>>>0),Ut[n](...i)},bc:function(n,i,o){return n>>>=0,i=Rn(i>>>0,o>>>0),Ut[n](...i)},$b:()=>Date.now(),Jc:function(){return 4294901760},ga:()=>performance.now(),Hc:function(n){n>>>=0;var i=oe.length;if(4294901760=o;o*=2){var a=i*(1+.2/o);a=Math.min(a,n+100663296);var l=Math;a=Math.max(n,a);e:{l=(l.min.call(l,4294901760,a+(65536-a%65536)%65536)-L.buffer.byteLength+65535)/65536;try{L.grow(l),Pe();var p=1;break e}catch{}p=void 0}if(p)return!0}return!1},Wc:function(n,i){n>>>=0,i>>>=0;var o=0;return Lr().forEach((a,l)=>{var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um,Ha:Mm,Ia:Bm,fd:_h,xd:kp,Z:Jp,pa:xm,pd:Wm,wd:Np,Mb:am,Ma:vm,Ka:Sm,Tb:Nf,rc:dm,Ja:Pm,Na:bm,pb:sm,la:gm,Ea:Wp,mc:Qm,qc:pm,Jb:Vm,Fa:qm,ja:vp,Ad:ip,nd:Fm,R:fm,eb:Hf,Za:eh,ec:vh,ib:cp,E:Jf,M:Wf,Va:sp,ld:Km,ca:op,nb:km,na:mm,dc:wh,Ac:Gf,u:Vf,L:yp,td:wm,Pb:Qp,oc:zm,Bd:np,Ob:Xp,Lb:cm,cb:Mp,zc:Xf,Rb:wp,Oa:ym,Y:em,uc:bp,J:Cp,gd:gh,vb:hp,sa:rm,H:tm,rb:Yp,Pa:Kp,Sa:Gp,sb:qp,qb:Zp,w:function(n){return n>>>0},Dc:Dn,fa:function(n,i,o,a){return Dn(n>>>0,i>>>0,o>>>0,a>>>0)}},M=function(){function n(o){return M=o.exports,M=In(),M=Eh(),L=M.Dd,Pe(),be.unshift(M.Ed),_e--,_e==0&&(Je!==null&&(clearInterval(Je),Je=null),ee&&(o=ee,ee=null,o())),M}var i={a:zn};if(_e++,t.instantiateWasm)try{return t.instantiateWasm(i,n)}catch(o){U(`Module.instantiateWasm callback failed with error: ${o}`),s(o)}return ct(i,function(o){n(o.instance)}).catch(s),{}}(),qr=n=>(qr=M.Fd)(n);t._OrtInit=(n,i)=>(t._OrtInit=M.Gd)(n,i),t._OrtGetLastError=(n,i)=>(t._OrtGetLastError=M.Hd)(n,i),t._OrtCreateSessionOptions=(n,i,o,a,l,p,h,y,b,_)=>(t._OrtCreateSessionOptions=M.Id)(n,i,o,a,l,p,h,y,b,_),t._OrtAppendExecutionProvider=(n,i)=>(t._OrtAppendExecutionProvider=M.Jd)(n,i),t._OrtAddFreeDimensionOverride=(n,i,o)=>(t._OrtAddFreeDimensionOverride=M.Kd)(n,i,o),t._OrtAddSessionConfigEntry=(n,i,o)=>(t._OrtAddSessionConfigEntry=M.Ld)(n,i,o),t._OrtReleaseSessionOptions=n=>(t._OrtReleaseSessionOptions=M.Md)(n),t._OrtCreateSession=(n,i,o)=>(t._OrtCreateSession=M.Nd)(n,i,o),t._OrtReleaseSession=n=>(t._OrtReleaseSession=M.Od)(n),t._OrtGetInputOutputCount=(n,i,o)=>(t._OrtGetInputOutputCount=M.Pd)(n,i,o),t._OrtGetInputName=(n,i)=>(t._OrtGetInputName=M.Qd)(n,i),t._OrtGetOutputName=(n,i)=>(t._OrtGetOutputName=M.Rd)(n,i),t._OrtFree=n=>(t._OrtFree=M.Sd)(n),t._OrtCreateTensor=(n,i,o,a,l,p)=>(t._OrtCreateTensor=M.Td)(n,i,o,a,l,p),t._OrtGetTensorData=(n,i,o,a,l)=>(t._OrtGetTensorData=M.Ud)(n,i,o,a,l),t._OrtReleaseTensor=n=>(t._OrtReleaseTensor=M.Vd)(n),t._OrtCreateRunOptions=(n,i,o,a)=>(t._OrtCreateRunOptions=M.Wd)(n,i,o,a),t._OrtAddRunConfigEntry=(n,i,o)=>(t._OrtAddRunConfigEntry=M.Xd)(n,i,o),t._OrtReleaseRunOptions=n=>(t._OrtReleaseRunOptions=M.Yd)(n),t._OrtCreateBinding=n=>(t._OrtCreateBinding=M.Zd)(n),t._OrtBindInput=(n,i,o)=>(t._OrtBindInput=M._d)(n,i,o),t._OrtBindOutput=(n,i,o,a)=>(t._OrtBindOutput=M.$d)(n,i,o,a),t._OrtClearBoundOutputs=n=>(t._OrtClearBoundOutputs=M.ae)(n),t._OrtReleaseBinding=n=>(t._OrtReleaseBinding=M.be)(n),t._OrtRunWithBinding=(n,i,o,a,l)=>(t._OrtRunWithBinding=M.ce)(n,i,o,a,l),t._OrtRun=(n,i,o,a,l,p,h,y)=>(t._OrtRun=M.de)(n,i,o,a,l,p,h,y),t._OrtEndProfiling=n=>(t._OrtEndProfiling=M.ee)(n),t._JsepOutput=(n,i,o)=>(t._JsepOutput=M.fe)(n,i,o),t._JsepGetNodeName=n=>(t._JsepGetNodeName=M.ge)(n);var Jt=t._malloc=n=>(Jt=t._malloc=M.he)(n),_t=t._free=n=>(_t=t._free=M.ie)(n),W=(n,i)=>(W=M.ke)(n,i),er=n=>(er=M.le)(n),N=n=>(N=M.me)(n),Mn=n=>(Mn=M.ne)(n),G=()=>(G=M.oe)(),jn=n=>(jn=M.pe)(n),Un=n=>(Un=M.qe)(n),Vn=(n,i,o)=>(Vn=M.re)(n,i,o),Wn=n=>(Wn=M.se)(n),tr=t.dynCall_vii=(n,i,o)=>(tr=t.dynCall_vii=M.te)(n,i,o),Ar=t.dynCall_iiii=(n,i,o,a)=>(Ar=t.dynCall_iiii=M.ue)(n,i,o,a),Kr=t.dynCall_iii=(n,i,o)=>(Kr=t.dynCall_iii=M.ve)(n,i,o),Yr=t.dynCall_ii=(n,i)=>(Yr=t.dynCall_ii=M.we)(n,i),Zr=t.dynCall_iiiiiii=(n,i,o,a,l,p,h)=>(Zr=t.dynCall_iiiiiii=M.xe)(n,i,o,a,l,p,h),Tr=t.dynCall_vi=(n,i)=>(Tr=t.dynCall_vi=M.ye)(n,i),Er=t.dynCall_v=n=>(Er=t.dynCall_v=M.ze)(n),Qr=t.dynCall_iiiiii=(n,i,o,a,l,p)=>(Qr=t.dynCall_iiiiii=M.Ae)(n,i,o,a,l,p),Xr=t.dynCall_iiij=(n,i,o,a)=>(Xr=t.dynCall_iiij=M.Be)(n,i,o,a),Jr=t.dynCall_iiiii=(n,i,o,a,l)=>(Jr=t.dynCall_iiiii=M.Ce)(n,i,o,a,l),Pr=t.dynCall_viii=(n,i,o,a)=>(Pr=t.dynCall_viii=M.De)(n,i,o,a),rr=t.dynCall_viiiii=(n,i,o,a,l,p)=>(rr=t.dynCall_viiiii=M.Ee)(n,i,o,a,l,p),kr=t.dynCall_viiii=(n,i,o,a,l)=>(kr=t.dynCall_viiii=M.Fe)(n,i,o,a,l),en=t.dynCall_viiiiii=(n,i,o,a,l,p,h)=>(en=t.dynCall_viiiiii=M.Ge)(n,i,o,a,l,p,h),tn=t.dynCall_viiji=(n,i,o,a,l)=>(tn=t.dynCall_viiji=M.He)(n,i,o,a,l),rn=t.dynCall_viiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k)=>(rn=t.dynCall_viiiiiiiiiii=M.Ie)(n,i,o,a,l,p,h,y,b,_,S,k),nn=t.dynCall_viiijjjii=(n,i,o,a,l,p,h,y,b)=>(nn=t.dynCall_viiijjjii=M.Je)(n,i,o,a,l,p,h,y,b),on=t.dynCall_iid=(n,i,o)=>(on=t.dynCall_iid=M.Ke)(n,i,o),Nn=t.dynCall_iif=(n,i,o)=>(Nn=t.dynCall_iif=M.Le)(n,i,o),nr=t.dynCall_iij=(n,i,o)=>(nr=t.dynCall_iij=M.Me)(n,i,o),an=t.dynCall_jii=(n,i,o)=>(an=t.dynCall_jii=M.Ne)(n,i,o),m=t.dynCall_i=n=>(m=t.dynCall_i=M.Oe)(n),v=t.dynCall_viiiiiiii=(n,i,o,a,l,p,h,y,b)=>(v=t.dynCall_viiiiiiii=M.Pe)(n,i,o,a,l,p,h,y,b),I=t.dynCall_viiiiij=(n,i,o,a,l,p,h)=>(I=t.dynCall_viiiiij=M.Qe)(n,i,o,a,l,p,h),D=t.dynCall_ji=(n,i)=>(D=t.dynCall_ji=M.Re)(n,i),H=t.dynCall_viij=(n,i,o,a)=>(H=t.dynCall_viij=M.Se)(n,i,o,a),Q=t.dynCall_iiiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k)=>(Q=t.dynCall_iiiiiiiiiiii=M.Te)(n,i,o,a,l,p,h,y,b,_,S,k),re=t.dynCall_viiiiiiiii=(n,i,o,a,l,p,h,y,b,_)=>(re=t.dynCall_viiiiiiiii=M.Ue)(n,i,o,a,l,p,h,y,b,_),ye=t.dynCall_ij=(n,i)=>(ye=t.dynCall_ij=M.Ve)(n,i),he=t.dynCall_iiiiij=(n,i,o,a,l,p)=>(he=t.dynCall_iiiiij=M.We)(n,i,o,a,l,p),fe=t.dynCall_j=n=>(fe=t.dynCall_j=M.Xe)(n),ve=t.dynCall_vij=(n,i,o)=>(ve=t.dynCall_vij=M.Ye)(n,i,o),Me=t.dynCall_viijjjiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k)=>(Me=t.dynCall_viijjjiiiiii=M.Ze)(n,i,o,a,l,p,h,y,b,_,S,k),je=t.dynCall_viiijiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k)=>(je=t.dynCall_viiijiiiiiii=M._e)(n,i,o,a,l,p,h,y,b,_,S,k),q=t.dynCall_iiiiiiii=(n,i,o,a,l,p,h,y)=>(q=t.dynCall_iiiiiiii=M.$e)(n,i,o,a,l,p,h,y),Ie=t.dynCall_viiiiiii=(n,i,o,a,l,p,h,y)=>(Ie=t.dynCall_viiiiiii=M.af)(n,i,o,a,l,p,h,y),Ue=t.dynCall_iiiiiiiij=(n,i,o,a,l,p,h,y,b)=>(Ue=t.dynCall_iiiiiiiij=M.bf)(n,i,o,a,l,p,h,y,b),kt=t.dynCall_viiiiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>(kt=t.dynCall_viiiiiiiiiiiii=M.cf)(n,i,o,a,l,p,h,y,b,_,S,k,z,T),sn=t.dynCall_iiiiiiiii=(n,i,o,a,l,p,h,y,b)=>(sn=t.dynCall_iiiiiiiii=M.df)(n,i,o,a,l,p,h,y,b),yo=t.dynCall_iiiiijiiiii=(n,i,o,a,l,p,h,y,b,_,S)=>(yo=t.dynCall_iiiiijiiiii=M.ef)(n,i,o,a,l,p,h,y,b,_,S),bo=t.dynCall_vijjjiiij=(n,i,o,a,l,p,h,y,b)=>(bo=t.dynCall_vijjjiiij=M.ff)(n,i,o,a,l,p,h,y,b),vo=t.dynCall_fi=(n,i)=>(vo=t.dynCall_fi=M.gf)(n,i),wo=t.dynCall_fii=(n,i,o)=>(wo=t.dynCall_fii=M.hf)(n,i,o),_o=t.dynCall_di=(n,i)=>(_o=t.dynCall_di=M.jf)(n,i),$o=t.dynCall_dii=(n,i,o)=>($o=t.dynCall_dii=M.kf)(n,i,o),Co=t.dynCall_vijj=(n,i,o,a)=>(Co=t.dynCall_vijj=M.lf)(n,i,o,a),So=t.dynCall_iiiiiiiiii=(n,i,o,a,l,p,h,y,b,_)=>(So=t.dynCall_iiiiiiiiii=M.mf)(n,i,o,a,l,p,h,y,b,_),xo=t.dynCall_viijiii=(n,i,o,a,l,p,h)=>(xo=t.dynCall_viijiii=M.nf)(n,i,o,a,l,p,h),Io=t.dynCall_viid=(n,i,o,a)=>(Io=t.dynCall_viid=M.of)(n,i,o,a),Ao=t.dynCall_viffiii=(n,i,o,a,l,p,h)=>(Ao=t.dynCall_viffiii=M.pf)(n,i,o,a,l,p,h),To=t.dynCall_viifiii=(n,i,o,a,l,p,h)=>(To=t.dynCall_viifiii=M.qf)(n,i,o,a,l,p,h),Eo=t.dynCall_viiiiidiidi=(n,i,o,a,l,p,h,y,b,_,S)=>(Eo=t.dynCall_viiiiidiidi=M.rf)(n,i,o,a,l,p,h,y,b,_,S),Po=t.dynCall_viiiiiiiiidi=(n,i,o,a,l,p,h,y,b,_,S,k)=>(Po=t.dynCall_viiiiiiiiidi=M.sf)(n,i,o,a,l,p,h,y,b,_,S,k),ko=t.dynCall_jiii=(n,i,o,a)=>(ko=t.dynCall_jiii=M.tf)(n,i,o,a),Oo=t.dynCall_vjiiiiii=(n,i,o,a,l,p,h,y)=>(Oo=t.dynCall_vjiiiiii=M.uf)(n,i,o,a,l,p,h,y),Ro=t.dynCall_viiid=(n,i,o,a,l)=>(Ro=t.dynCall_viiid=M.vf)(n,i,o,a,l),Bo=t.dynCall_viiiiiiiiiji=(n,i,o,a,l,p,h,y,b,_,S,k)=>(Bo=t.dynCall_viiiiiiiiiji=M.wf)(n,i,o,a,l,p,h,y,b,_,S,k),Do=t.dynCall_viji=(n,i,o,a)=>(Do=t.dynCall_viji=M.xf)(n,i,o,a),zo=t.dynCall_vijjjjjjjjjjjjji=(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)=>(zo=t.dynCall_vijjjjjjjjjjjjji=M.yf)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y),Mo=t.dynCall_viiiji=(n,i,o,a,l,p)=>(Mo=t.dynCall_viiiji=M.zf)(n,i,o,a,l,p),jo=t.dynCall_vijjjiiji=(n,i,o,a,l,p,h,y,b)=>(jo=t.dynCall_vijjjiiji=M.Af)(n,i,o,a,l,p,h,y,b),Uo=t.dynCall_iiiji=(n,i,o,a,l)=>(Uo=t.dynCall_iiiji=M.Bf)(n,i,o,a,l),Vo=t.dynCall_iiijiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>(Vo=t.dynCall_iiijiiiiiiiiii=M.Cf)(n,i,o,a,l,p,h,y,b,_,S,k,z,T),Wo=t.dynCall_vj=(n,i)=>(Wo=t.dynCall_vj=M.Df)(n,i),No=t.dynCall_jjj=(n,i,o)=>(No=t.dynCall_jjj=M.Ef)(n,i,o),Go=t.dynCall_iiijiiiiii=(n,i,o,a,l,p,h,y,b,_)=>(Go=t.dynCall_iiijiiiiii=M.Ff)(n,i,o,a,l,p,h,y,b,_),Ho=t.dynCall_vfiii=(n,i,o,a,l)=>(Ho=t.dynCall_vfiii=M.Gf)(n,i,o,a,l),Lo=t.dynCall_viiiiff=(n,i,o,a,l,p,h)=>(Lo=t.dynCall_viiiiff=M.Hf)(n,i,o,a,l,p,h),Fo=t.dynCall_viiiiiff=(n,i,o,a,l,p,h,y)=>(Fo=t.dynCall_viiiiiff=M.If)(n,i,o,a,l,p,h,y),qo=t.dynCall_viiff=(n,i,o,a,l)=>(qo=t.dynCall_viiff=M.Jf)(n,i,o,a,l),Ko=t.dynCall_viiiiiiiiifiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>(Ko=t.dynCall_viiiiiiiiifiii=M.Kf)(n,i,o,a,l,p,h,y,b,_,S,k,z,T),Yo=t.dynCall_viiiiiiiijj=(n,i,o,a,l,p,h,y,b,_,S)=>(Yo=t.dynCall_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vjjjjjjjjfffjifiiiiii=M.bg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We),ma=t.dynCall_vijiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(ma=t.dynCall_vijiiiiiiiiii=M.cg)(n,i,o,a,l,p,h,y,b,_,S,k,z),ha=t.dynCall_vijjfffiii=(n,i,o,a,l,p,h,y,b,_)=>(ha=t.dynCall_vijjfffiii=M.dg)(n,i,o,a,l,p,h,y,b,_),ga=t.dynCall_viiiiiiijiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(ga=t.dynCall_viiiiiiijiiii=M.eg)(n,i,o,a,l,p,h,y,b,_,S,k,z),ya=t.dynCall_vijjjjjjifiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)=>(ya=t.dynCall_vijjjjjjifiiiii=M.fg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V),ba=t.dynCall_viifi=(n,i,o,a,l)=>(ba=t.dynCall_viifi=M.gg)(n,i,o,a,l),va=t.dynCall_vjjjjjiiii=(n,i,o,a,l,p,h,y,b,_)=>(va=t.dynCall_vjjjjjiiii=M.hg)(n,i,o,a,l,p,h,y,b,_),wa=t.dynCall_vjjjjfiii=(n,i,o,a,l,p,h,y,b)=>(wa=t.dynCall_vjjjjfiii=M.ig)(n,i,o,a,l,p,h,y,b),_a=t.dynCall_viiiiiijiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>(_a=t.dynCall_viiiiiijiiiiii=M.jg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T),$a=t.dynCall_vijjii=(n,i,o,a,l,p)=>($a=t.dynCall_vijjii=M.kg)(n,i,o,a,l,p),Ca=t.dynCall_viiiiijjiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(Ca=t.dynCall_viiiiijjiiiii=M.lg)(n,i,o,a,l,p,h,y,b,_,S,k,z),Sa=t.dynCall_iiiiiji=(n,i,o,a,l,p,h)=>(Sa=t.dynCall_iiiiiji=M.mg)(n,i,o,a,l,p,h),xa=t.dynCall_iiiiji=(n,i,o,a,l,p)=>(xa=t.dynCall_iiiiji=M.ng)(n,i,o,a,l,p),Ia=t.dynCall_viiiiijiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(Ia=t.dynCall_viiiiijiiiiii=M.og)(n,i,o,a,l,p,h,y,b,_,S,k,z),Aa=t.dynCall_viiijiiiiii=(n,i,o,a,l,p,h,y,b,_,S)=>(Aa=t.dynCall_viiijiiiiii=M.pg)(n,i,o,a,l,p,h,y,b,_,S),Ta=t.dynCall_viijj=(n,i,o,a,l)=>(Ta=t.dynCall_viijj=M.qg)(n,i,o,a,l),Ea=t.dynCall_viiiijii=(n,i,o,a,l,p,h,y)=>(Ea=t.dynCall_viiiijii=M.rg)(n,i,o,a,l,p,h,y),Pa=t.dynCall_viijjiii=(n,i,o,a,l,p,h,y)=>(Pa=t.dynCall_viijjiii=M.sg)(n,i,o,a,l,p,h,y),ka=t.dynCall_ijii=(n,i,o,a)=>(ka=t.dynCall_ijii=M.tg)(n,i,o,a),Oa=t.dynCall_viiiiijjji=(n,i,o,a,l,p,h,y,b,_)=>(Oa=t.dynCall_viiiiijjji=M.ug)(n,i,o,a,l,p,h,y,b,_),Ra=t.dynCall_vijjjjiij=(n,i,o,a,l,p,h,y,b)=>(Ra=t.dynCall_vijjjjiij=M.vg)(n,i,o,a,l,p,h,y,b),Ba=t.dynCall_viiiiijij=(n,i,o,a,l,p,h,y,b)=>(Ba=t.dynCall_viiiiijij=M.wg)(n,i,o,a,l,p,h,y,b),Da=t.dynCall_viiiiiijij=(n,i,o,a,l,p,h,y,b,_)=>(Da=t.dynCall_viiiiiijij=M.xg)(n,i,o,a,l,p,h,y,b,_),za=t.dynCall_vijiii=(n,i,o,a,l,p)=>(za=t.dynCall_vijiii=M.yg)(n,i,o,a,l,p),Ma=t.dynCall_viiiiiiiiifi=(n,i,o,a,l,p,h,y,b,_,S,k)=>(Ma=t.dynCall_viiiiiiiiifi=M.zg)(n,i,o,a,l,p,h,y,b,_,S,k),ja=t.dynCall_iiijiiii=(n,i,o,a,l,p,h,y)=>(ja=t.dynCall_iiijiiii=M.Ag)(n,i,o,a,l,p,h,y),Ua=t.dynCall_viiiiiijjiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T)=>(Ua=t.dynCall_viiiiiijjiiiii=M.Bg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T),Va=t.dynCall_viiiiiiijiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)=>(Va=t.dynCall_viiiiiiijiiiiii=M.Cg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V),Wa=t.dynCall_vif=(n,i,o)=>(Wa=t.dynCall_vif=M.Dg)(n,i,o),Na=t.dynCall_viif=(n,i,o,a)=>(Na=t.dynCall_viif=M.Eg)(n,i,o,a),Ga=t.dynCall_fiii=(n,i,o,a)=>(Ga=t.dynCall_fiii=M.Fg)(n,i,o,a),Ha=t.dynCall_diii=(n,i,o,a)=>(Ha=t.dynCall_diii=M.Gg)(n,i,o,a),La=t.dynCall_viiiiiifii=(n,i,o,a,l,p,h,y,b,_)=>(La=t.dynCall_viiiiiifii=M.Hg)(n,i,o,a,l,p,h,y,b,_),Fa=t.dynCall_viiiiijiiiiiiiiiiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We,et,dt,Ci,Si,xi)=>(Fa=t.dynCall_viiiiijiiiiiiiiiiiiiiiiiii=M.Ig)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We,et,dt,Ci,Si,xi),qa=t.dynCall_viijji=(n,i,o,a,l,p)=>(qa=t.dynCall_viijji=M.Jg)(n,i,o,a,l,p),Ka=t.dynCall_iiiiiiiiiiiji=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(Ka=t.dynCall_iiiiiiiiiiiji=M.Kg)(n,i,o,a,l,p,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M.Sg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie),ns=t.dynCall_viiiijjj=(n,i,o,a,l,p,h,y)=>(ns=t.dynCall_viiiijjj=M.Tg)(n,i,o,a,l,p,h,y),is=t.dynCall_iiiiid=(n,i,o,a,l,p)=>(is=t.dynCall_iiiiid=M.Ug)(n,i,o,a,l,p),os=t.dynCall_viiiiiiijjj=(n,i,o,a,l,p,h,y,b,_,S)=>(os=t.dynCall_viiiiiiijjj=M.Vg)(n,i,o,a,l,p,h,y,b,_,S),as=t.dynCall_iiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S)=>(as=t.dynCall_iiiiiiiiiii=M.Wg)(n,i,o,a,l,p,h,y,b,_,S),ss=t.dynCall_iiiiiiiiiiiiiiiiiifi=(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze)=>(ss=t.dynCall_iiiiiiiiiiiiiiiiiifi=M.Xg)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze),us=t.dynCall_viiif=(n,i,o,a,l)=>(us=t.dynCall_viiif=M.Yg)(n,i,o,a,l),ls=t.dynCall_viiijiiiii=(n,i,o,a,l,p,h,y,b,_)=>(ls=t.dynCall_viiijiiiii=M.Zg)(n,i,o,a,l,p,h,y,b,_),ds=t.dynCall_viiij=(n,i,o,a,l)=>(ds=t.dynCall_viiij=M._g)(n,i,o,a,l),cs=t.dynCall_iijjj=(n,i,o,a,l)=>(cs=t.dynCall_iijjj=M.$g)(n,i,o,a,l),fs=t.dynCall_viiiiji=(n,i,o,a,l,p,h)=>(fs=t.dynCall_viiiiji=M.ah)(n,i,o,a,l,p,h),ps=t.dynCall_iijjji=(n,i,o,a,l,p)=>(ps=t.dynCall_iijjji=M.bh)(n,i,o,a,l,p),ms=t.dynCall_ijijji=(n,i,o,a,l,p)=>(ms=t.dynCall_ijijji=M.ch)(n,i,o,a,l,p),hs=t.dynCall_viiijjiii=(n,i,o,a,l,p,h,y,b)=>(hs=t.dynCall_viiijjiii=M.dh)(n,i,o,a,l,p,h,y,b),gs=t.dynCall_iiiiijji=(n,i,o,a,l,p,h,y)=>(gs=t.dynCall_iiiiijji=M.eh)(n,i,o,a,l,p,h,y),ys=t.dynCall_iiiifi=(n,i,o,a,l,p)=>(ys=t.dynCall_iiiifi=M.fh)(n,i,o,a,l,p),bs=t.dynCall_iiijii=(n,i,o,a,l,p)=>(bs=t.dynCall_iiijii=M.gh)(n,i,o,a,l,p),vs=t.dynCall_iiiiiiiiijii=(n,i,o,a,l,p,h,y,b,_,S,k)=>(vs=t.dynCall_iiiiiiiiijii=M.hh)(n,i,o,a,l,p,h,y,b,_,S,k),ws=t.dynCall_iiiijjii=(n,i,o,a,l,p,h,y)=>(ws=t.dynCall_iiiijjii=M.ih)(n,i,o,a,l,p,h,y),_s=t.dynCall_iiiiiijjjii=(n,i,o,a,l,p,h,y,b,_,S)=>(_s=t.dynCall_iiiiiijjjii=M.jh)(n,i,o,a,l,p,h,y,b,_,S),$s=t.dynCall_iiijiii=(n,i,o,a,l,p,h)=>($s=t.dynCall_iiijiii=M.kh)(n,i,o,a,l,p,h),Cs=t.dynCall_iiiiiiiijjjfi=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(Cs=t.dynCall_iiiiiiiijjjfi=M.lh)(n,i,o,a,l,p,h,y,b,_,S,k,z),Ss=t.dynCall_iijiiii=(n,i,o,a,l,p,h)=>(Ss=t.dynCall_iijiiii=M.mh)(n,i,o,a,l,p,h),xs=t.dynCall_iijjjii=(n,i,o,a,l,p,h)=>(xs=t.dynCall_iijjjii=M.nh)(n,i,o,a,l,p,h),Is=t.dynCall_jij=(n,i,o)=>(Is=t.dynCall_jij=M.oh)(n,i,o),As=t.dynCall_iiji=(n,i,o,a)=>(As=t.dynCall_iiji=M.ph)(n,i,o,a),Ts=t.dynCall_iiif=(n,i,o,a)=>(Ts=t.dynCall_iiif=M.qh)(n,i,o,a),Es=t.dynCall_vidi=(n,i,o,a)=>(Es=t.dynCall_vidi=M.rh)(n,i,o,a),Ps=t.dynCall_vjiii=(n,i,o,a,l)=>(Ps=t.dynCall_vjiii=M.sh)(n,i,o,a,l),ks=t.dynCall_diiii=(n,i,o,a,l)=>(ks=t.dynCall_diiii=M.th)(n,i,o,a,l),Os=t.dynCall_diiiii=(n,i,o,a,l,p)=>(Os=t.dynCall_diiiii=M.uh)(n,i,o,a,l,p),Rs=t.dynCall_viiijjiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k)=>(Rs=t.dynCall_viiijjiiiiii=M.vh)(n,i,o,a,l,p,h,y,b,_,S,k),Bs=t.dynCall_viijjijjjjiii=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(Bs=t.dynCall_viijjijjjjiii=M.wh)(n,i,o,a,l,p,h,y,b,_,S,k,z),Ds=t.dynCall_iiiij=(n,i,o,a,l)=>(Ds=t.dynCall_iiiij=M.xh)(n,i,o,a,l),zs=t.dynCall_viiijii=(n,i,o,a,l,p,h)=>(zs=t.dynCall_viiijii=M.yh)(n,i,o,a,l,p,h),Ms=t.dynCall_viijiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z)=>(Ms=t.dynCall_viijiiiiiiiii=M.zh)(n,i,o,a,l,p,h,y,b,_,S,k,z),js=t.dynCall_fiiii=(n,i,o,a,l)=>(js=t.dynCall_fiiii=M.Ah)(n,i,o,a,l),Us=t.dynCall_jfi=(n,i,o)=>(Us=t.dynCall_jfi=M.Bh)(n,i,o),Vs=t.dynCall_viiiiiiiiiiiiii=(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)=>(Vs=t.dynCall_viiiiiiiiiiiiii=M.Ch)(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V),Ws=t.dynCall_jiij=(n,i,o,a)=>(Ws=t.dynCall_jiij=M.Dh)(n,i,o,a),Ns=n=>(Ns=M.Eh)(n),Gs=()=>(Gs=M.Fh)(),Hs=n=>(Hs=M.Gh)(n),Ls=()=>(Ls=M.Hh)();t.___start_em_js=1275044,t.___stop_em_js=1275205;function vf(n,i,o,a){var l=G();try{return Ar(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function wf(n,i,o){var a=G();try{return Kr(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function _f(n,i,o){var a=G();try{tr(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function $f(n,i){var o=G();try{return Yr(n,i)}catch(a){if(N(o),a!==a+0)throw a;W(1,0)}}function Cf(n,i){var o=G();try{Tr(n,i)}catch(a){if(N(o),a!==a+0)throw a;W(1,0)}}function Sf(n,i,o,a){var l=G();try{return Xr(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function xf(n){var i=G();try{Er(n)}catch(o){if(N(i),o!==o+0)throw o;W(1,0)}}function If(n,i,o,a,l,p,h){var y=G();try{return Zr(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function Af(n,i,o,a,l,p){var h=G();try{return Qr(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Tf(n,i,o,a,l){var p=G();try{return Jr(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Ef(n,i,o,a){var l=G();try{Pr(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function Pf(n,i,o,a,l){var p=G();try{kr(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function kf(n,i,o,a,l,p){var h=G();try{rr(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Of(n,i,o,a,l,p,h){var y=G();try{en(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function Rf(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{rn(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function Bf(n,i,o){var a=G();try{return on(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function Df(n,i,o){var a=G();try{return Nn(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function zf(n,i,o){var a=G();try{return nr(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function Mf(n,i,o){var a=G();try{return an(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;return W(1,0),0n}}function jf(n,i,o,a,l,p,h,y,b){var _=G();try{v(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function Uf(n){var i=G();try{return m(n)}catch(o){if(N(i),o!==o+0)throw o;W(1,0)}}function Vf(n,i,o){var a=G();try{ve(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function Wf(n,i,o,a,l){var p=G();try{tn(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Nf(n,i,o,a,l,p,h){var y=G();try{I(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function Gf(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{Me(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function Hf(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{je(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function Lf(n,i,o,a,l,p,h,y){var b=G();try{return q(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function Ff(n,i,o,a,l,p,h,y){var b=G();try{Ie(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function qf(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{return Q(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function Kf(n,i,o,a,l,p,h,y,b,_){var S=G();try{re(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function Yf(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{kt(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function Zf(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{return yo(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function Qf(n,i,o,a,l,p,h,y,b){var _=G();try{return sn(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function Xf(n,i,o,a,l,p,h,y,b){var _=G();try{bo(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function Jf(n,i,o,a){var l=G();try{H(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function ep(n,i){var o=G();try{return vo(n,i)}catch(a){if(N(o),a!==a+0)throw a;W(1,0)}}function tp(n,i){var o=G();try{return D(n,i)}catch(a){if(N(o),a!==a+0)throw a;return W(1,0),0n}}function rp(n,i){var o=G();try{return _o(n,i)}catch(a){if(N(o),a!==a+0)throw a;W(1,0)}}function np(n,i,o,a){var l=G();try{Co(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function ip(n,i,o,a,l,p,h){var y=G();try{zs(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function op(n,i,o,a,l){var p=G();try{Ta(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function ap(n,i,o,a,l,p,h,y,b,_){var S=G();try{return So(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function sp(n,i,o,a,l,p,h){var y=G();try{xo(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function up(n,i,o,a){var l=G();try{Io(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function lp(n,i,o,a,l,p,h,y,b){var _=G();try{return Ue(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function dp(n,i,o,a,l,p,h){var y=G();try{Ao(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function cp(n,i,o,a,l,p,h,y,b){var _=G();try{nn(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function fp(n,i,o,a,l,p,h){var y=G();try{To(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function pp(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{Eo(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function mp(n,i,o,a){var l=G();try{return ko(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;return W(1,0),0n}}function hp(n,i,o,a,l,p,h,y){var b=G();try{Oo(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function gp(n,i,o,a,l){var p=G();try{Ro(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function yp(n,i,o,a){var l=G();try{Do(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function bp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y){var ie=G();try{zo(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)}catch(de){if(N(ie),de!==de+0)throw de;W(1,0)}}function vp(n,i,o,a,l,p){var h=G();try{Mo(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function wp(n,i,o,a,l,p,h,y,b){var _=G();try{jo(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function _p(n,i,o,a,l){var p=G();try{return Uo(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function $p(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{return Vo(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function Cp(n,i){var o=G();try{Wo(n,i)}catch(a){if(N(o),a!==a+0)throw a;W(1,0)}}function Sp(n,i,o){var a=G();try{return No(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;return W(1,0),0n}}function xp(n,i,o,a,l,p,h,y,b,_){var S=G();try{return Go(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function Ip(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{Ko(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function Ap(n,i,o,a,l){var p=G();try{Ho(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Tp(n,i,o,a,l,p,h){var y=G();try{Lo(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function Ep(n,i,o,a,l){var p=G();try{qo(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Pp(n,i,o,a,l,p,h,y){var b=G();try{Fo(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function kp(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{Yo(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function Op(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie){var de=G();try{return Zo(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie)}catch($e){if(N(de),$e!==$e+0)throw $e;W(1,0)}}function Rp(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Qo(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function Bp(n,i){var o=G();try{return ye(n,i)}catch(a){if(N(o),a!==a+0)throw a;W(1,0)}}function Dp(n,i,o,a,l){var p=G();try{return js(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function zp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze){var We=G();try{return Xo(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze)}catch(et){if(N(We),et!==et+0)throw et;W(1,0)}}function Mp(n,i,o,a,l,p,h,y,b,_){var S=G();try{Jo(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function jp(n,i,o,a,l,p,h){var y=G();try{return ea(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function Up(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{ta(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function Vp(n,i,o,a,l,p){var h=G();try{return ra(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Wp(n,i,o,a,l,p){var h=G();try{ia(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Np(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{oa(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function Gp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de){var $e=G();try{aa(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de)}catch(ze){if(N($e),ze!==ze+0)throw ze;W(1,0)}}function Hp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie){var de=G();try{sa(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie)}catch($e){if(N(de),$e!==$e+0)throw $e;W(1,0)}}function Lp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y){var ie=G();try{ua(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)}catch(de){if(N(ie),de!==de+0)throw de;W(1,0)}}function Fp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V){var Y=G();try{la(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)}catch(ie){if(N(Y),ie!==ie+0)throw ie;W(1,0)}}function qp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We){var et=G();try{da(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We)}catch(dt){if(N(et),dt!==dt+0)throw dt;W(1,0)}}function Kp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e){var ze=G();try{ca(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e)}catch(We){if(N(ze),We!==We+0)throw We;W(1,0)}}function Yp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de){var $e=G();try{fa(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de)}catch(ze){if(N($e),ze!==ze+0)throw ze;W(1,0)}}function Zp(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We){var et=G();try{pa(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We)}catch(dt){if(N(et),dt!==dt+0)throw dt;W(1,0)}}function Qp(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{ma(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function Xp(n,i,o,a,l,p,h,y,b,_){var S=G();try{ha(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function Jp(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{ga(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function em(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V){var Y=G();try{ya(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)}catch(ie){if(N(Y),ie!==ie+0)throw ie;W(1,0)}}function tm(n,i,o,a,l,p,h,y,b,_){var S=G();try{va(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function rm(n,i,o,a,l,p,h,y,b){var _=G();try{wa(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function nm(n,i,o,a,l,p,h){var y=G();try{return na(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function im(n,i,o,a,l){var p=G();try{ba(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function om(n,i,o){var a=G();try{return Us(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;return W(1,0),0n}}function am(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{_a(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function sm(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Ca(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function um(n,i,o,a,l,p,h){var y=G();try{return Sa(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function lm(n,i,o,a,l,p){var h=G();try{return xa(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function dm(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Ia(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function cm(n,i,o,a,l,p){var h=G();try{$a(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function fm(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{Aa(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function pm(n,i,o,a,l,p,h,y){var b=G();try{Ea(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function mm(n,i,o,a,l,p,h,y){var b=G();try{Pa(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function hm(n,i,o,a){var l=G();try{return ka(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function gm(n,i,o,a,l,p,h,y,b,_){var S=G();try{Oa(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function ym(n,i,o,a,l,p,h,y,b){var _=G();try{Ra(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function bm(n,i,o,a,l,p,h,y,b){var _=G();try{Ba(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function vm(n,i,o,a,l,p,h,y,b,_){var S=G();try{Da(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function wm(n,i,o,a,l,p){var h=G();try{za(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function _m(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{Ma(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function $m(n,i,o,a,l,p,h,y){var b=G();try{return ja(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function Cm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V){var Y=G();try{Vs(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)}catch(ie){if(N(Y),ie!==ie+0)throw ie;W(1,0)}}function Sm(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{Ua(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function xm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V){var Y=G();try{Va(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V)}catch(ie){if(N(Y),ie!==ie+0)throw ie;W(1,0)}}function Im(n,i,o){var a=G();try{Wa(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function Am(n,i,o,a){var l=G();try{return Ga(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function Tm(n,i,o,a){var l=G();try{return Ha(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function Em(n,i,o,a,l,p,h,y,b,_){var S=G();try{La(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function Pm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We,et,dt,Ci,Si,xi){var Ph=G();try{Fa(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We,et,dt,Ci,Si,xi)}catch(Ii){if(N(Ph),Ii!==Ii+0)throw Ii;W(1,0)}}function km(n,i,o,a,l,p){var h=G();try{qa(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Om(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{return Ka(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function Rm(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Ya(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function Bm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We){var et=G();try{Za(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze,We)}catch(dt){if(N(et),dt!==dt+0)throw dt;W(1,0)}}function Dm(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Qa(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function zm(n,i,o,a,l,p,h,y,b,_,S,k,z,T){var V=G();try{Xa(n,i,o,a,l,p,h,y,b,_,S,k,z,T)}catch(Y){if(N(V),Y!==Y+0)throw Y;W(1,0)}}function Mm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze){var We=G();try{es(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze)}catch(et){if(N(We),et!==et+0)throw et;W(1,0)}}function jm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie){var de=G();try{rs(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie)}catch($e){if(N(de),$e!==$e+0)throw $e;W(1,0)}}function Um(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e){var ze=G();try{Ja(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e)}catch(We){if(N(ze),We!==We+0)throw We;W(1,0)}}function Vm(n,i,o,a,l,p,h,y){var b=G();try{ns(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function Wm(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{os(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function Nm(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{return as(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function Gm(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze){var We=G();try{return ss(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y,ie,de,$e,ze)}catch(et){if(N(We),et!==et+0)throw et;W(1,0)}}function Hm(n,i,o,a,l){var p=G();try{us(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Lm(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{Po(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function Fm(n,i,o,a,l,p,h,y,b,_){var S=G();try{ls(n,i,o,a,l,p,h,y,b,_)}catch(k){if(N(S),k!==k+0)throw k;W(1,0)}}function qm(n,i,o,a,l){var p=G();try{ds(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Km(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Ms(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function Ym(n,i,o,a,l){var p=G();try{return cs(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Zm(n,i,o,a){var l=G();try{return Ws(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;return W(1,0),0n}}function Qm(n,i,o,a,l,p,h){var y=G();try{fs(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function Xm(n,i,o,a,l,p){var h=G();try{return ps(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Jm(n,i,o,a,l,p){var h=G();try{return ms(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function eh(n,i,o,a,l,p,h,y,b){var _=G();try{hs(n,i,o,a,l,p,h,y,b)}catch(S){if(N(_),S!==S+0)throw S;W(1,0)}}function th(n,i,o,a){var l=G();try{Na(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function rh(n,i,o,a,l,p,h,y){var b=G();try{return gs(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function nh(n,i,o,a,l,p){var h=G();try{return ys(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function ih(n,i,o,a,l,p){var h=G();try{return bs(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function oh(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{return vs(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function ah(n,i,o,a,l,p,h,y){var b=G();try{return ws(n,i,o,a,l,p,h,y)}catch(_){if(N(b),_!==_+0)throw _;W(1,0)}}function sh(n,i,o,a,l,p,h,y,b,_,S){var k=G();try{return _s(n,i,o,a,l,p,h,y,b,_,S)}catch(z){if(N(k),z!==z+0)throw z;W(1,0)}}function uh(n,i,o,a,l,p,h){var y=G();try{return $s(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function lh(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{return Cs(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function dh(n,i,o,a,l,p,h){var y=G();try{return Ss(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function ch(n,i,o,a,l,p,h){var y=G();try{return xs(n,i,o,a,l,p,h)}catch(b){if(N(y),b!==b+0)throw b;W(1,0)}}function fh(n,i,o){var a=G();try{return Is(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;return W(1,0),0n}}function ph(n,i,o,a){var l=G();try{return As(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function mh(n,i,o,a){var l=G();try{Es(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function hh(n,i,o,a){var l=G();try{return Ts(n,i,o,a)}catch(p){if(N(l),p!==p+0)throw p;W(1,0)}}function gh(n,i,o,a,l){var p=G();try{Ps(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function yh(n,i,o,a,l){var p=G();try{return ks(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function bh(n,i,o,a,l,p){var h=G();try{return Os(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function vh(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{Rs(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function wh(n,i,o,a,l,p,h,y,b,_,S,k,z){var T=G();try{Bs(n,i,o,a,l,p,h,y,b,_,S,k,z)}catch(V){if(N(T),V!==V+0)throw V;W(1,0)}}function _h(n,i,o,a,l,p,h,y,b,_,S,k){var z=G();try{Bo(n,i,o,a,l,p,h,y,b,_,S,k)}catch(T){if(N(z),T!==T+0)throw T;W(1,0)}}function $h(n,i,o,a,l){var p=G();try{return Ds(n,i,o,a,l)}catch(h){if(N(p),h!==h+0)throw h;W(1,0)}}function Ch(n){var i=G();try{return fe(n)}catch(o){if(N(i),o!==o+0)throw o;return W(1,0),0n}}function Sh(n,i,o,a,l,p){var h=G();try{return he(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function xh(n,i,o,a,l,p){var h=G();try{return is(n,i,o,a,l,p)}catch(y){if(N(h),y!==y+0)throw y;W(1,0)}}function Ih(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y){var ie=G();try{ts(n,i,o,a,l,p,h,y,b,_,S,k,z,T,V,Y)}catch(de){if(N(ie),de!==de+0)throw de;W(1,0)}}function Ah(n,i,o){var a=G();try{return wo(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function Th(n,i,o){var a=G();try{return $o(n,i,o)}catch(l){if(N(a),l!==l+0)throw l;W(1,0)}}function Eh(){var n=M;n=Object.assign({},n);var i=o=>a=>o(a)>>>0;return n.Fd=i(n.Fd),n.he=i(n.he),n.ne=i(n.ne),n.oe=(o=>()=>o()>>>0)(n.oe),n}t.stackSave=()=>G(),t.stackRestore=n=>N(n),t.stackAlloc=n=>Mn(n),t.UTF8ToString=qe,t.stringToUTF8=(n,i,o)=>vt(n,oe,i,o),t.lengthBytesUTF8=Kt;var Gn;ee=function n(){Gn||Fs(),Gn||(ee=n)};function Fs(){if(!(0<_e)){if(t.preRun)for(typeof t.preRun==\"function\"&&(t.preRun=[t.preRun]);t.preRun.length;){var n=t.preRun.shift();Ce.unshift(n)}for(;0Ks)});var Qs=un(()=>{});var Xs=un(()=>{});var Js={};Hn(Js,{cpus:()=>jh});var jh,eu=ae(()=>{jh=void 0});var nu=un((ru,ki)=>{\"use strict\";var tu=(()=>{var e=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(e=e||__filename),function(r={}){function t(){return we.buffer!=Ce.buffer&&ee(),Ce}function u(){return we.buffer!=Ce.buffer&&ee(),be}function s(){return we.buffer!=Ce.buffer&&ee(),Ae}function c(){return we.buffer!=Ce.buffer&&ee(),_e}function f(){return we.buffer!=Ce.buffer&&ee(),Je}var d=r,g,w;d.ready=new Promise((m,v)=>{g=m,w=v}),d.jsepInit=(m,v,I,D,H,Q,re,ye)=>{d.Qb=m,d.wb=v,d.yb=I,d.jb=D,d.xb=H,d.Ea=Q,d.zb=re,d.Ab=ye,v=(he,fe,ve)=>(...Me)=>{let je=lt,q=fe?.();Me=he(...Me);let Ie=fe?.();return q!==Ie&&(he=Ie,ve(q),fe=ve=null),lt!=je?N():Me},I=he=>async(...fe)=>{try{if(d.bb)throw Error(\"Session already started\");let ve=d.bb={Fb:fe[0],errors:[]},Me=await he(...fe);if(d.bb!==ve)throw Error(\"Session mismatch\");m.flush();let je=ve.errors;if(0Ie),0d._OrtRun,he=>d._OrtRun=he)),d._OrtRunWithBinding=I(v(d._OrtRunWithBinding,()=>d._OrtRunWithBinding,he=>d._OrtRunWithBinding=he)),d._OrtBindInput=v(d._OrtBindInput,()=>d._OrtBindInput,he=>d._OrtBindInput=he),d.jsepRegisterBuffer=(he,fe,ve,Me)=>m.registerBuffer(he,fe,ve,Me),d.jsepUnregisterBuffers=he=>{m.unregisterBuffers(he)},d.jsepGetBuffer=he=>m.getBuffer(he),d.jsepCreateDownloader=(he,fe,ve)=>m.createDownloader(he,fe,ve)};var C=Object.assign({},d),$=\"./this.program\",A=(m,v)=>{throw v},P=typeof window==\"object\",x=typeof importScripts==\"function\",E=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",O=d.ENVIRONMENT_IS_PTHREAD||!1,B=\"\";function R(m){return d.locateFile?d.locateFile(m,B):B+m}var j,U,L;if(E){var F=(Fn(),ir(Ln)),te=(Ei(),ir(Ti));B=x?te.dirname(B)+\"/\":__dirname+\"/\",j=(v,I)=>(v=v.startsWith(\"file://\")?new URL(v):te.normalize(v),F.readFileSync(v,I?void 0:\"utf8\")),L=v=>(v=j(v,!0),v.buffer||(v=new Uint8Array(v)),v),U=(v,I,D,H=!0)=>{v=v.startsWith(\"file://\")?new URL(v):te.normalize(v),F.readFile(v,H?void 0:\"utf8\",(Q,re)=>{Q?D(Q):I(H?re.buffer:re)})},!d.thisProgram&&1{throw process.exitCode=v,I},d.inspect=()=>\"[Emscripten Module object]\";let m;try{m=Qs()}catch(v){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),v}global.Worker=m.Worker}else(P||x)&&(x?B=self.location.href:typeof document<\"u\"&&document.currentScript&&(B=document.currentScript.src),typeof e<\"u\"&&e&&(B=e),B.indexOf(\"blob:\")!==0?B=B.substr(0,B.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):B=\"\",E||(j=m=>{var v=new XMLHttpRequest;return v.open(\"GET\",m,!1),v.send(null),v.responseText},x&&(L=m=>{var v=new XMLHttpRequest;return v.open(\"GET\",m,!1),v.responseType=\"arraybuffer\",v.send(null),new Uint8Array(v.response)}),U=(m,v,I)=>{var D=new XMLHttpRequest;D.open(\"GET\",m,!0),D.responseType=\"arraybuffer\",D.onload=()=>{D.status==200||D.status==0&&D.response?v(D.response):I()},D.onerror=I,D.send(null)}));E&&typeof performance>\"u\"&&(global.performance=Xs().performance);var J=console.log.bind(console),oe=console.error.bind(console);E&&(J=(...m)=>F.writeSync(1,m.join(\" \")+`\n`),oe=(...m)=>F.writeSync(2,m.join(\" \")+`\n`));var le=d.print||J,ge=d.printErr||oe;Object.assign(d,C),C=null,d.thisProgram&&($=d.thisProgram),d.quit&&(A=d.quit);var X;d.wasmBinary&&(X=d.wasmBinary);var pe=d.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&pt(\"no native wasm support detected\");var we,ue,me,Ee=!1,Pe,Ce,be,Ae,_e,Je;function ee(){var m=we.buffer;d.HEAP8=Ce=new Int8Array(m),d.HEAP16=new Int16Array(m),d.HEAP32=Ae=new Int32Array(m),d.HEAPU8=be=new Uint8Array(m),d.HEAPU16=new Uint16Array(m),d.HEAPU32=_e=new Uint32Array(m),d.HEAPF32=new Float32Array(m),d.HEAPF64=Je=new Float64Array(m)}var ce=d.INITIAL_MEMORY||16777216;if(5242880<=ce||pt(\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+ce+\"! (STACK_SIZE=5242880)\"),O)we=d.wasmMemory;else if(d.wasmMemory)we=d.wasmMemory;else if(we=new WebAssembly.Memory({initial:ce/65536,maximum:65536,shared:!0}),!(we.buffer instanceof SharedArrayBuffer))throw ge(\"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\"),E&&ge(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");ee(),ce=we.buffer.byteLength;var Be=[],tt=[],Ye=[],Ke=0;function Pt(){return pe||0{if(!v.ok)throw\"failed to load wasm binary file at '\"+m+\"'\";return v.arrayBuffer()}).catch(()=>cr(m));if(U)return new Promise((v,I)=>{U(m,D=>v(new Uint8Array(D)),I)})}return Promise.resolve().then(()=>cr(m))}function zr(m,v,I){return fr(m).then(D=>WebAssembly.instantiate(D,v)).then(D=>D).then(I,D=>{ge(\"failed to asynchronously prepare wasm: \"+D),pt(D)})}function hn(m,v){var I=ut;return X||typeof WebAssembly.instantiateStreaming!=\"function\"||qt(I)||I.startsWith(\"file://\")||E||typeof fetch!=\"function\"?zr(I,m,v):fetch(I,{credentials:\"same-origin\"}).then(D=>WebAssembly.instantiateStreaming(D,m).then(v,function(H){return ge(\"wasm streaming compile failed: \"+H),ge(\"falling back to ArrayBuffer instantiation\"),zr(I,m,v)}))}var qe,Kt={906828:m=>{d.Ea(\"Abs\",m,void 0)},906879:m=>{d.Ea(\"Neg\",m,void 0)},906930:m=>{d.Ea(\"Floor\",m,void 0)},906983:m=>{d.Ea(\"Ceil\",m,void 0)},907035:m=>{d.Ea(\"Reciprocal\",m,void 0)},907093:m=>{d.Ea(\"Sqrt\",m,void 0)},907145:m=>{d.Ea(\"Exp\",m,void 0)},907196:m=>{d.Ea(\"Erf\",m,void 0)},907247:m=>{d.Ea(\"Sigmoid\",m,void 0)},907302:m=>{d.Ea(\"Log\",m,void 0)},907353:m=>{d.Ea(\"Sin\",m,void 0)},907404:m=>{d.Ea(\"Cos\",m,void 0)},907455:m=>{d.Ea(\"Tan\",m,void 0)},907506:m=>{d.Ea(\"Asin\",m,void 0)},907558:m=>{d.Ea(\"Acos\",m,void 0)},907610:m=>{d.Ea(\"Atan\",m,void 0)},907662:m=>{d.Ea(\"Sinh\",m,void 0)},907714:m=>{d.Ea(\"Cosh\",m,void 0)},907766:m=>{d.Ea(\"Asinh\",m,void 0)},907819:m=>{d.Ea(\"Acosh\",m,void 0)},907872:m=>{d.Ea(\"Atanh\",m,void 0)},907925:m=>{d.Ea(\"Tanh\",m,void 0)},907977:m=>{d.Ea(\"Not\",m,void 0)},908028:(m,v,I)=>{d.Ea(\"ClipV10\",m,{min:v,max:I})},908100:m=>{d.Ea(\"Clip\",m,void 0)},908152:(m,v)=>{d.Ea(\"Elu\",m,{alpha:v})},908210:m=>{d.Ea(\"Relu\",m,void 0)},908262:(m,v)=>{d.Ea(\"LeakyRelu\",m,{alpha:v})},908326:(m,v)=>{d.Ea(\"ThresholdedRelu\",m,{alpha:v})},908396:(m,v)=>{d.Ea(\"Cast\",m,{to:v})},908454:m=>{d.Ea(\"Add\",m,void 0)},908505:m=>{d.Ea(\"Sub\",m,void 0)},908556:m=>{d.Ea(\"Mul\",m,void 0)},908607:m=>{d.Ea(\"Div\",m,void 0)},908658:m=>{d.Ea(\"Pow\",m,void 0)},908709:m=>{d.Ea(\"Equal\",m,void 0)},908762:m=>{d.Ea(\"Greater\",m,void 0)},908817:m=>{d.Ea(\"GreaterOrEqual\",m,void 0)},908879:m=>{d.Ea(\"Less\",m,void 0)},908931:m=>{d.Ea(\"LessOrEqual\",m,void 0)},908990:(m,v,I,D,H)=>{d.Ea(\"ReduceMean\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},909154:(m,v,I,D,H)=>{d.Ea(\"ReduceMax\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},909317:(m,v,I,D,H)=>{d.Ea(\"ReduceMin\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},909480:(m,v,I,D,H)=>{d.Ea(\"ReduceProd\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},909644:(m,v,I,D,H)=>{d.Ea(\"ReduceSum\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},909807:(m,v,I,D,H)=>{d.Ea(\"ReduceL1\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},909969:(m,v,I,D,H)=>{d.Ea(\"ReduceL2\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},910131:(m,v,I,D,H)=>{d.Ea(\"ReduceLogSum\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},910297:(m,v,I,D,H)=>{d.Ea(\"ReduceSumSquare\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},910466:(m,v,I,D,H)=>{d.Ea(\"ReduceLogSumExp\",m,{keepDims:!!v,noopWithEmptyAxes:!!I,axes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},910635:m=>{d.Ea(\"Where\",m,void 0)},910688:(m,v,I)=>{d.Ea(\"Transpose\",m,{perm:v?Array.from(s().subarray(I>>>0,I+v>>>0)):[]})},910801:(m,v,I,D,H,Q,re,ye,he,fe)=>{d.Ea(\"Conv\",m,{format:he?\"NHWC\":\"NCHW\",auto_pad:v,dilations:[I],group:D,kernel_shape:[H],pads:[Q,re],strides:[ye],w_is_const:()=>!!t()[fe>>>0]})},911029:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q,Ie)=>{d.Ea(\"Conv\",m,{format:q?\"NHWC\":\"NCHW\",auto_pad:v,dilations:[I,D],group:H,kernel_shape:[Q,re],pads:[ye,he,fe,ve],strides:[Me,je],w_is_const:()=>!!t()[Ie>>>0]})},911288:(m,v,I,D,H,Q,re,ye,he,fe)=>{d.Ea(\"Conv\",m,{format:he?\"NHWC\":\"NCHW\",auto_pad:v,dilations:[I],group:D,kernel_shape:[H],pads:[Q,re],strides:[ye],w_is_const:()=>!!t()[fe>>>0]})},911516:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q,Ie)=>{d.Ea(\"Conv\",m,{format:q?\"NHWC\":\"NCHW\",auto_pad:v,dilations:[I,D],group:H,kernel_shape:[Q,re],pads:[ye,he,fe,ve],strides:[Me,je],w_is_const:()=>!!t()[Ie>>>0]})},911775:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q)=>{d.Ea(\"ConvTranspose\",m,{format:he?\"NHWC\":\"NCHW\",autoPad:v,dilations:[I],group:D,kernel_shape:[H],pads:[Q,re],strides:[ye],wIsConst:()=>!!t()[fe>>>0],outputPadding:ve?Array.from(s().subarray(Me>>>0,Me+ve>>>0)):[],outputShape:je?Array.from(s().subarray(q>>>0,q+je>>>0)):[]})},912155:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je)=>{d.Ea(\"ConvTranspose\",m,{format:ye?\"NHWC\":\"NCHW\",autoPad:v,dilations:Array.from(s().subarray(I>>>0,I+2>>>0)),group:D,kernelShape:Array.from(s().subarray(H>>>0,H+2>>>0)),pads:Array.from(s().subarray(Q>>>0,Q+4>>>0)),strides:Array.from(s().subarray(re>>>0,re+2>>>0)),wIsConst:()=>!!t()[he>>>0],outputPadding:0>>0,ve+fe>>>0)):[],outputShape:0>>0,je+Me>>>0)):[]})},912678:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q)=>{d.Ea(\"ConvTranspose\",m,{format:he?\"NHWC\":\"NCHW\",autoPad:v,dilations:[I],group:D,kernel_shape:[H],pads:[Q,re],strides:[ye],wIsConst:()=>!!t()[fe>>>0],outputPadding:ve?Array.from(s().subarray(Me>>>0,Me+ve>>>0)):[],outputShape:je?Array.from(s().subarray(q>>>0,q+je>>>0)):[]})},913058:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je)=>{d.Ea(\"ConvTranspose\",m,{format:ye?\"NHWC\":\"NCHW\",autoPad:v,dilations:Array.from(s().subarray(I>>>0,I+2>>>0)),group:D,kernelShape:Array.from(s().subarray(H>>>0,H+2>>>0)),pads:Array.from(s().subarray(Q>>>0,Q+4>>>0)),strides:Array.from(s().subarray(re>>>0,re+2>>>0)),wIsConst:()=>!!t()[he>>>0],outputPadding:0>>0,ve+fe>>>0)):[],outputShape:0>>0,je+Me>>>0)):[]})},913581:(m,v)=>{d.Ea(\"GlobalAveragePool\",m,{format:v?\"NHWC\":\"NCHW\"})},913672:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q,Ie,Ue)=>{d.Ea(\"AveragePool\",m,{format:Ue?\"NHWC\":\"NCHW\",auto_pad:v,ceil_mode:I,count_include_pad:D,storage_order:H,dilations:[Q,re],kernel_shape:[ye,he],pads:[fe,ve,Me,je],strides:[q,Ie]})},913956:(m,v)=>{d.Ea(\"GlobalAveragePool\",m,{format:v?\"NHWC\":\"NCHW\"})},914047:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q,Ie,Ue)=>{d.Ea(\"AveragePool\",m,{format:Ue?\"NHWC\":\"NCHW\",auto_pad:v,ceil_mode:I,count_include_pad:D,storage_order:H,dilations:[Q,re],kernel_shape:[ye,he],pads:[fe,ve,Me,je],strides:[q,Ie]})},914331:(m,v)=>{d.Ea(\"GlobalMaxPool\",m,{format:v?\"NHWC\":\"NCHW\"})},914418:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q,Ie,Ue)=>{d.Ea(\"MaxPool\",m,{format:Ue?\"NHWC\":\"NCHW\",auto_pad:v,ceil_mode:I,count_include_pad:D,storage_order:H,dilations:[Q,re],kernel_shape:[ye,he],pads:[fe,ve,Me,je],strides:[q,Ie]})},914698:(m,v)=>{d.Ea(\"GlobalMaxPool\",m,{format:v?\"NHWC\":\"NCHW\"})},914785:(m,v,I,D,H,Q,re,ye,he,fe,ve,Me,je,q,Ie,Ue)=>{d.Ea(\"MaxPool\",m,{format:Ue?\"NHWC\":\"NCHW\",auto_pad:v,ceil_mode:I,count_include_pad:D,storage_order:H,dilations:[Q,re],kernel_shape:[ye,he],pads:[fe,ve,Me,je],strides:[q,Ie]})},915065:(m,v,I,D,H)=>{d.Ea(\"Gemm\",m,{alpha:v,beta:I,transA:D,transB:H})},915169:m=>{d.Ea(\"MatMul\",m,void 0)},915223:(m,v,I,D)=>{d.Ea(\"ArgMax\",m,{keepDims:!!v,selectLastIndex:!!I,axis:D})},915331:(m,v,I,D)=>{d.Ea(\"ArgMin\",m,{keepDims:!!v,selectLastIndex:!!I,axis:D})},915439:(m,v)=>{d.Ea(\"Softmax\",m,{axis:v})},915502:(m,v)=>{d.Ea(\"Concat\",m,{axis:v})},915562:(m,v,I,D,H)=>{d.Ea(\"Split\",m,{axis:v,numOutputs:I,splitSizes:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},915707:m=>{d.Ea(\"Expand\",m,void 0)},915761:(m,v)=>{d.Ea(\"Gather\",m,{axis:Number(v)})},915832:(m,v)=>{d.Ea(\"GatherElements\",m,{axis:Number(v)})},915911:(m,v,I,D,H,Q,re,ye,he,fe,ve)=>{d.Ea(\"Resize\",m,{antialias:v,axes:I?Array.from(s().subarray(D>>>0,D+I>>>0)):[],coordinateTransformMode:it(H),cubicCoeffA:Q,excludeOutside:re,extrapolationValue:ye,keepAspectRatioPolicy:it(he),mode:it(fe),nearestMode:it(ve)})},916262:(m,v,I,D,H,Q,re)=>{d.Ea(\"Slice\",m,{starts:v?Array.from(s().subarray(I>>>0,I+v>>>0)):[],ends:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[],axes:Q?Array.from(s().subarray(re>>>0,re+Q>>>0)):[]})},916493:m=>{d.Ea(\"Tile\",m,void 0)},916545:(m,v,I)=>{d.Ea(\"LayerNormalization\",m,{axis:Number(v),epsilon:Number(I)})},916652:(m,v,I)=>{d.Ea(\"InstanceNormalization\",m,{epsilon:v,format:I?\"NHWC\":\"NCHW\"})},916766:(m,v,I)=>{d.Ea(\"InstanceNormalization\",m,{epsilon:v,format:I?\"NHWC\":\"NCHW\"})},916880:m=>{d.Ea(\"Range\",m,void 0)},916933:(m,v)=>{d.Ea(\"Einsum\",m,{equation:it(v)})},917014:(m,v,I,D,H)=>{d.Ea(\"Pad\",m,{mode:v,value:I,pads:D?Array.from(s().subarray(H>>>0,H+D>>>0)):[]})},917146:m=>{d.Ea(\"Gelu\",m,void 0)},917198:m=>{d.Ea(\"BiasAdd\",m,void 0)},917253:m=>{d.Ea(\"BiasSplitGelu\",m,void 0)},917314:(m,v)=>{d.Ea(\"SkipLayerNormalization\",m,{epsilon:v})},917395:m=>{d.zb(m)},917429:(m,v)=>d.Ab(m,v,d.bb.Fb,d.bb.errors),917541:m=>d.wb(m),917574:m=>d.yb(m),917606:(m,v,I)=>{d.jb(m,v,I,!0)},917645:(m,v,I)=>{d.jb(m,v,I)}};function vt(m){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${m})`,this.status=m}function pr(m){m.terminate(),m.onmessage=()=>{}}function mt(m){(m=Se.Qa[m])||pt(),Se.Eb(m)}function mr(m){var v=Se.tb();if(!v)return 6;Se.Ya.push(v),Se.Qa[m.Xa]=v,v.Xa=m.Xa;var I={cmd:\"run\",start_routine:m.Gb,arg:m.rb,pthread_ptr:m.Xa};return E&&v.unref(),v.postMessage(I,m.Mb),0}var hr=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,gn=(m,v,I)=>{v>>>=0;var D=v+I;for(I=v;m[I]&&!(I>=D);)++I;if(16H?D+=String.fromCharCode(H):(H-=65536,D+=String.fromCharCode(55296|H>>10,56320|H&1023))}}else D+=String.fromCharCode(H)}return D},it=(m,v)=>(m>>>=0)?gn(u(),m,v):\"\";function yn(m){if(O)return Ge(1,1,m);Pe=m,Pt()||(Se.Hb(),d.onExit&&d.onExit(m),Ee=!0),A(m,new vt(m))}var ht=m=>{if(Pe=m,O)throw wt(m),\"unwind\";yn(m)},Se={ab:[],Ya:[],mb:[],Qa:{},gb:function(){O?Se.vb():Se.ub()},ub:function(){Be.unshift(()=>{Ut(),Se.Bb(()=>Vt())})},vb:function(){Se.receiveObjectTransfer=Se.Db,Se.threadInitTLS=Se.lb,Se.setExitStatus=Se.kb,pe=!1},kb:function(m){Pe=m},Sb:[\"$terminateWorker\"],Hb:function(){for(var m of Se.Ya)pr(m);for(m of Se.ab)pr(m);Se.ab=[],Se.Ya=[],Se.Qa=[]},Eb:function(m){var v=m.Xa;delete Se.Qa[v],Se.ab.push(m),Se.Ya.splice(Se.Ya.indexOf(m),1),m.Xa=0,Tr(v)},Db:function(){},lb:function(){Se.mb.forEach(m=>m())},Cb:m=>new Promise(v=>{m.onmessage=Q=>{Q=Q.data;var re=Q.cmd;if(Q.targetThread&&Q.targetThread!=tr()){var ye=Se.Qa[Q.Rb];ye?ye.postMessage(Q,Q.transferList):ge('Internal error! Worker sent a message \"'+re+'\" to target pthread '+Q.targetThread+\", but that thread no longer exists!\")}else re===\"checkMailbox\"?Qt():re===\"spawnThread\"?mr(Q):re===\"cleanupThread\"?mt(Q.thread):re===\"killThread\"?(Q=Q.thread,re=Se.Qa[Q],delete Se.Qa[Q],pr(re),Tr(Q),Se.Ya.splice(Se.Ya.indexOf(re),1),re.Xa=0):re===\"cancelThread\"?Se.Qa[Q.thread].postMessage({cmd:\"cancel\"}):re===\"loaded\"?(m.loaded=!0,v(m)):re===\"alert\"?alert(\"Thread \"+Q.threadId+\": \"+Q.text):Q.target===\"setimmediate\"?m.postMessage(Q):re===\"callHandler\"?d[Q.handler](...Q.args):re&&ge(\"worker sent an unknown command \"+re)},m.onerror=Q=>{throw ge(\"worker sent an error! \"+Q.filename+\":\"+Q.lineno+\": \"+Q.message),Q},E&&(m.on(\"message\",function(Q){m.onmessage({data:Q})}),m.on(\"error\",function(Q){m.onerror(Q)}));var I=[],D=[\"onExit\",\"onAbort\",\"print\",\"printErr\"],H;for(H of D)d.hasOwnProperty(H)&&I.push(H);m.postMessage({cmd:\"load\",handlers:I,urlOrBlob:d.mainScriptUrlOrBlob||e,wasmMemory:we,wasmModule:me})}),Bb:function(m){m()},qb:function(){var m=R(\"ort-wasm-simd-threaded.worker.js\");m=new Worker(m),Se.ab.push(m)},tb:function(){return Se.ab.length==0&&(Se.qb(),Se.Cb(Se.ab[0])),Se.ab.pop()}};d.PThread=Se;var Wt=m=>{for(;0>2>>>0];m=s()[m+56>>2>>>0],Jr(v,v-m),rr(v)};function wt(m){if(O)return Ge(2,0,m);ht(m)}d.invokeEntryPoint=function(m,v){m=en.apply(null,[m,v]),Pt()?Se.kb(m):Er(m)};function Mr(m){this.fb=m-24,this.pb=function(v){c()[this.fb+4>>2>>>0]=v},this.ob=function(v){c()[this.fb+8>>2>>>0]=v},this.gb=function(v,I){this.nb(),this.pb(v),this.ob(I)},this.nb=function(){c()[this.fb+16>>2>>>0]=0}}var ot=0,gt=0;function gr(m,v,I,D){return O?Ge(3,1,m,v,I,D):bn(m,v,I,D)}function bn(m,v,I,D){if(m>>>=0,v>>>=0,I>>>=0,D>>>=0,typeof SharedArrayBuffer>\"u\")return ge(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var H=[];return O&&H.length===0?gr(m,v,I,D):(m={Gb:I,Xa:m,rb:D,Mb:H},O?(m.Ob=\"spawnThread\",postMessage(m,H),0):mr(m))}function vn(m,v,I){return O?Ge(4,1,m,v,I):0}function jr(m,v){if(O)return Ge(5,1,m,v)}var Ur=m=>{for(var v=0,I=0;I=D?v++:2047>=D?v+=2:55296<=D&&57343>=D?(v+=4,++I):v+=3}return v},wn=(m,v,I,D)=>{if(I>>>=0,!(0=re){var ye=m.charCodeAt(++Q);re=65536+((re&1023)<<10)|ye&1023}if(127>=re){if(I>=D)break;v[I++>>>0]=re}else{if(2047>=re){if(I+1>=D)break;v[I++>>>0]=192|re>>6}else{if(65535>=re){if(I+2>=D)break;v[I++>>>0]=224|re>>12}else{if(I+3>=D)break;v[I++>>>0]=240|re>>18,v[I++>>>0]=128|re>>12&63}v[I++>>>0]=128|re>>6&63}v[I++>>>0]=128|re&63}}return v[I>>>0]=0,I-H},_n=(m,v,I)=>wn(m,u(),v,I);function $n(m,v){if(O)return Ge(6,1,m,v)}function Cn(m,v,I){if(O)return Ge(7,1,m,v,I)}function Sn(m,v,I){return O?Ge(8,1,m,v,I):0}function yr(m,v){if(O)return Ge(9,1,m,v)}function Vr(m,v,I){if(O)return Ge(10,1,m,v,I)}function Yt(m,v,I,D){if(O)return Ge(11,1,m,v,I,D)}function xn(m,v,I,D){if(O)return Ge(12,1,m,v,I,D)}function In(m,v,I,D){if(O)return Ge(13,1,m,v,I,D)}function Ct(m){if(O)return Ge(14,1,m)}function yt(m,v){if(O)return Ge(15,1,m,v)}function Wr(m,v,I){if(O)return Ge(16,1,m,v,I)}var Zt=m=>{if(!Ee)try{if(m(),!Pt())try{O?Er(Pe):ht(Pe)}catch(v){v instanceof vt||v==\"unwind\"||A(1,v)}}catch(v){v instanceof vt||v==\"unwind\"||A(1,v)}};function br(m){m>>>=0,typeof Atomics.Nb==\"function\"&&(Atomics.Nb(s(),m>>2,m).value.then(Qt),m+=128,Atomics.store(s(),m>>2,1))}d.__emscripten_thread_mailbox_await=br;function Qt(){var m=tr();m&&(br(m),Zt(()=>Qr()))}d.checkMailbox=Qt;var Nt=m=>m%4===0&&(m%100!==0||m%400===0),vr=[0,31,60,91,121,152,182,213,244,274,305,335],An=[0,31,59,90,120,151,181,212,243,273,304,334];function Tn(m,v,I,D,H,Q,re,ye){return O?Ge(17,1,m,v,I,D,H,Q,re,ye):-52}function En(m,v,I,D,H,Q,re){if(O)return Ge(18,1,m,v,I,D,H,Q,re)}var Pn=m=>{var v=Ur(m)+1,I=Ar(v);return I&&_n(m,I,v),I},wr=[],Xt=(m,v)=>{wr.length=0;var I;for(v>>=2;I=u()[m++>>>0];)v+=I!=105&v,wr.push(I==105?s()[v>>>0]:f()[v++>>>1]),++v;return wr},_i=m=>{var v=Pr();return m=m(),rr(v),m};function Ge(m,v){var I=arguments.length-2,D=arguments;return _i(()=>{for(var H=kr(8*I),Q=H>>3,re=0;re>>0]=ye}return Zr(m,I,H,v)})}var _r=[],Nr={},kn=()=>{if(!$r){var m={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\",_:$||\"./this.program\"},v;for(v in Nr)Nr[v]===void 0?delete m[v]:m[v]=Nr[v];var I=[];for(v in m)I.push(`${v}=${m[v]}`);$r=I}return $r},$r;function On(m,v){if(O)return Ge(19,1,m,v);m>>>=0,v>>>=0;var I=0;return kn().forEach(function(D,H){var Q=v+I;for(H=c()[m+4*H>>2>>>0]=Q,Q=0;Q>0>>>0]=D.charCodeAt(Q);t()[H>>0>>>0]=0,I+=D.length+1}),0}function jt(m,v){if(O)return Ge(20,1,m,v);m>>>=0,v>>>=0;var I=kn();c()[m>>2>>>0]=I.length;var D=0;return I.forEach(function(H){D+=H.length+1}),c()[v>>2>>>0]=D,0}function Gr(m){return O?Ge(21,1,m):52}function Hr(m,v,I,D){return O?Ge(22,1,m,v,I,D):52}function Cr(m,v,I,D,H){return O?Ge(23,1,m,v,I,D,H):70}var Rn=[null,[],[]];function Sr(m,v,I,D){if(O)return Ge(24,1,m,v,I,D);v>>>=0,I>>>=0,D>>>=0;for(var H=0,Q=0;Q>2>>>0],ye=c()[v+4>>2>>>0];v+=8;for(var he=0;he>>0],ve=Rn[m];fe===0||fe===10?((m===1?le:ge)(gn(ve,0)),ve.length=0):ve.push(fe)}H+=ye}return c()[D>>2>>>0]=H,0}var Lr=[31,29,31,30,31,30,31,31,30,31,30,31],xr=[31,28,31,30,31,30,31,31,30,31,30,31];function $i(m){var v=Array(Ur(m)+1);return wn(m,v,0,v.length),v}var Bn=(m,v)=>{t().set(m,v>>>0)};function Fr(m,v,I,D){function H(q,Ie,Ue){for(q=typeof q==\"number\"?q.toString():q||\"\";q.lengthsn?-1:0kt-q.getDate())Ie-=kt-q.getDate()+1,q.setDate(1),11>Ue?q.setMonth(Ue+1):(q.setMonth(0),q.setFullYear(q.getFullYear()+1));else{q.setDate(q.getDate()+Ie);break}}return Ue=new Date(q.getFullYear()+1,0,4),Ie=ye(new Date(q.getFullYear(),0,4)),Ue=ye(Ue),0>=re(Ie,q)?0>=re(Ue,q)?q.getFullYear()+1:q.getFullYear():q.getFullYear()-1}m>>>=0,v>>>=0,I>>>=0,D>>>=0;var fe=s()[D+40>>2>>>0];D={Kb:s()[D>>2>>>0],Jb:s()[D+4>>2>>>0],cb:s()[D+8>>2>>>0],ib:s()[D+12>>2>>>0],eb:s()[D+16>>2>>>0],$a:s()[D+20>>2>>>0],Wa:s()[D+24>>2>>>0],Za:s()[D+28>>2>>>0],Tb:s()[D+32>>2>>>0],Ib:s()[D+36>>2>>>0],Lb:fe?it(fe):\"\"},I=it(I),fe={\"%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 ve in fe)I=I.replace(new RegExp(ve,\"g\"),fe[ve]);var Me=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),je=\"January February March April May June July August September October November December\".split(\" \");fe={\"%a\":q=>Me[q.Wa].substring(0,3),\"%A\":q=>Me[q.Wa],\"%b\":q=>je[q.eb].substring(0,3),\"%B\":q=>je[q.eb],\"%C\":q=>Q((q.$a+1900)/100|0,2),\"%d\":q=>Q(q.ib,2),\"%e\":q=>H(q.ib,2,\" \"),\"%g\":q=>he(q).toString().substring(2),\"%G\":q=>he(q),\"%H\":q=>Q(q.cb,2),\"%I\":q=>(q=q.cb,q==0?q=12:12{for(var Ie=0,Ue=0;Ue<=q.eb-1;Ie+=(Nt(q.$a+1900)?Lr:xr)[Ue++]);return Q(q.ib+Ie,3)},\"%m\":q=>Q(q.eb+1,2),\"%M\":q=>Q(q.Jb,2),\"%n\":()=>`\n`,\"%p\":q=>0<=q.cb&&12>q.cb?\"AM\":\"PM\",\"%S\":q=>Q(q.Kb,2),\"%t\":()=>\"\t\",\"%u\":q=>q.Wa||7,\"%U\":q=>Q(Math.floor((q.Za+7-q.Wa)/7),2),\"%V\":q=>{var Ie=Math.floor((q.Za+7-(q.Wa+6)%7)/7);if(2>=(q.Wa+371-q.Za-2)%7&&Ie++,Ie)Ie==53&&(Ue=(q.Wa+371-q.Za)%7,Ue==4||Ue==3&&Nt(q.$a)||(Ie=1));else{Ie=52;var Ue=(q.Wa+7-q.Za-1)%7;(Ue==4||Ue==5&&Nt(q.$a%400-1))&&Ie++}return Q(Ie,2)},\"%w\":q=>q.Wa,\"%W\":q=>Q(Math.floor((q.Za+7-(q.Wa+6)%7)/7),2),\"%y\":q=>(q.$a+1900).toString().substring(2),\"%Y\":q=>q.$a+1900,\"%z\":q=>{q=q.Ib;var Ie=0<=q;return q=Math.abs(q)/60,(Ie?\"+\":\"-\")+(\"0000\"+(q/60*100+q%60)).slice(-4)},\"%Z\":q=>q.Lb,\"%%\":()=>\"%\"},I=I.replace(/%%/g,\"\\0\\0\");for(ve in fe)I.includes(ve)&&(I=I.replace(new RegExp(ve,\"g\"),fe[ve](D)));return I=I.replace(/\\0\\0/g,\"%\"),ve=$i(I),ve.length>v?0:(Bn(ve,m),ve.length-1)}function Ir(m){try{m()}catch(v){pt(v)}}function Dn(m){var v={},I;for(I in m)(function(D){var H=m[D];v[D]=typeof H==\"function\"?function(){M.push(D);try{return H.apply(null,arguments)}finally{Ee||(M.pop()===D||pt(),lt&&St===1&&M.length===0&&(St=0,Ke+=1,Ir(rn),typeof Fibers<\"u\"&&Fibers.Ub()))}}:H})(I);return v}var St=0,lt=null,zn=0,M=[],qr={},Jt={},_t=0,W=null,er=[];function N(){return new Promise((m,v)=>{W={resolve:m,reject:v}})}function Mn(){var m=Ar(65548),v=m+12;c()[m>>2>>>0]=v,c()[m+4>>2>>>0]=v+65536,v=M[0];var I=qr[v];return I===void 0&&(I=_t++,qr[v]=I,Jt[I]=v),v=I,s()[m+8>>2>>>0]=v,m}function G(){var m=s()[lt+8>>2>>>0];return m=ue[Jt[m]],--Ke,m()}function jn(m){if(!Ee){if(St===0){var v=!1,I=!1;m((D=0)=>{if(!Ee&&(zn=D,v=!0,I)){St=2,Ir(()=>nn(lt)),typeof Browser<\"u\"&&Browser.hb.sb&&Browser.hb.resume(),D=!1;try{var H=G()}catch(ye){H=ye,D=!0}var Q=!1;if(!lt){var re=W;re&&(W=null,(D?re.reject:re.resolve)(H),Q=!0)}if(D&&!Q)throw H}}),I=!0,v||(St=1,lt=Mn(),typeof Browser<\"u\"&&Browser.hb.sb&&Browser.hb.pause(),Ir(()=>tn(lt)))}else St===2?(St=0,Ir(on),Kr(lt),lt=null,er.forEach(D=>Zt(D))):pt(`invalid state: ${St}`);return zn}}function Un(m){return jn(v=>{m().then(v)})}Se.gb();var Vn=[null,yn,wt,gr,vn,jr,$n,Cn,Sn,yr,Vr,Yt,xn,In,Ct,yt,Wr,Tn,En,On,jt,Gr,Hr,Cr,Sr],Wn={r:function(m,v,I){return Un(async()=>{await d.xb(m,v,I)})},b:function(m,v,I){throw m>>>=0,new Mr(m).gb(v>>>0,I>>>0),ot=m,gt++,ot},O:function(m){Yr(m>>>0,!x,1,!P,131072,!1),Se.lb()},l:function(m){m>>>=0,O?postMessage({cmd:\"cleanupThread\",thread:m}):mt(m)},I:bn,i:vn,U:jr,E:$n,G:Cn,V:Sn,S:yr,K:Vr,R:Yt,p:xn,F:In,C:Ct,T:yt,D:Wr,q:()=>!0,A:function(m,v){m>>>=0,m==v>>>0?setTimeout(()=>Qt()):O?postMessage({targetThread:m,cmd:\"checkMailbox\"}):(m=Se.Qa[m])&&m.postMessage({cmd:\"checkMailbox\"})},M:function(){return-1},N:br,X:function(m){E&&Se.Qa[m>>>0].ref()},u:function(m,v,I){m=v+2097152>>>0<4194305-!!m?(m>>>0)+4294967296*v:NaN,I>>>=0,m=new Date(1e3*m),s()[I>>2>>>0]=m.getUTCSeconds(),s()[I+4>>2>>>0]=m.getUTCMinutes(),s()[I+8>>2>>>0]=m.getUTCHours(),s()[I+12>>2>>>0]=m.getUTCDate(),s()[I+16>>2>>>0]=m.getUTCMonth(),s()[I+20>>2>>>0]=m.getUTCFullYear()-1900,s()[I+24>>2>>>0]=m.getUTCDay(),m=(m.getTime()-Date.UTC(m.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,s()[I+28>>2>>>0]=m},v:function(m,v,I){m=v+2097152>>>0<4194305-!!m?(m>>>0)+4294967296*v:NaN,I>>>=0,m=new Date(1e3*m),s()[I>>2>>>0]=m.getSeconds(),s()[I+4>>2>>>0]=m.getMinutes(),s()[I+8>>2>>>0]=m.getHours(),s()[I+12>>2>>>0]=m.getDate(),s()[I+16>>2>>>0]=m.getMonth(),s()[I+20>>2>>>0]=m.getFullYear()-1900,s()[I+24>>2>>>0]=m.getDay(),v=(Nt(m.getFullYear())?vr:An)[m.getMonth()]+m.getDate()-1|0,s()[I+28>>2>>>0]=v,s()[I+36>>2>>>0]=-(60*m.getTimezoneOffset()),v=new Date(m.getFullYear(),6,1).getTimezoneOffset();var D=new Date(m.getFullYear(),0,1).getTimezoneOffset();m=(v!=D&&m.getTimezoneOffset()==Math.min(D,v))|0,s()[I+32>>2>>>0]=m},w:function(m){m>>>=0;var v=new Date(s()[m+20>>2>>>0]+1900,s()[m+16>>2>>>0],s()[m+12>>2>>>0],s()[m+8>>2>>>0],s()[m+4>>2>>>0],s()[m>>2>>>0],0),I=s()[m+32>>2>>>0],D=v.getTimezoneOffset(),H=new Date(v.getFullYear(),6,1).getTimezoneOffset(),Q=new Date(v.getFullYear(),0,1).getTimezoneOffset(),re=Math.min(Q,H);return 0>I?s()[m+32>>2>>>0]=+(H!=Q&&re==D):0>2>>>0]=v.getDay(),I=(Nt(v.getFullYear())?vr:An)[v.getMonth()]+v.getDate()-1|0,s()[m+28>>2>>>0]=I,s()[m>>2>>>0]=v.getSeconds(),s()[m+4>>2>>>0]=v.getMinutes(),s()[m+8>>2>>>0]=v.getHours(),s()[m+12>>2>>>0]=v.getDate(),s()[m+16>>2>>>0]=v.getMonth(),s()[m+20>>2>>>0]=v.getYear(),m=v.getTime()/1e3,Xr((qe=m,1<=+Math.abs(qe)?0>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)),m>>>0},s:Tn,t:En,z:function(m,v,I){function D(fe){return(fe=fe.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?fe[1]:\"GMT\"}m>>>=0,v>>>=0,I>>>=0;var H=new Date().getFullYear(),Q=new Date(H,0,1),re=new Date(H,6,1);H=Q.getTimezoneOffset();var ye=re.getTimezoneOffset(),he=Math.max(H,ye);c()[m>>2>>>0]=60*he,s()[v>>2>>>0]=+(H!=ye),m=D(Q),v=D(re),m=Pn(m),v=Pn(v),ye>2>>>0]=m,c()[I+4>>2>>>0]=v):(c()[I>>2>>>0]=v,c()[I+4>>2>>>0]=m)},d:()=>{pt(\"\")},c:function(m,v,I){return m>>>=0,v=Xt(v>>>0,I>>>0),Kt[m].apply(null,v)},k:function(m,v,I){return m>>>=0,v=Xt(v>>>0,I>>>0),Kt[m].apply(null,v)},m:function(){},j:function(){return Date.now()},W:()=>{throw Ke+=1,\"unwind\"},B:function(){return 4294901760},f:()=>performance.timeOrigin+performance.now(),g:function(){return E?(eu(),ir(Js)).cpus().length:navigator.hardwareConcurrency},L:function(m,v,I,D){for(Se.Pb=v>>>0,_r.length=I,v=D>>>0>>3,D=0;D>>0];return(0>m?Kt[-m-1]:Vn[m]).apply(null,_r)},y:function(m){m>>>=0;var v=u().length;if(m<=v||4294901760=I;I*=2){var D=v*(1+.2/I);D=Math.min(D,m+100663296);var H=Math;D=Math.max(m,D);e:{H=H.min.call(H,4294901760,D+(65536-D%65536)%65536)-we.buffer.byteLength+65535>>>16;try{we.grow(H),ee();var Q=1;break e}catch{}Q=void 0}if(Q)return!0}return!1},P:On,Q:jt,H:ht,h:Gr,o:Hr,x:Cr,n:Sr,a:we||d.wasmMemory,J:Fr,e:function(m,v,I,D){return Fr(m>>>0,v>>>0,I>>>0,D>>>0)}};(function(){function m(I,D){return I=I.exports,I=Dn(I),ue=I=Nn(I),Se.mb.push(ue.Da),tt.unshift(ue.Y),me=D,Vt(),I}var v={a:Wn};if(Ut(),d.instantiateWasm)try{return d.instantiateWasm(v,m)}catch(I){ge(\"Module.instantiateWasm callback failed with error: \"+I),w(I)}return hn(v,function(I){m(I.instance,I.module)}).catch(w),{}})(),d._OrtInit=(m,v)=>(d._OrtInit=ue.Z)(m,v),d._OrtGetLastError=(m,v)=>(d._OrtGetLastError=ue._)(m,v),d._OrtCreateSessionOptions=(m,v,I,D,H,Q,re,ye,he,fe)=>(d._OrtCreateSessionOptions=ue.$)(m,v,I,D,H,Q,re,ye,he,fe),d._OrtAppendExecutionProvider=(m,v)=>(d._OrtAppendExecutionProvider=ue.aa)(m,v),d._OrtAddFreeDimensionOverride=(m,v,I)=>(d._OrtAddFreeDimensionOverride=ue.ba)(m,v,I),d._OrtAddSessionConfigEntry=(m,v,I)=>(d._OrtAddSessionConfigEntry=ue.ca)(m,v,I),d._OrtReleaseSessionOptions=m=>(d._OrtReleaseSessionOptions=ue.da)(m),d._OrtCreateSession=(m,v,I)=>(d._OrtCreateSession=ue.ea)(m,v,I),d._OrtReleaseSession=m=>(d._OrtReleaseSession=ue.fa)(m),d._OrtGetInputOutputCount=(m,v,I)=>(d._OrtGetInputOutputCount=ue.ga)(m,v,I),d._OrtGetInputName=(m,v)=>(d._OrtGetInputName=ue.ha)(m,v),d._OrtGetOutputName=(m,v)=>(d._OrtGetOutputName=ue.ia)(m,v),d._OrtFree=m=>(d._OrtFree=ue.ja)(m),d._OrtCreateTensor=(m,v,I,D,H,Q)=>(d._OrtCreateTensor=ue.ka)(m,v,I,D,H,Q),d._OrtGetTensorData=(m,v,I,D,H)=>(d._OrtGetTensorData=ue.la)(m,v,I,D,H),d._OrtReleaseTensor=m=>(d._OrtReleaseTensor=ue.ma)(m),d._OrtCreateRunOptions=(m,v,I,D)=>(d._OrtCreateRunOptions=ue.na)(m,v,I,D),d._OrtAddRunConfigEntry=(m,v,I)=>(d._OrtAddRunConfigEntry=ue.oa)(m,v,I),d._OrtReleaseRunOptions=m=>(d._OrtReleaseRunOptions=ue.pa)(m),d._OrtCreateBinding=m=>(d._OrtCreateBinding=ue.qa)(m),d._OrtBindInput=(m,v,I)=>(d._OrtBindInput=ue.ra)(m,v,I),d._OrtBindOutput=(m,v,I,D)=>(d._OrtBindOutput=ue.sa)(m,v,I,D),d._OrtClearBoundOutputs=m=>(d._OrtClearBoundOutputs=ue.ta)(m),d._OrtReleaseBinding=m=>(d._OrtReleaseBinding=ue.ua)(m),d._OrtRunWithBinding=(m,v,I,D,H)=>(d._OrtRunWithBinding=ue.va)(m,v,I,D,H),d._OrtRun=(m,v,I,D,H,Q,re,ye)=>(d._OrtRun=ue.wa)(m,v,I,D,H,Q,re,ye),d._OrtEndProfiling=m=>(d._OrtEndProfiling=ue.xa)(m),d._JsepOutput=(m,v,I)=>(d._JsepOutput=ue.ya)(m,v,I),d._JsepGetNodeName=m=>(d._JsepGetNodeName=ue.za)(m);var tr=d._pthread_self=()=>(tr=d._pthread_self=ue.Aa)(),Ar=d._malloc=m=>(Ar=d._malloc=ue.Ba)(m),Kr=d._free=m=>(Kr=d._free=ue.Ca)(m);d.__emscripten_tls_init=()=>(d.__emscripten_tls_init=ue.Da)();var Yr=d.__emscripten_thread_init=(m,v,I,D,H,Q)=>(Yr=d.__emscripten_thread_init=ue.Fa)(m,v,I,D,H,Q);d.__emscripten_thread_crashed=()=>(d.__emscripten_thread_crashed=ue.Ga)();var Zr=(m,v,I,D)=>(Zr=ue.Ha)(m,v,I,D),Tr=m=>(Tr=ue.Ia)(m),Er=d.__emscripten_thread_exit=m=>(Er=d.__emscripten_thread_exit=ue.Ja)(m),Qr=d.__emscripten_check_mailbox=()=>(Qr=d.__emscripten_check_mailbox=ue.Ka)(),Xr=m=>(Xr=ue.La)(m),Jr=(m,v)=>(Jr=ue.Ma)(m,v),Pr=()=>(Pr=ue.Na)(),rr=m=>(rr=ue.Oa)(m),kr=m=>(kr=ue.Pa)(m),en=d.dynCall_ii=(m,v)=>(en=d.dynCall_ii=ue.Ra)(m,v),tn=m=>(tn=ue.Sa)(m),rn=()=>(rn=ue.Ta)(),nn=m=>(nn=ue.Ua)(m),on=()=>(on=ue.Va)();d.___start_em_js=917678,d.___stop_em_js=917839;function Nn(m){m=Object.assign({},m);var v=D=>()=>D()>>>0,I=D=>H=>D(H)>>>0;return m.__errno_location=v(m.__errno_location),m.pthread_self=v(m.pthread_self),m.malloc=I(m.malloc),m.stackSave=v(m.stackSave),m.stackAlloc=I(m.stackAlloc),m}d.keepRuntimeAlive=Pt,d.wasmMemory=we,d.stackAlloc=kr,d.stackSave=Pr,d.stackRestore=rr,d.UTF8ToString=it,d.stringToUTF8=_n,d.lengthBytesUTF8=Ur,d.ExitStatus=vt,d.PThread=Se;var nr;ct=function m(){nr||an(),nr||(ct=m)};function an(){function m(){if(!nr&&(nr=!0,d.calledRun=!0,!Ee)&&(O||Wt(tt),g(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),!O)){if(d.postRun)for(typeof d.postRun==\"function\"&&(d.postRun=[d.postRun]);d.postRun.length;){var v=d.postRun.shift();Ye.unshift(v)}Wt(Ye)}}if(!(0tu)});var iu=un((N0,Uh)=>{Uh.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 Bi,Gt,or,Kn,dn,du,Di,Te=ae(()=>{\"use strict\";Bi=e=>{switch(e){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: ${e}`)}},Gt=e=>{switch(e){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: ${e}`)}},or=e=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][e],Kn=e=>{switch(e){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: ${e}`)}},dn=e=>{switch(e){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: ${e}`)}},du=e=>e===\"float32\"||e===\"float16\"||e===\"int32\"||e===\"int64\"||e===\"uint32\"||e===\"uint8\"||e===\"bool\",Di=e=>{switch(e){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: ${e}`)}}});var Yn=ae(()=>{\"use strict\"});var fu=ae(()=>{\"use strict\";Yn()});var pu,mu=ae(()=>{\"use strict\";pu=\"1.18.0\"});var hu,bt,zi=ae(()=>{\"use strict\";mu();hu=\"warning\",bt={wasm:{},webgl:{},webgpu:{},versions:{common:pu},set logLevel(e){if(e!==void 0){if(typeof e!=\"string\"||[\"verbose\",\"info\",\"warning\",\"error\",\"fatal\"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);hu=e}},get logLevel(){return hu}};Object.defineProperty(bt,\"logLevel\",{enumerable:!0})});var Or,gu=ae(()=>{\"use strict\";zi();Or=bt});var yu=ae(()=>{\"use strict\"});var bu=ae(()=>{\"use strict\";Zn()});var wu=ae(()=>{\"use strict\"});var _u=ae(()=>{\"use strict\";Zn()});var Zn=ae(()=>{\"use strict\";yu();bu();wu();_u()});var Qn=ae(()=>{\"use strict\";Zn()});var Mi,$u,ar,Ht,ji=ae(()=>{\"use strict\";zi();Mi=(e,r)=>{(typeof bt.trace>\"u\"?!bt.wasm.trace:!bt.trace)||console.timeStamp(`${e}::ORT::${r}`)},$u=(e,r)=>{let t=new Error().stack?.split(/\\r\\n|\\r|\\n/g)||[],u=!1;for(let s=0;s{(typeof bt.trace>\"u\"?!bt.wasm.trace:!bt.trace)||$u(\"BEGIN\",e)},Ht=e=>{(typeof bt.trace>\"u\"?!bt.wasm.trace:!bt.trace)||$u(\"END\",e)}});var Cu=ae(()=>{\"use strict\";Yn();Qn();ji()});var Su=ae(()=>{\"use strict\";Cu()});var xu=ae(()=>{\"use strict\"});var Iu=ae(()=>{\"use strict\"});var Au=ae(()=>{\"use strict\"});var Tu=ae(()=>{\"use strict\"});var Eu=ae(()=>{\"use strict\";Yn();Qn()});var Pu=ae(()=>{\"use strict\";Eu()});var Rr=ae(()=>{\"use strict\";fu();gu();Su();Qn();xu();Iu();ji();Au();Tu();Pu()});var Zh,Qh,ku,Ou,Ru,Xh,Fe,Lt=ae(()=>{\"use strict\";Te();Zh=[\"V\",\"I\",\"W\",\"E\",\"F\"],Qh=(e,r)=>{console.log(`[${Zh[e]},${new Date().toISOString()}]${r}`)},Ru=(e,r)=>{ku=e,Ou=r},Xh=(e,r)=>{let t=dn(e),u=dn(ku);t>=u&&Qh(t,typeof r==\"function\"?r():r)},Fe=(...e)=>{Ou&&Xh(...e)}});var Bu,Du=ae(()=>{\"use strict\";Te();Bu=(e,r)=>new(Kn(r))(e)});var Xn=ae(()=>{\"use strict\"});var zu,Ui,Vi,Jh,eg,Mu,Ni,Wi,Uu,Vu=ae(()=>{\"use strict\";Lt();Xn();zu=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),Ui=[],Vi=e=>Math.ceil(e/16)*16,Jh=e=>{for(let r=0;reg++,Ni=async(e,r,t,u)=>{let s=Vi(t),c=e.device.createBuffer({size:s,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let f=e.getCommandEncoder();e.endComputePass(),f.copyBufferToBuffer(r,0,c,0,s),e.flush(),await c.mapAsync(GPUMapMode.READ);let d=c.getMappedRange();if(u){let g=u();return g.set(new Uint8Array(d,0,t)),g}else return new Uint8Array(d.slice(0,t))}finally{c.destroy()}},Wi=class{constructor(r){this.backend=r;this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersForUploadingPending=[],this.buffersPending=[],this.externalBuffers=new Map,this.capturedPendingBuffers=new Map;for(let[t]of zu)Ui.push(t),this.freeBuffers.set(t,[]),this.freeUniformBuffers.set(t,[])}upload(r,t){let u=t.buffer,s=t.byteOffset,c=t.byteLength,f=Vi(c),d=this.storageCache.get(r);if(!d)throw new Error(\"gpu data for uploading does not exist\");if(d.originalSize!==c)throw new Error(`inconsistent data size. gpu data size=${d.originalSize}, data size=${c}`);let g=this.backend.device.createBuffer({mappedAtCreation:!0,size:f,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),w=g.getMappedRange();new Uint8Array(w).set(new Uint8Array(u,s,c)),g.unmap();let C=this.backend.getCommandEncoder();this.backend.endComputePass(),C.copyBufferToBuffer(g,0,d.gpuData.buffer,0,f),Fe(\"verbose\",()=>`[WebGPU] GpuDataManager.upload(id=${r})`),this.buffersForUploadingPending.push(g)}memcpy(r,t){let u=this.storageCache.get(r);if(!u)throw new Error(\"source gpu data for memcpy does not exist\");let s=this.storageCache.get(t);if(!s)throw new Error(\"destination gpu data for memcpy does not exist\");if(u.originalSize!==s.originalSize)throw new Error(\"inconsistent source and destination gpu data size\");let c=Vi(u.originalSize),f=this.backend.getCommandEncoder();this.backend.endComputePass(),f.copyBufferToBuffer(u.gpuData.buffer,0,s.gpuData.buffer,0,c)}registerExternalBuffer(r,t,u){let s;if(u){if(s=this.externalBuffers.get(u),s===void 0)throw new Error(\"previous buffer is not registered\");if(r===u)return Fe(\"verbose\",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${s}, buffer is the same, skip.`),s;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet.\n Please use the previous external buffer!`);this.externalBuffers.delete(u)}else s=Mu();return this.storageCache.set(s,{gpuData:{id:s,type:0,buffer:r},originalSize:t}),this.externalBuffers.set(r,s),Fe(\"verbose\",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${s}, registered.`),s}unregisterExternalBuffer(r){let t=this.externalBuffers.get(r);t!==void 0&&(this.storageCache.delete(t),this.externalBuffers.delete(r),Fe(\"verbose\",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${t}`))}create(r,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let u=Jh(r),s,c=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,f=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(c||f){let w=(c?this.freeBuffers:this.freeUniformBuffers).get(u);w?w.length>0?s=w.pop():s=this.backend.device.createBuffer({size:u,usage:t}):s=this.backend.device.createBuffer({size:u,usage:t})}else s=this.backend.device.createBuffer({size:u,usage:t});let d={id:Mu(),type:0,buffer:s};return this.storageCache.set(d.id,{gpuData:d,originalSize:r}),Fe(\"verbose\",()=>`[WebGPU] GpuDataManager.create(size=${r}) => id=${d.id}`),d}get(r){return this.storageCache.get(r)?.gpuData}release(r){let t=this.storageCache.get(r);if(!t)throw new Error(\"releasing data does not exist\");return Fe(\"verbose\",()=>`[WebGPU] GpuDataManager.release(id=${r}), gpuDataId=${t.gpuData.id}`),this.storageCache.delete(r),this.buffersPending.push(t.gpuData.buffer),t.originalSize}async download(r,t){let u=this.storageCache.get(r);if(!u)throw new Error(\"data does not exist\");await Ni(this.backend,u.gpuData.buffer,u.originalSize,t)}refreshPendingBuffers(){for(let r of this.buffersForUploadingPending)r.destroy();if(this.buffersForUploadingPending=[],this.buffersPending.length!==0)if(this.backend.sessionStatus===\"default\"){for(let r of this.buffersPending){let t=zu.get(r.size);if((r.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let u=this.freeBuffers.get(r.size)||[];t===void 0||u.length>=t?r.destroy():u.push(r)}else if((r.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let u=this.freeUniformBuffers.get(r.size)||[];t===void 0||u.length>=t?r.destroy():u.push(r)}else r.destroy()}this.buffersPending=[]}else{let r=this.capturedPendingBuffers.get(this.backend.currentSessionId);r||(r=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,r));for(let t of this.buffersPending)r.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(r=>{r.forEach(t=>{t.destroy()})}),this.freeUniformBuffers.forEach(r=>{r.forEach(t=>{t.destroy()})}),this.storageCache.forEach(r=>{r.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(r=>{r.forEach(t=>{t.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onReleaseSession(r){let t=this.capturedPendingBuffers.get(r);t&&(t.forEach(u=>{u.destroy()}),this.capturedPendingBuffers.delete(r))}},Uu=(...e)=>new Wi(...e)});var Gi,ke,nt=ae(()=>{\"use strict\";Gi=class{constructor(r){Object.assign(this,r)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(r=>`${this[r]}`).join(\";\")),this.key}},ke=e=>new Gi(e)});var Hi,Ot,K,sr,Jn,ei,ti,De=ae(()=>{\"use strict\";Hi=class{static calcMatMulShape(r,t){return r[1]!==t[0]?void 0:[r[0],t[1]]}},Ot=class{static calcShape(r,t,u=!1){let s=r.length,c=t.length;if(s===0)return t;if(c===0)return r;let f=Math.max(r.length,t.length),d=new Array(f);if(u){if(s<2||c<2)return;let g=Hi.calcMatMulShape([r[s-2],r[s-1]],[t[c-2],t[c-1]]);if(g===void 0)return;[d[f-2],d[f-1]]=g}for(let g=u?3:1;g<=f;g++){let w=s-g<0?1:r[s-g],C=c-g<0?1:t[c-g];if(w!==C&&w>1&&C>1)return;let $=Math.max(w,C);if(w&&C)d[f-g]=Math.max(w,C);else{if($>1)return;d[f-g]=0}}return d}static isValidBroadcast(r,t){let u=r.length,s=t.length;if(u>s)return!1;for(let c=1;c<=u;c++)if(r[u-c]!==1&&r[u-c]!==t[s-c])return!1;return!0}},K=class e{static size(r){return e.getSizeFromDimensionRange(r,0,r.length)}static convertShape(r,t=4){let u=r.length;if(u===0)return[];let s=new Array(u),c=u-1;for(;c>=0;){if(r[c]%t===0){s[c]=r[c]/t;break}if(t%r[c]!==0)throw new Error(\"cannot convert shape\");s[c]=1,t/=r[c],c--}for(c--;c>=0;c--)s[c]=r[c];return s}static sizeFromDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return e.getSizeFromDimensionRange(r,t,r.length)}static sizeToDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${r.length} dimensions.`);return e.getSizeFromDimensionRange(r,0,t)}static getSizeFromDimensionRange(r,t,u){let s=1;for(let c=t;c=0;--s)u[s]=u[s+1]*r[s+1];return u}static normalizeAxis(r,t){if(r<-t&&r>=t)throw new Error(\"unsupported axis for this operation.\");return r<0?r+t:r}static normalizeAxes(r,t){return r.map(u=>this.normalizeAxis(u,t??r.length))}static sortBasedOnPerm(r,t){return t?t.map(u=>r[u]):r.slice().reverse()}static padShape(r,t){let u=r.length;return r.map((s,c)=>s+t[c]+t[c+u])}static areEqual(r,t){return r.length!==t.length?!1:r.every((u,s)=>u===t[s])}},sr=class e{static adjustPoolAttributes(r,t,u,s,c,f){if(!r&&u.length!==t.length-2)throw new Error(\"length of specified kernel shapes should be 2 less than length of input dimensions\");if(r)for(let d=0;d=u.length?u.push(t[d+2]):u[d]=t[d+2];for(let d=0;d=u[d]||f[d+u.length]>=u[d])throw new Error(\"pads should be smaller than kernel\")}}static adjustPadsBasedOnAutoPad(r,t,u,s,c,f,d){if(d){if(c.length!==2*(r.length-2))throw new Error(\"length of pads should be twice the length of data dimensions\");if(t.length!==r.length-2)throw new Error(\"length of strides should be the length of data dimensions\");if(s.length!==r.length-2)throw new Error(\"length of kernel shapes should be the length of data dimensions\");for(let g=0;g{\"use strict\";Te();De();ur=64,Fi=(e,r)=>{if(r===3)throw new Error(\"vec3 has same alignment as vec4, use vec4 instead\");switch(e){case 10:return r>1?`vec${r}`:\"f16\";case 1:return r>1?`vec${r}`:\"f32\";case 6:return r>1?`vec${r}`:\"i32\";case 12:return r>1?`vec${r}`:\"u32\";case 7:if(r>1)throw new Error(\"currently not supported vecX of uint64 yet\");return[\"vec2\",\"i32\"];case 13:if(r>1)throw new Error(\"currently not supported vecX of uint64 yet\");return[\"vec2\",\"u32\"];case 9:if(r!==4)throw new Error(\"bool must be vec4\");return[\"u32\",\"vec4\"];default:throw new Error(`Unknown data type: ${e}`)}},Ne=(e,r=1)=>{let t=Fi(e,r);return typeof t==\"string\"?t:t[0]},at=(e,r=1)=>{let t=Fi(e,r);return typeof t==\"string\"?t:t[1]},se=(...e)=>{let r=[];return e.forEach(t=>{t.length!==0&&r.push({type:12,data:t},{type:12,data:K.computeStrides(t)})}),r},He=e=>e%4===0?4:e%2===0?2:1,xt=(e=\"f32\",r,t=\"0\")=>!r||r===1?`${e}(${t})`:`vec${r}<${e}>(${t})`,lr=(e,r,t)=>e===\"f32\"?t:r===1?`f32(${t})`:`vec${r}(${t})`,It=(e,r)=>r===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:r===2?`(${e}.x + ${e}.y)`:r===3?`(${e}.x + ${e}.y + ${e}.z)`:e,xe=(e,r,t,u)=>e.startsWith(\"uniforms.\")&&t>4?typeof r==\"string\"?u===\"f16\"?`${e}[(${r}) / 8][(${r}) % 8 / 4][(${r}) % 8 % 4]`:`${e}[(${r}) / 4][(${r}) % 4]`:u===\"f16\"?`${e}[${Math.floor(r/8)}][${Math.floor(r%8/4)}][${r%8%4}]`:`${e}[${Math.floor(r/4)}][${r%4}]`:t>1?`${e}[${r}]`:e,qi=(e,r,t,u,s)=>{let c=typeof t==\"number\",f=c?t:t.length,d=[...new Array(f).keys()],g=f<2?\"u32\":f<=4?`vec${f}`:`array`,w=Fi(r,s),C=typeof w==\"string\"?w:w[1],$=typeof w==\"string\"?w:w[0],A={indices:g,value:C,storage:$,tensor:r},P=ee=>typeof ee==\"string\"?ee:`${ee}u`,x={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},E=c?\"uniforms.\":\"\",O=`${E}${e}_shape`,B=`${E}${e}_strides`,R=\"\";for(let ee=0;ee ${A.indices} {\n var indices: ${A.indices};\n var current = offset;\n ${R}\n return indices;\n }`,U=ee=>(x.offsetToIndices=!0,f<2?ee:`o2i_${e}(${ee})`),L=[];if(f>=2)for(let ee=f-1;ee>=0;ee--)L.push(`${xe(B,ee,f)} * (indices[${ee}])`);let F=f<2?\"\":`\n fn i2o_${e}(indices: ${A.indices}) -> u32 {\n return ${L.join(\"+\")};\n }`,te=ee=>(x.indicesToOffset=!0,f<2?ee:`i2o_${e}(${ee})`),J=(...ee)=>f===0?\"0u\":`${A.indices}(${ee.map(P).join(\",\")})`,oe=(ee,ce)=>f<2?`${ee}`:`${xe(ee,ce,f)}`,le=(ee,ce,Be)=>f<2?`${ee}=${Be};`:`${xe(ee,ce,f)}=${Be};`,ge={},X=(ee,ce)=>{x.broadcastedIndicesToOffset=!0;let Be=`${ce.name}broadcastedIndicesTo${e}Offset`;if(Be in ge)return`${Be}(${ee})`;let tt=[];for(let Ye=f-1;Ye>=0;Ye--){let Ke=ce.indicesGet(\"outputIndices\",Ye+ce.rank-f);tt.push(`${oe(B,Ye)} * (${Ke} % ${oe(O,Ye)})`)}return ge[Be]=`fn ${Be}(outputIndices: ${ce.type.indices}) -> u32 {\n return ${tt.length>0?tt.join(\"+\"):\"0u\"};\n }`,`${Be}(${ee})`},pe=(ee,ce)=>(()=>{if(A.storage===A.value)return`${e}[${ee}]=${ce};`;if(A.storage===\"vec2\"&&A.value===\"i32\")return`${e}[${ee}]=vec2(u32(${ce}), select(0u, 0xFFFFFFFFu, ${ce} < 0));`;if(A.storage===\"vec2\"&&A.value===\"u32\")return`${e}[${ee}]=vec2(u32(${ce}), 0u);`;if(A.storage===\"u32\"&&A.value===\"vec4\")return`${e}[${ee}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${ce}));`;throw new Error(`not supported combination of storage type ${A.storage} and value type ${A.value} yet`)})(),we=ee=>(()=>{if(A.storage===A.value)return`${e}[${ee}]`;if(A.storage===\"vec2\"&&A.value===\"i32\")return`i32(${e}[${ee}].x)`;if(A.storage===\"vec2\"&&A.value===\"u32\")return`u32(${e}[${ee}].x)`;if(A.storage===\"u32\"&&A.value===\"vec4\")return`vec4(bool(${e}[${ee}] & 0xFFu), bool(${e}[${ee}] & 0xFF00u), bool(${e}[${ee}] & 0xFF0000u), bool(${e}[${ee}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${A.storage} and value type ${A.value} yet`)})(),ue=f<2?\"\":`\n fn get_${e}ByIndices(indices: ${A.indices}) -> ${C} {\n return ${we(`i2o_${e}(indices)`)};\n }`,me=f<2?\"\":(()=>{let ee=d.map(Be=>`d${Be}: u32`).join(\", \"),ce=d.map(Be=>`d${Be}`).join(\", \");return`\n fn get_${e}(${ee}) -> ${C} {\n return get_${e}ByIndices(${J(ce)});\n }`})(),Ee=(...ee)=>{if(ee.length!==f)throw new Error(`indices length must be ${f}`);let ce=ee.map(P).join(\",\");return f===0?we(\"0u\"):f===1?we(ce[0]):(x.get=!0,x.getByIndices=!0,x.indicesToOffset=!0,`get_${e}(${ce})`)},Pe=ee=>f<2?we(ee):(x.getByIndices=!0,x.indicesToOffset=!0,`get_${e}ByIndices(${ee})`),Ce=f<2?\"\":`\n fn set_${e}ByIndices(indices: ${A.indices}, value: ${C}) {\n ${pe(`i2o_${e}(indices)`,\"value\")}\n }`,be=f<2?\"\":(()=>{let ee=d.map(Be=>`d${Be}: u32`).join(\", \"),ce=d.map(Be=>`d${Be}`).join(\", \");return`\n fn set_${e}(${ee}, value: ${C}) {\n set_${e}ByIndices(${J(ce)}, value);\n }`})();return{impl:()=>{let ee=[],ce=!1;return x.offsetToIndices&&(ee.push(j),ce=!0),x.indicesToOffset&&(ee.push(F),ce=!0),x.broadcastedIndicesToOffset&&(Object.values(ge).forEach(Be=>ee.push(Be)),ce=!0),x.set&&(ee.push(be),ce=!0),x.setByIndices&&(ee.push(Ce),ce=!0),x.get&&(ee.push(me),ce=!0),x.getByIndices&&(ee.push(ue),ce=!0),!c&&ce&&ee.unshift(`const ${O} = ${A.indices}(${t.join(\",\")});`,`const ${B} = ${A.indices}(${K.computeStrides(t).join(\",\")});`),ee.join(`\n`)},type:A,offsetToIndices:U,indicesToOffset:te,broadcastedIndicesToOffset:X,indices:J,indicesGet:oe,indicesSet:le,set:(...ee)=>{if(ee.length!==f+1)throw new Error(`indices length must be ${f}`);let ce=ee[f];if(typeof ce!=\"string\")throw new Error(\"value must be string\");let Be=ee.slice(0,f).map(P).join(\",\");return f===0?pe(\"0u\",ce):f===1?pe(Be[0],ce):(x.set=!0,x.setByIndices=!0,x.indicesToOffset=!0,`set_${e}(${Be}, ${ce})`)},setByOffset:pe,setByIndices:(ee,ce)=>f<2?pe(ee,ce):(x.setByIndices=!0,x.indicesToOffset=!0,`set_${e}ByIndices(${ee}, ${ce});`),get:Ee,getByOffset:we,getByIndices:Pe,usage:u,name:e,strides:B,shape:O,rank:f}},Z=(e,r,t,u=1)=>qi(e,r,t,\"input\",u),ne=(e,r,t,u=1)=>qi(e,r,t,\"output\",u),ri=(e,r,t,u=1)=>qi(e,r,t,\"internal\",u),Li=class{constructor(r,t){this.normalizedDispatchGroup=r;this.limits=t;this.internalVariables=[];this.variables=[];this.uniforms=[];this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(r){return`if (global_idx >= ${typeof r==\"number\"?`${r}u`:r}) { return; }`}mainStart(r=ur){let t=typeof r==\"number\"?r:r[0],u=typeof r==\"number\"?1:r[1],s=typeof r==\"number\"?1:r[2];if(t>this.limits.maxComputeWorkgroupSizeX||u>this.limits.maxComputeWorkgroupSizeY||s>this.limits.maxComputeWorkgroupSizeZ)throw new Error(`workgroup size [${t}, ${u}, ${s}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*u*s>this.limits.maxComputeInvocationsPerWorkgroup)throw new Error(`workgroup size [${t}, ${u}, ${s}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let c=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,f=c?`@builtin(global_invocation_id) global_id : vec3,\n @builtin(workgroup_id) workgroup_id : vec3,\n @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3,\n @builtin(local_invocation_id) local_id : vec3,\n @builtin(local_invocation_index) local_idx : u32,\n @builtin(workgroup_id) workgroup_id : vec3,\n @builtin(num_workgroups) num_workgroups : vec3`,d=c?\"let global_idx = global_id.x; let local_idx = local_id.x;\":`let global_idx = (workgroup_id.z * num_workgroups[0] * num_workgroups[1] +\n workgroup_id.y * num_workgroups[0] + workgroup_id.x) * ${t*u*s}u + local_idx;`;return`@compute @workgroup_size(${t}, ${u}, ${s})\n fn main(${f}) {\n ${d}\n `}appendVariableUniforms(r){r.rank!==0&&(r.shape.startsWith(\"uniforms.\")&&this.uniforms.push({name:r.shape.replace(\"uniforms.\",\"\"),type:\"u32\",length:r.rank}),r.strides.startsWith(\"uniforms.\")&&this.uniforms.push({name:r.strides.replace(\"uniforms.\",\"\"),type:\"u32\",length:r.rank}))}declareVariable(r,t){if(r.usage===\"internal\")throw new Error(\"cannot use internal variable with declareVariable(). use registerInternalVariables() instead.\");this.variables.push(r),this.appendVariableUniforms(r);let u=r.usage===\"input\"?\"read\":\"read_write\",s=r.type.storage;return`@group(0) @binding(${t}) var ${r.name}: array<${s}>;`}declareVariables(...r){return r.map(t=>this.declareVariable(t,this.variableIndex++)).join(`\n`)}registerInternalVariable(r){if(r.usage!==\"internal\")throw new Error(\"cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.\");this.internalVariables.push(r),this.appendVariableUniforms(r)}registerInternalVariables(...r){return r.forEach(t=>this.registerInternalVariable(t)),this}registerUniform(r,t,u=1){return this.uniforms.push({name:r,type:t,length:u}),this}registerUniforms(r){return this.uniforms=this.uniforms.concat(r),this}uniformDeclaration(){if(this.uniforms.length===0)return\"\";let r=[];for(let{name:t,type:u,length:s}of this.uniforms)if(s&&s>4)u===\"f16\"?r.push(`@align(16) ${t}:array, ${Math.ceil(s/8)}>`):r.push(`${t}:array, ${Math.ceil(s/4)}>`);else{let c=s==null||s===1?u:`vec${s}<${u}>`;r.push(`${t}:${c}`)}return`\n struct Uniforms { ${r.join(\", \")} };\n @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(r=>r.impl()).join(`\n`)+this.internalVariables.map(r=>r.impl()).join(`\n`)}get variablesInfo(){if(this.uniforms.length===0)return;let r=t=>[12,10,1,6][[\"u32\",\"f16\",\"f32\",\"i32\"].indexOf(t)];return this.uniforms.map(t=>[r(t.type),t.length??1])}},Wu=(e,r)=>new Li(e,r),Br=(e,r)=>{let t=e.length,u=[];for(let s=0;s1&&f===1&&u.unshift(c)}return u}});var tg,Nu,rg,ng,$t,Gu,Hu,Dr=ae(()=>{\"use strict\";Te();De();nt();Re();tg=e=>{if(!e||e.length!==1)throw new Error(\"Transpose requires 1 input.\")},Nu=(e,r)=>r&&r.length!==e?[...new Array(e).keys()].reverse():r,rg=(e,r)=>K.sortBasedOnPerm(e,Nu(e.length,r)),ng=(e,r,t,u)=>{let s=[];s.push(`fn perm(i: ${u.type.indices}) -> ${t.type.indices} {\n var a: ${t.type.indices};`);for(let c=0;c{let t=e.dataType,u=e.dims.length,s=Nu(u,r),c=rg(e.dims,s),f=ne(\"output\",t,c.length),d=Z(\"a\",t,u),g=w=>`\n ${w.registerUniform(\"output_size\",\"u32\").declareVariables(d,f)}\n\n ${ng(s,u,d,f)}\n\n ${w.mainStart()}\n ${w.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let indices = ${f.offsetToIndices(\"global_idx\")};\n let aIndices = perm(indices);\n\n ${f.setByOffset(\"global_idx\",d.getByIndices(\"aIndices\"))}\n }`;return{name:\"Transpose\",shaderCache:{hint:`${r}`,inputDependencies:[\"rank\"]},getRunData:w=>{let C=K.size(c);return{outputs:[{dims:c,dataType:w[0].dataType}],dispatchGroup:{x:Math.ceil(C/64)},programUniforms:[{type:12,data:C},...se(w[0].dims,c)]}},getShaderSource:g}},Gu=(e,r)=>{tg(e.inputs),e.compute($t(e.inputs[0],r.perm))},Hu=e=>ke({perm:e.perm})});var ig,og,ag,sg,ug,lg,dg,cg,fg,pg,Rt,Lu,Fu,qu,Ku,Yu,Zu,Qu,Xu,Ju,el,tl=ae(()=>{\"use strict\";Te();De();Re();ni();Dr();ig={max:\"select(bestValue, candidate, candidate > bestValue)\",min:\"select(bestValue, candidate, candidate < bestValue)\",mean:\"bestValue + candidate\",sum:\"bestValue + candidate\",prod:\"bestValue * candidate\",sumSquare:\"bestValue + candidate * candidate\",logSumExp:\"bestValue + exp(candidate)\",l1:\"bestValue + abs(candidate)\",l2:\"bestValue + candidate * candidate\",logSum:\"bestValue + candidate\"},og={max:\"select(bestValue, candidate, candidate > bestValue)\",min:\"select(bestValue, candidate, candidate < bestValue)\",mean:\"bestValue + candidate\",sum:\"bestValue + candidate\",prod:\"bestValue * candidate\",sumSquare:\"bestValue + candidate\",logSumExp:\"bestValue + candidate\",l1:\"bestValue + candidate\",l2:\"bestValue + candidate\",logSum:\"bestValue + candidate\"},ag={max:\"_A[offset]\",min:\"_A[offset]\",mean:\"0\",sum:\"0\",prod:\"1\",sumSquare:\"0\",logSumExp:\"0\",l1:\"0\",l2:\"0\",logSum:\"0\"},sg={max:\"bestValue\",min:\"bestValue\",sum:\"bestValue\",prod:\"bestValue\",sumSquare:\"bestValue\",logSumExp:\"log(bestValue)\",l1:\"bestValue\",l2:\"sqrt(bestValue)\",logSum:\"log(bestValue)\"},ug=(e,r)=>{let t=[];for(let u=r-e;u{let t=[],u=e.length;for(let c=0;ce[c]);return[t,s]},dg=(e,r)=>{let t=e.length+r.length,u=[],s=0;for(let c=0;c{for(let t=0;t{let t=[];if(!cg(e,r)){for(let u=0;ut.push(u))}return t},pg=(e,r,t,u,s,c,f)=>{let d=t[0].dims,g=K.size(c),w=K.size(f),C=Z(\"_A\",t[0].dataType,d),$=ne(\"output\",s,c),A=32,P=`\n var aBestValues : array;\n `;return{name:e,shaderCache:r,getShaderSource:E=>`\n ${E.registerUniform(\"reduceSize\",\"u32\").declareVariables(C,$)}\n ${P}\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\n return ((a - 1u) / b + 1u);\n }\n ${E.mainStart(A)}\n\n let outputIndex = global_idx / ${A};\n let offset = outputIndex * uniforms.reduceSize;\n\n var bestValue = f32(${ag[u]});\n let Length = uniforms.reduceSize;\n for (var k = local_idx; k < Length; k = k + ${A}) {\n let candidate = f32(${C.getByOffset(\"offset + k\")});\n bestValue = ${ig[u]};\n }\n aBestValues[local_idx] = bestValue;\n workgroupBarrier();\n\n var reduceSize = min(Length, ${A}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (local_idx < currentSize) {\n let candidate = aBestValues[local_idx + interval];\n bestValue = ${og[u]};\n aBestValues[local_idx] = bestValue;\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (local_idx == 0u) {\n ${$.setByOffset(\"outputIndex\",`${u===\"mean\"?`${$.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${$.type.storage}(${sg[u]})`}`)};\n }\n }`,getRunData:()=>({outputs:[{dims:c,dataType:s}],dispatchGroup:{x:g},programUniforms:[{type:12,data:w}]})}},Rt=(e,r,t,u)=>{let s=e.inputs.length===1?t:Ki(e.inputs,t),c=s.axes;c.length===0&&!s.noopWithEmptyAxes&&(c=e.inputs[0].dims.map((P,x)=>x));let f=K.normalizeAxes(c,e.inputs[0].dims.length),d=f,g=e.inputs[0],w=fg(d,e.inputs[0].dims.length);w.length>0&&(g=e.compute($t(e.inputs[0],w),{inputs:[0],outputs:[-1]})[0],d=ug(d.length,g.dims.length));let[C,$]=lg(g.dims,d),A=C;s.keepDims&&(A=dg(C,f)),e.compute(pg(r,{hint:s.cacheKey,inputDependencies:[\"type\"]},[g],u,e.inputs[0].dataType,A,$),{inputs:[g]})},Lu=(e,r)=>{Rt(e,\"ReduceMeanShared\",r,\"mean\")},Fu=(e,r)=>{Rt(e,\"ReduceL1Shared\",r,\"l1\")},qu=(e,r)=>{Rt(e,\"ReduceL2Shared\",r,\"l2\")},Ku=(e,r)=>{Rt(e,\"ReduceLogSumExpShared\",r,\"logSumExp\")},Yu=(e,r)=>{Rt(e,\"ReduceMaxShared\",r,\"max\")},Zu=(e,r)=>{Rt(e,\"ReduceMinShared\",r,\"min\")},Qu=(e,r)=>{Rt(e,\"ReduceProdShared\",r,\"prod\")},Xu=(e,r)=>{Rt(e,\"ReduceSumShared\",r,\"sum\")},Ju=(e,r)=>{Rt(e,\"ReduceSumSquareShared\",r,\"sumSquare\")},el=(e,r)=>{Rt(e,\"ReduceLogSumShared\",r,\"logSum\")}});var Bt,mg,ii,Ki,Dt,hg,gg,yg,bg,vg,wg,_g,$g,Cg,Sg,zt,rl,nl,il,ol,al,sl,ul,ll,dl,cl,ni=ae(()=>{\"use strict\";Te();De();nt();Re();tl();Bt=e=>{if(!e||e.length===0||e.length>2)throw new Error(\"Reduce op requires 1 or 2 inputs.\");if(e.length===2&&e[1].dims.length!==1)throw new Error(\"Invalid axes input dims.\")},mg=e=>[\"\",\"\",`var value = ${e.getByIndices(\"input_indices\")};`,\"\"],ii=(e,r,t,u,s,c,f=!1,d=!1)=>{let g=[],w=t[0].dims,C=w.length,$=K.normalizeAxes(s,C),A=!d&&$.length===0;w.forEach((O,B)=>{A||$.indexOf(B)>=0?f&&g.push(1):g.push(O)});let P=g.length,x=K.size(g);return{name:e,shaderCache:r,getShaderSource:O=>{let B=[],R=Z(\"_A\",t[0].dataType,C),j=ne(\"output\",c,P),U=u(R,j,$),L=U[2];for(let F=0,te=0;F=0?(f&&te++,L=`for(var j${F}: u32 = 0; j${F} < ${w[F]}; j${F}++) {\n ${U[2].includes(\"last_index\")?`let last_index = j${F};`:\"\"}\n ${R.indicesSet(\"input_indices\",F,`j${F}`)}\n ${L}\n }`):(B.push(`${R.indicesSet(\"input_indices\",F,j.indicesGet(\"output_indices\",te))};`),te++);return`\n\n ${O.registerUniform(\"output_size\",\"u32\").declareVariables(R,j)}\n\n ${O.mainStart()}\n ${O.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n var input_indices: ${R.type.indices};\n let output_indices = ${j.offsetToIndices(\"global_idx\")};\n\n ${B.join(`\n`)}\n ${U[0]} // init ops for reduce max/min\n ${U[1]}\n ${L}\n ${U[3]}\n ${U.length===4?j.setByOffset(\"global_idx\",\"value\"):U.slice(4).join(`\n`)}\n }`},getRunData:()=>({outputs:[{dims:g,dataType:c}],dispatchGroup:{x:Math.ceil(x/64)},programUniforms:[{type:12,data:x},...se(w,g)]})}},Ki=(e,r)=>{let t=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(u=>t.push(Number(u))),ke({axes:t,keepDims:r.keepDims,noopWithEmptyAxes:r.noopWithEmptyAxes})},Dt=(e,r,t,u)=>{let s=e.inputs,c=s.length===1?t:Ki(s,t);e.compute(ii(r,{hint:c.cacheKey,inputDependencies:[\"rank\"]},[s[0]],c.noopWithEmptyAxes&&c.axes.length===0?mg:u,c.axes,s[0].dataType,c.keepDims,c.noopWithEmptyAxes),{inputs:[0]})},hg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceLogSum\",r,(u,s)=>[`var value = ${s.type.storage}(0);`,\"\",`value += ${u.getByIndices(\"input_indices\")};`,\"value = log(value);\"])},gg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceL1\",r,(u,s)=>[`var value = ${s.type.storage}(0);`,\"\",`value += abs(${u.getByIndices(\"input_indices\")});`,\"\"])},yg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceL2\",r,(u,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,\"\",`t = ${u.getByIndices(\"input_indices\")}; value += (t * t);`,\"value = sqrt(value);\"])},bg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceLogSumExp\",r,(u,s)=>[`var value = ${s.type.storage}(0);`,\"\",`value += exp(${u.getByIndices(\"input_indices\")});`,\"value = log(value);\"])},vg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceMax\",r,(u,s,c)=>{let f=[];for(let d=0;d=0||c.length===0)&&f.push(u.indicesSet(\"input_indices\",d,0));return[`${f.join(`\n`)}`,`var value = ${u.getByIndices(\"input_indices\")};`,`value = max(value, ${u.getByIndices(\"input_indices\")});`,\"\"]})},wg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceMean\",r,(u,s,c)=>{let f=1;for(let d=0;d=0||c.length===0)&&(f*=e.inputs[0].dims[d]);return[\"var sum = f32(0);\",\"\",`sum += f32(${u.getByIndices(\"input_indices\")});`,`let value = ${s.type.value}(sum / ${f});`]})},_g=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceMin\",r,(u,s,c)=>{let f=[];for(let d=0;d=0||c.length===0)&&f.push(`input_indices[${d}] = 0;`);return[`${f.join(`\n`)}`,`var value = ${u.getByIndices(\"input_indices\")};`,`value = min(value, ${u.getByIndices(\"input_indices\")});`,\"\"]})},$g=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceProd\",r,(u,s)=>[`var value = ${s.type.storage}(1);`,\"\",`value *= ${u.getByIndices(\"input_indices\")};`,\"\"])},Cg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceSum\",r,(u,s)=>[`var value = ${s.type.storage}(0);`,\"\",`value += ${u.getByIndices(\"input_indices\")};`,\"\"])},Sg=(e,r)=>{Bt(e.inputs),Dt(e,\"ReduceSumSquare\",r,(u,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,\"\",`t = ${u.getByIndices(\"input_indices\")}; value += t * t;`,\"\"])},zt=(e,r,t)=>{if(r.length===0)return t;let u=1,s=1;for(let c=0;c1024},rl=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?wg(e,r):Lu(e,r)},nl=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?gg(e,r):Fu(e,r)},il=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?yg(e,r):qu(e,r)},ol=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?bg(e,r):Ku(e,r)},al=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?vg(e,r):Yu(e,r)},sl=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?_g(e,r):Zu(e,r)},ul=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?$g(e,r):Qu(e,r)},ll=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Cg(e,r):Xu(e,r)},dl=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Sg(e,r):Ju(e,r)},cl=(e,r)=>{zt(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?hg(e,r):el(e,r)}});var fl,pl,ml,Yi,hl=ae(()=>{\"use strict\";Te();nt();ni();fl=e=>{if(!e||e.length===0||e.length>2)throw new Error(\"ArgMinMaxOp op requires 1 or 2 inputs.\");if(e[0].dataType!==1)throw new Error(\"Invalid input type.\")},pl=(e,r)=>{fl(e.inputs);let t=(u,s,c)=>{let f=[];for(let d=0;d=0||c.length===0)&&f.push(`input_indices[${d}] = 0;`);return[`${f.join(`\n`)}`,`var value = ${u.getByIndices(\"input_indices\")};\nvar best_index : i32 = 0;`,`if (${u.getByIndices(\"input_indices\")} ${r.selectLastIndex>0?\"<=\":\"<\"} value) {\n value = ${u.getByIndices(\"input_indices\")};\n best_index = i32(last_index);\n }`,\"\",s.setByOffset(\"global_idx\",\"best_index\")]};e.compute(ii(\"ArgMin\",{hint:r.cacheKey,inputDependencies:[\"rank\"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},ml=(e,r)=>{fl(e.inputs);let t=(u,s,c)=>{let f=[];for(let d=0;d=0||c.length===0)&&f.push(`input_indices[${d}] = 0;`);return[`${f.join(`\n`)}`,`var value = ${u.getByIndices(\"input_indices\")};\nvar best_index : i32 = 0;`,`if (${u.getByIndices(\"input_indices\")} ${r.selectLastIndex>0?\">=\":\">\"} value) {\n value = ${u.getByIndices(\"input_indices\")};\n best_index = i32(last_index);\n }`,\"\",s.setByOffset(\"global_idx\",\"best_index\")]};e.compute(ii(\"argMax\",{hint:r.cacheKey,inputDependencies:[\"rank\"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},Yi=e=>ke(e)});var xg,Ig,Ag,oi,gl,yl,Zi=ae(()=>{\"use strict\";Te();De();nt();Re();xg=(e,r)=>{if(!e||e.length<1)throw new Error(\"too few inputs\");let t=0,u=e[t],s=u.dataType,c=u.dims.length;e.forEach((f,d)=>{if(d!==t){if(f.dataType!==s)throw new Error(\"input tensors should be one type\");if(f.dims.length!==c)throw new Error(\"input tensors should have the same shape\");f.dims.forEach((g,w)=>{if(w!==r&&g!==u.dims[w])throw new Error(\"non concat dimensions must match\")})}})},Ig=(e,r)=>`\n fn calculateInputIndex(index: u32) -> u32 {\n let sizeInConcatAxis = array(${r});\n for (var i: u32 = 0u; i < ${e}; i += 1u ) {\n if (index < sizeInConcatAxis[i]) {\n return i;\n }\n }\n return ${e}u;\n }`,Ag=(e,r)=>{let t=e.length,u=[];for(let s=0;s{let s=K.size(t),c=new Array(e.length),f=new Array(e.length),d=0,g=[],w=[],C=[{type:12,data:s}];for(let E=0;E`uniforms.sizeInConcatAxis${E}`).join(\",\"),x=E=>`\n\n ${(()=>{E.registerUniform(\"outputSize\",\"u32\");for(let O=0;O(${P});\n ${A} -= sizeInConcatAxis[inputIndex - 1u];\n }\n\n ${Ag(f,$)}\n }`;return{name:\"Concat\",shaderCache:{hint:`${r}`,inputDependencies:g},getRunData:()=>({outputs:[{dims:t,dataType:u}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:C}),getShaderSource:x}},gl=(e,r)=>{let t=e.inputs,u=t[0].dims,s=K.normalizeAxis(r.axis,u.length);xg(t,s);let c=u.slice();c[s]=t.reduce((d,g)=>d+(g.dims.length>s?g.dims[s]:0),0);let f=t.filter(d=>K.size(d.dims)>0);e.compute(oi(f,s,c,t[0].dataType),{inputs:f})},yl=e=>ke({axis:e.axis})});var Tg,Eg,Pg,kg,ai,Og,bl,Qi=ae(()=>{\"use strict\";Te();Xn();Re();Zi();Tg=(e,r)=>{let t=e[0],u=e[1],s=e[2],c=e[3],f=e[4],d=e[5];if(f&&d)throw new Error(\"Attention cannot have both past and relative_position_bias\");if(t.dims.length!==3)throw new Error('Input \"input\" must have 3 dimensions');let g=t.dims[0],w=t.dims[1],C=t.dims[2];if(s.dims.length!==1)throw new Error('Input \"bias\" is expected to have 1 dimensions');if(u.dims.length!==2)throw new Error('Input \"weights\" is expected to have 2 dimensions');if(u.dims[0]!==C)throw new Error(\"Input 1 dimension 0 should have same length as dimension 2 of input 0\");if(s.dims[0]!==u.dims[1])throw new Error('Input \"bias\" dimension 0 should have same length as dimension 1 of input \"weights\"');let $=s.dims[0]/3,A=$,P=A;if(r.qkvHiddenSizes.length>0){if(r.qkvHiddenSizes.length!==3)throw new Error(\"qkv_hidden_sizes attribute should have 3 elements\");for(let j of r.qkvHiddenSizes)if(j%r.numHeads!==0)throw new Error(\"qkv_hidden_sizes should be divisible by num_heads\");$=r.qkvHiddenSizes[0],A=r.qkvHiddenSizes[1],P=r.qkvHiddenSizes[2]}let x=w;if($!==A)throw new Error(\"qkv_hidden_sizes first element should be same as the second\");if(s.dims[0]!==$+A+P)throw new Error('Input \"bias\" dimension 0 should have same length as sum of Q/K/V hidden sizes');let E=0;if(f){if(A!==P)throw new Error('Input \"past\" expect k_hidden_size == v_hidden_size');if(f.dims.length!==5)throw new Error('Input \"past\" must have 5 dimensions');if(f.dims[0]!==2)throw new Error('Input \"past\" first dimension must be 2');if(f.dims[1]!==g)throw new Error('Input \"past\" second dimension must be batch_size');if(f.dims[2]!==r.numHeads)throw new Error('Input \"past\" third dimension must be num_heads');if(f.dims[4]!==A/r.numHeads)throw new Error('Input \"past\" fifth dimension must be k_hidden_size / num_heads');r.pastPresentShareBuffer||(E=f.dims[3])}let O=x+E,B=-1,R=0;if(c)throw new Error(\"Mask not supported\");if(f)throw new Error(\"past is not supported\");return{batchSize:g,sequenceLength:w,pastSequenceLength:E,kvSequenceLength:x,totalSequenceLength:O,maxSequenceLength:B,inputHiddenSize:C,hiddenSize:$,vHiddenSize:P,headSize:Math.floor($/r.numHeads),vHeadSize:Math.floor(P/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:R,scale:r.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},Eg=(e,r,t,u)=>{let s=He(u),c=64,f=u/s;f{let P=ne(\"x\",r.dataType,r.dims,s),E=[{name:\"d_inv\",type:at(r.dataType)},{name:\"d_comp\",type:\"u32\"},{name:\"elements_per_thread\",type:\"u32\"}];return`\n var thread_max: array;\n var thread_sum: array;\n ${A.registerUniforms(E).declareVariables(P)}\n ${A.mainStart([c,1,1])}\n let local_offset = local_idx * uniforms.elements_per_thread;\n let offset = workgroup_id.x * uniforms.d_comp + local_offset;\n\n var thread_max_vector = ${C}(-3.402823e+38f);\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n thread_max_vector = max(${C}(x[offset + i]), thread_max_vector);\n }\n thread_max[local_idx] = ${(()=>{switch(s){case 1:return\"thread_max_vector\";case 2:return\"max(thread_max_vector.x, thread_max_vector.y)\";case 4:return\"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))\";default:throw new Error(`Unsupported components: ${s}`)}})()};\n workgroupBarrier();\n\n var max_value = f32(-3.402823e+38f);\n for (var i = 0u; i < ${c}; i++) {\n max_value = max(thread_max[i], max_value);\n }\n\n var sum_vector = ${C}(0);\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n sum_vector += exp(${C}(x[offset + i]) - max_value);\n }\n thread_sum[local_idx] = ${(()=>{switch(s){case 1:return\"sum_vector\";case 2:return\"sum_vector.x + sum_vector.y\";case 4:return\"sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w\";default:throw new Error(`Unsupported components: ${s}`)}})()};\n workgroupBarrier();\n\n var sum: f32 = 0;\n for (var i = 0u; i < ${c}; i++) {\n sum += thread_sum[i];\n }\n\n if (sum == 0) {\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n x[offset + i] = ${P.type.value}(uniforms.d_inv);\n }\n } else {\n for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < uniforms.d_comp; i++) {\n var f32input = ${C}(x[offset + i]);\n x[offset + i] = ${P.type.value}(exp(f32input - max_value) / sum);\n }\n }\n }`};return{name:\"AttentionProbsSoftmax\",shaderCache:{hint:`${c};${w};${s}`},getShaderSource:$,getRunData:()=>({outputs:[],dispatchGroup:{x:t},programUniforms:g})}},Pg=(e,r,t,u,s,c,f)=>{let d=f+s.kvSequenceLength,g=[s.batchSize,s.numHeads,s.sequenceLength,d],w=c.scale===0?1/Math.sqrt(s.headSize):c.scale,C=He(s.headSize),$=s.headSize/C,A=12,P={x:Math.ceil(d/A),y:Math.ceil(s.sequenceLength/A),z:s.batchSize*s.numHeads},x=[{type:12,data:s.sequenceLength},{type:12,data:$},{type:12,data:d},{type:12,data:s.numHeads},{type:1,data:w}],E=[\"type\",\"type\"];u&&(E.push(\"rank\"),x.push(...se(u.dims)));let O=B=>{let R=Z(\"q\",r.dataType,r.dims,C),j=Z(\"key\",t.dataType,t.dims,C),U=[R,j],L=u?Z(\"relative_position_bias\",u.dataType,u.dims.length):void 0;L&&U.push(L);let F=ne(\"output\",r.dataType,g),te=at(1,C),J=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"alpha\",type:\"f32\"}];return`\n const TILE_SIZE = ${A}u;\n\n var tileQ: array<${R.type.storage}, ${A*A}>;\n var tileK: array<${R.type.storage}, ${A*A}>;\n ${B.registerUniforms(J).declareVariables(...U,F)}\n ${B.mainStart([A,A,1])}\n // x holds the N and y holds the M\n let headIdx = workgroup_id.z;\n let m = workgroup_id.y * TILE_SIZE;\n let n = workgroup_id.x * TILE_SIZE;\n let qOffset = uniforms.M * uniforms.K * headIdx + m * uniforms.K;\n let kOffset = uniforms.N * uniforms.K * headIdx + n * uniforms.K;\n\n var value = ${te}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) {\n tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x];\n }\n if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) {\n tileK[TILE_SIZE * local_id.y + local_id.x] = key[kOffset + local_id.y * uniforms.K + w + local_id.x];\n }\n workgroupBarrier();\n\n for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) {\n value += ${te}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]);\n }\n\n workgroupBarrier();\n }\n\n let headOffset = headIdx * uniforms.M * uniforms.N;\n if (global_id.y < uniforms.M && global_id.x < uniforms.N) {\n let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x;\n var sum: f32 = ${(()=>{switch(C){case 1:return\"value\";case 2:return\"value.x + value.y\";case 4:return\"value.x + value.y + value.z + value.w\";default:throw new Error(`Unsupported components: ${C}`)}})()};\n\n ${(()=>L?`\n let batch = workgroup_id.z / uniforms.num_heads;\n let head = workgroup_id.z % uniforms.num_heads;\n var indices = ${L.type.indices}(batch, head, global_id.y, global_id.x);\n output[outputIdx] = ${F.type.value}(sum * uniforms.alpha) + ${L.getByIndices(\"indices\")};`:`output[outputIdx] = ${F.type.value} (sum * uniforms.alpha);`)()}\n }\n }`};return{name:\"AttentionProbs\",shaderCache:{hint:`${C}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:g,dataType:r.dataType,gpuDataType:0}],dispatchGroup:P,programUniforms:x}),getShaderSource:O}},kg=(e,r,t,u,s)=>{let c=s+u.kvSequenceLength,f=[u.batchSize,u.sequenceLength,u.vHiddenSize],d=12,g={x:Math.ceil(u.vHeadSize/d),y:Math.ceil(u.sequenceLength/d),z:u.batchSize*u.numHeads},w=[{type:12,data:u.sequenceLength},{type:12,data:c},{type:12,data:u.vHeadSize},{type:12,data:u.numHeads},{type:12,data:u.vHiddenSize}];return{name:\"AttentionScore\",shaderCache:{inputDependencies:[\"type\",\"type\"]},getRunData:()=>({outputs:[{dims:f,dataType:r.dataType,gpuDataType:0}],dispatchGroup:g,programUniforms:w}),getShaderSource:A=>{let P=Z(\"probs\",r.dataType,r.dims),x=Z(\"v\",t.dataType,t.dims),E=ne(\"output\",r.dataType,f),O=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"v_hidden_size\",type:\"u32\"}];return`\n const TILE_SIZE = ${d}u;\n var tileQ: array<${P.type.value}, ${d*d}>;\n var tileK: array<${P.type.value}, ${d*d}>;\n ${A.registerUniforms(O).declareVariables(P,x,E)}\n ${A.mainStart([d,d,1])}\n let headIdx = workgroup_id.z;\n let m = global_id.y;\n let n = global_id.x;\n\n let offsetA = headIdx * (uniforms.M * uniforms.K) + m * uniforms.K;\n let offsetB = headIdx * (uniforms.N * uniforms.K) + n;\n\n var value = ${P.type.storage}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\n tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x];\n }\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\n tileK[TILE_SIZE * local_id.y + local_id.x] = v[offsetB + (w + local_id.y) * uniforms.N];\n }\n workgroupBarrier();\n for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) {\n value += tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * k + local_id.x];\n }\n workgroupBarrier();\n }\n\n // we need to transpose output from BNSH_v to BSND_v\n let batchIdx = workgroup_id.z / uniforms.num_heads;\n let currentBatchHeadNumber = workgroup_id.z % uniforms.num_heads;\n if (m < uniforms.M && n < uniforms.N) {\n let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size\n + currentBatchHeadNumber * uniforms.N + n;\n output[outputIdx] = value;\n }\n }`}}},ai=(e,r,t,u,s,c,f,d,g,w,C)=>{let $=e.outputCount>1,A=e.outputCount>2,P=$&&A?w.pastSequenceLength:0,x=P+w.kvSequenceLength,E=[w.batchSize,w.numHeads,x,w.headSize],O=f?[f,t]:[t],B=$?e.compute(oi(O,2,E,t.dataType),{inputs:O,outputs:[1]})[0]:t,R=[w.batchSize,w.numHeads,x,w.headSize],j=d?[d,u]:[u],U=A?e.compute(oi(j,2,R,u.dataType),{inputs:j,outputs:[2]})[0]:u,L=[r,B];g&&L.push(g);let F=e.compute(Pg(e,r,B,g,w,C,P),{inputs:L,outputs:[-1]})[0];e.compute(Eg(e,F,w.batchSize*w.numHeads*w.sequenceLength,x),{inputs:[F],outputs:[]});let te=[F,U];e.compute(kg(e,F,U,w,P),{inputs:te,outputs:[0]})},Og=(e,r)=>{let t=[r.batchSize,r.numHeads,r.sequenceLength,r.headSize],u=r.sequenceLength,s=r.inputHiddenSize,c=r.headSize,f=12,d={x:Math.ceil(r.headSize/f),y:Math.ceil(r.sequenceLength/f),z:r.batchSize*r.numHeads},g=[e.inputs[0],e.inputs[1],e.inputs[2]],w=[{type:12,data:u},{type:12,data:s},{type:12,data:c},{type:12,data:r.numHeads},{type:12,data:r.headSize},{type:12,data:r.hiddenSize},{type:12,data:r.hiddenSize+r.hiddenSize+r.vHiddenSize}],C=$=>{let A=ne(\"output_q\",g[0].dataType,t),P=ne(\"output_k\",g[0].dataType,t),x=ne(\"output_v\",g[0].dataType,t),E=Z(\"input\",g[0].dataType,g[0].dims),O=Z(\"weight\",g[1].dataType,g[1].dims),B=Z(\"bias\",g[2].dataType,g[2].dims),R=E.type.storage,j=[{name:\"M\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"num_heads\",type:\"u32\"},{name:\"head_size\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"},{name:\"ldb\",type:\"u32\"}];return`\n const TILE_SIZE = ${f}u;\n var tileInput: array<${R}, ${f*f}>;\n var tileWeightQ: array<${R}, ${f*f}>;\n var tileWeightK: array<${R}, ${f*f}>;\n var tileWeightV: array<${R}, ${f*f}>;\n ${$.registerUniforms(j).declareVariables(E,O,B,A,P,x)}\n ${$.mainStart([f,f,1])}\n let batchIndex = workgroup_id.z / uniforms.num_heads;\n let headNumber = workgroup_id.z % uniforms.num_heads;\n let m = global_id.y;\n let n = global_id.x;\n\n let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K;\n let biasOffsetQ = headNumber * uniforms.head_size;\n let biasOffsetK = uniforms.hidden_size + biasOffsetQ;\n let biasOffsetV = uniforms.hidden_size + biasOffsetK;\n\n var valueQ = ${R}(0);\n var valueK = ${R}(0);\n var valueV = ${R}(0);\n for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) {\n if (m < uniforms.M && w + local_id.x < uniforms.K) {\n tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x];\n }\n if (n < uniforms.N && w + local_id.y < uniforms.K) {\n let offset = n + (w + local_id.y) * uniforms.ldb;\n tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset];\n tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset];\n tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset];\n }\n workgroupBarrier();\n for (var k: u32 = 0u; k({outputs:[{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:d,programUniforms:w}),getShaderSource:C},{inputs:g,outputs:[-1,-1,-1]})},bl=(e,r)=>{let t=Tg(e.inputs,r),[u,s,c]=Og(e,t);return ai(e,u,s,c,e.inputs[4],void 0,void 0,void 0,e.inputs[5],t,r)}});var Rg,Bg,Dg,vl,wl=ae(()=>{\"use strict\";Rr();Te();De();nt();Re();Rg=(e,r)=>{if(!e||e.length!==5)throw new Error(\"BatchNormalization requires 5 inputs\");let t=(u,s,c)=>{let f=s.length;if(f!==u.length)throw new Error(`${c}: num dimensions != ${f}`);s.forEach((d,g)=>{if(d!==u[g])throw new Error(`${c}: dim[${g}] do not match`)})};if(e[0].dims.length>1){let u=r.format===\"NHWC\"?r.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,r.spatial?2:void 0);t(e[1].dims,u,\"Invalid input scale\"),t(e[2].dims,u,\"Invalid input B\"),t(e[3].dims,u,\"Invalid input mean\"),t(e[4].dims,u,\"Invalid input var\")}else t(e[1].dims,[1],\"Invalid input scale\"),t(e[2].dims,[1],\"Invalid input B\"),t(e[3].dims,[1],\"Invalid input mean\"),t(e[4].dims,[1],\"Invalid input var\")},Bg=(e,r)=>{let{epsilon:t,spatial:u,format:s}=r,c=e[0].dims,f=u?He(c[c.length-1]):1,d=s===\"NHWC\"&&c.length>1?f:1,g=K.size(c)/f,w=u,C=w?c.length:c,$=Z(\"x\",e[0].dataType,e[0].dims,f),A=Z(\"scale\",e[1].dataType,e[1].dims,d),P=Z(\"bias\",e[2].dataType,e[2].dims,d),x=Z(\"inputMean\",e[3].dataType,e[3].dims,d),E=Z(\"inputVar\",e[4].dataType,e[4].dims,d),O=ne(\"y\",e[0].dataType,C,f),B=()=>{let j=\"\";if(u)j=`let cOffset = ${c.length===1?\"0u\":s===\"NHWC\"?`outputIndices[${c.length-1}] / ${f}`:\"outputIndices[1]\"};`;else if(s===\"NCHW\")j=`\n ${O.indicesSet(\"outputIndices\",\"0\",\"0\")}\n let cOffset = ${O.indicesToOffset(\"outputIndices\")};`;else{j=`var cIndices = ${A.type.indices}(0);\n cIndices[0] = outputIndices[${c.length-1}];`;for(let U=1;U`\n const epsilon = ${t};\n ${j.registerUniform(\"outputSize\",\"u32\").declareVariables($,A,P,x,E,O)}\n ${j.mainStart()}\n ${j.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n var outputIndices = ${O.offsetToIndices(`global_idx * ${f}`)};\n ${B()}\n let scale = ${A.getByOffset(\"cOffset\")};\n let bias = ${P.getByOffset(\"cOffset\")};\n let inputMean = ${x.getByOffset(\"cOffset\")};\n let inputVar = ${E.getByOffset(\"cOffset\")};\n let x = ${$.getByOffset(\"global_idx\")};\n let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias;\n ${O.setByOffset(\"global_idx\",\"value\")}\n }`;return{name:\"BatchNormalization\",shaderCache:{hint:`${r.epsilon}_${r.format}_${u}_${f}`,inputDependencies:w?[\"rank\",\"type\",\"type\",\"type\",\"type\"]:void 0},getShaderSource:R,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(g/64)},programUniforms:w?[{type:12,data:g},...se(c)]:[{type:12,data:g}]})}},Dg=e=>ke(e),vl=(e,r)=>{let{inputs:t,outputCount:u}=e,s=Dg({...r,outputCount:u});if(Or.webgpu.validateInputContent&&Rg(t,s),r.trainingMode)throw new Error(\"BatchNormalization trainingMode is not supported yet.\");e.compute(Bg(t,s))}});var zg,Mg,_l,$l=ae(()=>{\"use strict\";De();Re();zg=e=>{if(e[0].dims.length!==3)throw new Error(\"input should have 3 dimensions\");if(![320,640,1280].includes(e[0].dims[2]))throw new Error(\"number of channels should be 320, 640 or 1280\");if(e[1].dims.length!==1)throw new Error(\"bias is expected to have 1 dimensions\");if(e[0].dims[2]!==e[1].dims[0])throw new Error(\"last dimension of input and bias are not the same\")},Mg=e=>{let r=e[0].dims,t=e[0].dims[2],u=K.size(r)/4,s=e[0].dataType,c=Z(\"input\",s,r,4),f=Z(\"bias\",s,[t],4),d=Z(\"residual\",s,r,4),g=ne(\"output\",s,r,4);return{name:\"BiasAdd\",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)}}),getShaderSource:C=>`\n const channels = ${t}u / 4;\n ${C.declareVariables(c,f,d,g)}\n\n ${C.mainStart()}\n ${C.guardAgainstOutOfBoundsWorkgroupSizes(u)}\n let value = ${c.getByOffset(\"global_idx\")}\n + ${f.getByOffset(\"global_idx % channels\")} + ${d.getByOffset(\"global_idx\")};\n ${g.setByOffset(\"global_idx\",\"value\")}\n }`}},_l=e=>{zg(e.inputs),e.compute(Mg(e.inputs))}});var jg,Ve,Cl,Sl,xl,Il,Al,Tl,El,Pl,kl,Ug,Ol,Rl,Bl,Dl,si,zl,ui,Ml,jl,Ul,Vl,Wl,Nl,Gl,Hl,Ll,Fl,ql,Kl,Yl,Zl,Ql,Xl,Jl,ed,Xi,Ji,td,rd,nd,li=ae(()=>{\"use strict\";Te();De();nt();Re();jg=(e,r,t,u,s,c)=>{let f=Math.ceil(r/4),d=\"\";typeof s==\"string\"?d=`${s}(a)`:d=s(\"a\");let g=Z(\"inputData\",t,[f],4),w=ne(\"outputData\",u,[f],4);return`\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(g,w)}\n\n ${c??\"\"}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n\n let a = ${g.getByOffset(\"global_idx\")};\n ${w.setByOffset(\"global_idx\",d)}\n }`},Ve=(e,r,t,u,s,c=e.dataType)=>({name:r,shaderCache:{hint:s,inputDependencies:[\"type\"]},getShaderSource:f=>jg(f,K.size(e.dims),e.dataType,c,t,u),getRunData:f=>({outputs:[{dims:e.dims,dataType:c}],dispatchGroup:{x:Math.ceil(K.size(f[0].dims)/64/4)},programUniforms:[{type:12,data:Math.ceil(K.size(e.dims)/4)}]})}),Cl=e=>{e.compute(Ve(e.inputs[0],\"Abs\",\"abs\"))},Sl=e=>{e.compute(Ve(e.inputs[0],\"Acos\",\"acos\"))},xl=e=>{e.compute(Ve(e.inputs[0],\"Acosh\",\"acosh\"))},Il=e=>{e.compute(Ve(e.inputs[0],\"Asin\",\"asin\"))},Al=e=>{e.compute(Ve(e.inputs[0],\"Asinh\",\"asinh\"))},Tl=e=>{e.compute(Ve(e.inputs[0],\"Atan\",\"atan\"))},El=e=>{e.compute(Ve(e.inputs[0],\"Atanh\",\"atanh\"))},Pl=e=>ke(e),kl=(e,r)=>{let t;switch(r.to){case 10:t=\"vec4\";break;case 1:t=\"vec4\";break;case 12:t=\"vec4\";break;case 6:t=\"vec4\";break;case 9:t=\"vec4\";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${r.to}`)}e.compute(Ve(e.inputs[0],\"Cast\",t,void 0,r.cacheKey,r.to))},Ug=e=>{let r=e.length>=2&&e[1].data!==0?e[1].getFloat32Array()[0]:ei,t=e.length>=3&&e[2].data!==0?e[2].getFloat32Array()[0]:ti;return ke({min:r,max:t})},Ol=(e,r)=>{let t=e.inputs.length===1?r:Ug(e.inputs),u=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"Clip\",s=>`clamp(${s}, clip_min_, clip_max_)`,`\n const clip_min_: vec4<${u}> = vec4(${u}(${t.min}));\n const clip_max_: vec4<${u}> = vec4(${u}(${t.max}));\n`,t.cacheKey),{inputs:[0]})},Rl=e=>{e.compute(Ve(e.inputs[0],\"Ceil\",\"ceil\"))},Bl=e=>{e.compute(Ve(e.inputs[0],\"Cos\",\"cos\"))},Dl=e=>{e.compute(Ve(e.inputs[0],\"Cosh\",\"cosh\"))},si=e=>ke(e),zl=(e,r)=>{let t=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"Elu\",u=>`elu_vf32(${u})`,`\n const elu_alpha_ = ${t}(${r.alpha});\n\n fn elu_f32(a: ${t}) -> ${t} {\n return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0);\n }\n\n fn elu_vf32(v: vec4<${t}>) -> vec4<${t}> {\n return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w));\n }`,r.cacheKey))},ui=(e=\"f32\")=>`\nconst r0: ${e} = 0.3275911;\nconst r1: ${e} = 0.254829592;\nconst r2: ${e} = -0.284496736;\nconst r3: ${e} = 1.421413741;\nconst r4: ${e} = -1.453152027;\nconst r5: ${e} = 1.061405429;\n\nfn erf_vf32(v: vec4<${e}>) -> vec4<${e}> {\n let absv = abs(v);\n let x = 1.0 / (1.0 + r0 * absv);\n return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv));\n}`,Ml=e=>{let r=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"Erf\",t=>`erf_vf32(${t})`,ui(r)))},jl=e=>{e.compute(Ve(e.inputs[0],\"Exp\",\"exp\"))},Ul=e=>{e.compute(Ve(e.inputs[0],\"Floor\",\"floor\"))},Vl=e=>{let r=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"Gelu\",t=>`0.5 * ${t} * (1.0 + erf_vf32(${t} * 0.7071067811865475))`,ui(r)))},Wl=(e,r)=>{let t=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"LeakyRelu\",u=>`select(leaky_relu_alpha_ * ${u}, ${u}, ${u} >= vec4<${t}>(0.0))`,`const leaky_relu_alpha_ = ${t}(${r.alpha});`,r.cacheKey))},Nl=e=>{e.compute(Ve(e.inputs[0],\"Not\",r=>`!${r}`))},Gl=e=>{e.compute(Ve(e.inputs[0],\"Neg\",r=>`-${r}`))},Hl=e=>{e.compute(Ve(e.inputs[0],\"Reciprocal\",r=>`1.0/${r}`))},Ll=e=>{let r=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"Relu\",t=>`select(vec4<${r}>(0.0), ${t}, ${t} > vec4<${r}>(0.0))`))},Fl=e=>{e.compute(Ve(e.inputs[0],\"Sigmoid\",r=>`(1.0 / (1.0 + exp(-${r})))`))},ql=e=>ke(e),Kl=(e,r)=>{let t=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"HardSigmoid\",u=>`max(vec4<${t}>(0.0), min(vec4<${t}>(1.0), ${r.alpha} * ${u} + vec4<${t}>(${r.beta})))`,void 0,r.cacheKey))},Yl=e=>{e.compute(Ve(e.inputs[0],\"Sin\",\"sin\"))},Zl=e=>{e.compute(Ve(e.inputs[0],\"Sinh\",\"sinh\"))},Ql=e=>{e.compute(Ve(e.inputs[0],\"Sqrt\",\"sqrt\"))},Xl=e=>{e.compute(Ve(e.inputs[0],\"Tan\",\"tan\"))},Jl=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,ed=e=>{e.compute(Ve(e.inputs[0],\"Tanh\",Jl))},Xi=(e=\"f32\")=>`\nconst fast_gelu_a: ${e} = 0.5;\nconst fast_gelu_b: ${e} = 0.7978845608028654;\nconst fast_gelu_c: ${e} = 0.035677408136300125;\n\nfn tanh_v(v: vec4<${e}>) -> vec4<${e}> {\n return ${Jl(\"v\")};\n}\n`,Ji=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,td=e=>{let r=at(e.inputs[0].dataType);e.compute(Ve(e.inputs[0],\"FastGelu\",Ji,Xi(r),void 0,e.inputs[0].dataType))},rd=(e,r)=>{let t=at(e.inputs[0].dataType);return e.compute(Ve(e.inputs[0],\"ThresholdedRelu\",u=>`select(vec4<${t}>(0.0), ${u}, ${u} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${t}>(${r.alpha});`,r.cacheKey)),0},nd=e=>{e.compute(Ve(e.inputs[0],\"Log\",\"log\"))}});var Vg,Wg,od,ad=ae(()=>{\"use strict\";De();Re();li();Vg=e=>{if(e[0].dims.length!==3)throw new Error(\"input should have 3 dimensions\");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error(\"hidden state should be 2560, 5120 or 10240\");if(e[1].dims.length!==1)throw new Error(\"bias is expected to have 1 dimensions\");if(e[0].dims[2]!==e[1].dims[0])throw new Error(\"last dimension of input and bias are not the same\")},Wg=e=>{let r=e[0].dims.slice();r[2]=r[2]/2;let t=Z(\"input\",e[0].dataType,e[0].dims,4),u=Z(\"bias\",e[0].dataType,[e[0].dims[2]],4),s=ne(\"output\",e[0].dataType,r,4),c=K.size(r)/4,f=Ne(e[0].dataType);return{name:\"BiasSplitGelu\",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)}}),getShaderSource:g=>`\n const M_SQRT2 = sqrt(2.0);\n const halfChannels = ${e[0].dims[2]/4/2}u;\n\n ${g.declareVariables(t,u,s)}\n\n ${ui(f)}\n\n ${g.mainStart()}\n ${g.guardAgainstOutOfBoundsWorkgroupSizes(c)}\n let biasIdx = global_idx % halfChannels;\n let batchIndex = global_idx / halfChannels;\n let inputOffset = biasIdx + batchIndex * halfChannels * 2;\n let valueLeft = input[inputOffset] + bias[biasIdx];\n let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels];\n let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1);\n\n ${s.setByOffset(\"global_idx\",\"valueLeft * geluRight\")}\n }`}},od=e=>{Vg(e.inputs),e.compute(Wg(e.inputs))}});var Ng,Gg,Mt,sd,ud,ld,dd,cd,fd,pd,md,hd,gd,yd=ae(()=>{\"use strict\";Te();De();Re();Ng=(e,r,t,u,s,c,f,d,g,w,C,$)=>{let A,P;typeof d==\"string\"?A=P=(R,j)=>`${d}((${R}),(${j}))`:typeof d==\"function\"?A=P=d:(A=d.scalar,P=d.vector);let x=ne(\"outputData\",C,u.length,4),E=Z(\"aData\",g,r.length,4),O=Z(\"bData\",w,t.length,4),B;if(s)if(c){let R=K.size(r)===1,j=K.size(t)===1,U=r.length>0&&r[r.length-1]%4===0,L=t.length>0&&t[t.length-1]%4===0;R||j?B=x.setByOffset(\"global_idx\",P(R?`${E.type.value}(${E.getByOffset(\"0\")}.x)`:E.getByOffset(\"global_idx\"),j?`${O.type.value}(${O.getByOffset(\"0\")}.x)`:O.getByOffset(\"global_idx\"))):B=`\n let outputIndices = ${x.offsetToIndices(\"global_idx * 4u\")};\n let offsetA = ${E.broadcastedIndicesToOffset(\"outputIndices\",x)};\n let offsetB = ${O.broadcastedIndicesToOffset(\"outputIndices\",x)};\n ${x.setByOffset(\"global_idx\",P(f||U?E.getByOffset(\"offsetA / 4u\"):`${E.type.value}(${E.getByOffset(\"offsetA / 4u\")}[offsetA % 4u])`,f||L?O.getByOffset(\"offsetB / 4u\"):`${O.type.value}(${O.getByOffset(\"offsetB / 4u\")}[offsetB % 4u])`))}\n `}else B=x.setByOffset(\"global_idx\",P(E.getByOffset(\"global_idx\"),O.getByOffset(\"global_idx\")));else{if(!c)throw new Error(\"no necessary to use scalar implementation for element-wise binary op implementation.\");let R=(j,U,L=\"\")=>{let F=`aData[indexA${U}][componentA${U}]`,te=`bData[indexB${U}][componentB${U}]`;return`\n let outputIndices${U} = ${x.offsetToIndices(`global_idx * 4u + ${U}u`)};\n let offsetA${U} = ${E.broadcastedIndicesToOffset(`outputIndices${U}`,x)};\n let offsetB${U} = ${O.broadcastedIndicesToOffset(`outputIndices${U}`,x)};\n let indexA${U} = offsetA${U} / 4u;\n let indexB${U} = offsetB${U} / 4u;\n let componentA${U} = offsetA${U} % 4u;\n let componentB${U} = offsetB${U} % 4u;\n ${j}[${U}] = ${L}(${A(F,te)});\n `};C===9?B=`\n var data = vec4(0);\n ${R(\"data\",0,\"u32\")}\n ${R(\"data\",1,\"u32\")}\n ${R(\"data\",2,\"u32\")}\n ${R(\"data\",3,\"u32\")}\n outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:B=`\n ${R(\"outputData[global_idx]\",0)}\n ${R(\"outputData[global_idx]\",1)}\n ${R(\"outputData[global_idx]\",2)}\n ${R(\"outputData[global_idx]\",3)}\n `}return`\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(E,O,x)}\n\n ${$??\"\"}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n ${B}\n }`},Gg=(e,r,t,u,s,c,f=t.dataType)=>{let d=!K.areEqual(t.dims,u.dims),g=t.dims,w=K.size(t.dims),C=!1,$=!1,A=[d];if(d){let P=Ot.calcShape(t.dims,u.dims,!1);if(!P)throw new Error(\"Can't perform binary op on the given tensors\");g=P,w=K.size(g);let x=K.size(t.dims)===1,E=K.size(u.dims)===1,O=t.dims.length>0&&t.dims[t.dims.length-1]%4===0,B=u.dims.length>0&&u.dims[u.dims.length-1]%4===0;A.push(x),A.push(E),A.push(O),A.push(B);let R=1;for(let j=1;jP.toString()).join(\"_\"),inputDependencies:[\"rank\",\"rank\"]},getShaderSource:P=>Ng(P,t.dims,u.dims,g,C,d,$,s,t.dataType,u.dataType,f,c),getRunData:()=>({outputs:[{dims:g,dataType:f}],dispatchGroup:{x:Math.ceil(w/64/4)},programUniforms:[{type:12,data:Math.ceil(K.size(g)/4)},...se(t.dims,u.dims,g)]})}},Mt=(e,r,t,u,s,c)=>{e.compute(Gg(r,s??\"\",e.inputs[0],e.inputs[1],t,u,c))},sd=e=>{Mt(e,\"Add\",(r,t)=>`${r}+${t}`)},ud=e=>{Mt(e,\"Div\",(r,t)=>`${r}/${t}`)},ld=e=>{Mt(e,\"Equal\",{scalar:(r,t)=>`u32(${r}==${t})`,vector:(r,t)=>`vec4(${r}==${t})`},void 0,void 0,9)},dd=e=>{Mt(e,\"Mul\",(r,t)=>`${r}*${t}`)},cd=e=>{let r=Z(\"input\",e.inputs[0].dataType,e.inputs[0].dims).type.value;Mt(e,\"Pow\",{scalar:(u,s)=>`pow_custom(${u},${s})`,vector:(u,s)=>`pow_vector_custom(${u},${s})`},`\n fn pow_custom(a : ${r}, b : ${r}) -> ${r} {\n if (b == ${r}(0.0)) {\n return ${r}(1.0);\n } else if (a < ${r}(0.0) && f32(b) != floor(f32(b))) {\n return ${r}(pow(f32(a), f32(b))); // NaN\n }\n return select(sign(a), ${r}(1.0), round(f32(abs(b) % ${r}(2.0))) != 1.0) * ${r}(${r===\"i32\"?\"round\":\"\"}(pow(f32(abs(a)), f32(b))));\n }\n fn pow_vector_custom(a : vec4<${r}>, b : vec4<${r}>) -> vec4<${r}> {\n // TODO: implement vectorized pow\n return vec4<${r}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w));\n }\n `)},fd=e=>{Mt(e,\"Sub\",(r,t)=>`${r}-${t}`)},pd=e=>{Mt(e,\"Greater\",{scalar:(r,t)=>`u32(${r}>${t})`,vector:(r,t)=>`vec4(${r}>${t})`},void 0,void 0,9)},md=e=>{Mt(e,\"Less\",{scalar:(r,t)=>`u32(${r}<${t})`,vector:(r,t)=>`vec4(${r}<${t})`},void 0,void 0,9)},hd=e=>{Mt(e,\"GreaterOrEqual\",{scalar:(r,t)=>`u32(${r}>=${t})`,vector:(r,t)=>`vec4(${r}>=${t})`},void 0,void 0,9)},gd=e=>{Mt(e,\"LessOrEqual\",{scalar:(r,t)=>`u32(${r}<=${t})`,vector:(r,t)=>`vec4(${r}<=${t})`},void 0,void 0,9)}});var At,Tt,Et,di,Ft=ae(()=>{\"use strict\";Te();De();At=(e,r,t=\"f32\")=>{switch(e.activation){case\"Relu\":return`value = max(value, ${r}(0.0));`;case\"Sigmoid\":return`value = (${r}(1.0) / (${r}(1.0) + exp(-value)));`;case\"Clip\":return`value = clamp(value, ${r}(${t}(uniforms.clip_min)), ${r}(${t}(uniforms.clip_max)));`;case\"HardSigmoid\":return`value = max(${r}(0.0), min(${r}(1.0), ${t}(uniforms.alpha) * value + ${t}(uniforms.beta)));`;case\"LeakyRelu\":return`value = select(${t}(uniforms.alpha) * value, value, value >= ${r}(0.0));`;case\"\":return\"\";default:throw new Error(`Unsupported activation ${e.activation}`)}},Tt=(e,r)=>{e.activation===\"Clip\"?r.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===\"HardSigmoid\"?r.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===\"LeakyRelu\"&&r.push({type:1,data:e.alpha})},Et=(e,r)=>{e.activation===\"Clip\"?r.push({name:\"clip_max\",type:\"f32\"},{name:\"clip_min\",type:\"f32\"}):e.activation===\"HardSigmoid\"?r.push({name:\"alpha\",type:\"f32\"},{name:\"beta\",type:\"f32\"}):e.activation===\"LeakyRelu\"&&r.push({name:\"alpha\",type:\"f32\"})},di=e=>{let r=e?.activation||\"\";if(r===\"HardSigmoid\"){let[t,u]=e?.activation_params||[.2,.5];return{activation:r,alpha:t,beta:u}}else if(r===\"Clip\"){let[t,u]=e?.activation_params||[ei,ti];return{activation:r,clipMax:u,clipMin:t}}else if(r===\"LeakyRelu\"){let[t]=e?.activation_params||[.01];return{activation:r,alpha:t}}return{activation:r}}});var st,ci,fi=ae(()=>{\"use strict\";st=(e,r)=>{switch(e){case 1:return r;case 2:return`vec2<${r}>`;case 3:return`vec3<${r}>`;case 4:return`vec4<${r}>`;default:throw new Error(`${e}-component is not supported.`)}},ci=e=>`\n ${e?\"value = value + getBiasByOutputCoords(coords);\":\"\"}\n `});var pi,eo=ae(()=>{\"use strict\";pi=e=>`\nfn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\n return dot(coords, vec4(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n}\nfn getOutputIndexFromCoords(coords : vec4) -> i32 {\n return dot(coords, vec4(\n i32(${e}.x), i32(${e}.y), i32(${e}.z), 1));\n}\n`});var Lg,Fg,cn,bd,qg,fn,Kg,mi,pn=ae(()=>{\"use strict\";Te();De();Re();Ft();fi();Lg=(e,r)=>e?`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart / innerElementSize + inputCol${r?\", batchIndices\":\"\"});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRow + innerRow,\n kStart / innerElementSize + inputCol${r?\", batchIndices\":\"\"});\n `,Fg=(e,r)=>e?`\n let ACached0 = mm_Asub[k * innerElementSize][localRow];\n let ACached1 = mm_Asub[k * innerElementSize + 1][localRow];\n let ACached2 = mm_Asub[k * innerElementSize + 2][localRow];\n ${r===3?\"\":\"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];\"}\n for (var i = 0; i < rowPerThread; i = i + 1) {\n acc[i] = BCached0 * ACached0[i] + acc[i];\n acc[i] = BCached1 * ACached1[i] + acc[i];\n acc[i] = BCached2 * ACached2[i] + acc[i];\n ${r===3?\"\":\"acc[i] = BCached3 * ACached3[i] + acc[i];\"}\n }`:`\n for (var i = 0; i < rowPerThread; i = i + 1) {\n let ACached = mm_Asub[tileRow + i][k];\n acc[i] = BCached0 * ACached.x + acc[i];\n acc[i] = BCached1 * ACached.y + acc[i];\n acc[i] = BCached2 * ACached.z + acc[i];\n ${r===3?\"\":\"acc[i] = BCached3 * ACached.w + acc[i];\"}\n }`,cn=(e,r,t=\"f32\",u,s=!1,c=32,f=!1,d=32)=>{let g=r[1]*e[1],w=r[0]*e[0],C=s?g:c,$=s?c:g,A=C/r[0],P=c/r[1];if(!((s&&A===4&&e[1]===4||!s&&(A===3||A===4))&&C%r[0]===0&&c%r[1]===0&&e[0]===4))throw new Error(`If transposeA ${s} is true, innerElementSize ${A} and workPerThread[1] ${e[1]} must be 4.\n Otherwise, innerElementSize ${A} must be 3 or 4.\n tileAWidth ${C} must be divisible by workgroupSize[0]${r[0]}. tileInner ${c} must be divisible by workgroupSize[1] ${r[1]}. colPerThread ${e[0]} must be 4.`);return`\nvar mm_Asub: array, ${C/A}>, ${$}>;\nvar mm_Bsub: array, ${w/e[0]}>, ${c}>;\n\nconst rowPerThread = ${e[1]};\nconst colPerThread = ${e[0]};\nconst innerElementSize = ${A};\nconst tileInner = ${c};\n\n@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]})\nfn main(@builtin(local_invocation_id) localId : vec3,\n @builtin(global_invocation_id) globalId : vec3,\n @builtin(workgroup_id) workgroupId : vec3) {\n let localRow = i32(localId.y);\n let tileRow = localRow * rowPerThread;\n let tileCol = i32(localId.x);\n\n let globalRow =i32(globalId.y) * rowPerThread;\n let globalCol = i32(globalId.x);\n let batch = ${f?\"0\":\"i32(globalId.z)\"};\n ${u?`let batchIndices = ${u.offsetToIndices(\"u32(batch)\")};`:\"\"}\n let globalRowStart = i32(workgroupId.y) * ${g};\n\n let num_tiles = ${f?`${Math.ceil(d/c)}`:\"(uniforms.dim_inner - 1) / tileInner + 1\"};\n var kStart = ${f?`i32(globalId.z) * ${d}`:\"0\"};\n\n var acc: array, rowPerThread>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${P};\n for (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${Lg(s,u)}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${P}; innerRow = innerRow + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${u?\", batchIndices\":\"\"});\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < tileInner / innerElementSize; k = k + 1) {\n let BCached0 = mm_Bsub[k * innerElementSize][tileCol];\n let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol];\n let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol];\n ${A===3?\"\":\"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];\"}\n\n ${Fg(s,A)}\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n}`},bd=(e,r)=>e?`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n kStart + inputRow,\n globalRowStart + inputCol${r?\", batchIndices\":\"\"});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batch,\n globalRowStart + inputRow,\n kStart + inputCol${r?\", batchIndices\":\"\"});\n `,qg=e=>e?\"let ACached = mm_Asub[k][tileRow + innerRow];\":\"let ACached = mm_Asub[tileRow + innerRow][k];\",fn=(e,r,t=\"f32\",u,s=!1,c=32,f=!1,d=32,g=!1)=>{let w=e[1]*r[1],C=e[0]*r[0],$=s?w:c,A=s?c:w;if(!(A%r[1]===0&&$%r[0]===0&&c%r[1]===0))throw new Error(`tileAHight ${A} must be divisible by workgroupSize[1]${r[1]}, tileAWidth ${$} must be divisible by workgroupSize[0]${r[0]}, tileInner ${c} must be divisible by workgroupSize[1]${r[1]}`);let P=A/r[1],x=$/r[0],E=c/r[1],O=g?`\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${w};\n let globalColStart = i32(workgroupId.x) * ${C};\n\n // Loop over shared dimension.\n for (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${A}; inputRow = inputRow + ${r[1]}) {\n for (var inputCol = localCol; inputCol < ${$}; inputCol = inputCol + ${r[0]}) {\n ${bd(s,u)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${c}; inputRow = inputRow + ${r[1]}) {\n for (var inputCol = localCol; inputCol < ${C}; inputCol = inputCol + ${r[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalColStart + inputCol${u?\", batchIndices\":\"\"});\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<${t}, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${r[0]}];\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let ACached = ${s?`mm_Asub[k][localRow + innerRow * ${r[1]}];`:`mm_Asub[localRow + innerRow * ${r[1]}][k];`}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] +\n ACached * BCached[innerCol];\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n let gRow = globalRowStart + localRow + innerRow * ${r[1]};\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let gCol = globalColStart + localCol + innerCol * ${r[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n `:`\nlet tileRow = i32(localId.y) * rowPerThread;\nlet tileCol = i32(localId.x) * colPerThread;\n\nlet globalRow = i32(globalId.y) * rowPerThread;\nlet globalCol = i32(globalId.x) * colPerThread;\nlet globalRowStart = i32(workgroupId.y) * ${w};\n\nlet tileRowA = i32(localId.y) * ${P};\nlet tileColA = i32(localId.x) * ${x};\nlet tileRowB = i32(localId.y) * ${E};\n// Loop over shared dimension.\nfor (var t = 0; t < num_tiles; t = t + 1) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${P}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < ${x}; innerCol = innerCol + 1) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${bd(s,u)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${E}; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batch,\n kStart + inputRow,\n globalCol + innerCol${u?\", batchIndices\":\"\"});\n }\n }\n kStart = kStart + tileInner;\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array<${t}, colPerThread>;\n for (var k = 0; k < tileInner; k = k + 1) {\n for (var inner = 0; inner < colPerThread; inner = inner + 1) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n ${qg(s)}\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol];\n }\n }\n }\n\n workgroupBarrier();\n}\n\nfor (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n}\n`;return`\n var mm_Asub : array, ${A}>;\n var mm_Bsub : array, ${c}>;\n const rowPerThread = ${e[1]};\n const colPerThread = ${e[0]};\n const tileInner = ${c};\n\n@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]})\nfn main(@builtin(local_invocation_id) localId : vec3,\n @builtin(global_invocation_id) globalId : vec3,\n @builtin(workgroup_id) workgroupId : vec3) {\n let batch = ${f?\"0\":\"i32(globalId.z)\"};\n ${u?`let batchIndices = ${u.offsetToIndices(\"u32(batch)\")};`:\"\"}\n let num_tiles = ${f?`${Math.ceil(d/c)}`:\"(uniforms.dim_inner - 1) / tileInner + 1\"};\n var kStart = ${f?`i32(globalId.z) * ${d}`:\"0\"};\n\n var acc : array, rowPerThread>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) {\n for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${O}\n }\n`},Kg=(e,r,t,u,s,c=!1)=>{let[f,d,g]=s,[w,C,$,A]=u,P=Br(f,g),x=Br(d,g),E=Ne(u[0].type.tensor),O=()=>{let j=C.rank,U=w.rank,L=`var aIndices: ${C.type.indices};`;for(let F=j-2-1,te=U-1;F>=0;F--,te--)L+=`\naIndices[${F}] = ${U>1?`batchIndices[${te}]`:\"batchIndices\"};`;return P.forEach(F=>{L+=`\naIndices[${F}] = 0;`}),L+=`\naIndices[${j-2}] = u32(row);\n aIndices[${j-1}] = u32(colIn);`,L},B=()=>{let j=$.rank,U=w.rank,L=`var bIndices: ${$.type.indices};`;for(let F=j-2-1,te=U-1;F>=0;F--,te--)L+=`\nbIndices[${F}] = ${U>1?`batchIndices[${te}]`:\"batchIndices\"};`;return x.forEach(F=>{L+=`\nbIndices[${F}] = 0;`}),L+=`\nbIndices[${j-2}] = u32(row);\n bIndices[${j-1}] = u32(colIn);`,L};return`\n fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${w.type.indices}) -> ${st(e,E)} {\n var value = ${st(e,E)}(0.0);\n let col = colIn * ${e};\n if(row < uniforms.dim_a_outer && col < uniforms.dim_inner)\n {\n ${O()}\n value = ${C.getByIndices(\"aIndices\")};\n }\n return value;\n }\n\n fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${w.type.indices}) -> ${st(e,E)} {\n var value = ${st(e,E)}(0.0);\n let col = colIn * ${e};\n if(row < uniforms.dim_inner && col < uniforms.dim_b_outer)\n {\n ${B()}\n value = ${$.getByIndices(\"bIndices\")};\n }\n return value;\n }\n\n fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${st(e,E)}) {\n let col = colIn * ${e};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\n var value = valueIn;\n let coords = vec3(batch, row, colIn);\n ${r?`value = value + ${c?\"bias[colIn]\":`${st(e,E)}(bias[row])`};`:\"\"}\n ${t}\n ${A.setByIndices(\"vec3(coords)\",\"value\")}\n }\n }\n `},mi=(e,r,t,u,s=!1)=>{let c=e[0].dims,f=e[1].dims,d=c.slice(0,-2),g=f.slice(0,-2),w=u?u.slice(0,-2):t.slice(0,-2),C=K.size(w),$=c[c.length-2],A=c[c.length-1],P=f[f.length-1],x=A%4===0&&P%4===0,E=$<=8?[4,1,1]:[4,4,1],O=[8,8,1],B=[Math.ceil(P/O[0]/E[0]),Math.ceil($/O[1]/E[1]),Math.ceil(C/O[2]/E[2])],R=x?4:1,j=[...d,$,A/R],U=j.length,L=[...g,A,P/R],F=L.length,te=[C,$,P/R],J=[{type:6,data:$},{type:6,data:P},{type:6,data:A}];Tt(r,J),J.push(...se(w,j,L));let oe=[\"rank\",\"rank\"],le=e.length>2;le&&(J.push(...se(e[2].dims)),oe.push(\"rank\")),J.push(...se(te));let ge=X=>{let pe=w.length,we=ri(\"batchDims\",e[0].dataType,pe,1),ue=Ne(e[0].dataType),me=Z(\"a\",e[0].dataType,U,R),Ee=Z(\"b\",e[1].dataType,F,R),Pe=ne(\"result\",e[0].dataType,te.length,R),Ce=[me,Ee];if(le){let ee=s?R:1;Ce.push(Z(\"bias\",e[2].dataType,e[2].dims.length,ee))}let be=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"}];Et(r,be);let Ae=Ne(Pe.type.tensor),_e=At(r,Pe.type.value,Ae),Je=Kg(R,le,_e,[we,me,Ee,Pe],[d,g,w],s);return`\n ${X.registerUniforms(be).registerInternalVariables(we).declareVariables(...Ce,Pe)}\n ${Je}\n ${x?cn(E,O,ue,we):fn(E,O,ue,we)}\n `};return{name:\"MatMul\",shaderCache:{hint:`${E};${r.activation};${x};${s}`,inputDependencies:oe},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:B[0],y:B[1],z:B[2]},programUniforms:J}),getShaderSource:ge}}});var Yg,vd,wd=ae(()=>{\"use strict\";Te();Lt();Re();Ft();fi();eo();pn();Yg=(e,r,t,u,s=!1,c,f=4,d=4,g=4,w=\"f32\")=>{let C=le=>{switch(le){case 1:return\"resData = x[xIndex];\";case 3:return`resData = vec3<${w}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return\"resData = x[xIndex / 4];\";default:throw new Error(`innerElementSize ${le} is not supported.`)}},$=le=>{switch(le){case 1:return\"return w[row * i32(uniforms.w_shape[3]) + colIn];\";case 4:return\"return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];\";default:throw new Error(`innerElementSize ${le} is not supported.`)}},A=e?`\n let coord = vec4(batch, xRow, xCol, xCh);\n `:`\n let coord = vec4(batch, xCh, xRow, xCol);\n `,P=e?`\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n `:`\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `,x=e?\"i32(uniforms.x_shape[1])\":\"i32(uniforms.x_shape[2])\",E=e?\"i32(uniforms.x_shape[2])\":\"i32(uniforms.x_shape[3])\",O=e?\"row\":\"col\",B=e?\"col\":\"row\",R=`\n let inChannels = i32(uniforms.w_shape[2]);\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n let outRow = ${O} / outWidth;\n let outCol = ${O} % outWidth;\n\n let WRow = ${B} / (i32(uniforms.w_shape[1]) * inChannels);\n let WCol = ${B} / inChannels % i32(uniforms.w_shape[1]);\n let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0];\n let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1];\n let xCh = ${B} % inChannels;\n var resData = ${st(f,w)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${x} && xCol >= 0 && xCol < ${E}) {\n ${A}\n let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape));\n ${C(f)}\n }\n return resData;`,j=e?r&&u?`\n let col = colIn * ${f};\n ${R}`:`\n let col = colIn * ${f};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\n ${R}\n }\n return ${st(f,w)}(0.0);`:u&&t?`\n let col = colIn * ${f};\n ${R}`:`\n let col = colIn * ${f};\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\n ${R}\n }\n return ${st(f,w)}(0.0);`,U=`${$(d)}`,L=st(g,w),F=e?st(f,w):st(d,w),te=e?st(d,w):st(f,w),J=At(c,L,w);return`\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${F} {\n ${e?j:U}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${te} {\n ${e?U:j}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${L}) {\n let col = colIn * ${g};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer)\n {\n var value = valueIn;\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n ${P}\n ${ci(s)}\n ${J}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`},vd=(e,r,t,u,s,c,f,d)=>{let g=r.format===\"NHWC\",w=g?e[0].dims[3]:e[0].dims[1],C=t[0],$=g?t[2]:t[3],A=g?t[1]:t[2],P=g?t[3]:t[1],x=g&&(w%4===0||w%3===0)&&P%4===0,E=g?P:$*A,O=g?$*A:P,B=[8,8,1],R=u<=8?[4,1,1]:[4,4,1],j=[Math.ceil(E/B[0]/R[0]),Math.ceil(O/B[1]/R[1]),Math.ceil(C/B[2]/R[2])];Fe(\"verbose\",()=>`[conv2d_mm_webgpu] dispatch = ${j}`);let U=x?g&&w%4!==0?3:4:1,L=B[1]*R[1],F=B[0]*R[0],te=Math.max(B[0]*U,B[1]),J=u%L===0,oe=s%F===0,le=c%te===0,ge=x?[U,4,4]:[1,1,1],X=[{type:6,data:u},{type:6,data:s},{type:6,data:c},{type:6,data:[r.pads[0],r.pads[1]]},{type:6,data:r.strides},{type:6,data:r.dilations}];Tt(r,X),X.push(...se(e[0].dims,e[1].dims));let pe=[\"rank\",\"rank\"];f&&(X.push(...se(e[2].dims)),pe.push(\"rank\")),X.push(...se(t));let we=ue=>{let me=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"},{name:\"pad\",type:\"i32\",length:2},{name:\"stride\",type:\"i32\",length:2},{name:\"dilation\",type:\"i32\",length:2}];Et(r,me);let Ee=x?4:1,Pe=Ne(e[0].dataType),Ce=`\n fn setOutputAtIndex(flatIndex : i32, value : ${x?`vec4<${Pe}>`:Pe}) {\n result[flatIndex] = ${x?`vec4<${Pe}>`:Pe}(value);\n }\n fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${x?`vec4<${Pe}>`:Pe}) {\n let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3));\n setOutputAtIndex(flatIndex ${x?\"/ 4\":\"\"}, value);\n }`,be=Z(\"x\",e[0].dataType,e[0].dims.length,U===3?1:U),Ae=Z(\"w\",e[1].dataType,e[1].dims.length,Ee),_e=[be,Ae],Je=ne(\"result\",e[0].dataType,t.length,Ee);if(f){let ee=Z(\"bias\",e[2].dataType,e[2].dims.length,Ee);_e.push(ee),Ce+=`\n fn getBiasByOutputCoords(coords : vec4) -> ${x?`vec4<${Pe}>`:Pe} {\n return bias[coords.${g?\"w\":\"y\"}${x?\"/ 4\":\"\"}];\n }`}return`\n ${pi(\"uniforms.result_strides\")}\n //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4,\n // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2,\n // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 };\n ${ue.registerUniforms(me).declareVariables(..._e,Je)}\n ${Ce}\n ${Yg(g,J,oe,le,f,r,ge[0],ge[1],ge[2],Pe)}\n ${x?cn(R,B,Pe,void 0,!g,te):fn(R,B,Pe,void 0,!g,te,!1,void 0,d)}`};return{name:\"Conv2DMatMul\",shaderCache:{hint:`${r.cacheKey};${U};${x};${J};${oe};${le};${L};${F};${te}`,inputDependencies:pe},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:j[0],y:j[1],z:j[2]},programUniforms:X}),getShaderSource:we}}});var to,_d,$d=ae(()=>{\"use strict\";Te();De();Re();ro();Ft();to=(e,r,t)=>{let u=e.length>2,s=u?\"value += b[output_channel];\":\"\",c=e[0].dims,f=e[1].dims,d=f[0]/r.group,g=r.format===\"NHWC\",w=hi(c,f,r.dilations,r.pads,r.strides,g),C=K.size(w),$=[{type:12,data:C},{type:12,data:r.dilations},{type:12,data:[r.strides[0],r.strides[1]]},{type:12,data:[r.pads[0],r.pads[1]]},{type:12,data:d}];Tt(r,$),$.push(...se(c,f));let A=[\"rank\",\"rank\"];u&&($.push(...se(e[2].dims)),A.push(\"rank\")),$.push(...se(w));let P=x=>{let E=ne(\"output\",e[0].dataType,w.length),O=Ne(E.type.tensor),B=At(r,E.type.value,O),R=Z(\"x\",e[0].dataType,c.length),j=Z(\"w\",e[1].dataType,f.length),U=[R,j];u&&U.push(Z(\"b\",e[2].dataType,e[2].dims.length));let L=[{name:\"output_size\",type:\"u32\"},{name:\"dilations\",type:\"u32\",length:r.dilations.length},{name:\"strides\",type:\"u32\",length:2},{name:\"pads\",type:\"u32\",length:2},{name:\"output_channels_per_group\",type:\"u32\"}];return Et(r,L),`\n ${x.registerUniforms(L).declareVariables(...U,E)}\n\n ${x.mainStart()}\n ${x.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let outputIndices = ${E.offsetToIndices(\"global_idx\")};\n let batch: u32 = outputIndices[0];\n let output_channel: u32 = outputIndices[${g?3:1}];\n let xRCCorner: vec2 = vec2(outputIndices[${g?1:2}], outputIndices[${g?2:3}]) * uniforms.strides - uniforms.pads;\n let group_id: u32 = output_channel / uniforms.output_channels_per_group;\n\n var value: ${E.type.value} = ${E.type.value}(0);\n for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) {\n let input_channel = group_id * uniforms.w_shape[1] + wInChannel;\n for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) {\n let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0];\n\n if (xHeight < 0u || xHeight >= uniforms.x_shape[${g?1:2}]) {\n continue;\n }\n\n for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) {\n let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1];\n if (xWidth < 0u || xWidth >= uniforms.x_shape[${g?2:3}]) {\n continue;\n }\n\n let xVal = ${g?R.get(\"batch\",\"xHeight\",\"xWidth\",\"input_channel\"):R.get(\"batch\",\"input_channel\",\"xHeight\",\"xWidth\")};\n let wVal = ${j.get(\"output_channel\",\"wInChannel\",\"wHeight\",\"wWidth\")};\n value += xVal*wVal;\n }\n }\n }\n ${s}\n ${B}\n ${E.setByOffset(\"global_idx\",\"value\")}\n }`};return{name:\"GroupedConv\",shaderCache:{hint:r.cacheKey,inputDependencies:A},getRunData:()=>({outputs:[{dims:t?t(w):w,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(C/64)},programUniforms:$}),getShaderSource:P}},_d=(e,r,t)=>{let u=e.length>2,s=He(t[3]),c=He(t[2]),f=K.size(t)/s/c,d=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/s],g=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/s],w=[t[0],t[1],t[2],t[3]/s],C=[{type:12,data:f},{type:6,data:[r.strides[0],r.strides[1]]},{type:6,data:[r.pads[0],r.pads[1]]}];Tt(r,C),C.push(...se(d,g,w));let $=(c-1)*r.strides[1]+g[1],A=P=>{let x=ne(\"output\",e[0].dataType,w.length,s),E=Ne(x.type.tensor),O=At(r,x.type.value,E),B=Z(\"x\",e[0].dataType,d.length,s),R=Z(\"w\",e[1].dataType,g.length,s),j=[B,R];u&&j.push(Z(\"b\",e[2].dataType,e[2].dims,s));let U=u?\"value += b[output_channel];\":\"\",L=[{name:\"output_size\",type:\"u32\"},{name:\"strides\",type:\"i32\",length:2},{name:\"pads\",type:\"i32\",length:2}];return Et(r,L),`\n ${P.registerUniforms(L).declareVariables(...j,x)}\n ${P.mainStart()}\n ${P.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n let width0 = uniforms.output_shape[3];\n let output_channel = global_idx % width0;\n var index1 = global_idx / width0;\n let width1 = uniforms.output_shape[2] / ${c}u;\n let col = (index1 % width1) * ${c}u;\n index1 = index1 / width1;\n let row = index1 % uniforms.output_shape[1];\n let batch = index1 / uniforms.output_shape[1];\n\n let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads;\n\n var x_vals: array<${B.type.value}, ${$}>;\n var values: array<${x.type.value}, ${c}>;\n let input_channel = output_channel;\n // Use constant instead of uniform can give better performance for w's height/width.\n for (var w_height: u32 = 0u; w_height < ${g[0]}; w_height++) {\n let x_height = x_corner.x + i32(w_height);\n if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) {\n for (var i = 0; i < ${$}; i++) {\n let x_width = x_corner.y + i;\n if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) {\n x_vals[i] = ${B.get(\"batch\",\"u32(x_height)\",\"u32(x_width)\",\"input_channel\")};\n } else {\n x_vals[i] = ${B.type.value}(0);\n }\n }\n for (var w_width: u32 = 0u; w_width < ${g[1]}; w_width++) {\n let w_val = ${R.get(\"w_height\",\"w_width\",\"0\",\"output_channel\")};\n for (var i = 0u; i < ${c}u; i++) {\n values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]);\n }\n }\n }\n }\n\n for (var i = 0u; i < ${c}u; i++) {\n var value = values[i];\n ${U}\n ${O}\n ${x.set(\"batch\",\"row\",\"col + i\",\"output_channel\",\"value\")};\n }\n }`};return{name:\"GroupedConv-Vectorize\",shaderCache:{hint:`${r.cacheKey};${s};${c};${$};${g[0]};${g[1]}`,inputDependencies:u?[\"rank\",\"rank\",\"type\"]:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:C}),getShaderSource:A}}});var no,Zg,Cd,io=ae(()=>{\"use strict\";Te();De();pn();Re();Ft();no=(e,r,t,u,s=!1)=>{let c=e[0].dims,f=e[1].dims,d=c[c.length-2],g=f[f.length-1],w=c[c.length-1],C=He(g),$=He(w),A=He(d),P=K.size(t)/C/A,x=e.length>2,E=u?u.slice(0,-2):t.slice(0,-2),B=[K.size(E),d,g],R=[{type:12,data:P},{type:12,data:d},{type:12,data:g},{type:12,data:w}];Tt(r,R),R.push(...se(E,c,f)),x&&R.push(...se(e[2].dims)),R.push(...se(B));let j=U=>{let L=ri(\"batch_dims\",e[0].dataType,E.length),F=Z(\"a\",e[0].dataType,c.length,$),te=Z(\"b\",e[1].dataType,f.length,C),J=ne(\"output\",e[0].dataType,B.length,C),oe=Ne(J.type.tensor),le=At(r,J.type.value,oe),ge=[F,te],X=\"\";if(x){let be=s?C:1;ge.push(Z(\"bias\",e[2].dataType,e[2].dims.length,be)),X=`${s?`value += bias[col / ${be}];`:`value += ${J.type.value}(bias[row + i]);`}`}let pe=c.slice(0,-2),we=f.slice(0,-2),ue=Br(pe,E),me=Br(we,E),Ee=[{name:\"output_size\",type:\"u32\"},{name:\"M\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"K\",type:\"u32\"}];Et(r,Ee);let Pe=(be,Ae)=>{let _e=be.rank,Je=be.name;if(_e===2)return`var ${Je}_indices = ${be.type.indices}(0u, 0u);`;let ee=L.rank,ce=`var ${Je}_indices: ${be.type.indices};`;for(let Be=_e-2-1,tt=ee-1;Be>=0;Be--,tt--)ce+=`\n${Je}_indices[${Be}] = ${ee>1?`batch_indices[${tt}]`:\"batch_indices\"};`;return Ae.forEach(Be=>{ce+=`\n${Je}_indices[${Be}] = 0;`}),ce+=`${Je}_indices[${_e-2}] = 0u;\n ${Je}_indices[${_e-1}] = 0u;`,ce},Ce=()=>{let be=`var a_data: ${F.type.value};`;for(let Ae=0;Ae<$;Ae++)be+=`\n let b_data${Ae} = b[(b_offset + (k + ${Ae}) * uniforms.N + col) / ${C}];`;for(let Ae=0;Ae;\n for (var k: u32 = 0u; k < uniforms.K; k = k + ${$}) {\n ${Ce()}\n }\n for (var i = 0u; i < ${A}u; i++) {\n var value = values[i];\n ${X}\n ${le}\n let cur_indices = ${J.type.indices}(batch, row + i, col);\n let offset = ${J.indicesToOffset(\"cur_indices\")};\n ${J.setByOffset(`offset / ${C}`,\"value\")};\n }\n }\n `};return{name:\"MatMulNaive\",shaderCache:{hint:`${r.activation};${C};${$};${A};${s}`,inputDependencies:x?[\"rank\",\"rank\",\"rank\"]:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(P/64)},programUniforms:R}),getShaderSource:j}},Zg=e=>{if(!e||e.length!==2)throw new Error(\"MatMul requires 2 inputs.\");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error(\"shared dimension does not match.\")},Cd=e=>{Zg(e.inputs);let r=Ot.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!r)throw new Error(\"Can't use matmul on the given tensors\");let t=r[r.length-1],u=e.inputs[0].dims[e.inputs[0].dims.length-1];t<8&&u<8?e.compute(no(e.inputs,{activation:\"\"},r)):e.compute(mi(e.inputs,{activation:\"\"},r))}});var hi,oo,Qg,Sd,ao,Xg,Jg,so,ro=ae(()=>{\"use strict\";De();wd();pn();$d();Ft();io();Dr();hi=(e,r,t,u,s,c)=>{let f=e[0],d=e.slice(c?1:2,c?3:4),g=d.length,w=r[0],$=r.slice(2).map((x,E)=>x+(x-1)*(t[E]-1)),P=d.map((x,E)=>x+u[E]+u[E+g]).map((x,E)=>Math.floor((x-$[E]+s[E])/s[E]));return P.splice(0,0,f),P.splice(c?3:1,0,w),P},oo=[2,3,1,0],Qg=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error(\"Conv requires 2 or 3 inputs\");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error(\"currently only support conv 1D and 2D\");if(e[0].dims.length!==e[1].dims.length)throw new Error(\"filter does not have same dimension as input\");let t=e[0].dims[r.format===\"NHWC\"?e[0].dims.length-1:1],u=e[1].dims[1]*r.group;if(t!==u)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw new Error(\"invalid bias\");let s=e[0].dims.length-2;if(r.dilations.length!==s)throw new Error(`dilations should be ${s}D`);if(r.strides.length!==s)throw new Error(`strides should be ${s}D`);if(r.pads.length!==s*2)throw new Error(`pads should be ${s*2}D`);if(r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error(\"invalid kernel shape\")},Sd=(e,r)=>{let t=e.kernelShape.slice();for(let c=2;c{let r=di(e),t=e.format,u=[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][e.auto_pad],s=e.dilations,c=e.group,f=e.kernel_shape,d=e.pads,g=e.strides,w=e.w_is_const();return{autoPad:u,format:t,dilations:s,group:c,kernelShape:f,pads:d,strides:g,wIsConst:w,...r,cacheKey:`${e.format};${r.activation};`}},Xg=(e,r,t)=>{let u=Sd(t,r),s=t.format===\"NHWC\";if(t.group!==1){if(!e.adapterInfo.isArchitecture(\"ampere\")&&s&&r[1].dims[0]===t.group&&r[1].dims[1]===1&&t.dilations[0]===1&&t.dilations[1]===1){let te=hi(r[0].dims,r[1].dims,t.dilations,u.pads,t.strides,s),J=e.kernelCustomData.wT??e.compute($t(r[1],oo),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=J);let oe=[r[0],J];r.length===3&&oe.push(r[2]),e.compute(_d(oe,u,te),{inputs:oe})}else e.compute(to(r,u));return}let c=r.length===3,f=r[0].dims[s?1:2],d=r[0].dims[s?2:3],g=r[0].dims[s?3:1],w=r[1].dims[2],C=r[1].dims[3],$=hi(r[0].dims,r[1].dims,t.dilations,u.pads,t.strides,s),A=$[s?1:2],P=$[s?2:3],x=$[s?3:1],E=s&&w===f&&C===d&&t.pads[0]===0&&t.pads[1]===0;if(E||w===1&&C===1&&t.dilations[0]===1&&t.dilations[1]===1&&t.strides[0]===1&&t.strides[1]===1&&t.pads[0]===0&&t.pads[1]===0){let F=$[0],te,J,oe,le=[];if(s){let pe=e.kernelCustomData.wT??e.compute($t(r[1],oo),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];if(t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=pe),E){let we=f*d*g;te=r[0].reshape([1,F,we]),J=pe.reshape([1,we,x]),oe=[1,F,x]}else te=r[0].reshape([F,f*d,g]),J=pe.reshape([1,g,x]),oe=[F,A*P,x];le.push(te),le.push(J)}else te=r[0].reshape([F,g,f*d]),J=r[1].reshape([1,x,g]),oe=[F,x,A*P],le.push(J),le.push(te);c&&le.push(r[2]);let ge=oe[2],X=le[0].dims[le[0].dims.length-1];ge<8&&X<8?e.compute(no(le,u,$,oe,s),{inputs:le}):e.compute(mi(le,u,$,oe,s),{inputs:le});return}let O=!0,B=e.kernelCustomData.wT??e.compute($t(r[1],oo),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=B);let R=[r[0],B];c&&R.push(r[2]);let j=s?A*P:x,U=s?x:A*P,L=w*C*g;e.compute(vd(R,u,$,j,U,L,c,O),{inputs:R})},Jg=(e,r)=>{let t=r.format===\"NHWC\",u=[e.inputs[0].reshape(t?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&u.push(e.inputs[2]);let s=[0,r.pads[0],0,r.pads[1]],c=[1].concat(r.strides),f=[1].concat(r.dilations),d=[1].concat(r.kernelShape),g=Sd({...r,pads:s,strides:c,dilations:f,kernelShape:d},u);e.compute(to(u,g,w=>t?[w[0],w[2],w[3]]:[]))},so=(e,r)=>{Qg(e.inputs,r),e.inputs[0].dims.length===3?Jg(e,r):Xg(e,e.inputs,r)}});var ey,xd,Id=ae(()=>{\"use strict\";Te();Lt();Re();Ft();fi();eo();pn();ey=(e,r=!1,t,u,s=4)=>{let c=B=>{switch(B){case 1:return\"return w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\";case 4:return`\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\n let v0 = w[getIndexFromCoords4D(coord, vec4(uniforms.w_shape))];\n let v1 = w[getIndexFromCoords4D(coord1, vec4(uniforms.w_shape))];\n let v2 = w[getIndexFromCoords4D(coord2, vec4(uniforms.w_shape))];\n let v3 = w[getIndexFromCoords4D(coord3, vec4(uniforms.w_shape))];\n return ${u}(v0, v1, v2, v3);\n `;default:throw new Error(`innerElementSize ${B} is not supported.`)}},f=e?`\n let coord = vec4(batch, iXR, iXC, xCh);\n `:`\n let coord = vec4(batch, xCh, iXR, iXC);\n `,d=e?`\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n `:`\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `,g=e?\"i32(uniforms.x_shape[1])\":\"i32(uniforms.x_shape[2])\",w=e?\"i32(uniforms.x_shape[2])\":\"i32(uniforms.x_shape[3])\",C=e?\"row\":\"col\",$=e?\"col\":\"row\",A=`\n let inChannels = ${e?\"i32(uniforms.x_shape[3])\":\"i32(uniforms.x_shape[1])\"};\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n let outRow = ${C} / outWidth;\n let outCol = ${C} % outWidth;\n\n let WRow = ${$} / (uniforms.filter_dims[1] * inChannels);\n let WCol = ${$} / inChannels % uniforms.filter_dims[1];\n let xR = f32(outRow - uniforms.pads[0] + uniforms.dilations[0] * WRow) / f32(uniforms.strides[0]);\n let xC = f32(outCol - uniforms.pads[1] + uniforms.dilations[1] * WCol) / f32(uniforms.strides[1]);\n if (xR < 0.0 || xR >= f32(${g}) || fract(xR) > 0.0) {\n return ${u}(0.0);\n }\n if (xC < 0.0 || xC >= f32(${w}) || fract(xC) > 0.0) {\n return ${u}(0.0);\n }\n let iXR = i32(xR);\n let iXC = i32(xC);\n let xCh = ${$} % inChannels;\n ${f}\n return x[getIndexFromCoords4D(coord, vec4(uniforms.x_shape))/${s}];`,P=e?`\n let col = colIn * ${s};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) {\n ${A}\n }\n return ${u}(0.0);`:`\n let col = colIn * ${s};\n if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) {\n ${A}\n }\n return ${u}(0.0);`,x=`\n let col = colIn * ${s};\n let inChannels = ${e?\"i32(uniforms.x_shape[3])\":\"i32(uniforms.x_shape[1])\"};\n let coordX = uniforms.filter_dims[0] - 1 - row / (uniforms.filter_dims[1] * inChannels);\n let coordY = uniforms.filter_dims[1] - 1 - (row / inChannels) % uniforms.filter_dims[1];\n if (${e?\"row < uniforms.dim_inner && col < uniforms.dim_b_outer\":\"row < uniforms.dim_inner && col < uniforms.dim_a_outer\"} && coordX >= 0 && coordY >= 0) {\n let rowInner = row % inChannels;\n let coord = vec4(coordX, coordY, col, rowInner);\n ${c(s)}\n }\n return ${u}(0.0);\n `,E=At(t,u);return`\n fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${u} {\n ${e?P:x}\n }\n\n fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${u} {\n ${e?x:P}\n }\n\n fn mm_write(batch: i32, row : i32, colIn : i32, valueInput : ${u}) {\n let col = colIn * ${s};\n if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) {\n var value = valueInput;\n let outWidth = ${e?\"i32(uniforms.result_shape[2])\":\"i32(uniforms.result_shape[3])\"};\n ${d}\n ${ci(r)}\n ${E}\n result[getIndexFromCoords4D(coords, vec4(uniforms.result_shape))/${s}] = value;\n }\n }`},xd=(e,r,t,u,s,c,f,d)=>{let g=r.format===\"NHWC\",w=g?e[0].dims[3]:e[0].dims[1],C=t[0],$=g?t[2]:t[3],A=g?t[1]:t[2],P=g?t[3]:t[1],x=g&&w%4===0&&w%3&&P%4===0,E=g?P:$*A,O=g?$*A:P,B=[8,8,1],R=u<=8?[4,1,1]:[4,4,1],j=[Math.ceil(E/B[0]/R[0]),Math.ceil(O/B[1]/R[1]),Math.ceil(C/B[2]/R[2])];Fe(\"verbose\",()=>`[conv_backprop_mm_webgpu] dispatch = ${j}`);let U=x?4:1,L=Math.max(B[0]*U,B[1]),F=x?4:1,te=[r.kernelShape[g?1:2],r.kernelShape[g?2:3]],J=[te[0]+(r.dilations[0]<=1?0:(te[0]-1)*(r.dilations[0]-1)),te[1]+(r.dilations[1]<=1?0:(te[1]-1)*(r.dilations[1]-1))],oe=[J[0]-1-Math.floor((r.pads[0]+r.pads[2])/2),J[1]-1-Math.floor((r.pads[1]+r.pads[3])/2)],le=[{type:6,data:u},{type:6,data:s},{type:6,data:c},{type:6,data:r.strides},{type:6,data:r.dilations},{type:6,data:te},{type:6,data:oe}];Tt(r,le),le.push(...se(e[0].dims,e[1].dims));let ge=[\"rank\",\"rank\"];f&&(le.push(...se(e[2].dims)),ge.push(\"rank\")),le.push(...se(t));let X=pe=>{let we=Z(\"x\",e[0].dataType,e[0].dims.length,F),ue=Z(\"w\",e[1].dataType,e[1].dims.length,1),me=ne(\"result\",e[0].dataType,t.length,F),Ee=[we,ue],Pe=\"\";if(f){let Ae=Z(\"bias\",e[2].dataType,e[2].dims.length,F);Ee.push(Ae),Pe+=`\n fn getBiasByOutputCoords(coords : vec4) -> ${Ae.type.value} {\n return bias[coords.${g?\"w\":\"y\"}${x?\"/ 4\":\"\"}];\n }`}let Ce=[{name:\"dim_a_outer\",type:\"i32\"},{name:\"dim_b_outer\",type:\"i32\"},{name:\"dim_inner\",type:\"i32\"},{name:\"strides\",type:\"i32\",length:2},{name:\"dilations\",type:\"i32\",length:2},{name:\"filter_dims\",type:\"i32\",length:te.length},{name:\"pads\",type:\"i32\",length:oe.length}];Et(r,Ce);let be=Ne(e[0].dataType,1);if(be!==\"f16\"&&be!==\"f32\")throw new Error(`elemType ${be} is not supported.`);return`\n ${pi(\"uniforms.result_strides\")}\n ${pe.registerUniforms(Ce).declareVariables(...Ee,me)};\n ${Pe}\n ${ey(g,f,r,we.type.value,U)}\n ${x?cn(R,B,be,void 0,!g,L):fn(R,B,be,void 0,!g,L,!1,void 0,d)}`};return{name:\"Conv2DTransposeMatMul\",shaderCache:{hint:`${r.cacheKey};${R};${B};${x}`,inputDependencies:ge},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:j[0],y:j[1],z:j[2]},programUniforms:le}),getShaderSource:X}}});var ty,uo,Ad=ae(()=>{\"use strict\";Te();Lt();De();Re();ty=(e,r,t,u,s,c=!1,f,d,g=!1)=>{let w=g?1:2,C=g?2:3,$=g?3:1,A=c?2:1,P=`\n fn setOutputAtIndex(flatIndex : u32, value : ${c?`vec4<${f}>`:f}) {\n result[flatIndex] = ${c?`vec4<${f}>`:f}(value);\n }`;u&&(P+=`\n fn getBiasByOutputCoords(coords : vec4) -> ${c?`vec4<${f}>`:f} {\n return bias[coords.${g?\"w\":\"y\"}${c?\"/ 4\":\"\"}];\n }`);let x=c?4:1,E=Z(\"W\",r[1].dataType,r[1].dims.length,x),O=Z(\"Dy\",r[0].dataType,r[0].dims.length,x),B=[O,E];u&&B.push(Z(\"bias\",r[2].dataType,[t[$]].length,x));let R=ne(\"result\",r[0].dataType,t.length,x),j=`{\n let batch: u32 = ${s?\"global_id.z\":\"workgroup_id.z\"} / uniforms.result_shape[1];\n let r = ${s?\"global_id.z\":\"workgroup_id.z\"} % uniforms.result_shape[1];\n let c = ${s?\"global_id.y\":\"workgroup_id.y\"} * ${A};\n let d1: u32 = ${s?\"global_id.x\":\"workgroup_id.x\"} * 4;\n\n let dyCorner = vec2(i32(r), i32(c)) - vec2(uniforms.pads);\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd: array, ${A}>;\n for (var i = 0; i < ${A}; i++) {\n dotProd[i] = vec4<${f}>(0.0);\n }\n for (var wR: u32 = 0; wR < uniforms.filter_dims[0]; wR = wR + 1) {\n var dyR = (${f}(dyCorner.x) + ${f}(wR)) / ${f}(uniforms.strides.x);\n let wRPerm = uniforms.filter_dims[0] - 1 - wR;\n if (dyR < 0.0 || dyR >= ${f}(uniforms.Dy_shape[1]) ||\n fract(dyR) > 0.0 || wRPerm < 0) {\n continue;\n }\n let idyR: u32 = u32(dyR);\n\n for (var wC: u32 = 0; wC < uniforms.filter_dims[1]; wC = wC + 1) {\n let dyC = (${f}(dyCorner.y) + ${f}(wC)) / ${f}(uniforms.strides.y);\n let dyC2 = (${f}(dyCorner.y) + 1.0 + ${f}(wC)) / ${f}(uniforms.strides.y);\n let wCPerm = uniforms.filter_dims[1] - 1 - wC;\n if (wCPerm < 0) {\n continue;\n }\n var bDyCVal = true;\n var bDyCVal2 = true;\n if (dyC < 0.0 || dyC >= ${f}(uniforms.Dy_shape[2]) ||\n fract(dyC) > 0.0) {\n bDyCVal = false;\n }\n if (dyC2 < 0.0 || dyC2 >= ${f}(uniforms.Dy_shape[2]) ||\n fract(dyC2) > 0.0) {\n bDyCVal2 = false;\n }\n\n let idyC: u32 = u32(dyC);\n let idyC2: u32 = u32(dyC2);\n if (bDyCVal && bDyCVal2) {\n let d2Length = uniforms.Dy_shape[3];\n for (var d2 :u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\n let wValue1 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\n let wValue2 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\n let wValue3 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\n\n var xValue = ${O.get(\"batch\",\"idyR\",\"idyC\",\"d2\")};\n let tmpval = vec4<${f}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n\n xValue = ${O.get(\"batch\",\"idyR\",\"idyC2\",\"d2\")};\n\n dotProd[1] = dotProd[1] + vec4<${f}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n }\n } else if (bDyCVal) {\n let d2Length = uniforms.Dy_shape[${$}];\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\n let wValue1 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\n let wValue2 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\n let wValue3 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\n\n var xValue = ${O.get(\"batch\",\"idyR\",\"idyC\",\"d2\")};\n let tmpval = vec4<${f}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n }\n } else if (bDyCVal2) {\n let d2Length = uniforms.Dy_shape[3];\n for (var d2: u32 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1\",\"d2\")};\n let wValue1 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 1\",\"d2\")};\n let wValue2 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 2\",\"d2\")};\n let wValue3 = ${E.get(\"u32(wRPerm)\",\"u32(wCPerm)\",\"d1 + 3\",\"d2\")};\n\n var xValue = ${O.get(\"batch\",\"idyR\",\"idyC2\",\"d2\")};\n let tmpval = vec4<${f}>(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[1] = dotProd[1] + tmpval;\n }\n }\n }\n }\n\n for (var i: u32 = 0; i < ${A}; i = i + 1) {\n let value = dotProd[i] + ${u?\"bias[c+i]\":`vec4<${f}>(0.0)`};\n ${R.set(\"batch\",\"r\",\"c + i\",\"d1\",\"value\")};\n }\n }`,U=`\n let outputIndices = ${R.offsetToIndices(\"global_idx\")};\n let batch = ${R.indicesGet(\"outputIndices\",0)};\n let d1 = ${R.indicesGet(\"outputIndices\",$)};\n let r = ${R.indicesGet(\"outputIndices\",w)};\n let c = ${R.indicesGet(\"outputIndices\",C)};\n let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n let groupId = d1 / uniforms.output_channels_per_group;\n let wOutChannel = d1 - groupId * uniforms.output_channels_per_group;\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = ${f}(0.0);\n for (var wR: u32 = 0; wR < uniforms.effective_filter_dims.x; wR = wR + 1) {\n if (wR % uniforms.dilations.x != 0) {\n continue;\n }\n let dyR = (${f}(dyRCorner) + ${f}(wR)) / ${f}(uniforms.strides[0]);\n let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x;\n if (dyR < 0.0 || dyR >= ${f}(uniforms.Dy_shape[${w}]) || fract(dyR) > 0.0 ||\n wRPerm < 0) {\n continue;\n }\n let idyR: u32 = u32(dyR);\n\n for (var wC: u32 = 0; wC < uniforms.effective_filter_dims.y; wC = wC + 1) {\n if (wC % uniforms.dilations.y != 0) {\n continue;\n }\n let dyC = (${f}(dyCCorner) + ${f}(wC)) / ${f}(uniforms.strides.y);\n let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y;\n if (dyC < 0.0 || dyC >= ${f}(uniforms.Dy_shape[${C}]) ||\n fract(dyC) > 0.0 || wCPerm < 0) {\n continue;\n }\n let idyC: u32 = u32(dyC);\n var inputChannel = groupId * uniforms.input_channels_per_group;\n for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group; d2 = d2 + 1) {\n let xValue = ${g?O.get(\"batch\",\"idyR\",\"idyC\",\"inputChannel\"):O.get(\"batch\",\"inputChannel\",\"idyR\",\"idyC\")};\n let wValue = ${E.get(\"inputChannel\",\"wOutChannel\",\"u32(wRPerm)\",\"u32(wCPerm)\")};\n dotProd = dotProd + xValue * wValue;\n inputChannel = inputChannel + 1;\n }\n }\n }\n let value = dotProd + ${u?\"bias[d1]\":`${f}(0.0)`};\n ${R.setByOffset(\"global_idx\",\"value\")};\n `;return`\n ${e.registerUniforms(d).declareVariables(...B,R)}\n ${P}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")};\n ${c?j:U}}`},uo=(e,r,t)=>{let u=e.length>2,s=r.outputShape,c=K.size(s),f=[Math.ceil(c/64),1,1];Fe(\"verbose\",()=>`[conv2d_backprop_webgpu] dispatch = ${f}`);let d=r.format===\"NHWC\",g=[\"rank\",\"rank\"],w=[r.strides[0],r.strides[1]],C=[r.kernelShape[d?1:2],r.kernelShape[d?2:3]],$=[r.dilations[0],r.dilations[1]],A=[C[0]+(r.dilations[0]<=1?0:(r.kernelShape[d?1:2]-1)*(r.dilations[0]-1)),C[1]+(r.dilations[1]<=1?0:(r.kernelShape[d?2:3]-1)*(r.dilations[1]-1))],P=[A[0]-1-Math.floor((r.pads[0]+r.pads[2])/2),A[1]-1-Math.floor(r.pads[1]+r.pads[3])/2],x=!1,E=r.group,O=e[1].dims,B=O[0]/E,R=O[1],j=[{type:12,data:c},{type:12,data:w},{type:12,data:C},{type:12,data:$},{type:12,data:A},{type:6,data:P},{type:12,data:B},{type:12,data:R},...se(e[0].dims,e[1].dims)];u&&(j.push(...se(e[2].dims)),g.push(\"rank\")),j.push(...se(s));let U=f[1]===1&&f[2]===1,L=F=>{let te=[{name:\"output_size\",type:\"u32\"},{name:\"strides\",type:\"u32\",length:w.length},{name:\"filter_dims\",type:\"u32\",length:C.length},{name:\"dilations\",type:\"u32\",length:C.length},{name:\"effective_filter_dims\",type:\"u32\",length:A.length},{name:\"pads\",type:\"i32\",length:P.length},{name:\"input_channels_per_group\",type:\"u32\"},{name:\"output_channels_per_group\",type:\"u32\"}],J=Ne(e[0].dataType);return`${ty(F,e,s,u,U,x,J,te,d)}`};return{name:\"ConvTranspose2D\",shaderCache:{hint:`${r.cacheKey};`,inputDependencies:g},getRunData:()=>({dispatchGroup:{x:f[0],y:f[1],z:f[2]},outputs:[{dims:t?t(s):s,dataType:e[0].dataType}],programUniforms:j}),getShaderSource:L}}});var ry,ny,iy,Td,Ed,oy,ay,sy,uy,Pd,kd=ae(()=>{\"use strict\";Id();Ad();Ft();Dr();ry=(e,r,t,u,s,c)=>(e-1)*r+t+(u-1)*s+1-c,ny=(e,r,t,u,s)=>{let c=Math.floor(e/2);r===\"SAME_UPPER\"?(t[u]=c,t[s]=e-c):r===\"SAME_LOWER\"&&(t[u]=e-c,t[s]=c)},iy=(e,r,t,u,s,c,f,d,g,w)=>{let C=e.length-2,$=w.length===0;if(g.length===0)for(let x=0;x{let t=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce(($,A)=>$*A,1)===0){t.length=0;for(let $=2;$$+A,0)===0){let $=r[0].dims.length-2;g=new Array($).fill(1)}let w=e.strides.slice();if(w.reduce(($,A)=>$+A,0)===0){let $=r[0].dims.length-2;w=new Array($).fill(1)}iy(d,t,g,e.autoPad,e.group,s,w,u,f,c);let C=Object.assign({},e);return Object.assign(C,{kernelShape:t,pads:s,outputPadding:f,outputShape:c,dilations:g,strides:w}),C},Ed=e=>{let r=di(e),t=e.format,u=[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][typeof e.autoPad>\"u\"?0:e.autoPad],s=e.dilations,c=e.group,f=e.kernelShape,d=e.pads,g=e.strides,w=e.wIsConst(),C=e.outputPadding,$=e.outputShape;return{autoPad:u,format:t,dilations:s,group:c,kernelShape:f,outputPadding:C,outputShape:$,pads:d,strides:g,wIsConst:w,...r,cacheKey:`${e.format};${r.activation};`}},oy=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error(\"Conv requires 2 or 3 inputs\");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error(\"currently only support 2-dimensional conv\");if(e[0].dims.length!==e[1].dims.length)throw new Error(\"filter does not have same dimension as input\");let t=e[0].dims[r.format===\"NHWC\"?e[0].dims.length-1:1],u=e[1].dims[0];if(t!==u)throw new Error(\"FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\");let s=e[1].dims[1]*r.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==s))throw new Error(\"invalid bias\");let c=e[0].dims.length-2;if(r.dilations.reduce((C,$)=>C+$,0)>0&&r.dilations.length!==c)throw new Error(`dilations should be ${c}D`);if(r.strides.reduce((C,$)=>C+$,0)>0&&r.strides.length!==c)throw new Error(`strides should be ${c}D`);if(r.pads.reduce((C,$)=>C+$,0)>0&&r.pads.length!==c*2)throw new Error(`pads should be ${c*2}D`);if(r.outputPadding.length!==c&&r.outputPadding.length!==0)throw new Error(`output_padding should be ${c}D`);if(r.kernelShape.reduce((C,$)=>C+$,0)>0&&r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error(\"invalid kernel shape\");if(r.outputShape.length!==0&&r.outputShape.length!==e[0].dims.length-2)throw new Error(\"invalid output shape\")},ay=[2,3,1,0],sy=(e,r,t)=>{let u=Td(t,r),s=t.format===\"NHWC\",c=u.outputShape,f=c[s?3:1],d=r[0].dims[s?3:1];if(u.group!==1||f===1&&d===1){e.compute(uo(r,u));return}let g=c[s?1:2],w=c[s?2:3],C=r[1].dims[2],$=r[1].dims[3],A=s?g*w:f,P=s?f:g*w,x=C*$*d,E=!0,O=e.kernelCustomData.wT??e.compute($t(r[1],ay),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=O);let B=[r[0],O],R=r.length===3;R&&(!s&&r[2].dims.length===1?B.push(r[2].reshape([r[2].dims[0],1,1])):B.push(r[2])),e.compute(xd(B,u,c,A,P,x,R,E),{inputs:B})},uy=(e,r)=>{let t=r.format===\"NHWC\",u=[e.inputs[0].reshape(t?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&u.push(e.inputs[2]);let s=r.kernelShape;(s.length===0||s[0]===0)&&(s=[e.inputs[1].dims[2]]);let c=r.dilations;(c.length===0||c[0]===0)&&(c=[1]);let f=r.strides;(f.length===0||f[0]===0)&&(f=[1]);let d=r.pads;d.length===0&&(d=[0,0]),d=[0,d[0],0,d[1]],f=[1].concat(f),c=[1].concat(c),s=[1].concat(s);let g=Td({...r,pads:d,strides:f,dilations:c,kernelShape:s},u);e.compute(uo(u,g,w=>t?[w[0],w[2],w[3]]:[w[0],w[1],w[3]]))},Pd=(e,r)=>{oy(e.inputs,r),e.inputs[0].dims.length===3?uy(e,r):sy(e,e.inputs,r)}});var ly,Od,Rd,Bd=ae(()=>{\"use strict\";Te();De();nt();Re();ly=(e,r,t,u)=>{let s=K.size(r),c=r.length,f=Z(\"input\",e,c),d=ne(\"output\",e,c),g=t.dataType===6?t.getInt32Array()[0]:Number(t.getBigInt64Array()[0]),w=K.normalizeAxis(g,c),C=$=>{let A=` i32(${f.indicesGet(\"inputIndices\",\"uniforms.axis\")}) `,P=xe(\"uniforms.input_shape\",\"uniforms.axis\",c),x=u.reverse?A+(u.exclusive?\" + 1\":\"\"):\"0\",E=u.reverse?P:A+(u.exclusive?\"\":\" + 1\");return`\n ${$.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axis\",\"u32\").declareVariables(f,d)}\n ${$.mainStart()}\n ${$.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n var inputIndices = ${d.offsetToIndices(\"global_idx\")};\n var sum = ${d.type.value}(0);\n let first : i32 = ${x};\n let last : i32 = ${E};\n for (var i : i32 = first; i < last; i++) {\n ${f.indicesSet(\"inputIndices\",\"uniforms.axis\",\"u32(i)\")};\n sum = sum + ${f.getByIndices(\"inputIndices\")};\n }\n ${d.setByOffset(\"global_idx\",\"sum\")};\n }`};return{name:\"CumSum\",shaderCache:{hint:u.cacheKey,inputDependencies:[\"rank\"]},getRunData:()=>({outputs:[{dims:r,dataType:e}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:[{type:12,data:s},{type:12,data:w},...se(r,r)]}),getShaderSource:C}},Od=(e,r)=>{let t=e.inputs[0].dims,u=e.inputs[0].dataType,s=e.inputs[1];e.compute(ly(u,t,s,r),{inputs:[0]})},Rd=e=>{let r=e.exclusive===1,t=e.reverse===1;return ke({exclusive:r,reverse:t})}});var dy,cy,fy,Dd,zd,Md=ae(()=>{\"use strict\";Te();De();nt();Re();dy=e=>{if(!e||e.length!==1)throw new Error(\"DepthToSpace requires 1 input.\");if(e[0].dims.length!==4)throw new Error(\"DepthToSpace requires 4D input.\")},cy=(e,r,t,u)=>{let s=[];s.push(`fn perm(i: ${u.type.indices}) -> ${t.type.indices} {\n var a: ${t.type.indices};`);for(let c=0;c{let t,u,s,c,f,d,g=r.format===\"NHWC\",w=r.blocksize,C=r.mode===\"DCR\";g?([t,u,s,c]=e.dims,f=C?[t,u,s,w,w,c/w**2]:[t,u,s,c/w**2,w,w],d=C?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([t,u,s,c]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],f=C?[t,w,w,c/w**2,u,s]:[t,c/w**2,w,w,u,s],d=C?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let $=e.reshape(f),A=$.dims.length,P=e.dataType,x=Z(\"a\",P,A),E=ne(\"output\",P,A),O=B=>`\n ${B.registerUniform(\"output_size\",\"u32\").declareVariables(x,E)}\n\n ${cy(d,A,x,E)}\n\n ${B.mainStart()}\n ${B.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let indices = ${E.offsetToIndices(\"global_idx\")};\n let aIndices = perm(indices);\n\n ${E.setByOffset(\"global_idx\",x.getByIndices(\"aIndices\"))}\n }`;return{name:\"DepthToSpace\",shaderCache:{hint:`${e.dims};${r.blocksize};${r.mode}`,inputDependencies:[\"rank\"]},getRunData:B=>{let R=g?[t,u*w,s*w,c/w**2]:[t,c/w**2,u*w,s*w],j=K.size(R),U=$.dims,L=K.sortBasedOnPerm(U,d);return{outputs:[{dims:R,dataType:B[0].dataType}],dispatchGroup:{x:Math.ceil(j/64)},programUniforms:[{type:12,data:j},...se(U,L)]}},getShaderSource:O}},Dd=(e,r)=>{dy(e.inputs),e.compute(fy(e.inputs[0],r))},zd=e=>ke({blocksize:e.blocksize,mode:e.mode,format:e.format})});var lo,gi,jd,py,my,co,fo,Ud,hy,Vd,Wd,Nd=ae(()=>{\"use strict\";Te();De();nt();Re();lo=\"[a-zA-Z]|\\\\.\\\\.\\\\.\",gi=\"(\"+lo+\")+\",jd=\"^\"+gi+\"$\",py=\"(\"+gi+\",)*\"+gi,my=\"^\"+py+\"$\",co=class{constructor(r=-1){this.symbolToIndices=new Map,this.inputIndex=r}addSymbol(r,t){let u=this.symbolToIndices.get(r);u===void 0?u=[t]:u.push(t),this.symbolToIndices.set(r,u)}},fo=class{constructor(r,t){this.equation=t;this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[u,s]=t.includes(\"->\")?t.split(\"->\",2):[t,\"\"];if(!u.match(RegExp(my)))throw new Error(\"Invalid LHS term\");if(u.split(\",\").forEach((d,g)=>{let w=r[g].dims.slice();if(!d.match(RegExp(jd)))throw new Error(\"Invalid LHS term\");let C=this.processTerm(d,!0,w,g);this.lhs.push(C)}),s===\"\")s+=[...this.symbolToInfo.entries()].filter(([d,g])=>g.count===1||d===\"...\").map(([d])=>d).join(\"\");else if(!s.match(RegExp(gi)))throw new Error(\"Invalid RHS\");s.match(RegExp(lo,\"g\"))?.forEach(d=>{if(d===\"...\")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let g=this.symbolToInfo.get(d);if(g===void 0)throw new Error(\"Invalid RHS symbol\");this.outputDims.push(g.dimValue)}}),this.rhs=this.processTerm(s,!1,this.outputDims)}addSymbol(r,t,u){let s=this.symbolToInfo.get(r);if(s!==void 0){if(s.dimValue!==t&&s.count!==1)throw new Error(\"Dimension mismatch\");s.count++,s.inputIndices.push(u)}else s={count:1,dimValue:t,inputIndices:[u]};this.symbolToInfo.set(r,s)}processTerm(r,t,u,s=-1){let c=u.length,f=!1,d=[],g=0;if(!r.match(RegExp(jd))&&!t&&r!==\"\")throw new Error(\"Invalid LHS term\");let w=r.match(RegExp(lo,\"g\")),C=new co(s);return w?.forEach(($,A)=>{if($===\"...\"){if(f)throw new Error(\"Only one ellipsis is allowed per input term\");f=!0;let P=c-w.length+1;if(P<0)throw new Error(\"Ellipsis out of bounds\");if(d=u.slice(g,g+P),this.hasEllipsis){if(this.ellipsisDims.length!==d.length||this.ellipsisDims.toString()!==d.toString())throw new Error(\"Ellipsis dimensions mismatch\")}else if(t)this.hasEllipsis=!0,this.ellipsisDims=d;else throw new Error(\"Ellipsis must be specified in the LHS\");for(let x=0;xe+\"_max\",hy=(e,r,t,u)=>{let c=e.map(C=>C.length).map((C,$)=>Z(`input${$}`,r,C)),f=K.size(u),d=ne(\"output\",r,u.length),g=[...t.symbolToInfo.keys()].filter(C=>!t.rhs.symbolToIndices.has(C)),w=C=>{let $=[],A=\"var prod = 1.0;\",P=\"var sum = 0.0;\",x=\"sum += prod;\",E=[],O=[],B=[],R=[],j=t.symbolToInfo.size===t.rhs.symbolToIndices.size;t.symbolToInfo.forEach((L,F)=>{if(t.rhs.symbolToIndices.has(F)){let te=t.rhs.symbolToIndices.get(F)?.[0];te!==void 0&&t.lhs.forEach((J,oe)=>{if(L.inputIndices.includes(oe)){let le=J.symbolToIndices.get(F);if(le===void 0)throw new Error(\"Invalid symbol error\");le.forEach(ge=>{$.push(`${c[oe].indicesSet(`input${oe}Indices`,ge,d.indicesGet(\"outputIndices\",te))}`)})}})}else t.lhs.forEach((te,J)=>{if(L.inputIndices.includes(J)){let oe=te.symbolToIndices.get(F);if(oe===void 0)throw new Error(\"Invalid symbol error\");oe.forEach(le=>{E.push(`${c[J].indicesSet(`input${J}Indices`,le,`${F}`)}`)}),R.push(`prod *= ${c[J].getByIndices(`input${J}Indices`)};`)}}),O.push(`for(var ${F}: u32 = 0; ${F} < uniforms.${Ud(F)}; ${F}++) {`),B.push(\"}\")});let U=j?[...$,`let sum = ${c.map((L,F)=>L.getByIndices(`input${F}Indices`)).join(\" * \")};`]:[...$,P,...O,...E,A,...R,x,...B];return`\n ${C.registerUniforms(g.map(L=>({name:`${Ud(L)}`,type:\"u32\"}))).registerUniform(\"outputSize\",\"u32\").declareVariables(...c,d)}\n\n ${C.mainStart()}\n ${C.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n var outputIndices = ${d.offsetToIndices(\"global_idx\")};\n ${c.map((L,F)=>`var input${F}Indices: ${c[F].type.indices};`).join(`\n`)}\n ${U.join(`\n`)};\n ${d.setByOffset(\"global_idx\",\"sum\")};\n }`};return{name:\"Einsum\",shaderCache:{hint:t.equation,inputDependencies:e.map(()=>\"rank\")},getRunData:()=>{let C=g.filter(A=>t.symbolToInfo.has(A)).map(A=>({type:12,data:t.symbolToInfo.get(A)?.dimValue||0}));C.push({type:12,data:f});let $=e.map((A,P)=>[...se(A)]).reduce((A,P)=>A.concat(P),C);return $.push(...se(u)),{outputs:[{dims:u,dataType:r}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:$}},getShaderSource:w}},Vd=(e,r)=>{let t=new fo(e.inputs,r.equation),u=t.outputDims,s=e.inputs.map((c,f)=>c.dims);e.compute(hy(s,e.inputs[0].dataType,t,u))},Wd=e=>{let r=e.equation.replace(/\\s+/g,\"\");return ke({equation:r})}});var gy,Gd,yy,by,Hd,Ld=ae(()=>{\"use strict\";Te();De();Re();gy=e=>{if(!e||e.length!==2)throw new Error(\"Expand requires 2 input.\");let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),u=t.length{let t=e.length-r.length,u=[];for(let s=0;se.length>r.length?Gd(e,r):Gd(r,e),by=e=>{let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),u=yy(r,t),s=e[0].dataType,c=s===9?4:1,f=Math.ceil(K.size(u)/c),d=w=>{let C=Z(\"input\",s,r.length,c),$=ne(\"output\",s,u.length,c),A;if(s===9){let P=(x,E,O=\"\")=>`\n let outputIndices${E} = ${$.offsetToIndices(`outputOffset + ${E}u`)};\n let offset${E} = ${C.broadcastedIndicesToOffset(`outputIndices${E}`,$)};\n let index${E} = offset${E} / 4u;\n let component${E} = offset${E} % 4u;\n ${x}[${E}] = ${O}(${C.getByOffset(`index${E}`)}[component${E}]);\n `;A=`\n let outputOffset = global_idx * ${c};\n var data = vec4(0);\n ${P(\"data\",0,\"u32\")}\n ${P(\"data\",1,\"u32\")}\n ${P(\"data\",2,\"u32\")}\n ${P(\"data\",3,\"u32\")}\n ${$.setByOffset(\"global_idx\",\"data\")}\n }`}else A=`\n let outputIndices = ${$.offsetToIndices(\"global_idx\")};\n let inputOffset = ${C.broadcastedIndicesToOffset(\"outputIndices\",$)};\n ${$.setByOffset(\"global_idx\",C.getByOffset(\"inputOffset\"))}\n }`;return`\n ${w.registerUniform(\"vec_size\",\"u32\").declareVariables(C,$)}\n ${w.mainStart()}\n ${w.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n ${A}`},g=[{type:12,data:f},...se(r,u)];return{name:\"Expand\",shaderCache:{hint:`${u.length}`,inputDependencies:[\"rank\"]},getShaderSource:d,getRunData:()=>({outputs:[{dims:u,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:g})}},Hd=e=>{gy(e.inputs),e.compute(by(e.inputs),{inputs:[0]})}});var vy,Fd,qd=ae(()=>{\"use strict\";Te();De();Re();li();vy=e=>{let r=e[0].dataType,t=K.size(e[0].dims),u=K.size(e[1].dims),s=u%4===0,c=f=>{let d=Z(\"x\",r,[1],4),g=Z(\"bias\",r,[1],4),w=ne(\"y\",r,[1],4),C=[{name:\"output_vec_size\",type:\"u32\"},{name:\"bias_size\",type:\"u32\"}],$=P=>`\n let bias${P}_offset: u32 = (global_idx * 4 + ${P}) % uniforms.bias_size;\n let bias${P} = ${g.getByOffset(`bias${P}_offset / 4`)}[bias${P}_offset % 4];`,A=s?`\n let bias = ${g.getByOffset(\"global_idx % (uniforms.bias_size / 4)\")};`:`${$(0)}${$(1)}${$(2)}${$(3)}\n let bias = ${d.type.value}(bias0, bias1, bias2, bias3);`;return`${f.registerUniforms(C).declareVariables(d,g,w)}\n\n ${Xi(at(r))}\n\n ${f.mainStart(ur)}\n ${f.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_vec_size\")}\n\n let x = ${d.getByOffset(\"global_idx\")};\n ${A}\n let x_in = x + bias;\n ${w.setByOffset(\"global_idx\",Ji(\"x_in\"))}\n }`};return{name:\"FastGeluWithBias\",shaderCache:{hint:`${s}`,inputDependencies:[\"type\",\"type\"]},getShaderSource:c,getRunData:f=>({outputs:[{dims:f[0].dims,dataType:f[0].dataType}],programUniforms:[{type:12,data:Math.ceil(t/4)},{type:12,data:u}],dispatchGroup:{x:Math.ceil(t/ur/4)}})}},Fd=e=>{e.inputs.length<2||K.size(e.inputs[1].dims)===0?td(e):e.compute(vy(e.inputs))}});var wy,_y,Kd,Yd,Zd=ae(()=>{\"use strict\";Te();De();nt();Re();wy=e=>{if(!e||e.length!==2)throw new Error(\"Gather requires 2 inputs.\")},_y=(e,r)=>{let t=e[0].dims,u=e[1].dims,s=t.length,c=K.normalizeAxis(r.axis,s),f=t.slice(0);f.splice(c,1,...u);let d=t[c],g=e[0].dataType===9?4:1,w=Math.ceil(K.size(f)/g),C=[{type:12,data:w},{type:6,data:d},{type:12,data:c},...se(e[0].dims,e[1].dims,f)],$=A=>{let P=Z(\"data\",e[0].dataType,e[0].dims.length,g),x=Z(\"inputIndices\",e[1].dataType,e[1].dims.length),E=ne(\"output\",e[0].dataType,f.length,g),O=R=>{let j=u.length,U=`var indicesIndices${R} = ${x.type.indices}(0);`;for(let L=0;L1?`indicesIndices${R}[${L}]`:`indicesIndices${R}`} = ${f.length>1?`outputIndices${R}[uniforms.axis + ${L}]`:`outputIndices${R}`};`;U+=`\n var idx${R} = ${x.getByIndices(`indicesIndices${R}`)};\n if (idx${R} < 0) {\n idx${R} = idx${R} + uniforms.axisDimLimit;\n }\n var dataIndices${R} : ${P.type.indices};\n `;for(let L=0,F=0;L1?`dataIndices${R}[${L}]`:`dataIndices${R}`} = u32(idx${R});`,F+=j):(U+=`${s>1?`dataIndices${R}[${L}]`:`dataIndices${R}`} = ${f.length>1?`outputIndices${R}[${F}]`:`outputIndices${R}`};`,F++);return U},B;if(e[0].dataType===9){let R=(j,U,L=\"\")=>`\n let outputIndices${U} = ${E.offsetToIndices(`outputOffset + ${U}u`)};\n ${O(U)};\n let offset${U} = ${P.indicesToOffset(`dataIndices${U}`)};\n let index${U} = offset${U} / 4u;\n let component${U} = offset${U} % 4u;\n ${j}[${U}] = ${L}(${P.getByOffset(`index${U}`)}[component${U}]);\n `;B=`\n let outputOffset = global_idx * ${g};\n var value = vec4(0);\n ${R(\"value\",0,\"u32\")}\n ${R(\"value\",1,\"u32\")}\n ${R(\"value\",2,\"u32\")}\n ${R(\"value\",3,\"u32\")}\n ${E.setByOffset(\"global_idx\",\"value\")}\n `}else B=`\n let outputIndices = ${E.offsetToIndices(\"global_idx\")};\n ${O(\"\")};\n let value = ${P.getByIndices(\"dataIndices\")};\n ${E.setByOffset(\"global_idx\",\"value\")};\n `;return`\n ${A.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axisDimLimit\",\"i32\").registerUniform(\"axis\",\"u32\").declareVariables(P,x,E)}\n ${A.mainStart()}\n ${A.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n ${B}\n }`};return{name:\"Gather\",shaderCache:{hint:r.cacheKey,inputDependencies:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:f,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(w/64)},programUniforms:C}),getShaderSource:$}},Kd=e=>ke({axis:e.axis}),Yd=(e,r)=>{let t=e.inputs;wy(t),e.compute(_y(e.inputs,r))}});var $y,Cy,Qd,Xd,Jd=ae(()=>{\"use strict\";Te();De();nt();Re();$y=e=>{if(!e||e.length!==2)throw new Error(\"GatherElements requires 2 inputs.\");if(e[0].dims.length<1)throw new Error(\"GatherElements requires that the data input be rank >= 1.\");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and\n indices input tensors be of same rank.`)},Cy=(e,r)=>{let t=e[0].dims,u=e[0].dataType,s=t.length,c=e[1].dims,f=e[1].dataType,d=K.normalizeAxis(r.axis,s),g=t[d],w=c.slice(0),C=K.size(w),$=Z(\"input\",u,s),A=Z(\"indicesInput\",f,c.length),P=ne(\"output\",u,w.length),x=[{type:12,data:C},{type:6,data:g},{type:12,data:d}];return x.push(...se(t,c,w)),{name:\"GatherElements\",shaderCache:{inputDependencies:[\"rank\",\"rank\"]},getRunData:()=>({outputs:[{dims:w,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(C/64)},programUniforms:x}),getShaderSource:B=>`\n ${B.registerUniform(\"outputSize\",\"u32\").registerUniform(\"axisDimLimit\",\"i32\").registerUniform(\"axis\",\"u32\").declareVariables($,A,P)}\n ${B.mainStart()}\n ${B.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n\n let outputIndices = ${P.offsetToIndices(\"global_idx\")};\n\n var idx = ${A.getByOffset(\"global_idx\")};\n if (idx < 0) {\n idx = idx + uniforms.axisDimLimit;\n }\n var inputIndices = ${$.type.indices}(outputIndices);\n ${$.indicesSet(\"inputIndices\",\"uniforms.axis\",\"u32(idx)\")};\n let value = ${$.getByIndices(\"inputIndices\")};\n\n ${P.setByOffset(\"global_idx\",\"value\")};\n }`}},Qd=e=>ke({axis:e.axis}),Xd=(e,r)=>{let t=e.inputs;$y(t),e.compute(Cy(e.inputs,r))}});var Sy,xy,ec,tc,rc=ae(()=>{\"use strict\";Te();De();Re();Sy=e=>{if(!e)throw new Error(\"Input is missing\");if(e.length<2||e.length>3)throw new Error(\"Invaid input number.\");if(e.length===3&&e[2].dims.length>2)throw new Error(\"Invalid input shape of C\");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error(\"Input types are mismatched\")},xy=(e,r)=>{let t=e[0].dims.slice(),u=e[1].dims.slice(),[s,c,f]=Jn.getShapeOfGemmResult(t,r.transA,u,r.transB,e.length===3?e[2].dims:void 0),d=[s,c];if(!d)throw new Error(\"Can't use gemm on the given tensors\");let g=K.size(d),w=[{type:12,data:g},{type:12,data:s},{type:12,data:c},{type:12,data:f},{type:1,data:r.alpha},{type:1,data:r.beta}],C=[\"type\",\"type\"];e.length===3&&(w.push(...se(e[2].dims)),C.push(\"rank\")),w.push(...se(d));let $=A=>{let P=\"\";r.transA&&r.transB?P=\"value += a[k * uniforms.M + m] * b[n * uniforms.K + k];\":r.transA&&!r.transB?P=\"value += a[k * uniforms.M + m] * b[k * uniforms.N + n];\":!r.transA&&r.transB?P=\"value += a[m * uniforms.K + k] * b[n * uniforms.K + k];\":!r.transA&&!r.transB&&(P=\"value += a[m * uniforms.K + k] * b[k * uniforms.N + n];\");let x=r.alpha===1?\"\":\"value *= uniforms.alpha;\",E=Z(\"a\",e[0].dataType,e[0].dims),O=Z(\"b\",e[1].dataType,e[1].dims),B=E.type.value,R=null,j=[E,O];e.length===3&&(R=Z(\"c\",e[2].dataType,e[2].dims.length),j.push(R));let U=ne(\"output\",e[0].dataType,d.length);j.push(U);let L=[{name:\"output_size\",type:\"u32\"},{name:\"M\",type:\"u32\"},{name:\"N\",type:\"u32\"},{name:\"K\",type:\"u32\"},{name:\"alpha\",type:\"f32\"},{name:\"beta\",type:\"f32\"}];return`\n ${A.registerUniforms(L).declareVariables(...j)}\n\n ${A.mainStart()}\n ${A.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let m = global_idx / uniforms.N;\n let n = global_idx % uniforms.N;\n\n var value = ${B}(0);\n for (var k: u32 = 0u; k < uniforms.K; k++) {\n ${P}\n }\n\n ${x}\n ${(()=>R!=null?`let cOffset = ${R.broadcastedIndicesToOffset(\"vec2(m, n)\",U)}; value += ${B}(uniforms.beta) * ${R.getByOffset(\"cOffset\")};`:\"\")()}\n output[global_idx] = value;\n }`};return{name:\"Gemm\",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:C},getRunData:()=>({outputs:[{dims:d,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(g/64)},programUniforms:w}),getShaderSource:$}},ec=e=>{let r=e.transA,t=e.transB,u=e.alpha,s=e.beta;return{transA:r,transB:t,alpha:u,beta:s,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},tc=(e,r)=>{Sy(e.inputs),e.compute(xy(e.inputs,r))}});var Iy,Ay,Ty,nc,ic=ae(()=>{\"use strict\";Te();De();Re();Iy=(e,r)=>{let t=e[0].dims,u=t,s=2,c=K.sizeToDimension(t,s),f=K.sizeFromDimension(t,s),d=He(f),g=f/d,w=[t[0],t[1],g],C=[\"rank\",\"type\",\"type\"],$=[{type:12,data:f},{type:12,data:g}];$.push(...se(w,w));let A=P=>{let x=Z(\"x\",e[0].dataType,w.length,d),E=Z(\"scale\",e[1].dataType,e[1].dims),O=Z(\"bias\",e[2].dataType,e[2].dims),B=ne(\"output\",e[0].dataType,w.length,d),R=[x,E,O,B],j=x.type.value,U=d===1?\"f32\":`vec${d}`,L=64,F=[{name:\"normSize\",type:\"u32\"},{name:\"normPackedSize\",type:\"u32\"}];return`\n var meanShared : f32;\n var squaredNormShared : f32;\n var workgroupShared : array<${U}, ${L}>;\n const workgroupSize = ${L}u;\n ${P.registerUniforms(F).declareVariables(...R)}\n ${P.mainStart(L)}\n let norm = global_idx / workgroupSize;\n let batch = norm / uniforms.x_shape[1];\n let channel = norm % uniforms.x_shape[1];\n let localIndex = local_id.x;\n\n // initialize workgroup memory\n var initial = ${U}(0);\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n initial = initial + ${U}(${x.get(\"batch\",\"channel\",\"h\")});\n }\n workgroupShared[localIndex] = initial;\n workgroupBarrier();\n\n // Calculate the mean of current channel data.\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (localIndex < currSize) {\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\n }\n workgroupBarrier();\n }\n if (localIndex == 0) {\n meanShared = ${It(\"workgroupShared[0]\",d)} / f32(uniforms.normSize);\n }\n workgroupBarrier();\n\n // reinitialize workgroup memory.\n initial = ${U}(0);\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n let deviation = ${U}(${x.get(\"batch\",\"channel\",\"h\")}) - ${U}(meanShared);\n initial = initial + deviation * deviation;\n }\n workgroupShared[localIndex] = initial;\n workgroupBarrier();\n\n // Calculate the sum of square of deviation of current channel data.\n for (var currSize = workgroupSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (localIndex < currSize) {\n workgroupShared[localIndex] = workgroupShared[localIndex] + workgroupShared[localIndex + currSize];\n }\n workgroupBarrier();\n }\n if (localIndex == 0) {\n squaredNormShared = ${It(\"workgroupShared[0]\",d)};\n }\n workgroupBarrier();\n\n let invStdDev = inverseSqrt(squaredNormShared / f32(uniforms.normSize) + f32(${r.epsilon}));\n let channelScale = invStdDev * f32(${E.getByOffset(\"channel\")});\n let channelShift = f32(${O.getByOffset(\"channel\")}) - meanShared * channelScale;\n for (var h = localIndex; h < uniforms.normPackedSize; h += workgroupSize) {\n let value = ${x.get(\"batch\",\"channel\",\"h\")} * ${j}(${U}(channelScale)) + ${j}(${U}(channelShift));\n ${B.set(\"batch\",\"channel\",\"h\",\"value\")};\n }\n }`};return{name:\"InstanceNormalization\",shaderCache:{hint:`${r.epsilon};${d}`,inputDependencies:C},getRunData:()=>({outputs:[{dims:u,dataType:e[0].dataType}],dispatchGroup:{x:c},programUniforms:$}),getShaderSource:A}},Ay=(e,r,t,u,s,c,f,d)=>{let g=He(f),w=64,C=g===1?\"vec2f\":`mat2x${g}f`,$=g===1?\"f32\":`vec${g}f`,A=(F,te)=>`${C}(${F}, ${te})`,P=s*f/g,x=Math.ceil(c/w),E=[\"type\"],O=[{type:12,data:x},{type:12,data:c},{type:12,data:Math.floor(f/g)},{type:12,data:Math.floor(c*f/g)}],B=F=>{let te=Z(\"input\",r.dataType,r.dims,g);return`\n ${F.declareVariables(te)}\n @group(0) @binding(1) var output : array<${C}>;\n struct Uniforms {wg_size:u32, H:u32, C:u32, image_size:u32};\n @group(0) @binding(2) var uniforms: Uniforms;\n\n ${F.mainStart(w)}\n let currentImageNumber = global_idx / ${w} / uniforms.C;\n let currentChannelNumber = (global_idx / ${w}) % uniforms.C;\n let wgOffset = local_id.x * uniforms.wg_size;\n if (wgOffset >= uniforms.H) {\n return;\n }\n let wgMax = min(wgOffset + uniforms.wg_size, uniforms.H);\n\n let offset = currentImageNumber * uniforms.image_size + currentChannelNumber;\n var sum = ${xt(\"f32\",g)};\n var squaredSum = ${xt(\"f32\",g)};\n for (var i: u32 = wgOffset; i < wgMax; i++) {\n let value = ${$}(input[offset + i * uniforms.C]);\n sum += value;\n squaredSum += value * value;\n }\n output[global_idx] = ${A(\"sum\",\"squaredSum\")};\n }`},R=e.compute({name:\"InstanceNormComputeMean\",shaderCache:{hint:`${g}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:[s,f,w,2],dataType:1}],dispatchGroup:{x:s*f/g},programUniforms:O}),getShaderSource:B},{inputs:[r],outputs:[-1]})[0],j=[{type:12,data:P},{type:12,data:c},{type:12,data:Math.floor(f/g)},{type:12,data:Math.floor(w*f/g)}],U=[\"type\",\"type\",\"type\"],L=F=>{let te=Z(\"scale\",t.dataType,t.dims,g),J=Z(\"bias\",u.dataType,u.dims,g);return`\n @group(0) @binding(0) var input : array<${C}>;\n @group(0) @binding(1) var scale : array<${te.type.storage}>;\n @group(0) @binding(2) var bias : array<${J.type.storage}>;\n @group(0) @binding(3) var output : array<${C}>;\n struct Uniforms {units_of_work : u32, H: u32, C : u32, image_size : u32};\n @group(0) @binding(4) var uniforms: Uniforms;\n\n ${F.mainStart()}\n ${F.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.units_of_work\")}\n let currentImageNumber = global_idx / uniforms.C;\n let currentChannelNumber = global_idx % uniforms.C;\n\n let offset = currentImageNumber * uniforms.image_size;\n var sum = ${xt(\"f32\",g)};\n var squaredSum = ${xt(\"f32\",g)};\n for (var i: u32 = 0; i < min(${w}, uniforms.H); i++) {\n let value = input[offset + i + currentChannelNumber * ${w}];\n sum += value[0];\n squaredSum += value[1];\n }\n sum = sum / f32(uniforms.H);\n squaredSum = squaredSum / f32(uniforms.H);\n let invStdDev = inverseSqrt(squaredSum - sum * sum + f32(${d}));\n let channelScale = invStdDev * ${$}(scale[currentChannelNumber]);\n let channelShift = ${$}(bias[currentChannelNumber]) - sum * channelScale;\n\n output[global_idx] = ${A(\"channelScale\",\"channelShift\")};\n }`};return e.compute({name:\"InstanceNormComputeChannelScaleShift\",shaderCache:{hint:`${g};${d}`,inputDependencies:U},getRunData:()=>({outputs:[{dims:[s,f,2],dataType:1}],dispatchGroup:{x:Math.ceil(P/64)},programUniforms:j}),getShaderSource:L},{inputs:[R,t,u],outputs:[-1]})[0]},Ty=(e,r,t)=>{let u=r[0].dims,s=u,c=u[0],f=u[u.length-1],d=K.sizeFromDimension(u,1)/f,g=He(f),w=K.size(s)/g,C=[{type:12,data:d},{type:12,data:Math.floor(f/g)}],$=[\"type\",\"type\"],A=Ay(e,r[0],r[1],r[2],c,d,f,t.epsilon),P=x=>{let E=Ne(r[0].dataType),O=g===1?\"vec2f\":`mat2x${g}f`,B=g===1?E:`vec${g}<${E}>`,R=Z(\"input\",r[0].dataType,r[0].dims,g),j=ne(\"output\",r[0].dataType,s,g);return`\n @group(0) @binding(0) var input : array<${R.type.storage}>;\n @group(0) @binding(1) var scaleInput : array<${O}>;\n @group(0) @binding(2) var output : array<${j.type.storage}>;\n struct Uniforms {H: u32, C : u32};\n @group(0) @binding(3) var uniforms: Uniforms;\n\n ${x.mainStart()}\n let currentImageNumber = global_idx / (uniforms.C * uniforms.H);\n let currentChannelNumber = global_idx % uniforms.C;\n\n let scaleOffset = currentImageNumber * uniforms.C + currentChannelNumber;\n let scale = scaleInput[scaleOffset];\n output[global_idx] = fma(input[global_idx], ${B}(scale[0]), ${B}(scale[1]));\n }`};e.compute({name:\"InstanceNormalizationNHWC\",shaderCache:{hint:`${g}`,inputDependencies:$},getRunData:()=>({outputs:[{dims:s,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(w/64)},programUniforms:C}),getShaderSource:P},{inputs:[r[0],A]})},nc=(e,r)=>{r.format===\"NHWC\"?Ty(e,e.inputs,r):e.compute(Iy(e.inputs,r))}});var Ey,Py,oc,ac=ae(()=>{\"use strict\";Te();De();Re();Ey=e=>{if(!e||e.length<2)throw new Error(\"layerNorm requires at least 2 inputs.\")},Py=(e,r,t)=>{let u=r.simplified,s=e[0].dims,c=e[1],f=!u&&e[2],d=s,g=K.normalizeAxis(r.axis,s.length),w=K.sizeToDimension(s,g),C=K.sizeFromDimension(s,g),$=K.size(c.dims),A=f?K.size(f.dims):0;if($!==C||f&&A!==C)throw new Error(`Size of X.shape()[axis:] == ${C}.\n Size of scale and bias (if provided) must match this.\n Got scale size of ${$} and bias size of ${A}`);let P=[];for(let L=0;L1,R=t>2,j=L=>{let F=Ne(e[0].dataType),te=[Z(\"x\",e[0].dataType,e[0].dims,x),Z(\"scale\",c.dataType,c.dims,x)];f&&te.push(Z(\"bias\",f.dataType,f.dims,x)),te.push(ne(\"output\",e[0].dataType,d,x)),B&&te.push(ne(\"mean_data_output\",1,P)),R&&te.push(ne(\"inv_std_output\",1,P));let J=[{name:\"norm_count\",type:\"u32\"},{name:\"norm_size\",type:\"f32\"},{name:\"norm_size_vectorized\",type:\"u32\"},{name:\"epsilon\",type:\"f32\"}];return`\n ${L.registerUniforms(J).declareVariables(...te)}\n ${L.mainStart()}\n ${L.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.norm_count\")}\n let offset = global_idx * uniforms.norm_size_vectorized;\n var mean_vector = ${xt(\"f32\",x)};\n var mean_square_vector = ${xt(\"f32\",x)};\n\n for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) {\n let value = ${lr(F,x,\"x[h + offset]\")};\n mean_vector += value;\n mean_square_vector += value * value;\n }\n let mean = ${It(\"mean_vector\",x)} / uniforms.norm_size;\n let inv_std_dev = inverseSqrt(${It(\"mean_square_vector\",x)} / uniforms.norm_size ${u?\"\":\"- mean * mean\"} + uniforms.epsilon);\n\n for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) {\n let f32input = ${lr(F,x,\"x[j + offset]\")};\n let f32scale = ${lr(F,x,\"scale[j]\")};\n output[j + offset] = ${te[0].type.value}((f32input ${u?\"\":\"- mean\"}) * inv_std_dev * f32scale\n ${f?`+ ${lr(F,x,\"bias[j]\")}`:\"\"}\n );\n }\n\n ${B?\"mean_data_output[global_idx] = mean\":\"\"};\n ${R?\"inv_std_output[global_idx] = inv_std_dev\":\"\"};\n }`},U=[{dims:d,dataType:e[0].dataType}];return B&&U.push({dims:P,dataType:1}),R&&U.push({dims:P,dataType:1}),{name:\"LayerNormalization\",shaderCache:{hint:`${x};${t};${u}`,inputDependencies:E},getRunData:()=>({outputs:U,dispatchGroup:{x:Math.ceil(w/64)},programUniforms:O}),getShaderSource:j}},oc=(e,r)=>{Ey(e.inputs),e.compute(Py(e.inputs,r,e.outputCount))}});var ky,Oy,sc,uc,lc=ae(()=>{\"use strict\";Te();De();nt();Re();ky=(e,r)=>{if(e.length<3||e.length>4)throw new Error(\"MatMulNBits requires 3 or 4 inputs\");let t=e[0],u=t.dims.length;if(t.dims[u-1]!==r.k)throw new Error(\"The last dim of input shape does not match the k value\");let s=Math.floor((r.k+r.blockSize-1)/r.blockSize),c=r.blockSize/8*r.bits,f=e[1];if(!K.areEqual(f.dims,[r.n,s,c]))throw new Error(\"The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize\");let g=e[2].dims;if(K.size(g)!==r.n*s)throw new Error(\"scales input size error.\");if(e.length===4){let C=e[3].dims,$=r.bits>4?r.n*s:r.n*Math.floor((s+1)/2);if(K.size(C)!==$)throw new Error(\"zeroPoints input size error.\")}},Oy=(e,r,t,u)=>{let s=e[0].dims,c=s.length,f=Math.floor((r.k+r.blockSize-1)/r.blockSize),d=s[c-2],g=r.k,w=r.n,C=s.slice(0,c-2),$=K.size(C),P=r.blockSize/8*r.bits/4,x=e[0].dataType,E=He(d),O=He(r.k),B=He(P),R=or(x),j=d*f*R,U=Math.floor(u/j),L=f<=t[0]&&U>0,F=!L||U>=4?He(w):U>=2&&He(w)>=2?2:1,te=C.concat([d,w]),J=K.size(te)/F/E,oe=L?[]:[{type:12,data:J},{type:12,data:r.blockSize}],le=[$,d,g/O],ge=K.convertShape(e[1].dims).slice();ge.splice(-1,1,P/B),oe.push(...se(le)),oe.push(...se(ge)),oe.push(...se(e[2].dims)),e.length===4&&oe.push(...se(K.convertShape(e[3].dims)));let X=[$,d,w/F];oe.push(...se(X));let pe=we=>{let ue=le.length,me=Z(\"a\",e[0].dataType,ue,O),Ee=Z(\"b\",12,ge.length,B),Pe=Z(\"scales\",e[2].dataType,e[2].dims.length),Ce=[me,Ee,Pe],be=e.length===4?Z(\"zero_points\",12,e[3].dims.length):void 0;be&&Ce.push(be);let Ae=X.length,_e=ne(\"output\",e[0].dataType,Ae,F),Je=[{name:\"output_size\",type:\"u32\"},{name:\"block_size\",type:\"u32\"}],ee=Ne(e[0].dataType),ce=(()=>{switch(O){case 1:return`array<${ee}, 8>`;case 2:return`mat4x2<${ee}>`;case 4:return`mat2x4<${ee}>`;default:throw new Error(`${O}-component is not supported.`)}})(),Be=`\n for (var word: u32 = 0; word < ${P}; word += ${B}) {\n ${Ee.indicesSet(\"b_indices\",\"2\",\"word\")};\n let b_data = ${Ee.getByIndices(\"b_indices\")};\n for (var i: u32 = 0; i < ${B}; i++) {\n let b_value: u32 = ${B===1?\"b_data\":\"b_data[word + i]\"};\n let b_mask: u32 = 0x0F0F0F0Fu;\n let b_value_lower: vec4 = unpack4xU8(b_value & b_mask);\n let b_value_upper: vec4 = unpack4xU8((b_value >> 4) & b_mask);\n let b_quantized_values = ${ce}(${Array.from({length:4},(Ye,Ke)=>`${ee}(b_value_lower[${Ke}]), ${ee}(b_value_upper[${Ke}])`).join(\", \")});\n let b_dequantized_values = ${(()=>O===1?`${ce}(${Array.from({length:8},(Ye,Ke)=>`(b_quantized_values[${Ke}] - zero_point) * scale`).join(\", \")});`:`(b_quantized_values - ${ce}(${Array(8).fill(\"zero_point\").join(\",\")})) * scale;`)()};\n // Number of B elements per 32-bit word is 32/bits = 32/4 = 8\n for (var m: u32 = 0; m < ${L?d:E}u; m++) {\n ${me.indicesSet(\"a_indices\",ue-2,L?\"m\":`row * ${E} + m`)};\n ${me.indicesSet(\"a_indices\",ue-1,\"word_offset\")};\n var input_offset = ${me.indicesToOffset(\"a_indices\")};\n var a_data: ${ce};\n for (var j: u32 = 0; j < ${8/O}; j++) {\n a_data[j] = ${me.getByOffset(\"input_offset\")};\n input_offset++;\n }\n ${L?\"workgroup_shared[workgroup_shared_offset + m]\":\"output_values[m]\"}${F>1?\"[c]\":\"\"} += ${Array.from({length:8/O},(Ye,Ke)=>`${O===1?`a_data[${Ke}] * b_dequantized_values[${Ke}]`:`dot(a_data[${Ke}], b_dequantized_values[${Ke}])`}`).join(\" + \")};\n }\n word_offset += ${8/O};\n }\n }`,tt=be?`\n zero_point_offset += 4;\n if (zero_point_offset == 32) {\n zero_point_offset = 0;\n zero_point_index++;\n zero_point_word = ${be.getByOffset(\"zero_point_index\")};\n }`:\"\";return L?`\n var workgroup_shared: array<${_e.type.value}, ${d*f}>;\n ${we.declareVariables(...Ce,_e)}\n ${we.mainStart([f,1,1])}\n var a_indices: ${me.type.indices};\n var block = local_id.x;\n var col = workgroup_id.y;\n var batch = workgroup_id.z;\n ${me.indicesSet(\"a_indices\",\"0\",\"batch\")};\n // Two zero points are packed into one byte when uniforms.bits is 4.\n for (var c: u32 = 0; c < ${F}; c++) {\n let col_times_components_plus_c = col * ${F} + c;\n ${be?`\n var zero_point_bytes_per_col: u32 = (${f} + 1) / 2;\n var zero_point_byte_count: u32 = col_times_components_plus_c * zero_point_bytes_per_col + (block >> 0x1u);\n var zero_point_word_index: u32 = zero_point_byte_count >> 0x2u;\n var zero_point_byte_offset: u32 = zero_point_byte_count & 0x3u;\n var zero_point_nibble_offset: u32 = block & 0x1u;\n var zero_point_bits_offset: u32 = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2);\n var zero_point_word: u32 = ${be.getByOffset(\"zero_point_word_index\")} >> zero_point_bits_offset;`:\"\"}\n var b_indices: ${Ee.type.indices};\n ${Ee.indicesSet(\"b_indices\",\"0\",\"col_times_components_plus_c\")};\n // The scale and zero points are computed per block.\n var scales_index = col_times_components_plus_c * ${f} + block;\n let scale = ${Pe.getByOffset(\"scales_index\")};\n // The default zero point is 8 for unsigned 4-bit quantization.\n let zero_point = ${ee}(${be?\"(zero_point_word) & 0xFu\":8});\n ${Ee.indicesSet(\"b_indices\",\"1\",\"block\")};\n var word_offset: u32 = block * ${r.blockSize/O};\n var workgroup_shared_offset: u32 = block * ${d};\n ${Be}\n }\n workgroupBarrier();\n if (local_id.x == 0u) {\n var output_indices: ${_e.type.indices};\n ${_e.indicesSet(\"output_indices\",\"0\",\"batch\")};\n ${_e.indicesSet(\"output_indices\",Ae-1,\"col\")};\n ${_e.indicesSet(\"output_indices\",Ae-2,\"0\")};\n var output_offset = ${_e.indicesToOffset(\"output_indices\")};\n for (var m: u32 = 0u; m < ${d}u; m++) {\n var output_value: ${_e.type.value} = ${_e.type.value}(0);\n var workgroup_shared_offset: u32 = m;\n for (var b: u32 = 0u; b < ${f}u; b++) {\n output_value += workgroup_shared[workgroup_shared_offset];\n workgroup_shared_offset += ${d};\n }\n ${_e.setByOffset(\"output_offset\",\"output_value\")};\n output_offset += ${w/F};\n }\n }\n }`:`\n ${we.registerUniforms(Je).declareVariables(...Ce,_e)}\n ${we.mainStart()}\n ${we.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n var output_values: array<${_e.type.value}, ${E}>;\n var output_indices = ${_e.offsetToIndices(\"global_idx\")};\n var col = ${_e.indicesGet(\"output_indices\",Ae-1)};\n var row = ${_e.indicesGet(\"output_indices\",Ae-2)};\n var a_indices: ${me.type.indices} = output_indices;\n // Two zero points are packed into one byte because uniforms.bits <= 4.\n // zero_point_offset is either 0 or 4. It is bit offset within one byte.\n // TODO support zero_point_offset for bits > 4\n ${be?`\n var zero_point_abs_offset = col * ${F} * ((${f} + 1) / 2);\n var zero_point_index: u32 = zero_point_abs_offset / 4;\n var zero_point_word: u32 = ${be.getByOffset(\"zero_point_index\")};\n var zero_point_offset: u32 = (zero_point_abs_offset % 4) * 8;`:\"\"}\n var scale_index = col * ${f*F};\n var b_indices: ${Ee.type.indices};\n for (var c: u32 = 0; c < ${F}; c++) {\n ${Ee.indicesSet(\"b_indices\",\"0\",`col * ${F} + c`)};\n var block_offset: u32 = 0;\n for (var block: u32 = 0; block < ${f}; block++) {\n // The scale and zero points are computed per block.\n let scale = ${Pe.getByOffset(\"scale_index\")};\n // The default zero point is 8 for unsigned 4-bit quantization.\n let zero_point = ${ee}(${be?\"extractBits(zero_point_word, zero_point_offset, 4)\":8});\n ${Ee.indicesSet(\"b_indices\",\"1\",\"block\")};\n var word_offset: u32 = block_offset;\n ${Be}\n scale_index++;\n ${tt}\n block_offset += uniforms.block_size / ${O};\n }\n // Drop the trailing 4 bits if the zero_poit_offset is not a byte boundary to align with the next byte.\n ${be?`if (zero_point_offset % 8 > 0) {\n ${tt}\n }`:\"\"}\n }\n for (var k: u32 = 0u; k < ${E}u; k++) {\n ${_e.indicesSet(\"output_indices\",Ae-2,`${E} * row + k`)};\n ${_e.setByIndices(\"output_indices\",\"output_values[k]\")}\n }\n }`};return{name:L?\"BlockwiseMatMulNBits\":\"MatMulNBits\",shaderCache:{hint:`${r.cacheKey};${d};${x};${e.length}`,inputDependencies:Array(e.length).fill(\"rank\")},getRunData:()=>({outputs:[{dims:te,dataType:x}],name:L?\"BlockwiseMatMulNBits\":\"MatMulNBits\",dispatchGroup:L?{x:1,y:Math.ceil(w/F),z:$}:{x:Math.ceil(J/64)},programUniforms:oe}),getShaderSource:pe}},sc=(e,r)=>{ky(e.inputs,r);let t=e.getMaxComputeWorkgroupSizes(),u=e.getMaxComputeWorkgroupStoragesize();e.compute(Oy(e.inputs,r,t,u))},uc=e=>ke(e)});var ft,Ry,cc,dc,By,po,fc,pc=ae(()=>{\"use strict\";Te();De();nt();Xn();Qi();Re();Dr();ft=(e,r)=>e.length>r&&e[r].dims.length>0&&K.size(e[r].dims)>0?e[r]:void 0,Ry=(e,r)=>{let t=e[0],u=ft(e,1),s=ft(e,2),c=ft(e,3),f=ft(e,4),d=ft(e,5),g=ft(e,6),w=ft(e,7);if(t.dims.length!==3&&t.dims.length!==5)throw new Error(\"Input query is expected to have 3 or 5 dimensions\");let C=!1,$=t.dims[0],A=t.dims[1],P=t.dims.length===3?C?t.dims[2]/3:t.dims[2]:r.numHeads*t.dims[4],x=A,E=0,O=0,B=Math.floor(P/r.numHeads);if(g&&w){if(g.dims.length!==4)throw new Error('Input \"past_key\" is expected to have 4 dimensions');if(g.dims[0]!==$||g.dims[1]!==r.numHeads||g.dims[3]!==B)throw new Error('Input \"past_key\" shape (batch_size, num_heads, past_sequence_length, head_size)');if(w.dims[0]!==$||w.dims[1]!==r.numHeads||w.dims[3]!==B)throw new Error('Input \"past_value\" shape (batch_size, num_heads, past_sequence_length, head_size)');if(g.dims[2]!==w.dims[2])throw new Error('Input \"past_key\" and \"past_value\" shall have same dim 2 (past_sequence_length)');if(w.dims.length!==4)throw new Error('Input \"past_value\" is expected to have 4 dimensions');E=g.dims[2],O=g.dims[2]}else if(g||w)throw new Error('Input \"past_key\" and \"past_value\" shall be both present or both absent');let R;if(u){if(t.dims.length!==3)throw new Error('Input \"query\" is expected to have 3 dimensions when key is given');if(u.dims.length<3||u.dims.length>5)throw new Error('Input \"key\" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==u.dims[0])throw new Error('Input \"query\" and \"key\" shall have same dim 0 (batch size)');if(u.dims.length===3){if(u.dims[2]!==t.dims[2])throw new Error('Input \"query\" and \"key\" shall have same dim 2 (hidden_size)');R=2,x=u.dims[1]}else if(u.dims.length===5){if(u.dims[2]!==r.numHeads||u.dims[3]!==2||u.dims[4]!==B)throw new Error('Expect \"key\" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(s)throw new Error('Expect \"value\" be none when \"key\" has packed kv format.');R=5,x=u.dims[1]}else{if(u.dims[1]!==r.numHeads||u.dims[3]!==B)throw new Error('Expect \"key\" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');R=0,x=u.dims[2]}}else{if(t.dims.length!==3&&t.dims.length!==5)throw new Error('Input \"query\" is expected to have 3 or 5 dimensions when key is empty');if(t.dims.length===5&&(t.dims[2]!==r.numHeads||t.dims[3]!==3))throw new Error('Expect \"query\" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');R=3}if(c){if(c.dims.length!==1)throw new Error('Input \"bias\" is expected to have 1 dimension');if(s&&t.dims.length===5&&t.dims[3]===2)throw new Error(\"bias is not allowed for packed kv.\")}let j=0;if(f){j=8;let J=f.dims;throw J.length===1?J[0]===$?j=1:J[0]===3*$+2&&(j=3):J.length===2&&J[0]===$&&J[1]===x&&(j=5),j===8?new Error('Input \"key_padding_mask\" shape shall be (batch_size) or (batch_size, kv_sequence_length)'):new Error(\"Mask not supported\")}let U=!1,L=P;if(s){if(s.dims.length!==3&&s.dims.length!==4)throw new Error('Input \"value\" is expected to have 3 or 4 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input \"query\" and \"value\" shall have same dim 0 (batch_size)');if(s.dims.length===3){if(x!==s.dims[1])throw new Error('Input \"key\" and \"value\" shall have the same dim 1 (kv_sequence_length)');L=s.dims[2]}else{if(x!==s.dims[2])throw new Error('Input \"past_key\" and \"past_value\" shall have the same dim 2 (kv_sequence_length)');L=s.dims[1]*s.dims[3],U=!0}}let F=E+x,te=!1;if(f)throw new Error(\"Key padding mask is not supported\");if(d){if(d.dims.length!==4)throw new Error('Input \"relative_position_bias\" is expected to have 4 dimensions');if(d.dims[0]!==$&&d.dims[0]!==1||d.dims[1]!==r.numHeads||d.dims[2]!==A||d.dims[3]!==F)throw new Error('Input \"relative_position_bias\" shape (batch_size, 1, sequence_length, kv_sequence_length)')}return{batchSize:$,sequenceLength:A,pastSequenceLength:E,kvSequenceLength:x,totalSequenceLength:F,maxSequenceLength:O,inputHiddenSize:0,hiddenSize:P,vHiddenSize:L,headSize:B,vHeadSize:Math.floor(L/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:j,scale:r.scale,broadcastResPosBias:te,passPastInKv:U,qkvFormat:R}},cc=e=>ke({...e}),dc=ke({perm:[0,2,1,3]}),By=(e,r,t,u,s,c,f)=>{let d=[u,s,c],g=K.size(d),w=[{type:12,data:g},{type:12,data:f},{type:12,data:c}],C=$=>{let A=ne(\"qkv_with_bias\",r.dataType,d),P=Z(\"qkv\",r.dataType,d),x=Z(\"bias\",t.dataType,d),E=[{name:\"output_size\",type:\"u32\"},{name:\"bias_offset\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"}];return`\n ${$.registerUniforms(E).declareVariables(P,x,A)}\n ${$.mainStart()}\n ${$.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset;\n\n qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx];\n }`};return e.compute({name:\"MultiHeadAttentionAddBias\",shaderCache:{inputDependencies:[\"type\",\"type\"]},getRunData:()=>({outputs:[{dims:d,dataType:r.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(g/64)},programUniforms:w}),getShaderSource:C},{inputs:[r,t],outputs:[-1]})[0]},po=(e,r,t,u,s,c,f,d)=>{let g=c;if(f){if(u===1)throw new Error(\"AddBiasReshape is not implemented. Please export your model with packed QKV or KV\");return g=By(e,c,f,r,u,t*s,d),g=g.reshape([r,u,t,s]),e.compute($t(g,dc.perm),{inputs:[g],outputs:[-1]})[0]}else return c.dims.length===3&&(g=c.reshape([r,u,t,s])),e.compute($t(g,dc.perm),{inputs:[g],outputs:[-1]})[0]},fc=(e,r)=>{let t=Ry(e.inputs,r),u=e.inputs[0],s=ft(e.inputs,1),c=ft(e.inputs,2),f=ft(e.inputs,3),d=ft(e.inputs,4),g=ft(e.inputs,5),w=ft(e.inputs,6),C=ft(e.inputs,7);if(u.dims.length===5)throw new Error(\"Packed QKV is not implemented\");if(s?.dims.length===5)throw new Error(\"Packed KV is not implemented\");let $=s&&c&&s.dims.length===4&&c.dims.length===4,A=po(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,u,f,0);if($)return ai(e,A,s,c,d,void 0,w,C,g,t,r);if(!s||!c)throw new Error(\"key and value must be provided\");let P=po(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.headSize,s,f,t.hiddenSize),x=po(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.vHeadSize,c,f,2*t.hiddenSize);ai(e,A,P,x,d,void 0,w,C,g,t,r)}});var Dy,zy,My,jy,Uy,Vy,Wy,Ny,mc,hc=ae(()=>{\"use strict\";Te();De();Re();Dy=e=>{if(!e||e.length<1)throw new Error(\"Too few inputs\");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error(\"Input type must be float or float16.\");if(e.length>=2){let r=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(r=e[3].dims[0]*2===e[1].dims[0]),!r)throw new Error(\"The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].\")}},zy=(e,r,t)=>{let u=\"\";for(let s=r-1;s>=0;--s)u+=`\n k = i32(${e.indicesGet(\"indices\",s)}) - ${xe(\"uniforms.pads\",s,t)};\n if (k < 0) {\n break;\n }\n if (k >= i32(${xe(\"uniforms.x_shape\",s,r)})) {\n break;\n }\n offset += k * i32(${xe(\"uniforms.x_strides\",s,r)});\n `;return`\n value = ${e.type.value}(uniforms.constant_value);\n for (var i = 0; i < 1; i++) {\n var offset = 0;\n var k = 0;\n ${u}\n value = x[offset];\n }\n `},My=(e,r,t)=>{let u=\"\";for(let s=r-1;s>=0;--s)u+=`\n k = i32(${e.indicesGet(\"indices\",s)}) - ${xe(\"uniforms.pads\",s,t)};\n if (k < 0) {\n k = -k;\n }\n {\n let _2n_1 = 2 * (i32(${xe(\"uniforms.x_shape\",s,r)}) - 1);\n k = k % _2n_1;\n if(k >= i32(${xe(\"uniforms.x_shape\",s,r)})) {\n k = _2n_1 - k;\n }\n }\n offset += k * i32(${xe(\"uniforms.x_strides\",s,r)});\n `;return`\n var offset = 0;\n var k = 0;\n ${u}\n value = x[offset];\n `},jy=(e,r,t)=>{let u=\"\";for(let s=r-1;s>=0;--s)u+=`\n k = i32(${e.indicesGet(\"indices\",s)}) - ${xe(\"uniforms.pads\",s,t)};\n if (k < 0) {\n k = 0;\n }\n if (k >= i32(${xe(\"uniforms.x_shape\",s,r)})) {\n k = i32(${xe(\"uniforms.x_shape\",s,r)}) - 1;\n }\n offset += k * i32(${xe(\"uniforms.x_strides\",s,r)});\n `;return`\n var offset = 0;\n var k = 0;\n ${u}\n value = x[offset];\n `},Uy=(e,r,t)=>{let u=\"\";for(let s=r-1;s>=0;--s)u+=`\n k = i32(${e.indicesGet(\"indices\",s)}) - ${xe(\"uniforms.pads\",s,t)};\n if (k < 0) {\n k += i32(${xe(\"uniforms.x_shape\",s,r)}]);\n }\n if (k >= i32(${xe(\"uniforms.x_shape\",s,r)})) {\n k -= i32(${xe(\"uniforms.x_shape\",s,r)});\n }\n offset += k * i32(${xe(\"uniforms.x_strides\",s,r)});\n `;return`\n var offset = 0;\n var k = 0;\n ${u}\n value = x[offset];\n `},Vy=(e,r,t)=>{switch(t.mode){case 0:return zy(e,r,t.pads.length);case 1:return My(e,r,t.pads.length);case 2:return jy(e,r,t.pads.length);case 3:return Uy(e,r,t.pads.length);default:throw new Error(\"Invalid mode\")}},Wy=(e,r)=>{let t=K.padShape(e[0].dims.slice(),r.pads),u=e[0].dims,s=K.size(t),c=[{type:12,data:s},{type:6,data:r.pads}];r.mode===0&&c.push({type:e[0].dataType,data:r.value}),c.push(...se(e[0].dims,t));let f=[\"rank\"],d=g=>{let w=ne(\"output\",e[0].dataType,t.length),C=Z(\"x\",e[0].dataType,u.length),$=C.type.value,A=Vy(w,u.length,r),P=[{name:\"output_size\",type:\"u32\"},{name:\"pads\",type:\"i32\",length:r.pads.length}];return r.mode===0&&P.push({name:\"constant_value\",type:$}),`\n ${g.registerUniforms(P).declareVariables(C,w)}\n ${g.mainStart()}\n ${g.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n\n let indices = ${w.offsetToIndices(\"global_idx\")};\n\n var value = ${$}(0);\n ${A}\n output[global_idx] = value;\n }`};return{name:\"Pad\",shaderCache:{hint:`${r.mode}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(K.size(t)/64)},programUniforms:c}),getShaderSource:d}},Ny=(e,r)=>{if(e.length>1){let t=e[1].getBigInt64Array(),u=e.length>=3&&e[2].data?e[2].getFloat32Array()[0]:0,s=e[0].dims.length,c=new Int32Array(2*s).fill(0);if(e.length>=4){let d=e[3].getBigInt64Array();for(let g=0;gc[Number(g)]=Number(d));let f=[];return c.forEach(d=>f.push(d)),{mode:r.mode,value:u,pads:f}}else return r},mc=(e,r)=>{Dy(e.inputs);let t=Ny(e.inputs,r);e.compute(Wy(e.inputs,t),{inputs:[0]})}});var yi,gc,yc,bc,vc,Gy,Hy,wc,_c,$c,Cc,Sc,xc,Ic,Ac,Tc,Ec,Pc,kc,Oc=ae(()=>{\"use strict\";Rr();Te();De();Re();yi=e=>{if(Or.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error(\"Pool ops requires 1 input.\")},gc=(e,r,t)=>{let u=r.format===\"NHWC\",s=e.dims.slice();u&&s.splice(1,0,s.pop());let c=Object.hasOwnProperty.call(r,\"dilations\"),f=r.kernelShape.slice(),d=r.strides.slice(),g=c?r.dilations.slice():[],w=r.pads.slice();sr.adjustPoolAttributes(t,s,f,d,g,w);let C=sr.computePoolOutputShape(t,s,d,g,f,w,r.autoPad),$=Object.assign({},r);c?Object.assign($,{kernelShape:f,strides:d,pads:w,dilations:g,cacheKey:r.cacheKey}):Object.assign($,{kernelShape:f,strides:d,pads:w,cacheKey:r.cacheKey});let A=C.slice();return A.push(A.splice(1,1)[0]),[$,u?A:C]},yc=(e,r)=>{let t=r.format===\"NHWC\",u=K.size(e),s=K.size(r.kernelShape),c=[{type:12,data:u},{type:12,data:s}],f=[{name:\"outputSize\",type:\"u32\"},{name:\"kernelSize\",type:\"u32\"}];if(r.kernelShape.length<=2){let d=r.kernelShape[r.kernelShape.length-1],g=r.strides[r.strides.length-1],w=r.pads[r.pads.length/2-1],C=r.pads[r.pads.length-1],$=!!(w+C);c.push({type:12,data:d},{type:12,data:g},{type:12,data:w},{type:12,data:C}),f.push({name:\"kw\",type:\"u32\"},{name:\"sw\",type:\"u32\"},{name:\"pwStart\",type:\"u32\"},{name:\"pwEnd\",type:\"u32\"});let A=!1;if(r.kernelShape.length===2){let P=r.kernelShape[r.kernelShape.length-2],x=r.strides[r.strides.length-2],E=r.pads[r.pads.length/2-2],O=r.pads[r.pads.length-2];A=!!(E+O),c.push({type:12,data:P},{type:12,data:x},{type:12,data:E},{type:12,data:O}),f.push({name:\"kh\",type:\"u32\"},{name:\"sh\",type:\"u32\"},{name:\"phStart\",type:\"u32\"},{name:\"phEnd\",type:\"u32\"})}return[c,f,!0,$,A]}else{if(t)throw new Error(\"Pooling with kernelShape.length > 2 is not supported for NHWC format.\");let d=K.computeStrides(r.kernelShape);c.push({type:12,data:d},{type:12,data:r.pads},{type:12,data:r.strides}),f.push({name:\"kernelStrides\",type:\"u32\",length:d.length},{name:\"pads\",type:\"u32\",length:r.pads.length},{name:\"strides\",type:\"u32\",length:r.strides.length});let g=r.pads.reduce((w,C)=>w+C);return[c,f,!!g,!1,!1]}},bc=(e,r,t,u,s,c,f,d,g,w,C,$)=>{let A=s.format===\"NHWC\",P=r.type.value,x=ne(\"output\",r.type.tensor,u);if(s.kernelShape.length<=2){let E=\"\",O=\"\",B=\"\",R=t-(A?2:1);if(C?E=`\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\n xIndices[${R}] = indices[${R}] * uniforms.sw - uniforms.pwStart + i;\n if (xIndices[${R}] < 0 || xIndices[${R}]\n >= uniforms.x_shape[${R}]) {\n pad++;\n continue;\n }\n let x_val = x[${r.indicesToOffset(\"xIndices\")}];\n ${c}\n }`:E=`\n for (var i: u32 = 0u; i < uniforms.kw; i++) {\n xIndices[${R}] = indices[${R}] * uniforms.sw - uniforms.pwStart + i;\n let x_val = x[${r.indicesToOffset(\"xIndices\")}];\n ${c}\n }`,s.kernelShape.length===2){let U=t-(A?3:2);$?O=`\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\n xIndices[${U}] = indices[${U}] * uniforms.sh - uniforms.phStart + j;\n if (xIndices[${U}] < 0 || xIndices[${U}] >= uniforms.x_shape[${U}]) {\n pad += i32(uniforms.kw);\n continue;\n }\n `:O=`\n for (var j: u32 = 0u; j < uniforms.kh; j++) {\n xIndices[${U}] = indices[${U}] * uniforms.sh - uniforms.phStart + j;\n `,B=`\n }\n `}return`\n ${e.registerUniforms(g).declareVariables(r,x)}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n\n let indices = ${x.offsetToIndices(\"global_idx\")};\n var xIndices = ${x.offsetToIndices(\"global_idx\")};\n\n var value = ${P}(${d});\n var pad = 0;\n ${O}\n ${E}\n ${B}\n ${f}\n\n output[global_idx] = value;\n }`}else{if(A)throw new Error(\"Pooling with kernelShape.length > 2 is not supported for NHWC format.\");let E=s.kernelShape.length,O=s.pads.length,B=\"\";return w?B=`\n if (xIndices[j] >= uniforms.x_shape[j]) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n let x_val = x[${r.indicesToOffset(\"xIndices\")}];\n ${c}\n }`:B=`\n }\n let x_val = x[${r.indicesToOffset(\"xIndices\")}];\n ${c}\n `,`\n ${e.registerUniforms(g).declareVariables(r,x)}\n\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n let indices = ${x.offsetToIndices(\"global_idx\")};\n var xIndices = ${x.offsetToIndices(\"global_idx\")};\n\n var offsets: array;\n\n var value = ${P}(${d});\n var pad = 0;\n var isPad = false;\n\n for (var i: u32 = 0u; i < uniforms.kernelSize; i++) {\n var offset = i;\n for (var j = 0u; j < ${E-1}u; j++) {\n offsets[j] = offset / ${xe(\"uniforms.kernelStrides\",\"j\",E)};\n offset -= offsets[j] * ${xe(\"uniforms.kernelStrides\",\"j\",E)};\n }\n offsets[${E-1}] = offset;\n\n isPad = false;\n for (var j = ${t-E}u; j < ${t}u; j++) {\n xIndices[j] = indices[j] * ${xe(\"uniforms.strides\",`j - ${t-E}u`,E)}\n + offsets[j - ${t-E}u] - ${xe(\"uniforms.pads\",\"j - 2u\",O)};\n ${B}\n }\n ${f}\n\n output[global_idx] = value;\n }`}},vc=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Gy=e=>`${vc(e)};${e.countIncludePad}`,Hy=e=>`${vc(e)};${e.storageOrder};${e.dilations}`,wc=e=>({format:e.format,autoPad:[\"NOTSET\",\"VALID\",\"SAME_UPPER\",\"SAME_LOWER\"][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),_c=(e,r,t,u)=>{let[s,c]=gc(r,u,t),f=Z(\"x\",r.dataType,r.dims.length),d=f.type.value,g=\"value += x_val;\",w=\"\";s.countIncludePad?w+=`value /= ${d}(uniforms.kernelSize);`:w+=`value /= ${d}(i32(uniforms.kernelSize) - pad);`;let[C,$,A,P,x]=yc(c,s);C.push(...se(r.dims,c));let E=[\"rank\"];return{name:e,shaderCache:{hint:`${u.cacheKey};${A};${P};${x}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:c,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(K.size(c)/64)},programUniforms:C}),getShaderSource:O=>bc(O,f,r.dims.length,c.length,s,g,w,0,$,A,P,x)}},$c=e=>{let r=e.count_include_pad!==0,t=wc(e);if(t.ceilMode!==0)throw new Error(\"using ceil() in shape computation is not yet supported for AveragePool\");let u={countIncludePad:r,...t,cacheKey:\"\"};return{...u,cacheKey:Gy(u)}},Cc=(e,r)=>{yi(e.inputs),e.compute(_c(\"AveragePool\",e.inputs[0],!1,r))},Sc={autoPad:\"\",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},xc=e=>{let r=e.format;return{format:r,...Sc,cacheKey:r}},Ic=(e,r)=>{yi(e.inputs),e.compute(_c(\"GlobalAveragePool\",e.inputs[0],!0,r))},Ac=(e,r,t,u)=>{let[s,c]=gc(r,u,t),f=`\n value = max(x_val, value);\n `,d=\"\",g=Z(\"x\",r.dataType,r.dims.length),w=[\"rank\"],[C,$,A,P,x]=yc(c,s);return C.push(...se(r.dims,c)),{name:e,shaderCache:{hint:`${u.cacheKey};${A};${P};${x}`,inputDependencies:w},getRunData:()=>({outputs:[{dims:c,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(K.size(c)/64)},programUniforms:C}),getShaderSource:E=>bc(E,g,r.dims.length,c.length,s,f,d,r.dataType===10?-65504:-1e5,$,A,P,x)}},Tc=(e,r)=>{yi(e.inputs),e.compute(Ac(\"MaxPool\",e.inputs[0],!1,r))},Ec=e=>{let r=e.storage_order,t=e.dilations,u=wc(e);if(r!==0)throw new Error(\"column major storage order is not yet supported for MaxPool\");if(u.ceilMode!==0)throw new Error(\"using ceil() in shape computation is not yet supported for MaxPool\");let s={storageOrder:r,dilations:t,...u,cacheKey:\"\"};return{...s,cacheKey:Hy(s)}},Pc=e=>{let r=e.format;return{format:r,...Sc,cacheKey:r}},kc=(e,r)=>{yi(e.inputs),e.compute(Ac(\"GlobalMaxPool\",e.inputs[0],!0,r))}});var Fy,qy,Rc,Bc=ae(()=>{\"use strict\";Rr();Te();Re();Fy=(e,r,t)=>{let u=e===r,s=er&&t>0;if(u||s||c)throw new Error(\"Range these inputs' contents are invalid.\")},qy=(e,r,t,u)=>{let s=Math.abs(Math.ceil((r-e)/t)),c=[s],f=s,d=[{type:12,data:f},{type:u,data:e},{type:u,data:t},...se(c)],g=w=>{let C=ne(\"output\",u,c.length),$=C.type.value,A=[{name:\"outputSize\",type:\"u32\"},{name:\"start\",type:$},{name:\"delta\",type:$}];return`\n ${w.registerUniforms(A).declareVariables(C)}\n ${w.mainStart()}\n ${w.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n output[global_idx] = uniforms.start + ${$}(global_idx) * uniforms.delta;\n }`};return{name:\"Range\",shaderCache:{hint:`${u}`},getShaderSource:g,getRunData:()=>({outputs:[{dims:c,dataType:u}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:d})}},Rc=e=>{let r=0,t=0,u=0;e.inputs[0].dataType===6?(r=e.inputs[0].getInt32Array()[0],t=e.inputs[1].getInt32Array()[0],u=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(r=e.inputs[0].getFloat32Array()[0],t=e.inputs[1].getFloat32Array()[0],u=e.inputs[2].getFloat32Array()[0]),Or.webgpu.validateInputContent&&Fy(r,t,u),e.compute(qy(r,t,u,e.inputs[0].dataType),{inputs:[]})}});var Ky,Yy,Zy,Qy,Xy,Jy,e0,t0,r0,n0,i0,Dc,o0,a0,s0,u0,l0,zc,Mc,jc=ae(()=>{\"use strict\";Te();De();nt();Re();Ky=(e,r)=>{if(e.every(t=>t>0||(()=>{throw new Error(\"Resize requires scales input values to be positive\")})),e.length>0){if(r.mode===\"linear\"){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw new Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and\n one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(r.mode===\"cubic\"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error(\"Resize requires scales input size to be 2 or 4 for cubic mode\")}},Yy=(e,r,t)=>{r.every(s=>s>=0&&s{throw new Error(\"Resize requires axes input values to be positive and less than rank\")}));let u=new Array(t).fill(1);return r.forEach((s,c)=>u[s]=e[c]),u},Zy=(e,r,t,u,s,c)=>{let[f,d,g]=t>10?[1,2,3]:[-1,e.length>1?1:-1,-1],w=e[0].dims.length;if(f>0&&e.length>f&&e[f].dims.length>0)e[f].getFloat32Array().forEach(C=>c.push(C));else if(r.coordinateTransformMode===\"tf_crop_and_resize\")throw new Error(\"Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize\");if(d>0&&e.length>d&&e[d].dims.length>0){if(e[d].getFloat32Array().forEach(C=>u.push(C)),u.length!==0&&u.length!==w&&t>=18&&u.length!==r.axes.length)throw new Error(\"Resize requires scales input size to be same as input rank or axes size for opset 18 and up\");Ky(u,r),r.axes.length>0&&Yy(u,r.axes,w).forEach((C,$)=>u[$]=C)}if(g>0&&e.length>g&&(e[g].getBigInt64Array().forEach(C=>s.push(Number(C))),s.length!==w||t>=18&&s.length===r.axes.length))throw new Error(\"Resize requires sizes input size to be same as input rank or axes size for opset 18 and up\");if(r.axes.length>0){if(u.length!==r.axes.length)throw new Error('Resize requires \"scales\" input size to be of axes rank when axes attributes is specified');if(s.length!==r.axes.length)throw new Error('Resize requires \"sizes\" input size to be of rank axes rank when axes attributes is specified')}if(typeof u<\"u\"&&typeof s<\"u\"&&u.length>0&&s.length>w)throw new Error(\"Resize requires only of scales or sizes to be specified\")},Qy=(e,r)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32,\n lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${r} { `+(()=>{switch(e){case\"asymmetric\":return`return ${r}(xResized) / ${r}(xScale);`;case\"pytorch_half_pixel\":return`if (lengthResized > 1) {\n return (${r}(xResized) + 0.5) / ${r}(xScale) - 0.5;\n } else {\n return 0.0;\n }`;case\"tf_half_pixel_for_nn\":return`return (${r}(xResized) + 0.5) / ${r}(xScale);`;case\"align_corners\":return`if (lengthResized == 1) {\n return 0.0;\n } else {\n // The whole part and the fractional part are calculated separately due to inaccuracy of floating\n // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an\n // offset-by-one error later in floor().\n let whole = ${r}(xResized * (lengthOriginal - 1) / (lengthResized - 1));\n let fract =\n ${r}(xResized * (lengthOriginal - 1) % (lengthResized - 1)) / ${r}(lengthResized - 1);\n return whole + fract;\n }`;case\"tf_crop_and_resize\":return`if (lengthResized > 1) {\n return ${r}(roiStart) * ${r}(lengthOriginal - 1) +\n (${r}(xResized) * ${r}(roiEnd - roiStart) * ${r}(lengthOriginal - 1)) /\n ${r}(lengthResized - 1);\n } else {\n return 0.5 * ${r}(roiStart + roiEnd) * ${r}(lengthOriginal - 1);\n }`;case\"half_pixel_symmetric\":return`const outputWidth = ${r}xScale * ${r}(lengthResized);\n const adjustment = ${r}(lengthResized) / outputWidth;\n const center = ${r}(lengthOriginal) / 2;\n const offset = center * (1 - adjustment);\n return offset + ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;case\"half_pixel\":return`return ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+\"}\",Xy=(e,r,t)=>`fn getNearestPixelFromOriginal(xOriginal: ${t}, isDownSample: bool) -> ${t} {`+(()=>{switch(e){case\"round_prefer_ceil\":return\"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }\";case\"floor\":return\"return floor(xOriginal);\";case\"ceil\":return\"return ceil(xOriginal);\";case\"round_prefer_floor\":return\"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }\";case\"simple\":default:if(r<11)return\"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }\";throw new Error(`Nearest mode ${e} is not supported`)}})()+\"}\",Jy=(e,r,t)=>{let u=new Array(t).fill(0).concat(new Array(t).fill(1)),s=e.length===0?u:e.slice();return r.length>0?(r.forEach((c,f)=>{u[c]=s[f],u[f+t]=s[r.length+f]}),u):s},e0=(e,r,t,u)=>{let s=[];if(t.length>0)if(u.length>0){if(e.forEach(c=>s.push(c)),Math.max(...u)>e.length)throw new Error(\"axes is out of bound\");u.forEach((c,f)=>s[c]=t[f])}else t.forEach(c=>s.push(c));else{if(r.length===0)throw new Error(\"Resize requires either scales or sizes.\");s=e.map((c,f)=>Math.round(c*r[f]))}return s},t0=(e,r,t)=>{let u=(()=>{switch(t.keepAspectRatioPolicy){case\"not_larger\":return t.axes.length>0?Math.min(...t.axes.map(c=>r[c]),Number.MAX_VALUE):Math.min(...r,Number.MAX_VALUE);case\"not_smaller\":return t.axes.length>0?Math.max(...t.axes.map(c=>r[c]),Number.MIN_VALUE):Math.max(...r,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${t.keepAspectRatioPolicy} is not supported`)}})();r.fill(1,0,r.length);let s=e.slice();return t.axes.length>0?(t.axes.forEach(c=>r[c]=u),t.axes.forEach(c=>s[c]=Math.round(e[c]*r[c]))):(r.fill(u,0,r.length),s.forEach((c,f)=>s[f]=Math.round(c*r[f]))),s},r0=(e,r,t,u,s)=>`\n fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${t.length}> {\n var original_indices: array<${e.type.value}, ${t.length}>;\n for (var i:u32 = 0; i < ${t.length}; i++) {\n var output_index = ${e.indicesGet(\"output_indices\",\"i\")};\n var scale = ${xe(\"uniforms.scales\",\"i\",u)};\n var roi_low = ${xe(\"uniforms.roi\",\"i\",s)};\n var roi_hi = ${xe(\"uniforms.roi\",`i + ${r.length}`,s)};\n if (scale == 1.0) {\n original_indices[i] = ${e.type.value}(output_index);\n } else {\n var input_shape_i = ${xe(\"uniforms.input_shape\",\"i\",r.length)};\n var output_shape_i = ${xe(\"uniforms.output_shape\",\"i\",t.length)};\n original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\n input_shape_i, roi_low, roi_hi);\n }\n }\n return original_indices;\n }`,n0=(e,r,t,u,s,c,f)=>`\n fn calculateInputIndicesFromOutputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} {\n var input_indices: ${e.type.indices};\n for (var i:u32 = 0; i < ${u.length}; i++) {\n var output_index = ${r.indicesGet(\"output_indices\",\"i\")};\n var input_index: u32;\n var scale = ${xe(\"uniforms.scales\",\"i\",s)};\n if (scale == 1.0) {\n input_index = output_index;\n } else {\n var roi_low = ${xe(\"uniforms.roi\",\"i\",c)};\n var roi_hi = ${xe(\"uniforms.roi\",`i + ${t.length}`,c)};\n var input_shape_i = ${xe(\"uniforms.input_shape\",\"i\",t.length)};\n var output_shape_i = ${xe(\"uniforms.output_shape\",\"i\",u.length)};\n var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i,\n input_shape_i, roi_low, roi_hi);\n if (!${f} || (original_idx >= 0 && original_idx < ${r.type.value}(input_shape_i))) {\n if (original_idx < 0) {\n input_index = 0;\n } else if (original_idx > ${r.type.value}(input_shape_i - 1)) {\n input_index = input_shape_i - 1;\n } else {\n input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1));\n }\n } else {\n input_index = u32(original_idx);\n }\n }\n ${e.indicesSet(\"input_indices\",\"i\",\" input_index\")}\n }\n return input_indices;\n }`,i0=(e,r)=>`\n fn checkInputIndices(input_indices: ${e.type.indices}) -> bool {\n for (var i:u32 = 0; i < ${r.length}; i++) {\n var input_index = ${e.indicesGet(\"input_indices\",\"i\")};\n if (input_index < 0 || input_index >= ${xe(\"uniforms.input_shape\",\"i\",r.length)}) {\n return false;\n }\n }\n return true;\n }`,Dc=(e,r,t,u)=>e.rank>u?`\n ${e.indicesSet(\"input_indices\",r,\"channel\")};\n ${e.indicesSet(\"input_indices\",t,\"batch\")};\n`:\"\",o0=(e,r,t,u,s)=>{let[f,d,g,w]=t.length===2?[-1,0,1,-1]:[0,2,3,1],C=e.type.value;return`\n fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${C} {\n var input_indices: ${e.type.indices};\n ${e.indicesSet(\"input_indices\",d,`max(0, min(row, ${t[d]} - 1))`)};\n ${e.indicesSet(\"input_indices\",g,`max(0, min(col, ${t[g]} - 1))`)};\n ${Dc(e,w,f,2)}\n return ${e.getByIndices(\"input_indices\")};\n }\n\n fn bilinearInterpolation(output_indices: ${r.type.indices}) -> ${C} {\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\n var row:${C} = originalIndices[${d}];\n var col:${C} = originalIndices[${g}];\n ${u?`if (row < 0 || row > (${t[d]} - 1) || col < 0 || col > (${t[g]} - 1)) {\n return ${s};\n }`:\"\"};\n row = max(0, min(row, ${t[d]} - 1));\n col = max(0, min(col, ${t[g]} - 1));\n var row1: u32 = u32(row);\n var col1: u32 = u32(col);\n var row2: u32 = u32(row + 1);\n var col2: u32 = u32(col + 1);\n var channel: u32 = ${t.length>2?`u32(originalIndices[${w}])`:\"0\"};\n var batch: u32 = ${t.length>2?`u32(originalIndices[${f}])`:\"0\"};\n var x11: ${C} = getInputValue(batch, channel, row1, col1);\n var x12: ${C} = getInputValue(batch, channel, row1, col2);\n var x21: ${C} = getInputValue(batch, channel, row2, col1);\n var x22: ${C} = getInputValue(batch, channel, row2, col2);\n var dx1: ${C} = abs(row - ${C}(row1));\n var dx2: ${C} = abs(${C}(row2) - row);\n var dy1: ${C} = abs(col - ${C}(col1));\n var dy2: ${C} = abs(${C}(col2) - col);\n if (row1 == row2) {\n dx1 = 0.5;\n dx2 = 0.5;\n }\n if (col1 == col2) {\n dy1 = 0.5;\n dy2 = 0.5;\n }\n return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1);\n }`},a0=(e,r,t,u,s,c,f,d,g,w)=>{let C=t.length===2,$=!0,[A,P]=C?[0,1]:$?[2,3]:[1,2],x=e.type.value,E=O=>{let B=O===A?\"row\":\"col\";return`\n fn ${B}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${r.type.indices}) -> ${x} {\n var output_index = ${r.indicesGet(\"output_indices\",O)};\n var originalIdx: ${x} = getOriginalCoordinateFromResizedCoordinate(output_index, ${s[O]},\n ${u[O]}, ${t[O]}, ${c[O]}, ${c[O]} + ${t.length});\n var fractOriginalIdx: ${x} = originalIdx - floor(originalIdx);\n var coefs = getCubicInterpolationCoefs(fractOriginalIdx);\n\n if (${d} && (originalIdx < 0 || originalIdx > (${t[O]} - 1))) {\n return ${g};\n }\n var data: array<${x}, 4> = array<${x}, 4>(0.0, 0.0, 0.0, 0.0);\n for (var i: i32 = -1; i < 3; i++) {\n var ${B}: ${x} = originalIdx + ${x}(i);\n if (${B} < 0 || ${B} >= ${t[O]}) {\n ${(()=>w?`coefs[i + 1] = 0.0;\n continue;`:d?`return ${g};`:`${B} = max(0, min(${B}, ${t[O]} - 1));`)()};\n }\n var input_indices_copy: ${e.type.indices} = input_indices;\n ${e.indicesSet(\"input_indices_copy\",O,`u32(${B})`)};\n data[i + 1] = ${O===A?e.getByIndices(\"input_indices_copy\"):\"rowCubicInterpolation(input_indices_copy, output_indices)\"};\n }\n return cubicInterpolation1D(data, coefs);\n }`};return`\n ${E(A)};\n ${E(P)};\n fn getCubicInterpolationCoefs(s: ${x}) -> array<${x}, 4> {\n var absS = abs(s);\n var coeffs: array<${x}, 4> = array<${x}, 4>(0.0, 0.0, 0.0, 0.0);\n var oneMinusAbsS: ${x} = 1.0 - absS;\n var twoMinusAbsS: ${x} = 2.0 - absS;\n var onePlusAbsS: ${x} = 1.0 + absS;\n coeffs[0] = ((${f} * onePlusAbsS - 5 * ${f}) * onePlusAbsS + 8 * ${f}) * onePlusAbsS - 4 * ${f};\n coeffs[1] = ((${f} + 2) * absS - (${f} + 3)) * absS * absS + 1;\n coeffs[2] = ((${f} + 2) * oneMinusAbsS - (${f} + 3)) * oneMinusAbsS * oneMinusAbsS + 1;\n coeffs[3] = ((${f} * twoMinusAbsS - 5 * ${f}) * twoMinusAbsS + 8 * ${f}) * twoMinusAbsS - 4 * ${f};\n return coeffs;\n }\n\n fn cubicInterpolation1D(x: array<${x}, 4>, coefs: array<${x}, 4>) -> ${x} {\n var coefsSum: ${x} = coefs[0] + coefs[1] + coefs[2] + coefs[3];\n return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum;\n }\n\n fn bicubicInterpolation(output_indices: ${r.type.indices}) -> ${x} {\n var input_indices: ${e.type.indices} = output_indices;\n return colCubicInterpolation(input_indices, output_indices);\n }\n `},s0=(e,r,t,u,s)=>{let[f,d,g,w,C]=t.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],$=e.type.value;return`\n fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${$} {\n var input_indices: ${e.type.indices};\n ${e.indicesSet(\"input_indices\",d,`max(0, min(depth, ${t[d]} - 1))`)};\n ${e.indicesSet(\"input_indices\",g,`max(0, min(height, ${t[g]} - 1))`)};\n ${e.indicesSet(\"input_indices\",w,`max(0, min(width, ${t[w]} - 1))`)};\n ${Dc(e,C,f,3)}\n return ${e.getByIndices(\"input_indices\")};\n }\n\n fn trilinearInterpolation(output_indices: ${r.type.indices}) -> ${$} {\n var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices);\n var depth:${$} = originalIndices[${d}];\n var height:${$} = originalIndices[${g}];\n var width:${$} = originalIndices[${w}];\n ${u?`if (depth < 0 || depth > (${t[d]} - 1) || height < 0 || height > (${t[g]} - 1) || width < 0 || (width > ${t[w]} - 1)) {\n return ${s};\n }`:\"\"};\n\n depth = max(0, min(depth, ${t[d]} - 1));\n height = max(0, min(height, ${t[g]} - 1));\n width = max(0, min(width, ${t[w]} - 1));\n var depth1: u32 = u32(depth);\n var height1: u32 = u32(height);\n var width1: u32 = u32(width);\n var depth2: u32 = u32(depth + 1);\n var height2: u32 = u32(height + 1);\n var width2: u32 = u32(width + 1);\n var channel: u32 = ${t.length>3?`u32(originalIndices[${C}])`:\"0\"};\n var batch: u32 = ${t.length>3?`u32(originalIndices[${f}])`:\"0\"};\n\n var x111: ${$} = getInputValue(batch, channel, depth1, height1, width1);\n var x112: ${$} = getInputValue(batch, channel, depth1, height1, width2);\n var x121: ${$} = getInputValue(batch, channel, depth1, height2, width1);\n var x122: ${$} = getInputValue(batch, channel, depth1, height2, width2);\n var x211: ${$} = getInputValue(batch, channel, depth2, height1, width1);\n var x212: ${$} = getInputValue(batch, channel, depth2, height1, width2);\n var x221: ${$} = getInputValue(batch, channel, depth2, height2, width1);\n var x222: ${$} = getInputValue(batch, channel, depth2, height2, width2);\n var dx1: ${$} = abs(depth - ${$}(depth1));\n var dx2: ${$} = abs(${$}(depth2) - depth);\n var dy1: ${$} = abs(height - ${$}(height1));\n var dy2: ${$} = abs(${$}(height2) - height);\n var dz1: ${$} = abs(width - ${$}(width1));\n var dz2: ${$} = abs(${$}(width2) - width);\n if (depth1 == depth2) {\n dx1 = 0.5;\n dx2 = 0.5;\n }\n if (height1 == height2) {\n dy1 = 0.5;\n dy2 = 0.5;\n }\n if (width1 == width2) {\n dz1 = 0.5;\n dz2 = 0.5;\n }\n return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 +\n x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1);\n }`},u0=(e,r,t,u,s,c)=>{let f=e.dims,d=Jy(c,r.axes,f.length),g=e0(f,u,s,r.axes),w=u.slice();u.length===0&&(w=f.map((R,j)=>R===0?1:g[j]/R),r.keepAspectRatioPolicy!==\"stretch\"&&(g=t0(f,w,r)));let C=ne(\"output\",e.dataType,g.length),$=Z(\"input\",e.dataType,f.length),A=K.size(g),P=f.length===g.length&&f.every((R,j)=>R===g[j]),x=r.coordinateTransformMode===\"tf_crop_and_resize\",E=r.extrapolationValue,O=$.type.value,B=R=>`\n ${P?\"\":`\n ${Qy(r.coordinateTransformMode,O)};\n ${(()=>{switch(r.mode){case\"nearest\":return`\n ${i0($,f)};\n ${Xy(r.nearestMode,t,O)};\n ${n0($,C,f,g,w.length,d.length,x)};\n `;case\"linear\":return`\n ${r0(C,f,g,w.length,d.length)};\n ${(()=>{if(f.length===2||f.length===4)return`${o0($,C,f,x,E)}`;if(f.length===3||f.length===5)return`${s0($,C,f,x,E)}`;throw Error(\"Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.\")})()};\n `;case\"cubic\":return`\n ${(()=>{if(f.length===2||f.length===4)return`${a0($,C,f,g,w,d,r.cubicCoeffA,x,r.extrapolationValue,r.excludeOutside)}`;throw Error(\"Cubic mode only supports input dims 2 and 4 are supported in linear mode.\")})()};\n `;default:throw Error(\"Invalid resize mode\")}})()};\n `}\n ${R.registerUniform(\"output_size\",\"u32\").registerUniform(\"scales\",\"f32\",w.length).registerUniform(\"roi\",\"f32\",d.length).declareVariables($,C)}\n ${R.mainStart()}\n ${R.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n ${P?\"output[global_idx] = input[global_idx];\":`\n let output_indices = ${C.offsetToIndices(\"global_idx\")};\n var input_indices: ${$.type.indices};\n ${(()=>{switch(r.mode){case\"nearest\":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices);\n if (checkInputIndices(input_indices)) {\n output[global_idx] = ${$.getByIndices(\"input_indices\")};\n } else {\n output[global_idx] = ${r.extrapolationValue};\n }`;case\"linear\":return`output[global_idx] = ${f.length===2||f.length===4?\"bilinearInterpolation\":\"trilinearInterpolation\"}(output_indices);`;case\"cubic\":return\"output[global_idx] = bicubicInterpolation(output_indices);\";default:throw Error(`Unsupported resize mode: ${r.mode}`)}})()};\n`}\n }`;return{name:\"Resize\",shaderCache:{hint:`${r.cacheKey}|${t}|${w.length>0?w:\"\"}|${s.length>0?s:\"\"}|${d.length>0?d:\"\"}|${P}|${f}`,inputDependencies:[\"rank\"]},getShaderSource:B,getRunData:()=>({outputs:[{dims:g,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(A/64)},programUniforms:[{type:12,data:A},{type:1,data:w},{type:1,data:d},...se(f,g)]})}},l0=e=>{let r=e.customDataBuffer;return new Uint32Array(r,r.byteOffset,1)[0]},zc=(e,r)=>{let t=[],u=[],s=[],c=l0(e);if(r.antialias!==0)throw Error(\"Only default value (0) for Antialias attribute is supported\");Zy(e.inputs,r,c,t,u,s),e.compute(u0(e.inputs[0],r,c,t,u,s),{inputs:[0]})},Mc=e=>{let r=e.antialias,t=e.axes,u=e.coordinateTransformMode,s=e.cubicCoeffA,c=e.excludeOutside!==0,f=e.extrapolationValue,d=e.keepAspectRatioPolicy,g=e.mode,w=e.nearestMode===\"\"?\"simple\":e.nearestMode;return ke({antialias:r,axes:t,coordinateTransformMode:u,cubicCoeffA:s,excludeOutside:c,extrapolationValue:f,keepAspectRatioPolicy:d,mode:g,nearestMode:w})}});var d0,c0,Uc,Vc=ae(()=>{\"use strict\";Te();De();nt();Re();d0=(e,r)=>{let[t,u,s,c]=e,{numHeads:f,rotaryEmbeddingDim:d}=r;if(t.dims.length!==3&&t.dims.length!==4)throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${t.dims.length}`);if(!K.areEqual(u.dims,[])&&!K.areEqual(u.dims,[1])&&u.dims.length!==2)throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${u.dims.length}`);if(s.dims.length!==2)throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${s.dims.length}`);if(c.dims.length!==2)throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${c.dims.length}`);if(!K.areEqual(s.dims,c.dims))throw new Error(\"Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape\");if(d>0&&f===0)throw new Error(\"num_heads must be provided if rotary_embedding_dim is specified\");let g=t.dims[0],w=t.dims[t.dims.length-2],C=s.dims[0],$=K.sizeFromDimension(t.dims,1)/w,A=d===0?s.dims[1]*2:$/f;if(d>A)throw new Error(\"rotary_embedding_dim must be less than or equal to head_size\");if(u.dims.length===2){if(g!==u.dims[0])throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${u.dims[0]}`);if(w!==u.dims[1])throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${u.dims[1]}`)}if(A/2!==s.dims[1]&&d/2!==s.dims[1])throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${s.dims[1]}`);if(w>C)throw new Error(\"Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported\")},c0=(e,r)=>{let{interleaved:t,numHeads:u,rotaryEmbeddingDim:s,scale:c}=r,f=e[0].dims[0],d=K.sizeFromDimension(e[0].dims,1),g=e[0].dims[e[0].dims.length-2],w=d/g,C=e[2].dims[1],$=s===0?C*2:w/u,A=new Array(f,g,w/$,$-C),P=K.computeStrides(A),x=[{type:1,data:c},{type:12,data:A},{type:12,data:P},...e[0].dims.length===3?new Array({type:12,data:[d,w,$,1]}):[],...e[0].dims.length===4?new Array({type:12,data:[d,$,g*$,1]}):[],...se(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],E=O=>{let B=Z(\"input\",e[0].dataType,e[0].dims.length),R=Z(\"position_ids\",e[1].dataType,e[1].dims.length),j=Z(\"cos_cache\",e[2].dataType,e[2].dims.length),U=Z(\"sin_cache\",e[3].dataType,e[3].dims.length),L=ne(\"output\",e[0].dataType,e[0].dims.length);return O.registerUniforms([{name:\"scale\",type:\"f32\"},{name:\"global_shape\",type:\"u32\",length:A.length},{name:\"global_strides\",type:\"u32\",length:P.length},{name:\"input_output_strides\",type:\"u32\",length:P.length}]),`\n ${O.declareVariables(B,R,j,U,L)}\n\n ${O.mainStart(ur)}\n let half_rotary_emb_dim = uniforms.${j.name}_shape[1];\n let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape;\n let size = uniforms.global_shape[0] * uniforms.global_strides[0];\n ${O.guardAgainstOutOfBoundsWorkgroupSizes(\"size\")}\n\n if (bsnh[3] < half_rotary_emb_dim) {\n let position_ids_idx =\n ${R.broadcastedIndicesToOffset(\"bsnh.xy\",ne(\"\",R.type.tensor,2))};\n let position_id =\n u32(${R.getByOffset(\"position_ids_idx\")}) + select(0, bsnh[1], position_ids_idx == 0);\n let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${t});\n let j = i + select(half_rotary_emb_dim, 1, ${t});\n let re = ${B.getByOffset(\"i\")} * ${j.get(\"position_id\",\"bsnh[3]\")} -\n ${B.getByOffset(\"j\")} * ${U.get(\"position_id\",\"bsnh[3]\")};\n ${L.setByOffset(\"i\",\"re\")}\n let im = ${B.getByOffset(\"i\")} * ${U.get(\"position_id\",\"bsnh[3]\")} +\n ${B.getByOffset(\"j\")} * ${j.get(\"position_id\",\"bsnh[3]\")};\n ${L.setByOffset(\"j\",\"im\")}\n } else {\n let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim;\n ${L.setByOffset(\"k\",B.getByOffset(\"k\"))}\n }\n }`};return{name:\"RotaryEmbedding\",shaderCache:{hint:ke({interleaved:t}).cacheKey,inputDependencies:[\"rank\",\"rank\",\"rank\",\"rank\"]},getShaderSource:E,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(K.size(A)/ur)},programUniforms:x})}},Uc=(e,r)=>{d0(e.inputs,r),e.compute(c0(e.inputs,r))}});var f0,p0,Wc,Nc=ae(()=>{\"use strict\";Te();De();Re();f0=e=>{if(!e||e.length<3)throw new Error(\"layerNorm requires at least 3 inputs.\");let r=e[0],t=e[1],u=e[2];if(r.dataType!==t.dataType||r.dataType!==u.dataType)throw new Error(\"All inputs must have the same data type\");if(r.dims.length!==3&&r.dims.length!==2)throw new Error(\"Input must be 2D or 3D\");if(t.dims.length!==3&&t.dims.length!==2)throw new Error(\"Skip must be 2D or 3D\");let s=r.dims[r.dims.length-1],c=r.dims[r.dims.length-2];if(t.dims[t.dims.length-1]!==s)throw new Error(\"Skip must have the same hidden size as input\");if(t.dims[t.dims.length-2]!==c)throw new Error(\"Skip must have the same sequence length as input\");if(u.dims.length!==1)throw new Error(\"Gamma must be 1D\");if(u.dims[u.dims.length-1]!==s)throw new Error(\"Gamma must have the same hidden size as input\");if(e.length>3){let f=e[3];if(f.dims.length!==1)throw new Error(\"Beta must be 1D\");if(f.dims[f.dims.length-1]!==s)throw new Error(\"Beta must have the same hidden size as input\")}if(e.length>4){let f=e[4];if(f.dims.length!==1)throw new Error(\"Bias must be 1D\");if(f.dims[f.dims.length-1]!==s)throw new Error(\"Bias must have the same hidden size as input\")}},p0=(e,r,t,u)=>{let s=r.simplified,c=e[0].dims,f=K.size(c),d=c,g=f,w=c.slice(-1)[0],C=u?c.slice(0,-1).concat(1):[],$=!s&&e.length>3,A=e.length>4,P=u&&t>1,x=u&&t>2,E=t>3,O=He(w),B=[{type:12,data:g},{type:12,data:O},{type:12,data:w},{type:1,data:r.epsilon}],R=U=>{let L=[{name:\"output_size\",type:\"u32\"},{name:\"components\",type:\"u32\"},{name:\"hidden_size\",type:\"u32\"},{name:\"epsilon\",type:\"f32\"}],F=[Z(\"x\",e[0].dataType,e[0].dims,O),Z(\"skip\",e[1].dataType,e[1].dims,O),Z(\"gamma\",e[2].dataType,e[2].dims,O)];$&&F.push(Z(\"beta\",e[3].dataType,e[3].dims,O)),A&&F.push(Z(\"bias\",e[4].dataType,e[4].dims,O)),F.push(ne(\"output\",e[0].dataType,d,O)),P&&F.push(ne(\"mean_output\",1,C)),x&&F.push(ne(\"inv_std_output\",1,C)),E&&F.push(ne(\"input_skip_bias_sum\",e[0].dataType,d,O));let te=Ne(e[0].dataType);return`\n\n ${U.registerUniforms(L).declareVariables(...F)}\n\n ${U.mainStart()}\n ${U.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size / uniforms.hidden_size\")}\n let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components;\n let offset = global_idx * hidden_size_vectorized;\n var sum = ${xt(\"f32\",O)};\n var squareSum = ${xt(\"f32\",O)};\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\n let skip_value = skip[offset + i];\n let bias_value = ${A?\"bias[i]\":te+\"(0.0)\"};\n let input_value = x[offset + i];\n let value = input_value + skip_value + bias_value;\n ${E?\"input_skip_bias_sum[offset + i] = value;\":\"\"}\n output[offset + i] = value;\n let f32_value = ${lr(te,O,\"value\")};\n sum += f32_value;\n squareSum += f32_value * f32_value;\n }\n let mean = ${It(\"sum\",O)} / f32(uniforms.hidden_size);\n let inv_std_dev = inverseSqrt(${It(\"squareSum\",O)} / f32(uniforms.hidden_size) ${s?\"\":\"- mean * mean\"} + uniforms.epsilon);\n ${P?\"mean_output[global_idx] = mean;\":\"\"}\n ${x?\"inv_std_output[global_idx] = inv_std_dev;\":\"\"}\n for (var i: u32 = 0; i < hidden_size_vectorized; i++) {\n output[offset + i] = (output[offset + i] ${s?\"\":`- ${te}(mean)`}) * ${te}(inv_std_dev) * gamma[i] ${$?\"+ beta[i]\":\"\"};\n }\n }`},j=[{dims:d,dataType:e[0].dataType}];return t>1&&j.push({dims:C,dataType:1}),t>2&&j.push({dims:C,dataType:1}),t>3&&j.push({dims:c,dataType:e[0].dataType}),{name:\"SkipLayerNormalization\",shaderCache:{hint:`${O};${P};${x};${E}`,inputDependencies:e.map((U,L)=>\"type\")},getShaderSource:R,getRunData:()=>({outputs:j,dispatchGroup:{x:Math.ceil(g/w/64)},programUniforms:B})}},Wc=(e,r)=>{f0(e.inputs);let u=[0];e.outputCount>1&&u.push(-3),e.outputCount>2&&u.push(-3),e.outputCount>3&&u.push(3),e.compute(p0(e.inputs,r,e.outputCount,!1),{outputs:u})}});var m0,bi,h0,Gc,g0,y0,Hc,Lc,Fc=ae(()=>{\"use strict\";Te();De();nt();Re();m0=(e,r)=>{if(!e||e.length<1)throw new Error(\"too few inputs\");if(r.axes.length!==0){if(r.axes.length!==r.starts.length||r.axes.length!==r.ends.length)throw new Error(\"axes, starts and ends must have the same length\")}else if(r.starts.length!==r.ends.length)throw new Error(\"starts and ends must have the same length\");e.slice(1).forEach((t,u)=>{if(e[u+1].dataType!==6&&e[u+1].dataType!==7)throw new Error(`Input ${u} must be an array of int32 or int64`)})},bi=(e,r)=>{let t=[];if(e.length>r)if(e[r].dataType===7)e[r].getBigInt64Array().forEach(u=>t.push(Number(u)));else if(e[r].dataType===6)e[r].getInt32Array().forEach(u=>t.push(Number(u)));else throw new Error(`Input ${r} must be an array of int32 or int64`);return t},h0=(e,r)=>{if(e.length>1){let t=bi(e,1),u=bi(e,2),s=bi(e,3);return s.length===0&&(s=[...Array(e[0].dims.length).keys()]),ke({starts:t,ends:u,axes:s})}else return r},Gc=(e,r,t,u,s)=>{let c=e;return e<0&&(c+=t[u[r]]),s[r]<0?Math.max(0,Math.min(c,t[u[r]]-1)):Math.max(0,Math.min(c,t[u[r]]))},g0=(e,r,t)=>`fn calculateInputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} {\n var input_indices: ${e.type.indices};\n var carry = 0u;\n for (var i = ${t.length}; i >= 0; i--) {\n let input_shape_i = ${xe(\"uniforms.input_shape\",\"i\",t.length)};\n let steps_i = ${xe(\"uniforms.steps\",\"i\",t.length)};\n let signs_i = ${xe(\"uniforms.signs\",\"i\",t.length)};\n let starts_i = ${xe(\"uniforms.starts\",\"i\",t.length)};\n var output_index = ${r.indicesGet(\"output_indices\",\"i\")};\n var input_index = output_index * steps_i + starts_i + carry;\n carry = input_index / input_shape_i;\n input_index = input_index % input_shape_i;\n if (signs_i < 0) {\n input_index = input_shape_i - input_index - 1u + starts_i;\n }\n ${e.indicesSet(\"input_indices\",\"i\",\"input_index\")};\n }\n return input_indices;\n }`,y0=(e,r)=>{let t=e[0].dims,u=K.size(t),s=r.axes.length>0?K.normalizeAxes(r.axes,t.length):[...Array(t.length).keys()],c=bi(e,4);c.forEach(B=>B!==0||(()=>{throw new Error(\"step cannot be 0\")})),c.length===0&&(c=Array(s.length).fill(1));let f=r.starts.map((B,R)=>Gc(B,R,t,s,c)),d=r.ends.map((B,R)=>Gc(B,R,t,s,c));if(s.length!==f.length||s.length!==d.length)throw new Error(\"start, ends and axes should have the same number of elements\");if(s.length!==t.length)for(let B=0;BMath.sign(B));c.forEach((B,R,j)=>{if(B<0){let U=(d[R]-f[R])/B,L=f[R],F=L+U*c[R];f[R]=F,d[R]=L,j[R]=-B}});let w=t.slice(0);s.forEach((B,R)=>{w[B]=Math.ceil((d[B]-f[B])/c[B])});let C={dims:w,dataType:e[0].dataType},$=ne(\"output\",e[0].dataType,w.length),A=Z(\"input\",e[0].dataType,e[0].dims.length),P=K.size(w),x=[{name:\"outputSize\",type:\"u32\"},{name:\"starts\",type:\"u32\",length:f.length},{name:\"signs\",type:\"i32\",length:g.length},{name:\"steps\",type:\"u32\",length:c.length}],E=[{type:12,data:P},{type:12,data:f},{type:6,data:g},{type:12,data:c},...se(e[0].dims,w)],O=B=>`\n ${B.registerUniforms(x).declareVariables(A,$)}\n ${g0(A,$,t)}\n ${B.mainStart()}\n ${B.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.outputSize\")}\n let output_indices = ${$.offsetToIndices(\"global_idx\")};\n let input_indices = calculateInputIndices(output_indices);\n ${$.setByOffset(\"global_idx\",A.getByIndices(\"input_indices\"))}\n }`;return{name:\"Slice\",shaderCache:{hint:`${g.length}_${f.length}_${c.length}`,inputDependencies:[\"rank\"]},getShaderSource:O,getRunData:()=>({outputs:[C],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:E})}},Hc=(e,r)=>{m0(e.inputs,r);let t=h0(e.inputs,r);e.compute(y0(e.inputs,t),{inputs:[0]})},Lc=e=>{let r=e.starts,t=e.ends,u=e.axes;return ke({starts:r,ends:t,axes:u})}});var b0,v0,qc,Kc,Yc=ae(()=>{\"use strict\";Te();De();nt();Re();b0=e=>{if(!e||e.length!==1)throw new Error(\"Softmax op requires 1 input.\")},v0=(e,r)=>{let t=e.dims,u=K.size(t),s=64,c=r.axis;if(c<0&&(c=t.length+c),cB===4?`max(max(${O}.x, ${O}.y), max(${O}.z, ${O}.w))`:B===2?`max(${O}.x, ${O}.y)`:B===3?`max(max(${O}.x, ${O}.y), ${O}.z)`:O,$=Z(\"x\",e.dataType,e.dims,g),A=ne(\"result\",e.dataType,e.dims,g),P=$.type.value,x=Ne(e.dataType)===\"f32\"?`var threadMax = ${P}(-3.402823e+38f);`:`var threadMax = ${P}(-65504.0h);`,E=O=>`\n var rowMaxShared : ${P};\n var rowSumShared : ${P};\n var threadShared : array<${P}, ${s}>;\n\n fn getValue(row: i32, col: i32, row_stride: i32) -> ${P} {\n let index = row * row_stride + col;\n return x[index];\n }\n\n fn setValue(row: i32, col: i32, row_stride: i32, value: ${P}) {\n let index = row * row_stride + col;\n result[index] = value;\n }\n ${O.registerUniform(\"packedCols\",\"i32\").declareVariables($,A)}\n ${O.mainStart()}\n let gindex = i32(global_idx);\n let lindex = i32(local_idx);\n const wg = ${s};\n let row = gindex / wg;\n let cols = uniforms.packedCols;\n let row_stride : i32 = uniforms.packedCols;\n\n // find the rows max\n ${x}\n for (var col = lindex; col < cols; col += wg) {\n let value = getValue(row, col, row_stride);\n threadMax = max(threadMax, value);\n }\n if (lindex < cols) {\n threadShared[lindex] = threadMax;\n }\n workgroupBarrier();\n\n var reduceSize = min(cols, wg);\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\n reduceSize = currSize + (reduceSize & 1);\n if (lindex < currSize) {\n threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]);\n }\n workgroupBarrier();\n }\n if (lindex == 0) {\n rowMaxShared = ${P}(${C(\"threadShared[0]\",g)});\n }\n workgroupBarrier();\n\n // find the rows sum\n var threadSum = ${P}(0.0);\n for (var col = lindex; col < cols; col += wg) {\n let subExp = exp(getValue(row, col, row_stride) - rowMaxShared);\n threadSum += subExp;\n }\n threadShared[lindex] = threadSum;\n workgroupBarrier();\n\n for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) {\n if (lindex < currSize) {\n threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize];\n }\n workgroupBarrier();\n }\n if (lindex == 0) {\n rowSumShared = ${P}(${It(\"threadShared[0]\",g)});\n }\n workgroupBarrier();\n\n // calculate final value for each element in the row\n for (var col = lindex; col < cols; col += wg) {\n let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared;\n setValue(row, col, row_stride, value);\n }\n }`;return{name:\"Softmax\",shaderCache:{hint:`${g}`,inputDependencies:[\"type\"]},getRunData:()=>({outputs:[{dims:t,dataType:e.dataType}],dispatchGroup:{x:d},programUniforms:[{type:6,data:w}]}),getShaderSource:E}},qc=(e,r)=>{b0(e.inputs),e.compute(v0(e.inputs[0],r))},Kc=e=>ke({axis:e.axis})});var w0,_0,$0,C0,S0,Zc,Qc,Xc=ae(()=>{\"use strict\";Te();De();nt();Re();w0=e=>{if(!e||e.length<1)throw new Error(\"too few inputs\")},_0=(e,r)=>{let t=[],u=r.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(s=>t.push(Number(s))),u=t.length),ke({numOutputs:u,axis:r.axis,splitSizes:t})},$0=e=>`\nfn calculateOutputIndex(index: u32) -> u32 {\n for (var i: u32 = 0u; i < ${e}u; i += 1u ) {\n if (index < ${xe(\"uniforms.size_in_split_axis\",\"i\",e)}) {\n return i;\n }\n }\n return ${e}u;\n}`,C0=e=>{let r=e.length,t=[];for(let u=0;u{let t=e[0].dims,u=K.size(t),s=e[0].dataType,c=K.normalizeAxis(r.axis,t.length),f=new Array(r.numOutputs),d=Z(\"input\",s,t.length),g=new Array(r.numOutputs),w=[],C=[],$=0,A=[{type:12,data:u}];for(let x=0;x`\n ${x.registerUniform(\"input_size\",\"u32\").registerUniform(\"size_in_split_axis\",\"u32\",g.length).declareVariables(d,...f)}\n ${$0(g.length)}\n ${C0(f)}\n\n ${x.mainStart()}\n ${x.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.input_size\")}\n\n var indices = ${d.offsetToIndices(\"global_idx\")};\n var index = ${d.indicesGet(\"indices\",c)};\n let output_number = calculateOutputIndex(index);\n if (output_number != 0) {\n index -= ${xe(\"uniforms.size_in_split_axis\",\"output_number - 1u\",g.length)};\n ${d.indicesSet(\"indices\",c,\"index\")};\n }\n writeBufferData(output_number, indices, global_idx);\n }`;return{name:\"Split\",shaderCache:{hint:r.cacheKey,inputDependencies:[\"rank\"]},getShaderSource:P,getRunData:()=>({outputs:w,dispatchGroup:{x:Math.ceil(u/64)},programUniforms:A})}},Zc=(e,r)=>{w0(e.inputs);let t=e.inputs.length===1?r:_0(e.inputs,r);e.compute(S0(e.inputs,t),{inputs:[0]})},Qc=e=>{let r=e.axis,t=e.splitSizes,u=e.numOutputs<0?t.length:e.numOutputs;if(u!==t.length)throw new Error(\"numOutputs and splitSizes lengh must be equal\");return ke({axis:r,numOutputs:u,splitSizes:t})}});var Jc,x0,I0,A0,ef,tf=ae(()=>{\"use strict\";Te();De();Re();Jc=e=>Array.from(e.getBigInt64Array(),Number),x0=e=>{if(!e||e.length!==2)throw new Error(\"Tile requires 2 inputs.\");if(e[0].dataType!==1&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error(\"Tile only support float, int32, and uint32 data types\");if(e[1].dataType!==7)throw new Error(\"Tile `repeats` input should be of int64 data type\");if(e[1].dims.length!==1)throw new Error(\"Tile `repeats` input should be 1-D\");if(Jc(e[1]).length!==e[0].dims.length)throw new Error(\"Tile `repeats` input should have same number of elements as rank of input data tensor\")},I0=(e,r)=>{let t=[];for(let u=0;u{let r=e[0].dims,t=Jc(e[1]),u=I0(r,t),s=K.size(u),c=e[0].dataType,f=Z(\"input\",c,r.length),d=ne(\"output\",c,u.length),g=w=>`\n const inputShape = ${f.indices(...r)};\n ${w.registerUniform(\"output_size\",\"u32\").declareVariables(f,d)}\n ${w.mainStart()}\n ${w.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.output_size\")}\n let output_indices = ${d.offsetToIndices(\"global_idx\")};\n var input_indices: ${f.type.indices};\n for (var i = 0; i < ${r.length}; i++) {\n let input_dim_i = ${f.indicesGet(\"uniforms.input_shape\",\"i\")};\n let input_dim_value = ${d.indicesGet(\"output_indices\",\"i\")} % input_dim_i;\n\n ${f.indicesSet(\"input_indices\",\"i\",\"input_dim_value\")}\n }\n ${d.setByOffset(\"global_idx\",f.getByIndices(\"input_indices\"))}\n }`;return{name:\"Tile\",shaderCache:{hint:`${t}`,inputDependencies:[\"rank\"]},getRunData:()=>({outputs:[{dims:u,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:[{type:12,data:s},...se(e[0].dims,u)]}),getShaderSource:g}},ef=e=>{x0(e.inputs),e.compute(A0(e.inputs),{inputs:[0]})}});var T0,E0,rf,nf=ae(()=>{\"use strict\";Te();De();Re();T0=(e,r,t,u,s)=>{let c=ne(\"output_data\",s,t.length,4),f=Z(\"a_data\",r[1].dataType,r[1].dims.length,4),d=Z(\"b_data\",r[2].dataType,r[2].dims.length,4),g=Z(\"c_data\",r[0].dataType,r[0].dims.length,4),w,C=($,A,P)=>`select(${A}, ${$}, ${P})`;if(!u)w=c.setByOffset(\"global_idx\",C(f.getByOffset(\"global_idx\"),d.getByOffset(\"global_idx\"),g.getByOffset(\"global_idx\")));else{let $=(A,P,x=\"\")=>{let E=`a_data[index_a${P}][component_a${P}]`,O=`b_data[index_b${P}][component_b${P}]`,B=`bool(c_data[index_c${P}] & (0xffu << (component_c${P} * 8)))`;return`\n let output_indices${P} = ${c.offsetToIndices(`global_idx * 4u + ${P}u`)};\n let offset_a${P} = ${f.broadcastedIndicesToOffset(`output_indices${P}`,c)};\n let offset_b${P} = ${d.broadcastedIndicesToOffset(`output_indices${P}`,c)};\n let offset_c${P} = ${g.broadcastedIndicesToOffset(`output_indices${P}`,c)};\n let index_a${P} = offset_a${P} / 4u;\n let index_b${P} = offset_b${P} / 4u;\n let index_c${P} = offset_c${P} / 4u;\n let component_a${P} = offset_a${P} % 4u;\n let component_b${P} = offset_b${P} % 4u;\n let component_c${P} = offset_c${P} % 4u;\n ${A}[${P}] = ${x}(${C(E,O,B)});\n `};s===9?w=`\n var data = vec4(0);\n ${$(\"data\",0,\"u32\")}\n ${$(\"data\",1,\"u32\")}\n ${$(\"data\",2,\"u32\")}\n ${$(\"data\",3,\"u32\")}\n output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:w=`\n ${$(\"output_data[global_idx]\",0)}\n ${$(\"output_data[global_idx]\",1)}\n ${$(\"output_data[global_idx]\",2)}\n ${$(\"output_data[global_idx]\",3)}\n `}return`\n ${e.registerUniform(\"vec_size\",\"u32\").declareVariables(g,f,d,c)}\n ${e.mainStart()}\n ${e.guardAgainstOutOfBoundsWorkgroupSizes(\"uniforms.vec_size\")}\n ${w}\n }`},E0=e=>{let r=e[1].dims,t=e[2].dims,u=e[0].dims,s=e[1].dataType,c=!(K.areEqual(r,t)&&K.areEqual(t,u)),f=r,d=K.size(r);if(c){let w=Ot.calcShape(Ot.calcShape(r,t,!1),u,!1);if(!w)throw new Error(\"Can't perform where op on the given tensors\");f=w,d=K.size(f)}let g=Math.ceil(d/4);return{name:\"Where\",shaderCache:{inputDependencies:[\"rank\",\"rank\",\"rank\"]},getShaderSource:w=>T0(w,e,f,c,s),getRunData:()=>({outputs:[{dims:f,dataType:s}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:g},...se(u,r,t,f)]})}},rf=e=>{e.compute(E0(e.inputs))}});var of,af=ae(()=>{\"use strict\";hl();Qi();wl();$l();ad();yd();Zi();ro();kd();Bd();Md();Nd();Ld();qd();Zd();Jd();rc();ic();ac();io();lc();pc();hc();Oc();Bc();ni();jc();Vc();Nc();Fc();Yc();Xc();tf();Dr();li();nf();of=new Map([[\"Abs\",[Cl]],[\"Acos\",[Sl]],[\"Acosh\",[xl]],[\"Add\",[sd]],[\"ArgMax\",[ml,Yi]],[\"ArgMin\",[pl,Yi]],[\"Asin\",[Il]],[\"Asinh\",[Al]],[\"Atan\",[Tl]],[\"Atanh\",[El]],[\"Attention\",[bl]],[\"AveragePool\",[Cc,$c]],[\"BatchNormalization\",[vl]],[\"BiasAdd\",[_l]],[\"BiasSplitGelu\",[od]],[\"Cast\",[kl,Pl]],[\"Ceil\",[Rl]],[\"Clip\",[Ol]],[\"Concat\",[gl,yl]],[\"Conv\",[so,ao]],[\"ConvTranspose\",[Pd,Ed]],[\"Cos\",[Bl]],[\"Cosh\",[Dl]],[\"CumSum\",[Od,Rd]],[\"DepthToSpace\",[Dd,zd]],[\"Div\",[ud]],[\"Einsum\",[Vd,Wd]],[\"Elu\",[zl,si]],[\"Equal\",[ld]],[\"Erf\",[Ml]],[\"Exp\",[jl]],[\"Expand\",[Hd]],[\"FastGelu\",[Fd]],[\"Floor\",[Ul]],[\"FusedConv\",[so,ao]],[\"Gather\",[Yd,Kd]],[\"GatherElements\",[Xd,Qd]],[\"Gelu\",[Vl]],[\"Gemm\",[tc,ec]],[\"GlobalAveragePool\",[Ic,xc]],[\"GlobalMaxPool\",[kc,Pc]],[\"Greater\",[pd]],[\"GreaterOrEqual\",[hd]],[\"HardSigmoid\",[Kl,ql]],[\"InstanceNormalization\",[nc]],[\"LayerNormalization\",[oc]],[\"LeakyRelu\",[Wl,si]],[\"Less\",[md]],[\"LessOrEqual\",[gd]],[\"Log\",[nd]],[\"MatMul\",[Cd]],[\"MatMulNBits\",[sc,uc]],[\"MaxPool\",[Tc,Ec]],[\"Mul\",[dd]],[\"MultiHeadAttention\",[fc,cc]],[\"Neg\",[Gl]],[\"Not\",[Nl]],[\"Pad\",[mc]],[\"Pow\",[cd]],[\"Range\",[Rc]],[\"Reciprocal\",[Hl]],[\"ReduceMin\",[sl]],[\"ReduceMean\",[rl]],[\"ReduceMax\",[al]],[\"ReduceSum\",[ll]],[\"ReduceProd\",[ul]],[\"ReduceL1\",[nl]],[\"ReduceL2\",[il]],[\"ReduceLogSum\",[cl]],[\"ReduceLogSumExp\",[ol]],[\"ReduceSumSquare\",[dl]],[\"Relu\",[Ll]],[\"Resize\",[zc,Mc]],[\"RotaryEmbedding\",[Uc]],[\"Sigmoid\",[Fl]],[\"Sin\",[Yl]],[\"Sinh\",[Zl]],[\"Slice\",[Hc,Lc]],[\"SkipLayerNormalization\",[Wc]],[\"Split\",[Zc,Qc]],[\"Sqrt\",[Ql]],[\"Softmax\",[qc,Kc]],[\"Sub\",[fd]],[\"Tan\",[Xl]],[\"Tanh\",[ed]],[\"ThresholdedRelu\",[rd,si]],[\"Tile\",[ef]],[\"Transpose\",[Gu,Hu]],[\"Where\",[rf]]])});var vi,sf=ae(()=>{\"use strict\";Rr();Lt();Re();vi=class{constructor(r){this.backend=r;this.repo=new Map,this.attributesBound=!1}getArtifact(r){return this.repo.get(r)}setArtifact(r,t){this.repo.set(r,t)}run(r,t,u,s,c){ar(r.programInfo.name);let f=this.backend.device,d=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let g=[];for(let C of t)g.push({binding:g.length,resource:{buffer:C.buffer}});for(let C of u)g.push({binding:g.length,resource:{buffer:C.buffer}});c&&g.push({binding:g.length,resource:c});let w=f.createBindGroup({layout:r.computePipeline.getBindGroupLayout(0),entries:g,label:r.programInfo.name});if(this.backend.sessionStatus===\"capturing\"){let C={kernelId:this.backend.currentKernelId,computePipeline:r.computePipeline,bindGroup:w,dispatchGroup:s};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(C)}d.setPipeline(r.computePipeline),d.setBindGroup(0,w),d.dispatchWorkgroups(...s),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===\"at-passes\")&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),Ht(r.programInfo.name)}dispose(){}build(r,t){ar(r.name);let u=this.backend.device,s=[];u.features.has(\"shader-f16\")&&s.push(\"enable f16;\");let c=Wu(t,this.backend.device.limits),f=r.getShaderSource(c),d=`${s.join(`\n`)}\n${c.additionalImplementations}\n${f}`,g=u.createShaderModule({code:d,label:r.name});Fe(\"verbose\",()=>`[WebGPU] ${r.name} shader code: ${d}`);let w=u.createComputePipeline({compute:{module:g,entryPoint:\"main\"},layout:\"auto\",label:r.name});return Ht(r.name),{programInfo:r,computePipeline:w,uniformVariablesInfo:c.variablesInfo}}normalizeDispatchGroupSize(r){let t=typeof r==\"number\"?r:r.x,u=typeof r==\"number\"?1:r.y||1,s=typeof r==\"number\"?1:r.z||1,c=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=c&&u<=c&&s<=c)return[t,u,s];let f=t*u*s,d=Math.ceil(Math.sqrt(f));if(d>c){if(d=Math.ceil(Math.cbrt(f)),d>c)throw new Error(\"Total dispatch size exceeds WebGPU maximum.\");return[d,d,d]}else return[d,d,1]}}});var P0,k0,mo,wi,uf=ae(()=>{\"use strict\";Rr();Te();Lt();Du();Vu();af();sf();P0=(e,r)=>{if(r.length!==e.length)throw new Error(`inputDependencies length ${r.length} is not equal to inputTensors length ${e.length}.`);let t=[];for(let u=0;u{let u=e.name;return e.shaderCache?.hint&&(u+=\"[\"+e.shaderCache.hint+\"]\"),u+=\":\"+t+`:${P0(r,e.shaderCache?.inputDependencies??new Array(r.length).fill(\"dims\"))}`,u},mo=class{constructor(r){r&&(this.architecture=r.architecture,this.vendor=r.vendor)}isArchitecture(r){return this.architecture===r}isVendor(r){return this.vendor===r}},wi=class{constructor(){this.currentSessionId=null;this.currentKernelId=null;this.commandEncoder=null;this.computePassEncoder=null;this.maxDispatchNumber=16;this.pendingDispatchNumber=0;this.pendingKernels=[];this.pendingQueries=new Map;this.sessionStatus=\"default\";this.capturedCommandList=new Map;this.capturedPendingKernels=new Map;this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw new Error(\"currentKernelCustomData(): currentKernelId is null. (should not happen)\");let r=this.kernelCustomData.get(this.currentKernelId);return r||(r={},this.kernelCustomData.set(this.currentKernelId,r)),r}async initialize(r,t){this.env=r;let u=[],s={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:u};t.features.has(\"chromium-experimental-timestamp-query-inside-passes\")?u.push(\"chromium-experimental-timestamp-query-inside-passes\"):t.features.has(\"timestamp-query\")&&u.push(\"timestamp-query\"),t.features.has(\"shader-f16\")&&u.push(\"shader-f16\"),this.device=await t.requestDevice(s),this.adapterInfo=new mo(await t.requestAdapterInfo()),this.gpuDataManager=Uu(this),this.programManager=new vi(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,Ru(r.logLevel,!!r.debug),this.device.onuncapturederror=c=>{c.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${c.error.message}`)},Object.defineProperty(this.env.webgpu,\"device\",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,\"adapter\",{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<\"u\"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let r=this.getCommandEncoder(),t={};this.queryType===\"at-passes\"&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=r.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;ar(),this.endComputePass();let r;this.queryType!==\"none\"&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),r=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(r,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,r,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==\"none\"&&r.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(r.getMappedRange()),u=this.pendingQueries.get(r);for(let s=0;s\"u\"&&(this.queryTimeBase=P);let E=Number(P-this.queryTimeBase),O=Number(x-this.queryTimeBase);if(!Number.isSafeInteger(E)||!Number.isSafeInteger(O))throw new RangeError(\"incorrect timestamp range\");if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:$.map(B=>({dims:B.dims,dataType:Gt(B.dataType)})),outputsMetadata:A.map(B=>({dims:B.dims,dataType:Gt(B.dataType)})),kernelId:f,kernelType:g,kernelName:w,programName:C,startTime:E,endTime:O});else{let B=\"\";$.forEach((j,U)=>{B+=`input[${U}]: [${j.dims}] | ${Gt(j.dataType)}, `});let R=\"\";A.forEach((j,U)=>{R+=`output[${U}]: [${j.dims}] | ${Gt(j.dataType)}, `}),console.log(`[profiling] kernel \"${f}|${g}|${w}|${C}\" ${B}${R}execution time: ${O-E} ns`)}Mi(\"GPU\",`${C}::${P}::${x}`)}r.unmap(),this.pendingQueries.delete(r)}),Ht()}run(r,t,u,s,c,f){ar(r.name);let d=[];for(let j=0;jU):u;if($.length!==g.length)throw new Error(`Output size ${$.length} must be equal to ${g.length}.`);let A=[],P=[];for(let j=0;j=f)throw new Error(`Invalid output index: ${$[j]}`);if($[j]===-3)continue;let U=$[j]===-1,L=$[j]===-2,F=U||L?c(g[j].dataType,g[j].dims):s($[j],g[j].dataType,g[j].dims);if(A.push(F),F.data===0)continue;let te=this.gpuDataManager.get(F.data);if(!te)throw new Error(`no GPU data for output: ${F.data}`);if(U&&this.temporaryData.push(te),L){let J=this.kernelPersistentData.get(this.currentKernelId);J||(J=[],this.kernelPersistentData.set(this.currentKernelId,J)),J.push(te)}P.push(te)}if(d.length!==t.length||P.length!==A.length){if(P.length===0)return Ht(r.name),A;throw new Error(`Program ${r.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let x;if(C){let j=0,U=[];C.forEach(J=>{let oe=typeof J.data==\"number\"?[J.data]:J.data;if(oe.length===0)return;let le=J.type===10?2:4,ge,X;J.type===10?(X=oe.length>4?16:oe.length>2?8:oe.length*le,ge=oe.length>4?16:le*oe.length):(X=oe.length<=2?oe.length*le:16,ge=16),j=Math.ceil(j/X)*X,U.push(j);let pe=J.type===10?8:4;j+=oe.length>4?Math.ceil(oe.length/pe)*ge:oe.length*le});let L=16;j=Math.ceil(j/L)*L;let F=new ArrayBuffer(j);C.forEach((J,oe)=>{let le=U[oe],ge=typeof J.data==\"number\"?[J.data]:J.data;if(J.type===6)new Int32Array(F,le,ge.length).set(ge);else if(J.type===12)new Uint32Array(F,le,ge.length).set(ge);else if(J.type===10)new Uint16Array(F,le,ge.length).set(ge);else if(J.type===1)new Float32Array(F,le,ge.length).set(ge);else throw new Error(`Unsupported uniform type: ${Gt(J.type)}`)});let te=this.gpuDataManager.create(j,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(te.buffer,0,F,0,j),this.gpuDataManager.release(te.id),x={offset:0,size:j,buffer:te.buffer}}let E=this.programManager.normalizeDispatchGroupSize(w),O=E[1]===1&&E[2]===1,B=k0(r,t,O),R=this.programManager.getArtifact(B);if(R||(R=this.programManager.build(r,E),this.programManager.setArtifact(B,R),Fe(\"info\",()=>`[artifact] key: ${B}, programName: ${r.name}`)),C&&R.uniformVariablesInfo){if(C.length!==R.uniformVariablesInfo.length)throw new Error(`Uniform variables count mismatch: expect ${R.uniformVariablesInfo.length}, got ${C.length} in program \"${R.programInfo.name}\".`);for(let j=0;j`[ProgramManager] run \"${r.name}\" (key=${B}) with ${E[0]}x${E[1]}x${E[2]}`),this.queryType!==\"none\"||this.sessionStatus===\"capturing\"){let j={kernelId:this.currentKernelId,programName:R.programInfo.name,inputTensorViews:t,outputTensorViews:A};this.pendingKernels.push(j),this.sessionStatus===\"capturing\"&&this.capturedPendingKernels.get(this.currentSessionId).push(j)}return this.programManager.run(R,d,P,E,x),Ht(r.name),A}upload(r,t){this.gpuDataManager.upload(r,t)}memcpy(r,t){this.gpuDataManager.memcpy(r,t)}async download(r,t){await this.gpuDataManager.download(r,t)}alloc(r){return this.gpuDataManager.create(r).id}free(r){return this.gpuDataManager.release(r)}createKernel(r,t,u,s){let c=of.get(r);if(!c)throw new Error(`kernel not implemented: ${r}`);let f={kernelType:r,kernelName:s,kernelEntry:c[0],attributes:[c[1],u]};this.kernels.set(t,f)}releaseKernel(r){let t=this.kernelPersistentData.get(r);if(t){for(let u of t)this.gpuDataManager.release(u.id);this.kernelPersistentData.delete(r)}this.kernelCustomData.delete(r),this.kernels.delete(r)}computeKernel(r,t,u){let s=this.kernels.get(r);if(!s)throw new Error(`kernel not created: ${r}`);let c=s.kernelType,f=s.kernelName,d=s.kernelEntry,g=s.attributes;if(this.currentKernelId!==null)throw new Error(`kernel \"[${c}] ${f}\" is not allowed to be called recursively`);this.currentKernelId=r,g[0]&&(g[1]=g[0](g[1]),g[0]=void 0),Fe(\"info\",()=>`[WebGPU] Start to run kernel \"[${c}] ${f}\"...`);let w=this.env.debug;this.temporaryData=[];try{return w&&this.device.pushErrorScope(\"validation\"),d(t,g[1]),0}catch(C){return u.push(Promise.resolve(`[WebGPU] Kernel \"[${c}] ${f}\" failed. ${C}`)),1}finally{w&&u.push(this.device.popErrorScope().then(C=>C?`GPU validation error for kernel \"[${c}] ${f}\": ${C.message}`:null));for(let C of this.temporaryData)this.gpuDataManager.release(C.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(r,t,u,s){let c=this.sessionExternalDataMapping.get(r);c||(c=new Map,this.sessionExternalDataMapping.set(r,c));let f=c.get(t),d=this.gpuDataManager.registerExternalBuffer(u,s,f?.[1]);return c.set(t,[d,u]),d}unregisterBuffers(r){let t=this.sessionExternalDataMapping.get(r);t&&(t.forEach(u=>this.gpuDataManager.unregisterExternalBuffer(u[1])),this.sessionExternalDataMapping.delete(r))}getBuffer(r){let t=this.gpuDataManager.get(r);if(!t)throw new Error(`no GPU data for buffer: ${r}`);return t.buffer}createDownloader(r,t,u){return async()=>{let s=await Ni(this,r,t);return Bu(s.buffer,u)}}writeTimestamp(r){this.queryType===\"inside-passes\"&&this.computePassEncoder.writeTimestamp(this.querySet,r)}setQueryType(){this.queryType=\"none\",(this.env.webgpu.profiling?.mode===\"default\"||(typeof this.env.trace>\"u\"?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(\"chromium-experimental-timestamp-query-inside-passes\")?this.queryType=\"inside-passes\":this.device.features.has(\"timestamp-query\")&&(this.queryType=\"at-passes\"),this.queryType!==\"none\"&&typeof this.querySet>\"u\"&&(this.querySet=this.device.createQuerySet({type:\"timestamp\",count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){Fe(\"info\",\"captureBegin\"),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=\"capturing\"}captureEnd(){Fe(\"info\",\"captureEnd\"),this.flush(),this.sessionStatus=\"default\"}replay(){Fe(\"info\",\"replay\"),this.sessionStatus=\"replaying\";let r=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),u=r.length;this.pendingKernels=[];for(let s=0;s=this.maxDispatchNumber||this.queryType===\"at-passes\")&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=\"default\"}onReleaseSession(r){this.unregisterBuffers(r),this.capturedCommandList.has(r)&&this.capturedCommandList.delete(r),this.capturedPendingKernels.has(r)&&this.capturedPendingKernels.delete(r),this.gpuDataManager.onReleaseSession(r)}onRunStart(r){this.currentSessionId=r,this.setQueryType()}}});var lf={};Hn(lf,{init:()=>O0});var mn,ho,O0,df=ae(()=>{\"use strict\";Te();uf();Lt();De();mn=class e{constructor(r,t,u,s){this.module=r;this.dataType=t;this.data=u;this.dims=s}getFloat32Array(){if(this.dataType!==1)throw new Error(\"Invalid data type\");let r=K.size(this.dims);return r===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,r)}getBigInt64Array(){if(this.dataType!==7)throw new Error(\"Invalid data type\");let r=K.size(this.dims);return r===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,r)}getInt32Array(){if(this.dataType!==6)throw new Error(\"Invalid data type\");let r=K.size(this.dims);return r===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,r)}reshape(r){if(K.size(r)!==K.size(this.dims))throw new Error(\"Invalid new shape\");return new e(this.module,this.dataType,this.data,r)}},ho=class{constructor(r,t,u){this.module=r;this.backend=t;this.customDataOffset=0;this.customDataSize=0;this.adapterInfo=t.adapterInfo;let s=r.HEAPU32,c=u>>>2;this.opKernelContext=s[c++];let f=s[c++];this.outputCount=s[c++],this.customDataOffset=s[c++],this.customDataSize=s[c++];let d=[];for(let g=0;gtypeof d==\"number\"?this.inputs[d]:d)??this.inputs,s=t?.outputs??[],c=(d,g,w)=>new mn(this.module,g,this.output(d,w),w),f=(d,g)=>{let w=or(d);if(!w)throw new Error(`Unsupported data type: ${d}`);let C=w*K.size(g),$=C>0?this.backend.gpuDataManager.create(C).id:0;return new mn(this.module,d,$,g)};return this.backend.run(r,u,s,c,f,this.outputCount)}output(r,t){let u=this.module.stackSave();try{let s=this.module.stackAlloc((1+t.length)*4),c=s>>2;this.module.HEAPU32[c++]=t.length;for(let f=0;f{let s=r.jsepInit;if(!s)throw new Error(\"Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.\");if(e===\"webgpu\"){let c=new wi;await c.initialize(t,u),s(\"webgpu\",[c,f=>c.alloc(f),f=>c.free(f),(f,d,g,w=!1)=>{if(w)Fe(\"verbose\",()=>`[WebGPU] jsepCopyGpuToGpu: src=${f}, dst=${d}, size=${g}`),c.memcpy(f,d);else{Fe(\"verbose\",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${f}, gpuDataId=${d}, size=${g}`);let C=r.HEAPU8.subarray(f>>>0,(f>>>0)+g);c.upload(d,C)}},async(f,d,g)=>{Fe(\"verbose\",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${f}, dataOffset=${d}, size=${g}`),await c.download(f,()=>r.HEAPU8.subarray(d>>>0,(d>>>0)+g))},(f,d,g)=>c.createKernel(f,d,g,r.UTF8ToString(r._JsepGetNodeName(d))),f=>c.releaseKernel(f),(f,d,g,w)=>{Fe(\"verbose\",()=>`[WebGPU] jsepRun: sessionHandle=${g}, kernel=${f}, contextDataOffset=${d}`);let C=new ho(r,c,d);return c.computeKernel(f,C,w)},()=>c.captureBegin(),()=>c.captureEnd(),()=>c.replay()])}else s(\"webnn\")}});var au;au=Zs();var Vh=nu(),Oi,Ri=!1,qn=!1,ou=!1,Wh=e=>{if(e===1)return!1;if(typeof SharedArrayBuffer>\"u\")return typeof self<\"u\"&&!self.crossOriginIsolated&&console.warn(\"env.wasm.numThreads is set to \"+e+\", 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 \"+e+\", 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}},Nh=()=>{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}},Gh=(e,r)=>e?r?\"ort-wasm-simd-threaded.wasm\":\"ort-wasm-simd.wasm\":r?\"ort-wasm-threaded.wasm\":\"ort-wasm.wasm\",su=async e=>{if(Ri)return Promise.resolve();if(qn)throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");if(ou)throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");qn=!0;let r=e.initTimeout,t=e.numThreads,u=e.simd,s=Wh(t),c=u&&Nh(),f=e.wasmPaths,d=typeof f==\"string\"?f:void 0,g=Gh(c,s),w=typeof f==\"object\"?f[g]:void 0,C=!1,$=[];if(r>0&&$.push(new Promise(A=>{setTimeout(()=>{C=!0,A()},r)})),$.push(new Promise((A,P)=>{let x=s?Vh:au,E={locateFile:(O,B)=>{if(s&&O.endsWith(\".worker.js\")&&typeof Blob<\"u\")return URL.createObjectURL(new Blob([iu()],{type:\"text/javascript\"}));if(O.endsWith(\".wasm\")){if(w)return w;let R=d??B;return g===\"ort-wasm-simd.wasm\"?R+\"ort-wasm-simd.jsep.wasm\":g===\"ort-wasm-simd-threaded.wasm\"?R+\"ort-wasm-simd-threaded.jsep.wasm\":R+g}return B+O}};if(s)if(E.numThreads=t,typeof Blob>\"u\")E.mainScriptUrlOrBlob=(void 0)(__dirname,\"ort-wasm-threaded.js\");else{let O=`var ortWasmThreaded=${x.toString()};`;E.mainScriptUrlOrBlob=new Blob([O],{type:\"text/javascript\"})}x(E).then(O=>{qn=!1,Ri=!0,Oi=O,A()},O=>{qn=!1,ou=!0,P(O)})})),await Promise.race($),C)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},Qe=()=>{if(Ri&&Oi)return Oi;throw new Error(\"WebAssembly is not initialized yet.\")};var Xe=(e,r)=>{let t=Qe(),u=t.lengthBytesUTF8(e)+1,s=t._malloc(u);return t.stringToUTF8(e,s,u),r.push(s),s},ln=(e,r,t,u)=>{if(typeof e==\"object\"&&e!==null){if(t.has(e))throw new Error(\"Circular reference in options\");t.add(e)}Object.entries(e).forEach(([s,c])=>{let f=r?r+s:s;if(typeof c==\"object\")ln(c,f+\".\",t,u);else if(typeof c==\"string\"||typeof c==\"number\")u(f,c.toString());else if(typeof c==\"boolean\")u(f,c?\"1\":\"0\");else throw new Error(`Can't handle extra config type: ${typeof c}`)})},Le=e=>{let r=Qe(),t=r.stackSave();try{let u=r.stackAlloc(8);r._OrtGetLastError(u,u+4);let s=r.HEAP32[u/4],c=r.HEAPU32[u/4+1],f=c?r.UTF8ToString(c):\"\";throw new Error(`${e} ERROR_CODE: ${s}, ERROR_MESSAGE: ${f}`)}finally{r.stackRestore(t)}};var uu=e=>{let r=Qe(),t=0,u=[],s=e||{};try{if(e?.logSeverityLevel===void 0)s.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=\"number\"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)s.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=\"number\"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(s.terminate=!1);let c=0;return e?.tag!==void 0&&(c=Xe(e.tag,u)),t=r._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,c),t===0&&Le(\"Can't create run options.\"),e?.extra!==void 0&&ln(e.extra,\"\",new WeakSet,(f,d)=>{let g=Xe(f,u),w=Xe(d,u);r._OrtAddRunConfigEntry(t,g,w)!==0&&Le(`Can't set a run config entry: ${f} - ${d}.`)}),[t,u]}catch(c){throw t!==0&&r._OrtReleaseRunOptions(t),u.forEach(f=>r._free(f)),c}};var Hh=e=>{switch(e){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},Lh=e=>{switch(e){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},Fh=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let r=e.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly=\"1\"),e.executionProviders&&e.executionProviders.some(t=>(typeof t==\"string\"?t:t.name)===\"webgpu\")&&(e.enableMemPattern=!1)},qh=(e,r,t)=>{for(let u of r){let s=typeof u==\"string\"?u:u.name;switch(s){case\"webnn\":if(s=\"WEBNN\",typeof u!=\"string\"){let f=u;if(f?.deviceType){let d=Xe(\"deviceType\",t),g=Xe(f.deviceType,t);Qe()._OrtAddSessionConfigEntry(e,d,g)!==0&&Le(`Can't set a session config entry: 'deviceType' - ${f.deviceType}.`)}if(f?.numThreads){let d=f.numThreads;(typeof d!=\"number\"||!Number.isInteger(d)||d<0)&&(d=0);let g=Xe(\"numThreads\",t),w=Xe(d.toString(),t);Qe()._OrtAddSessionConfigEntry(e,g,w)!==0&&Le(`Can't set a session config entry: 'numThreads' - ${f.numThreads}.`)}if(f?.powerPreference){let d=Xe(\"powerPreference\",t),g=Xe(f.powerPreference,t);Qe()._OrtAddSessionConfigEntry(e,d,g)!==0&&Le(`Can't set a session config entry: 'powerPreference' - ${f.powerPreference}.`)}}break;case\"webgpu\":if(s=\"JS\",typeof u!=\"string\"){let f=u;if(f?.preferredLayout){if(f.preferredLayout!==\"NCHW\"&&f.preferredLayout!==\"NHWC\")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${f.preferredLayout}`);let d=Xe(\"preferredLayout\",t),g=Xe(f.preferredLayout,t);Qe()._OrtAddSessionConfigEntry(e,d,g)!==0&&Le(`Can't set a session config entry: 'preferredLayout' - ${f.preferredLayout}.`)}}break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported execution provider: ${s}`)}let c=Xe(s,t);Qe()._OrtAppendExecutionProvider(e,c)!==0&&Le(`Can't append execution provider: ${s}.`)}},lu=e=>{let r=Qe(),t=0,u=[],s=e||{};Fh(s);try{let c=Hh(s.graphOptimizationLevel??\"all\"),f=Lh(s.executionMode??\"sequential\"),d=typeof s.logId==\"string\"?Xe(s.logId,u):0,g=s.logSeverityLevel??2;if(!Number.isInteger(g)||g<0||g>4)throw new Error(`log serverity level is not valid: ${g}`);let w=s.logVerbosityLevel??0;if(!Number.isInteger(w)||w<0||w>4)throw new Error(`log verbosity level is not valid: ${w}`);let C=typeof s.optimizedModelFilePath==\"string\"?Xe(s.optimizedModelFilePath,u):0;if(t=r._OrtCreateSessionOptions(c,!!s.enableCpuMemArena,!!s.enableMemPattern,f,!!s.enableProfiling,0,d,g,w,C),t===0&&Le(\"Can't create session options.\"),s.executionProviders&&qh(t,s.executionProviders,u),s.enableGraphCapture!==void 0){if(typeof s.enableGraphCapture!=\"boolean\")throw new Error(`enableGraphCapture must be a boolean value: ${s.enableGraphCapture}`);let $=Xe(\"enableGraphCapture\",u),A=Xe(s.enableGraphCapture.toString(),u);r._OrtAddSessionConfigEntry(t,$,A)!==0&&Le(`Can't set a session config entry: 'enableGraphCapture' - ${s.enableGraphCapture}.`)}if(s.freeDimensionOverrides)for(let[$,A]of Object.entries(s.freeDimensionOverrides)){if(typeof $!=\"string\")throw new Error(`free dimension override name must be a string: ${$}`);if(typeof A!=\"number\"||!Number.isInteger(A)||A<0)throw new Error(`free dimension override value must be a non-negative integer: ${A}`);let P=Xe($,u);r._OrtAddFreeDimensionOverride(t,P,A)!==0&&Le(`Can't set a free dimension override: ${$} - ${A}.`)}return s.extra!==void 0&&ln(s.extra,\"\",new WeakSet,($,A)=>{let P=Xe($,u),x=Xe(A,u);r._OrtAddSessionConfigEntry(t,P,x)!==0&&Le(`Can't set a session config entry: ${$} - ${A}.`)}),[t,u]}catch(c){throw t!==0&&r._OrtReleaseSessionOptions(t),u.forEach(f=>r._free(f)),c}};Te();var cu=async e=>{if(typeof e==\"string\")if(typeof process<\"u\"&&process.versions&&process.versions.node)try{return new Uint8Array(await(void 0)(e))}catch(r){if(r.code===\"ERR_FS_FILE_TOO_LARGE\"){let t=(void 0)(e),u=[];for await(let s of t)u.push(s);return new Uint8Array(Buffer.concat(u))}throw r}else{let r=await fetch(e);if(!r.ok)throw new Error(`failed to load external data file: ${e}`);let t=r.headers.get(\"Content-Length\"),u=t?parseInt(t,10):0;if(u<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let s=r.body.getReader(),c;try{c=new ArrayBuffer(u)}catch(d){if(d instanceof RangeError){let g=Math.ceil(u/65536);c=new WebAssembly.Memory({initial:g,maximum:g}).buffer}else throw d}let f=0;for(;;){let{done:d,value:g}=await s.read();if(d)break;let w=g.byteLength;new Uint8Array(c,f,w).set(g),f+=w}return new Uint8Array(c,0,u)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)};var R0=(e,r)=>{Qe()._OrtInit(e,r)!==0&&Le(\"Can't initialize onnxruntime.\")},ff=async e=>{R0(e.wasm.numThreads,dn(e.logLevel))},pf=async(e,r)=>{{let t=(df(),ir(lf)).init;if(r===\"webgpu\"){if(typeof navigator>\"u\"||!navigator.gpu)throw new Error(\"WebGPU is not supported in current environment\");let u=e.webgpu.adapter;if(u){if(typeof u.limits!=\"object\"||typeof u.features!=\"object\"||typeof u.requestDevice!=\"function\")throw new Error(\"Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.\")}else{let s=e.webgpu.powerPreference;if(s!==void 0&&s!==\"low-power\"&&s!==\"high-performance\")throw new Error(`Invalid powerPreference setting: \"${s}\"`);let c=e.webgpu.forceFallbackAdapter;if(c!==void 0&&typeof c!=\"boolean\")throw new Error(`Invalid forceFallbackAdapter setting: \"${c}\"`);if(u=await navigator.gpu.requestAdapter({powerPreference:s,forceFallbackAdapter:c}),!u)throw new Error('Failed to get GPU adapter. You may need to enable flag \"--enable-unsafe-webgpu\" if you are using Chrome.')}if(!e.wasm.simd)throw new Error(\"Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using `webgpu` EP\");await t(\"webgpu\",Qe(),e,u)}if(r===\"webnn\"){if(typeof navigator>\"u\"||!navigator.ml)throw new Error(\"WebNN is not supported in current environment\");await t(\"webnn\",Qe(),e)}}},dr=new Map,B0=e=>{let r=Qe(),t=r.stackSave();try{let u=r.stackAlloc(8);return r._OrtGetInputOutputCount(e,u,u+4)!==0&&Le(\"Can't get session input/output count.\"),[r.HEAP32[u/4],r.HEAP32[u/4+1]]}finally{r.stackRestore(t)}},go=e=>{let r=Qe(),t=r._malloc(e.byteLength);if(t===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return r.HEAPU8.set(e,t),[t,e.byteLength]},mf=async(e,r)=>{let t,u,s=Qe();Array.isArray(e)?[t,u]=e:e.buffer===s.HEAPU8.buffer?[t,u]=[e.byteOffset,e.byteLength]:[t,u]=go(e);let c=0,f=0,d=0,g=[],w=[],C=[];try{if([f,g]=lu(r),r?.externalData&&s.mountExternalData){let R=[];for(let j of r.externalData){let U=typeof j==\"string\"?j:j.path;R.push(cu(typeof j==\"string\"?j:j.data).then(L=>{s.mountExternalData(U,L)}))}await Promise.all(R)}c=await s._OrtCreateSession(t,u,f),c===0&&Le(\"Can't create a session.\");let[$,A]=B0(c),P=!!r?.enableGraphCapture,x=[],E=[],O=[];for(let R=0;R<$;R++){let j=s._OrtGetInputName(c,R);j===0&&Le(\"Can't get an input name.\"),w.push(j),x.push(s.UTF8ToString(j))}for(let R=0;RR===\"gpu-buffer\")&&(d=s._OrtCreateBinding(c),d===0&&Le(\"Can't create IO binding.\"),B={handle:d,outputPreferredLocations:O,outputPreferredLocationsEncoded:O.map(R=>Di(R))}),dr.set(c,[c,w,C,B,P,!1]),[c,x,E]}catch($){throw w.forEach(A=>s._OrtFree(A)),C.forEach(A=>s._OrtFree(A)),d!==0&&s._OrtReleaseBinding(d),c!==0&&s._OrtReleaseSession(c),$}finally{s._free(t),f!==0&&s._OrtReleaseSessionOptions(f),g.forEach($=>s._free($)),s.unmountExternalData?.()}},hf=e=>{let r=Qe(),t=dr.get(e);if(!t)throw new Error(`cannot release session. invalid session id: ${e}`);let[u,s,c,f,d]=t;f&&(d&&r._OrtClearBoundOutputs(f.handle),r._OrtReleaseBinding(f.handle)),r.jsepOnReleaseSession?.(e),s.forEach(g=>r._OrtFree(g)),c.forEach(g=>r._OrtFree(g)),r._OrtReleaseSession(u),dr.delete(e)},cf=(e,r,t,u,s,c=!1)=>{if(!e){r.push(0);return}let f=Qe(),d=e[0],g=e[1],w=e[3],C,$;if(d===\"string\"&&w===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");if(c&&w!==\"gpu-buffer\")throw new Error(`External buffer must be provided for input/output index ${s} when enableGraphCapture is true.`);if(w===\"gpu-buffer\"){let x=e[2].gpuBuffer,E=or(Bi(d));$=g.reduce((B,R)=>B*R,1)*E;let O=f.jsepRegisterBuffer;if(!O)throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');C=O(u,s,x,$)}else{let x=e[2];if(Array.isArray(x)){$=4*x.length,C=f._malloc($),t.push(C);let E=C/4;for(let O=0;Of.HEAP32[x++]=O);let E=f._OrtCreateTensor(Bi(d),C,$,P,g.length,Di(w));E===0&&Le(`Can't create tensor for input/output. session=${u}, index=${s}.`),r.push(E)}finally{f.stackRestore(A)}},gf=async(e,r,t,u,s,c)=>{let f=Qe(),d=dr.get(e);if(!d)throw new Error(`cannot run inference. invalid session id: ${e}`);let g=d[0],w=d[1],C=d[2],$=d[3],A=d[4],P=d[5],x=r.length,E=u.length,O=0,B=[],R=[],j=[],U=[],L=f.stackSave(),F=f.stackAlloc(x*4),te=f.stackAlloc(x*4),J=f.stackAlloc(E*4),oe=f.stackAlloc(E*4);try{[O,B]=uu(c);for(let me=0;meZe*rt,1);Ae=Gt(ce);let Pt=$?.outputPreferredLocations[u[me]];if(Ae===\"string\"){if(Pt===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");let Ze=[],rt=_e/4;for(let ct=0;ct0){let Ze=f.jsepGetBuffer;if(!Ze)throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');let rt=Ze(_e),ct=or(ce);if(ct===void 0||!du(Ae))throw new Error(`Unsupported data type: ${Ae}`);be=!0,ue.push([Ae,Ye,{gpuBuffer:rt,download:f.jsepCreateDownloader(rt,Ke*ct,Ae),dispose:()=>{f._OrtReleaseTensor(Ee)}},\"gpu-buffer\"])}else{let Ze=Kn(Ae),rt=new Ze(Ke);new Uint8Array(rt.buffer,rt.byteOffset,rt.byteLength).set(f.HEAPU8.subarray(_e,_e+rt.byteLength)),ue.push([Ae,Ye,rt,\"cpu\"])}}finally{f.stackRestore(Pe),Ae===\"string\"&&_e&&f._free(_e),be||f._OrtReleaseTensor(Ee)}}return $&&!A&&(f._OrtClearBoundOutputs($.handle),dr.set(e,[g,w,C,$,A,!1])),ue}finally{f.stackRestore(L),R.forEach(le=>f._OrtReleaseTensor(le)),j.forEach(le=>f._OrtReleaseTensor(le)),U.forEach(le=>f._free(le)),O!==0&&f._OrtReleaseRunOptions(O),B.forEach(le=>f._free(le))}},yf=e=>{let r=Qe(),t=dr.get(e);if(!t)throw new Error(\"invalid session id\");let u=t[0],s=r._OrtEndProfiling(u);s===0&&Le(\"Can't get an profile file name.\"),r._OrtFree(s)},bf=e=>{let r=[];for(let t of e){let u=t[2];!Array.isArray(u)&&\"buffer\"in u&&r.push(u.buffer)}return r};self.onmessage=e=>{let{type:r,in:t}=e.data;try{switch(r){case\"init-wasm\":su(t.wasm).then(()=>{ff(t).then(()=>{postMessage({type:r})},u=>{postMessage({type:r,err:u})})},u=>{postMessage({type:r,err:u})});break;case\"init-ep\":{let{epName:u,env:s}=t;pf(s,u).then(()=>{postMessage({type:r})},c=>{postMessage({type:r,err:c})});break}case\"copy-from\":{let{buffer:u}=t,s=go(u);postMessage({type:r,out:s});break}case\"create\":{let{model:u,options:s}=t;mf(u,s).then(c=>{postMessage({type:r,out:c})},c=>{postMessage({type:r,err:c})});break}case\"release\":hf(t),postMessage({type:r});break;case\"run\":{let{sessionId:u,inputIndices:s,inputs:c,outputIndices:f,options:d}=t;gf(u,s,c,f,new Array(f.length).fill(null),d).then(g=>{g.some(w=>w[3]!==\"cpu\")?postMessage({type:r,err:\"Proxy does not support non-cpu tensor location.\"}):postMessage({type:r,out:g},bf([...c,...g]))},g=>{postMessage({type:r,err:g})});break}case\"end-profiling\":yf(t),postMessage({type:r});break;default:}}catch(u){postMessage({type:r,err:u})}};})();\n/**\n * @license\n * Copyright 2021 Google LLC. All Rights Reserved.\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 */\n/**\n * @license\n * Copyright 2020 Google LLC. All Rights Reserved.\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 */\n/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\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 */\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,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,EAAI,CAAC", + "names": ["backends", "backendsSortedByPriority", "registerBackend", "tryResolveAndInitializeBackend", "resolveBackendAndExecutionProviders", "init_backend_impl", "__esmMin", "name", "backend", "priority", "currentBackend", "i", "backendName", "backendInfo", "isInitializing", "e", "options", "eps", "backendHints", "backendNames", "errors", "availableBackendNames", "resolveResult", "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", "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", "ident", "onnxruntime", "init_ort_generated", "__esmMin", "init_flatbuffers", "experimental", "fbs", "AttributeType", "DimensionValueType", "TensorDataType", "NodeType", "TypeInfoValue", "Shape", "i", "bb", "obj", "flatbuffers", "index", "offset", "builder", "dimOffset", "data", "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", "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", "buffer", "start", "end", "parts", "chunk", "i", "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", "str", "newError", "name", "CustomError", "message", "properties", "fieldNames", "fieldMap", "i", "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", "head", "tail", "BufferWriter_", "require_writer_buffer", "__commonJSMin", "exports", "module", "BufferWriter", "Writer", "util", "val", "buf", "pos", "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", "message", "writer", "i", "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", "getOutput", "coord00", "coord01", "coord10", "coord11", "D", "i", "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", "v", "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", "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", "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", "i", "rank", "_s", "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", "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", "b", "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", "shape", "rank", "dimOffset", "funcName", "block", "i", "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", "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", "resolved", "input", "i", "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_simd_jsep", "__commonJSMin", "exports", "module", "ortWasm", "_scriptDir", "moduleArg", "g", "aa", "ba", "readyPromise", "a", "b", "da", "c", "d", "e", "f", "h", "t", "k", "l", "ca", "ea", "fa", "ha", "ia", "ja", "ka", "v", "la", "ma", "na", "fs", "oa", "pa", "qa", "w", "ra", "x", "sa", "z", "E", "ta", "ua", "G", "I", "va", "wa", "xa", "ya", "za", "Aa", "Ba", "Ca", "Da", "Ea", "Fa", "Ga", "Ha", "Ia", "Ja", "Ka", "La", "Ma", "Na", "Oa", "J", "m", "n", "q", "r", "p", "u", "y", "Pa", "Qa", "Ra", "L", "Sa", "Za", "Ta", "Ua", "$a", "ab", "bb", "M", "cb", "N", "db", "eb", "fb", "O", "gb", "P", "hb", "ib", "Q", "jb", "R", "S", "kb", "lb", "mb", "nb", "ob", "pb", "qb", "rb", "sb", "tb", "vb", "ub", "T", "wb", "xb", "yb", "zb", "U", "Ab", "V", "Bb", "Cb", "Db", "Eb", "Fb", "Gb", "Hb", "Ib", "Jb", "Kb", "Lb", "Mb", "Nb", "Ob", "Pb", "Qb", "Rb", "Sb", "Tb", "Ub", "Vb", "Wb", "W", "Xb", "Yb", "Zb", "$b", "ac", "cc", "bc", "dc", "ec", "fc", "gc", "hc", "B", "A", "ic", "jc", "Cf", "kc", "lc", "X", "mc", "nc", "oc", "pc", "qc", "rc", "sc", "tc", "uc", "vc", "wc", "xc", "yc", "zc", "Ac", "Bc", "Cc", "Dc", "Ec", "Fc", "Gc", "Hc", "Ic", "Jc", "Kc", "Lc", "Mc", "Nc", "Oc", "Pc", "Qc", "Rc", "Sc", "Tc", "Uc", "Vc", "Wc", "Xc", "Yc", "Zc", "$c", "ad", "bd", "cd", "dd", "ed", "fd", "gd", "hd", "jd", "kd", "ld", "md", "nd", "od", "pd", "qd", "rd", "sd", "td", "ud", "vd", "wd", "xd", "yd", "zd", "Ad", "Bd", "Cd", "Dd", "Ed", "Fd", "Gd", "Hd", "Id", "Jd", "Kd", "Ld", "Md", "Nd", "Od", "Pd", "Qd", "Rd", "Sd", "Td", "Ud", "Vd", "Wd", "Xd", "Yd", "Zd", "$d", "ae", "be", "ce", "de", "ee", "fe", "ge", "he", "ie", "je", "ke", "le", "me", "ne", "oe", "pe", "qe", "re", "se", "te", "ue", "ve", "we", "xe", "ye", "ze", "Ae", "Be", "Ce", "De", "Ee", "Fe", "Ge", "He", "Ie", "Je", "Ke", "Le", "Me", "Ne", "Oe", "Pe", "Qe", "Re", "Se", "Te", "Ue", "Ve", "We", "Xe", "Ye", "Ze", "$e", "af", "bf", "cf", "df", "ef", "ff", "gf", "hf", "jf", "kf", "lf", "mf", "nf", "of", "pf", "qf", "rf", "sf", "tf", "uf", "vf", "wf", "xf", "yf", "zf", "Af", "Bf", "Df", "Y", "Ef", "Z", "dynCall_vii", "Ff", "dynCall_iii", "Gf", "Hf", "dynCall_vi", "dynCall_v", "If", "Jf", "Kf", "Lf", "Mf", "Nf", "Of", "Pf", "Qf", "Rf", "Sf", "Tf", "Uf", "Vf", "Wf", "Xf", "Yf", "Zf", "$f", "ag", "bg", "cg", "dg", "eg", "fg", "gg", "hg", "ig", "jg", "kg", "lg", "mg", "ng", "og", "pg", "qg", "rg", "sg", "tg", "ug", "vg", "wg", "xg", "yg", "zg", "Ag", "Bg", "Cg", "Dg", "Eg", "Fg", "Gg", "Hg", "Ig", "Jg", "Kg", "Lg", "Mg", "Ng", "Og", "Pg", "Qg", "Rg", "Sg", "Tg", "Ug", "Vg", "Wg", "C", "D", "Xg", "Yg", "Zg", "$g", "ah", "bh", "ch", "dh", "eh", "fh", "gh", "hh", "F", "ih", "jh", "kh", "lh", "mh", "nh", "oh", "ph", "qh", "rh", "sh", "th", "uh", "vh", "wh", "xh", "yh", "zh", "Ah", "Bh", "Ch", "Dh", "Eh", "Fh", "Gh", "Hh", "Ih", "Jh", "Kh", "Lh", "Mh", "Nh", "Oh", "Ph", "Qh", "Rh", "H", "K", "Va", "Wa", "Xa", "Sh", "Th", "Uh", "Vh", "Wh", "Xh", "Yh", "Zh", "$h", "ai", "bi", "ci", "di", "ei", "fi", "gi", "hi", "ii", "ji", "ki", "li", "mi", "ni", "oi", "pi", "qi", "ri", "si", "ti", "ui", "vi", "wi", "xi", "yi", "zi", "Ai", "Bi", "Ci", "Di", "Ei", "Fi", "Gi", "Hi", "Ii", "Ji", "Ki", "Li", "Mi", "Ni", "Qi", "Ya", "Oi", "Pi", "Ri", "require_worker_threads", "__commonJSMin", "require_perf_hooks", "__commonJSMin", "os_exports", "__export", "cpus", "init_os", "__esmMin", "require_ort_wasm_simd_threaded_jsep", "__commonJSMin", "exports", "module", "ortWasmThreaded", "_scriptDir", "moduleArg", "d", "l", "p", "t", "v", "aa", "z", "ba", "A", "ca", "da", "ea", "B", "fa", "C", "a", "b", "c", "e", "f", "h", "k", "q", "n", "m", "r", "w", "x", "D", "g", "u", "ha", "ia", "ja", "E", "ka", "F", "G", "H", "I", "la", "ma", "J", "na", "fs", "oa", "pa", "qa", "ra", "K", "L", "noExitRuntime", "M", "N", "sa", "P", "Q", "ta", "ua", "va", "wa", "xa", "ya", "R", "za", "S", "Aa", "Ba", "Ca", "T", "Da", "Ea", "Fa", "Ga", "U", "Ha", "y", "V", "Ia", "Ja", "Ka", "W", "La", "Ma", "Na", "Oa", "X", "Qa", "Pa", "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", "rb", "sb", "tb", "ub", "vb", "Y", "wb", "xb", "yb", "zb", "Bb", "Ab", "Cb", "Db", "Fb", "Eb", "Gb", "Hb", "Ib", "Jb", "Lb", "Kb", "Mb", "Nb", "Ob", "Pb", "Qb", "Rb", "Tb", "Ub", "Vb", "Wb", "Xb", "Yb", "Sb", "O", "Zb", "$b", "ac", "Z", "bc", "cc", "dc", "ec", "fc", "gc", "hc", "ic", "jc", "kc", "lc", "mc", "nc", "oc", "pc", "qc", "tc", "rc", "sc", "uc", "vc", "wc", "xc", "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", "prefix", "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", "stream", "chunks", "chunk", "response", "contentLengthHeader", "fileSize", "reader", "buffer", "e", "pages", "offset", "done", "value", "chunkSize", "logLevelPrefix", "doLog", "configLogLevel", "debug", "configureLogger", "LOG", "LOG_DEBUG", "init_log", "__esmMin", "init_wasm_common", "level", "message", "$configLogLevel", "$debug", "logLevel", "msg", "messageLevel", "logLevelStringToEnum", "configLevel", "args", "createView", "init_tensor_view", "__esmMin", "init_wasm_common", "dataBuffer", "type", "tensorTypeToTypedArrayConstructor", "init_types", "__esmMin", "bucketFreelist", "bucketArr", "calcNormalizedBufferSize", "calcBucketBufferSize", "guid", "createNewGpuDataId", "downloadGpuData", "GpuDataManagerImpl", "createGpuDataManager", "init_gpu_data_manager", "__esmMin", "init_log", "init_types", "size", "idx", "sizeForBucket", "backend", "gpuBuffer", "originalSize", "getTargetBuffer", "bufferSize", "gpuReadBuffer", "commandEncoder", "arrayBuffer", "targetBuffer", "key", "id", "data", "srcArrayBuffer", "srcOffset", "srcLength", "gpuDataCache", "gpuBufferForUploading", "LOG_DEBUG", "sourceId", "destinationId", "sourceGpuDataCache", "destinationGpuDataCache", "buffer", "previousBuffer", "usage", "isStorage", "isUniform", "buffers", "gpuData", "cachedData", "maxInFreeList", "freelist", "capturedBuffers", "storage", "sessionId", "pendingBuffers", "args", "AttributeWithCacheKeyImpl", "createAttributeWithCacheKey", "init_attribute_with_cache_key", "__esmMin", "attribute", "name", "MatMulUtil", "BroadcastUtil", "ShapeUtil", "PoolConvUtil", "GemmUtil", "MIN_CLIP", "MAX_CLIP", "init_util", "__esmMin", "a", "b", "adims", "bdims", "isMatMul", "arank", "brank", "crank", "cdims", "cShapeMatMul", "i", "aLen", "bLen", "max", "shape", "finalShape", "inputRank", "finalRank", "_ShapeUtil", "dims", "size", "rank", "newDims", "axis", "start", "end", "strides", "tensorRank", "axes", "x", "perm", "v", "pad", "shape1", "shape2", "_PoolConvUtil", "isGlobalOperator", "inputDims", "kernelShape", "dilations", "pads", "dim", "isChannelLast", "autoPad", "outputDims", "filterDims", "inSize", "stride", "dilation", "kernel", "padHeadIndex", "padTailIndex", "dkernel", "padNeeded", "leftShape", "transLeft", "rightShape", "transRight", "biasShape", "M", "K", "N", "kDim", "WORKGROUP_SIZE", "getWgslMappedType", "tensorTypeToWsglStorageType", "tensorTypeToWsglValueType", "createTensorShapeVariables", "getMaxComponents", "fillVector", "castToF32", "sumVector", "getElementAt", "createIndicesHelper", "inputVariable", "outputVariable", "internalVariable", "ShaderHelperImpl", "createShaderHelper", "getBroadcastDims", "init_common", "__esmMin", "init_wasm_common", "init_util", "type", "components", "mappedType", "dims", "programUniforms", "dim", "ShapeUtil", "size", "dataType", "value", "name", "index", "length", "tensorType", "shapeOrRank", "usage", "useUniform", "rank", "rankIdentity", "indicesType", "valueType", "storageType", "normalizeDim", "implementationUsed", "uniformPrefix", "shape", "strides", "o2iSnippet", "i", "offsetToIndicesImplementation", "offsetToIndices", "varOffset", "offsets", "indicesToOffsetImplementation", "indicesToOffset", "varIndices", "indices", "init", "indicesGet", "idx", "indicesSet", "broadcastedIndicesToOffsetImplementation", "broadcastedIndicesToOffset", "output", "implKey", "setByOffset", "offset", "getByOffset", "getByIndicesImplementation", "getImplementation", "functionParams", "dimsParams", "get", "normalizedIndices", "getByIndices", "setByIndicesImplementation", "setImplementation", "impls", "needShapeStrides", "impl", "indicesAndValue", "normalizedDispatchGroup", "limits", "workgroupSize", "workgroupSizeX", "workgroupSizeY", "workgroupSizeZ", "is1DimensionDispatch", "paramList", "globalIdxDefinition", "variable", "bindingIndex", "access", "variables", "v", "additionalUniforms", "uniformSnippets", "typeTemp", "uniformWgslTypeToDataType", "u", "dispatchGroup", "inShape", "outShape", "inRank", "a", "validateInputs", "getAdjustedPerm", "getOutputShape", "permFunctionBody", "createTransposeProgramInfo", "transpose", "parseTransposeAttributes", "init_transpose", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "inputRank", "perm", "inputShape", "ShapeUtil", "rank", "input", "output", "reverseFunc", "i", "inputTensor", "permAttr", "inputDataType", "outputShape", "outputVariable", "inputVariable", "getShaderSource", "shaderHelper", "outputSize", "createTensorShapeVariables", "context", "attributes", "createAttributeWithCacheKey", "reduceOps", "reduceSharedOps", "reduceInitValues", "reduceOutputValues", "getInnerMostAxes", "computeOutAndReduceShapes", "expandShapeToKeepDim", "areAxesInnerMostDims", "getAxesPermutation", "createReduceSharedProgramInfo", "reduceCommon", "reduceMeanShared", "reduceL1Shared", "reduceL2Shared", "reduceLogSumExpShared", "reduceMaxShared", "reduceMinShared", "reduceProdShared", "reduceSumShared", "reduceSumSquareShared", "reduceLogSumShared", "init_reduce_shared", "__esmMin", "init_wasm_common", "init_util", "init_common", "init_reduce", "init_transpose", "numInnerAxes", "rank", "res", "i", "shape", "axes", "outputShape", "dim", "reduceShape", "expandShape", "shapeIdx", "axis", "name", "shaderCache", "inputs", "reduceType", "outputDataType", "inputShape", "outputSize", "ShapeUtil", "reduceSize", "input", "inputVariable", "output", "outputVariable", "workgroupSize", "sharedMemorySnippet", "shaderHelper", "context", "attributes", "updatedAttributes", "createReduceAttributesFromInputs", "updatedAxes", "_dim", "normalizeAxes", "permutedAxes", "createTransposeProgramInfo", "finalOutputShape", "validateInputs", "noOp", "createReduceProgramInfo", "createReduceAttributesFromInputs", "runReduceProgram", "reduceLogSumNaive", "reduceL1Naive", "reduceL2Naive", "reduceLogSumExpNaive", "reduceMaxNaive", "reduceMeanNaive", "reduceMinNaive", "reduceProdNaive", "reduceSumNaive", "reduceSumSquareNaive", "useNaiveReduceMethod", "reduceMean", "reduceL1", "reduceL2", "reduceLogSumExp", "reduceMax", "reduceMin", "reduceProd", "reduceSum", "reduceSumSquare", "reduceLogSum", "init_reduce", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "init_reduce_shared", "inputs", "input", "name", "shaderCache", "reduceOp", "axesInput", "outputDataType", "keepDims", "noopWithEmptyAxes", "outputShape", "inputShape", "inputRank", "axes", "ShapeUtil", "reduceOnAllAxes", "d", "i", "outputRank", "outputSize", "shaderHelper", "idxCopy", "inputVariable", "output", "outputVariable", "ops", "reduceOps", "k", "l", "createTensorShapeVariables", "attributes", "v", "createAttributeWithCacheKey", "context", "updatedAttributes", "_output", "idxZero", "size", "shape", "reduceSize", "dim", "reduceMeanShared", "reduceL1Shared", "reduceL2Shared", "reduceLogSumExpShared", "reduceMaxShared", "reduceMinShared", "reduceProdShared", "reduceSumShared", "reduceSumSquareShared", "reduceLogSumShared", "validateInputs", "argMin", "argMax", "parseArgMinMaxAttributes", "init_argminmax", "__esmMin", "init_wasm_common", "init_attribute_with_cache_key", "init_reduce", "inputs", "context", "attributes", "argMinMaxOp", "input", "output", "axes", "idxZero", "k", "createReduceProgramInfo", "createAttributeWithCacheKey", "validateInputs", "calculateInputIndexImpl", "assignOutputData", "createConcatProgramInfo", "concat", "parseConcatAttributes", "init_concat", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "axis", "referenceIndex", "referenceInput", "inputType", "inputRank", "input", "i", "dim", "numberOfTensors", "sizeInConcatAxisStr", "output", "codeLines", "returnSnippet", "adjustedAxis", "outputShape", "dataType", "outputSize", "ShapeUtil", "sizeInConcatAxis", "inputVars", "previousSum", "inputDependencies", "inputRanks", "programUniforms", "inputVariable", "createTensorShapeVariables", "outputVariable", "indicesAxis", "getShaderSource", "shaderHelper", "context", "attributes", "inputShape", "sum", "nonEmptyInputs", "createAttributeWithCacheKey", "validateAttentionInputs", "createInPlaceSoftmaxProgramInfo", "createAttentionProbsProgramInfo", "createVxAttentionScoreProgramInfo", "applyAttention", "prepare", "attention", "init_attention", "__esmMin", "init_wasm_common", "init_types", "init_common", "init_concat", "inputs", "attributes", "input", "weights", "bias", "maskIndex", "past", "relativePositionBias", "batchSize", "sequenceLength", "inputHiddenSize", "qHiddenSize", "kHiddenSize", "vHiddenSize", "sz", "kvSequenceLength", "pastSequenceLength", "totalSequenceLength", "maxSequenceLength", "maskType", "_context", "n", "d", "components", "getMaxComponents", "WG", "dComp", "elementsPerThread", "programUniforms", "dataType", "tensorTypeToWsglStorageType", "f32Type", "tensorTypeToWsglValueType", "getShaderSource", "shaderHelper", "inputHelper", "outputVariable", "uniforms", "q", "key", "parameters", "probsShape", "alpha", "vectorizedHeadSize", "TILE_SIZE", "dispatch", "inputDependencies", "createTensorShapeVariables", "qInput", "inputVariable", "kInput", "inputVars", "relativePositionBiasInput", "output", "probs", "v", "params", "outputShape", "probsHelper", "vHelper", "context", "k", "_maskIndex", "_past", "pastKey", "pastValue", "outputPresentKey", "outputPresentValue", "presentKeyShape", "concatKeyInputs", "createConcatProgramInfo", "presentValueShape", "concatValueInputs", "value", "inputsK", "inputsV", "M", "K", "N", "outputQ", "outputK", "outputV", "weight", "validateInputs", "createBatchNormInferenceProgramInfo", "parseBatchNormAttributes", "batchNorm", "init_batch_norm", "__esmMin", "init_esm", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "checkShapeEqual", "actual", "expected", "message", "r", "v", "i", "shape", "epsilon", "spatial", "format", "yShape", "components", "getMaxComponents", "cComponents", "outputSize", "ShapeUtil", "useShapesUniforms", "shapeOrRank", "x", "inputVariable", "scale", "bias", "inputMean", "inputVar", "y", "outputVariable", "calcCOffset", "cOffset", "getInferenceModeShaderSource", "helper", "createTensorShapeVariables", "createAttributeWithCacheKey", "context", "outputCount", "updatedAttributes", "env", "validateInputs", "createBiasAddProgramInfo", "biasAdd", "init_bias_add", "__esmMin", "init_util", "init_common", "inputs", "outputShape", "channels", "outputSize", "ShapeUtil", "dataType", "input", "inputVariable", "bias", "residual", "output", "outputVariable", "shaderHelper", "context", "createElementwiseProgramShader", "createElementwiseProgramInfo", "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "parseCastAttributes", "cast", "generateClipAttributesFromInputs", "clip", "ceil", "cos", "cosh", "parseAlphaAttributes", "elu", "erfImpl", "erf", "exp", "floor", "gelu", "leakyRelu", "not", "neg", "reciprocal", "relu", "sigmoid", "parseHardSigmoidAttributes", "hardSigmoid", "sin", "sinh", "sqrt", "tan", "tanhExpression", "tanh", "fastGeluImpl", "fastGeluExpression", "fastGelu", "thresholdedRelu", "log", "init_unary_op", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "shaderHelper", "datasize", "inputDataType", "outputDataType", "funcCall", "additionalImplementation", "vecSize", "expression", "input", "inputVariable", "output", "outputVariable", "name", "cacheKey", "ShapeUtil", "inputTensors", "context", "attributes", "createAttributeWithCacheKey", "func", "inputs", "min", "MIN_CLIP", "max", "MAX_CLIP", "clipAttributes", "dataType", "tensorTypeToWsglValueType", "a", "varType", "x", "validateInputs", "createBiasSplitGeluProgramInfo", "biasSplitGelu", "init_bias_split_gelu", "__esmMin", "init_util", "init_common", "init_unary_op", "inputs", "outputShape", "input", "inputVariable", "bias", "output", "outputVariable", "outputSize", "ShapeUtil", "dataType", "tensorTypeToWsglStorageType", "shaderHelper", "erfImpl", "context", "createBinaryOpProgramShader", "createBinaryOpProgramInfo", "runBinaryOp", "add", "div", "equal", "mul", "pow", "sub", "greater", "less", "greaterOrEqual", "lessOrEqual", "init_binary_op", "__esmMin", "init_wasm_common", "init_util", "init_common", "shaderHelper", "dimsA", "dimsB", "dimsOutput", "vectorize", "doBroadcast", "sharedDimensionDivisibleBy4", "funcCall", "typeA", "typeB", "typeOutput", "additionalImplementation", "expressionScalar", "expressionVector", "a", "b", "output", "outputVariable", "inputVariable", "assignment", "isAOneElement", "ShapeUtil", "isBOneElement", "aLastDimDivisibleBy4", "bLastDimDivisibleBy4", "singleAssignment", "resStr", "x", "typeCast", "expressionA", "expressionB", "name", "cacheKey", "outputDataType", "isBroadcast", "outputShape", "outputSize", "cacheKeyAux", "calculatedShape", "BroadcastUtil", "sharedDimension", "i", "dimA", "dimB", "createTensorShapeVariables", "context", "type", "getActivationSnippet", "appendActivationUniformsData", "appendActivationUniforms", "parseInternalActivationAttributes", "init_fuse_utils", "__esmMin", "init_wasm_common", "init_util", "attributes", "valueType", "baseType", "programUniform", "uniforms", "activation", "alpha", "beta", "clipMin", "clipMax", "MIN_CLIP", "MAX_CLIP", "typeSnippet", "biasSnippet", "init_activation_util", "__esmMin", "component", "dataType", "hasBias", "utilFunctions", "init_conv_util", "__esmMin", "strideStr", "writeDataToSubAVec4Snippet", "calculateResultSnippet", "makeMatMulPackedVec4Source", "writeDataToSubASnippet", "readDataFromSubASnippet", "makeMatMulPackedSource", "matMulReadWriteFnSource", "createMatmulProgramInfo", "init_matmul_packed_webgpu", "__esmMin", "init_wasm_common", "init_util", "init_common", "init_fuse_utils", "init_activation_util", "transpose", "batchDims", "transposeA", "innerElementSize", "workPerThread", "workgroupSize", "type", "tileInner", "splitK", "splitedDimInner", "tileAOuter", "tileBOuter", "tileAWidth", "tileAHight", "rowPerThreadB", "sequentialAccessByThreads", "rowPerThreadA", "colPerThreadA", "matmulSnippet", "component", "hasBias", "applyActivation", "variables", "batchShapes", "isChannelsLast", "batchAShape", "batchBShape", "batchShape", "batchVariable", "aVariable", "bVariable", "outputVariable", "broadCastADims", "getBroadcastDims", "broadCastBDims", "dataType", "tensorTypeToWsglStorageType", "getAIndices", "aRank", "batchRank", "resStr", "i", "j", "getBIndices", "bRank", "typeSnippet", "inputs", "activationAttributes", "outputShape", "reshapedOutputShape", "aShape", "bShape", "outerDimsA", "outerDimsB", "outerDims", "batchSize", "ShapeUtil", "dimAOuter", "dimInner", "dimBOuter", "isVec4", "elementsPerThread", "dispatch", "components", "aShapeTemp", "bShapeTemp", "outputShapeTemp", "programUniforms", "appendActivationUniformsData", "createTensorShapeVariables", "inputDependencies", "getShaderSource", "shaderHelper", "internalVariable", "A", "inputVariable", "B", "output", "inputVariables", "biasComponents", "uniforms", "appendActivationUniforms", "baseType", "getActivationSnippet", "declareFunctions", "conv2dCommonSnippet", "createConv2DMatMulProgramInfo", "init_conv2d_mm_webgpu", "__esmMin", "init_wasm_common", "init_log", "init_common", "init_fuse_utils", "init_activation_util", "init_conv_util", "init_matmul_packed_webgpu", "isChannelsLast", "fitAOuter", "fitBOuter", "fitInner", "addBias", "attributes", "innerElementSizeX", "innerElementSizeW", "innerElementSize", "dataType", "getXSnippet", "getWSnippet", "coordASnippet", "coordResSnippet", "xHeight", "xWidth", "row", "col", "readXSnippet", "typeSnippet", "sampleX", "sampleW", "resType", "aType", "bType", "applyActivation", "getActivationSnippet", "biasSnippet", "inputs", "outputShape", "dimAOuter", "dimBOuter", "dimInner", "hasBias", "sequentialAccessByThreads", "inChannels", "batchSize", "outWidth", "outHeight", "outChannels", "isVec4", "dispatchX", "dispatchY", "workGroupSize", "elementsPerThread", "dispatch", "LOG_DEBUG", "tileAOuter", "tileBOuter", "tileInner", "elementsSize", "programUniforms", "appendActivationUniformsData", "createTensorShapeVariables", "inputDependencies", "getShaderSource", "shaderHelper", "uniforms", "appendActivationUniforms", "components", "t", "tensorTypeToWsglStorageType", "declareFunctions", "x", "inputVariable", "w", "inputVariables", "output", "outputVariable", "bias", "utilFunctions", "makeMatMulPackedVec4Source", "makeMatMulPackedSource", "createGroupedConvProgramInfo", "createGroupedConvVectorizeProgramInfo", "init_conv_grouped", "__esmMin", "init_wasm_common", "init_util", "init_common", "init_conv", "init_fuse_utils", "inputs", "attributes", "squeezeOutputShapeFunction", "hasBias", "processBias", "xShape", "wShape", "outputChannelsPerGroup", "isChannelLast", "outputShape", "calculateOutputShape", "outputSize", "ShapeUtil", "programUniforms", "appendActivationUniformsData", "createTensorShapeVariables", "inputDependencies", "getShaderSource", "shaderHelper", "output", "outputVariable", "baseType", "tensorTypeToWsglStorageType", "applyActivation", "getActivationSnippet", "x", "inputVariable", "w", "inputVars", "uniforms", "appendActivationUniforms", "components", "getMaxComponents", "outputNumber", "outputShapeInShader", "xNumber", "createNaiveMatmulProgramInfo", "validateInputs", "matMul", "init_matmul", "__esmMin", "init_wasm_common", "init_util", "init_matmul_packed_webgpu", "init_common", "init_fuse_utils", "inputs", "activationAttributes", "outputShape", "reshapedOutputShape", "isChannelsLast", "aShape", "bShape", "M", "N", "K", "components", "getMaxComponents", "aComponents", "outputNumber", "outputSize", "ShapeUtil", "hasBias", "outerDims", "outputShapeInShader", "programUniforms", "appendActivationUniformsData", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "batchDims", "internalVariable", "a", "inputVariable", "b", "output", "outputVariable", "baseType", "tensorTypeToWsglStorageType", "applyActivation", "getActivationSnippet", "inputVariables", "processBias", "biasComponents", "outerDimsA", "outerDimsB", "broadCastADims", "getBroadcastDims", "broadCastBDims", "uniforms", "appendActivationUniforms", "getIndices", "variable", "broadCastDims", "rank", "name", "batchRank", "resStr", "i", "j", "calcResult", "calcStr", "context", "BroadcastUtil", "createMatmulProgramInfo", "calculateOutputShape", "weightTransposeAttribute", "validateInputs", "getAdjustedConvAttributes", "parseConvAttributes", "conv2d", "conv1d", "conv", "init_conv", "__esmMin", "init_util", "init_conv2d_mm_webgpu", "init_matmul_packed_webgpu", "init_conv_grouped", "init_fuse_utils", "init_matmul", "init_transpose", "inputShape", "kernelShape", "dilations", "adjustPads", "strides", "isChannelLast", "batchSize", "inputSpatialShape", "spatialRank", "outChannels", "dilatedKernelShape", "v", "i", "outputShape", "inputs", "attributes", "dataChannel", "filterInChannel", "pads", "PoolConvUtil", "newAttributes", "activationAttributes", "parseInternalActivationAttributes", "format", "autoPad", "group", "wIsConst", "context", "adjustedAttributes", "isChannelsLast", "transposedWeight", "createTransposeProgramInfo", "convInputs", "createGroupedConvVectorizeProgramInfo", "createGroupedConvProgramInfo", "hasBias", "inputHeight", "inputWidth", "inputChannels", "weightHeight", "weightWidth", "outHeight", "outWidth", "sameSize", "batch", "xReshaped", "wReshaped", "matmulOutputShape", "matmulInputs", "sharedDim", "N", "K", "createNaiveMatmulProgramInfo", "createMatmulProgramInfo", "sequentialAccessByThreads", "dimAOuter", "dimBOuter", "dimInner", "createConv2DMatMulProgramInfo", "conv2dTransposeCommonSnippet", "createConv2DTransposeMatMulProgramInfo", "init_conv_backprop_mm_webgpu", "__esmMin", "init_wasm_common", "init_log", "init_common", "init_fuse_utils", "init_activation_util", "init_conv_util", "init_matmul_packed_webgpu", "isChannelsLast", "addBias", "attributes", "type", "innerElementSize", "getWSnippet", "coordASnippet", "coordResSnippet", "xHeight", "xWidth", "row", "col", "readASnippet", "sampleA", "sampleW", "applyActivation", "getActivationSnippet", "biasSnippet", "inputs", "outputShape", "dimAOuter", "dimBOuter", "dimInner", "hasBias", "sequentialAccessByThreads", "inChannels", "batchSize", "outWidth", "outHeight", "outChannels", "isVec4", "dispatchX", "dispatchY", "workGroupSize", "elementsPerThread", "dispatch", "LOG_DEBUG", "tileInner", "components", "filterDims", "effectiveFilterDims", "pads", "programUniforms", "appendActivationUniformsData", "createTensorShapeVariables", "inputDependencies", "getShaderSource", "shaderHelper", "x", "inputVariable", "w", "output", "outputVariable", "inputVariables", "declareFunctions", "bias", "uniforms", "appendActivationUniforms", "elemType", "tensorTypeToWsglStorageType", "utilFunctions", "makeMatMulPackedVec4Source", "makeMatMulPackedSource", "createConvTranspose2DOpProgramShaderSource", "createConvTranspose2DProgramInfo", "init_conv_backprop_webgpu", "__esmMin", "init_wasm_common", "init_log", "init_util", "init_common", "shaderHelper", "inputs", "outputShape", "hasBias", "is1DimensionDispatch", "isVec4", "dataType", "uniforms", "isChannelsLast", "rowDim", "colDim", "channelDim", "workPerThread", "declareFunctions", "components", "w", "inputVariable", "dy", "inputVariables", "output", "outputVariable", "codeSnippet4", "codeSnippet", "attributes", "squeezeOutputShapeFunction", "outputSize", "ShapeUtil", "dispatch", "LOG_DEBUG", "inputDependencies", "strides", "filterDims", "dilations", "effectiveFilterDims", "pads", "group", "wShape", "inputChannelsPerGroup", "outputChannelsPerGroup", "programUniforms", "createTensorShapeVariables", "getShaderSource", "tensorTypeToWsglStorageType", "computeTotalPad", "distributePadding", "calculateOutputShapeAndPads", "getAdjustedConvTransposeAttributes", "parseConvTransposeAttributes", "validateInputs", "weightTransposePerm", "convTranspose2d", "convTranspose1d", "convTranspose", "init_conv_transpose", "__esmMin", "init_conv_backprop_mm_webgpu", "init_conv_backprop_webgpu", "init_fuse_utils", "init_transpose", "inDim", "stride", "adj", "kernel", "dilation", "outSize", "totalPad", "autoPad", "pads", "head", "tail", "smallPad", "inputShape", "kernelShape", "dilations", "group", "strides", "isChannelLast", "outputPadding", "outputShape", "spatialRank", "updateOutputShape", "i", "batchSize", "outChannels", "j", "inSize", "attributes", "inputs", "a", "b", "isChannelsLast", "newAttributes", "activationAttributes", "parseInternalActivationAttributes", "format", "wIsConst", "dataChannel", "filterInChannel", "featureMaps", "context", "adjustedAttributes", "inputChannels", "createConvTranspose2DProgramInfo", "outHeight", "outWidth", "weightHeight", "weightWidth", "dimAOuter", "dimBOuter", "dimInner", "sequentialAccessByThreads", "transposedWeight", "createTransposeProgramInfo", "convTransposeInputs", "hasBias", "createConv2DTransposeMatMulProgramInfo", "createCumsumProgramInfo", "cumsum", "parseCumSumAttributes", "init_cumsum", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputType", "inputShape", "axisInput", "attributes", "outputSize", "ShapeUtil", "rank", "input", "inputVariable", "output", "outputVariable", "axisValue", "axis", "getShaderSource", "shaderHelper", "index", "max", "getElementAt", "lowerLimit", "upperLimit", "createTensorShapeVariables", "context", "exclusive", "reverse", "createAttributeWithCacheKey", "validateInputs", "permFunctionBody", "createDepthToSpaceProgramInfo", "depthToSpace", "parseDepthToSpaceAttributes", "init_depth_to_space", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "perm", "rank", "input", "output", "reverseFunc", "i", "inputTensor", "attributes", "n", "h", "w", "c", "shape", "isChannelLast", "blocksize", "isDCRmode", "reshapedInputTensor", "reshapedInputRank", "inputDataType", "reshapedInput", "inputVariable", "permedOutput", "outputVariable", "getShaderSource", "shaderHelper", "outputShape", "outputSize", "ShapeUtil", "shapeBeforePerm", "shapeAfterPerm", "createTensorShapeVariables", "context", "createAttributeWithCacheKey", "symbolPattern", "termPattern", "termPatternOnly", "lhsPattern", "lhsPatternOnly", "EinsumTerm", "EinsumEquation", "appendMax", "createEinsumProgramInfo", "einsum", "parseEinsumAttributes", "init_einsum", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputIndex", "symbol", "index", "value", "inputs", "equation", "lhs", "rhs", "inputTerm", "dims", "einsumTerm", "sym", "info", "dimValue", "term", "isInput", "rank", "ellipsis", "ellipsisDims", "nextDim", "indexSymbols", "i", "ellipsisDimLength", "j", "name", "inputShapes", "dataType", "einsumEquation", "outputShape", "inputVars", "inputVariable", "outputSize", "ShapeUtil", "output", "outputVariable", "uniformsSymbols", "getShaderSource", "shaderHelper", "idxCopy", "initProd", "initSum", "updateSum", "reduceOpsSetIndices", "reduceOpsLoopHeaders", "reduceOpsLoopFooters", "reduceOpCompute", "isReduceOpsWithoutLoop", "outputIndex", "indices", "reduceOps", "inputVar", "_var", "programUniformsInit", "programUniforms", "_", "createTensorShapeVariables", "acc", "inputProgramUniforms", "context", "attributes", "input", "createAttributeWithCacheKey", "validateInputs", "getAdjustedShape", "calculateOutputShape", "createExpandProgramInfo", "expand", "init_expand", "__esmMin", "init_wasm_common", "init_util", "init_common", "inputs", "inputShape", "shape", "shapeIndex", "inputShapeIndex", "shape1", "shape2", "diff", "outputShape", "dataType", "components", "outputSize", "ShapeUtil", "getShaderSource", "shaderHelper", "input", "inputVariable", "output", "outputVariable", "assignment", "singleAssignment", "resStr", "x", "typeCast", "programUniforms", "createTensorShapeVariables", "context", "createFastGeluProgramInfo", "fastGelu", "init_fast_gelu", "__esmMin", "init_wasm_common", "init_util", "init_common", "init_unary_op", "inputTensors", "dataType", "outputSize", "ShapeUtil", "biasLength", "useVec4", "getShaderSource", "shaderHelper", "x", "inputVariable", "bias", "y", "outputVariable", "uniforms", "singleElementBias", "i", "biasGetExpression", "fastGeluImpl", "tensorTypeToWsglValueType", "WORKGROUP_SIZE", "fastGeluExpression", "inputs", "context", "validateInputs", "createGatherProgramInfo", "parseGatherAttributes", "gather", "init_gather", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "inputShape", "indicesShape", "inputRank", "axis", "ShapeUtil", "outputShape", "axisDimLimit", "components", "outputSize", "programUniforms", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "data", "inputVariable", "indices", "output", "outputVariable", "calcDataIndices", "x", "indicesRank", "calcStr", "i", "j", "assignment", "singleAssignment", "resStr", "typeCast", "createAttributeWithCacheKey", "context", "validateInputs", "createGatherElementsProgramInfo", "parseGatherElementsAttributes", "gatherElements", "init_gather_elements", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "inputShape", "inputOutputDataType", "inputRank", "indicesShape", "indicesDataType", "axis", "ShapeUtil", "axisDimLimit", "outputShape", "outputSize", "input", "inputVariable", "indices", "output", "outputVariable", "programUniforms", "createTensorShapeVariables", "shaderHelper", "createAttributeWithCacheKey", "context", "validateInputs", "createGemmProgramInfo", "parseGemmAttributes", "gemm", "init_gemm", "__esmMin", "init_wasm_common", "init_util", "init_common", "inputs", "attributes", "aShape", "bShape", "M", "N", "K", "GemmUtil", "outputShape", "outputSize", "ShapeUtil", "programUniforms", "inputDependencies", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "line", "calculateAlpha", "a", "inputVariable", "b", "dataType", "c", "variables", "output", "outputVariable", "uniforms", "transA", "transB", "alpha", "beta", "context", "createInstanceNormProgramInfo", "computeMean", "createInstanceNormNHWCProgramInfo", "instanceNorm", "init_instance_norm", "__esmMin", "init_wasm_common", "init_util", "init_common", "inputs", "attributes", "xShape", "outputShape", "axis", "normCount", "ShapeUtil", "normSize", "components", "getMaxComponents", "normPackedSize", "inputShape", "inputDependencies", "programUniforms", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "x", "inputVariable", "scale", "bias", "output", "outputVariable", "variables", "dataType", "f32Type", "workgroupSize", "uniforms", "sumVector", "context", "input", "n", "h", "c", "epsilon", "WG", "outputType", "sumCastType", "setOutputValue", "var1", "var2", "unitsOfWork", "wgSize", "meanInputDependencies", "meanProgramUniforms", "getMeanShaderSource", "inputHelper", "fillVector", "meanValues", "scaleHelper", "biasHelper", "N", "C", "H", "outputSize", "channelScaleShift", "tensorTypeToWsglStorageType", "scaleType", "scaleCastType", "outputHelper", "validateInputs", "createLayerNormProgramInfo", "layerNorm", "init_layer_norm", "__esmMin", "init_wasm_common", "init_util", "init_common", "inputs", "attributes", "outputCount", "simplified", "xShape", "scale", "bias", "outputShape", "axis", "ShapeUtil", "normCount", "normSize", "scaleSize", "biasSize", "meanInvStdDevDim", "i", "components", "getMaxComponents", "inputDependencies", "programUniforms", "hasMeanDataOutput", "hasInvStdOutput", "getShaderSource", "shaderHelper", "dataType", "tensorTypeToWsglStorageType", "variables", "inputVariable", "outputVariable", "uniforms", "fillVector", "castToF32", "sumVector", "outputs", "context", "validateInputs", "createMatMulNBitsProgramInfo", "matMulNBits", "parseMatMulNBitsAttributes", "init_matmulnbits", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "a", "aRank", "nBlocksPerCol", "blobSize", "b", "ShapeUtil", "scalesShape", "zeroPointsShape", "expectedZeroPointsSize", "maxComputeWorkgroupSizes", "maxComputeWorkgroupStorageSize", "inputShape", "dimAOuter", "dimInner", "dimBOuter", "batchDims", "batchSize", "blobSizeInWords", "dataType", "outputNumber", "getMaxComponents", "aComponents", "bComponents", "elementSize", "getTensorElementSize", "workgroupOutputSize", "maxNumberOfComponents", "useBlockwiseMatMulNBits", "components", "outputShape", "outputSize", "programUniforms", "inputShapeTemp", "bShape", "createTensorShapeVariables", "outputShapeTemp", "getShaderSource", "shaderHelper", "inputRank", "inputVariable", "scales", "inputVariables", "zeroPoints", "outputRank", "output", "outputVariable", "uniforms", "tensorTypeToWsglStorageType", "qDqDataType", "processOneBlock", "_", "i", "updateZeroPointIndex", "context", "createAttributeWithCacheKey", "getInput", "validateInputs", "parseMultiHeadAttentionAttributes", "weightTransposeAttribute", "addBiasTranspose", "maybeTransposeToBNSHAndAddBias", "multiHeadAttention", "init_multihead_attentiion", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_types", "init_attention", "init_common", "init_transpose", "inputs", "i", "ShapeUtil", "attributes", "query", "key", "value", "bias", "keyPaddingMask", "relativePositionBias", "pastKey", "pastValue", "dmmhaPacking", "batchSize", "sequenceLength", "hiddenSize", "kvSequenceLength", "pastSequenceLength", "maxSequenceLength", "headSize", "qkvFormat", "maskType", "maskDims", "passPastInKv", "vHiddenSize", "totalSequenceLength", "broadcastResPosBias", "createAttributeWithCacheKey", "context", "qkv", "biasOffset", "outputShape", "outputSize", "programUniforms", "getShaderSource", "shaderHelper", "output", "outputVariable", "qkvInput", "inputVariable", "biasInput", "uniforms", "numHeads", "input", "reshapedInput", "createTransposeProgramInfo", "params", "kvBNSH", "Q", "applyAttention", "K", "V", "validateInputs", "getPadConstant", "getPadReflect", "getPadEdge", "getPadWrap", "getPadSnippet", "createPadProgramInfo", "createPadAttributesFromInputs", "pad", "init_pad", "__esmMin", "init_wasm_common", "init_util", "init_common", "inputs", "validPads", "output", "inputRank", "padsLength", "block", "getElementAt", "attributes", "outputShape", "ShapeUtil", "inputDims", "outputSize", "programUniforms", "createTensorShapeVariables", "inputDependencies", "getShaderSource", "shaderHelper", "outputVariable", "input", "inputVariable", "dataType", "padSnippet", "uniforms", "bigInt64Pads", "value", "updatePads", "axes", "i", "v", "pads", "context", "updatedAttributes", "validateInputs", "getAdjustedPoolAttributesAndOutputShape", "getUniformAndPadInfo", "generatePoolingCode", "createShaderKeyFromAttributes", "createAveragePoolShaderKeyFromAttributes", "createMaxPoolShaderKeyFromAttributes", "parsePoolCommonAttributes", "createAveragePoolProgramInfo", "parseAveragePoolAttributes", "averagePool", "globalPoolAttributes", "parseGlobalAveragePoolAttributes", "globalAveragePool", "createMaxPoolProgramInfo", "maxPool", "parseMaxPoolAttributes", "parseGlobalMaxPoolAttributes", "globalMaxPool", "init_pool", "__esmMin", "init_esm", "init_wasm_common", "init_util", "init_common", "inputs", "env", "input", "attributes", "isGlobalOperator", "isChannelsLast", "inputShapeAsChannelFirst", "hasDilations", "kernelShape", "strides", "dilations", "pads", "PoolConvUtil", "outputShapeAsChannelFirst", "newAttributes", "outputShapeAsChannelLast", "outputShape", "outputSize", "ShapeUtil", "kernelSize", "programUniforms", "uniforms", "kw", "sw", "pwStart", "pwEnd", "pwStartEndNotZero", "phStartEndNotZero", "kh", "sh", "phStart", "phEnd", "kernelStrides", "hasPads", "sum", "cur", "shaderHelper", "x", "rank", "outputShapeRank", "op1", "op2", "start", "dataType", "output", "outputVariable", "codeW", "codeH", "codeHEnd", "dimIdxW", "dimIdxH", "stridesRank", "padsRank", "padCode", "getElementAt", "name", "adjustedAttributes", "inputVariable", "createTensorShapeVariables", "inputDependencies", "countIncludePad", "attr", "averagePoolAttributes", "context", "format", "storageOrder", "maxPoolAttributes", "validateInputsContent", "createRangeProgramInfo", "range", "init_range", "__esmMin", "init_esm", "init_wasm_common", "init_common", "start", "limit", "delta", "sameStartLimit", "increasingRangeNegativeStep", "decreasingRangePositiveStep", "dataType", "numElements", "outputShape", "outputSize", "programUniforms", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "output", "outputVariable", "wgslType", "uniforms", "context", "env", "validateScales", "updateScales", "validateInputs", "getOriginalCoordinateFromResizedCoordinate", "getNearestPixelFromOriginal", "updateRoI", "initOutputShape", "adjustOutputShape", "calculateOriginalIndicesFromOutputIndices", "calculateInputIndicesFromOutputIndices", "checkInputIndices", "setChannelAndBatchIndices", "bilinearInterpolation", "bicubicInterpolation", "trilinearInterpolation", "createResizeProgramInfo", "getOpsetVersionFromCustomDataBuffer", "resize", "parseResizeAttributes", "init_resize", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "scales", "attributes", "value", "axes", "rank", "newScales", "index", "inputs", "opsetVersion", "sizes", "roi", "roiInputIndex", "scalesInputIndex", "sizesInputIndex", "coordinateTransferMode", "dType", "nearestMode", "roiTmp", "roiLocal", "v", "i", "inputShape", "outputShape", "scaleInPolicy", "adjustedOutputShape", "output", "scalesLength", "roiLength", "getElementAt", "input", "useExtrapolation", "channelIdx", "batchIdx", "spacialDims", "extrapolationValue", "heightIdx", "widthIdx", "cubicCoeffA", "excludeOutside", "is2D", "isNchw", "createCubicInterpolationFunction", "idx", "direction", "depthIdx", "inputTensor", "scalesInput", "roiInput", "outputVariable", "inputVariable", "outputSize", "ShapeUtil", "noScale", "d", "dataType", "getShaderSource", "shaderHelper", "createTensorShapeVariables", "context", "customDataBuffer", "antialias", "coordinateTransformMode", "keepAspectRatioPolicy", "mode", "createAttributeWithCacheKey", "validateInputs", "createRotaryEmbeddingProgramInfo", "rotaryEmbedding", "init_rotary_embedding", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "input", "positionIds", "cosCache", "sinCache", "numHeads", "rotaryEmbeddingDim", "ShapeUtil", "batchSize", "sequenceLength", "maxSequenceLength", "hiddenSize", "headSize", "interleaved", "scale", "batchStride", "halfRotaryEmbeddingDim", "globalShape", "globalStrides", "programUniforms", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "inputVariable", "output", "outputVariable", "WORKGROUP_SIZE", "createAttributeWithCacheKey", "context", "validateInputs", "createSkipLayerNormProgramInfo", "skipLayerNorm", "init_skip_layer_norm", "__esmMin", "init_wasm_common", "init_util", "init_common", "inputs", "input", "skip", "gamma", "hiddenSize", "sequenceLength", "beta", "bias", "attributes", "outputCount", "isTraining", "simplified", "inputShape", "inputSize", "ShapeUtil", "outputShape", "outputSize", "meanInvStdDevDim", "hasBetaInput", "hasBiasInput", "hasMeanOutput", "hasInvStdDevOutput", "hasInputSkipBiasSumOutput", "components", "getMaxComponents", "programUniforms", "getShaderSource", "shaderHelper", "uniformsArray", "variables", "inputVariable", "outputVariable", "dataType", "tensorTypeToWsglStorageType", "fillVector", "castToF32", "sumVector", "outputs", "_input", "_index", "context", "validateInputs", "readInput", "createSliceAttributesFromInputs", "fixStartEndValues", "calculateInputIndicesImpl", "createSliceProgramInfo", "slice", "parseSliceAttributes", "init_slice", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "_", "idx", "input", "v", "starts", "ends", "axes", "createAttributeWithCacheKey", "value", "index", "inputShape", "steps", "newValue", "output", "getElementAt", "inputSize", "ShapeUtil", "step", "start", "i", "end", "signs", "array", "numSteps", "newEnd", "newStart", "outputShape", "axis", "outputTensorInfo", "outputVariable", "inputVariable", "outputSize", "uniforms", "programUniforms", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "context", "updatedAttributes", "validateInputs", "createSoftmaxProgramInfo", "softmax", "parseSoftmaxAttributes", "init_softmax", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "input", "attributes", "shape", "outputSize", "ShapeUtil", "WG", "axis", "cols", "rows", "components", "getMaxComponents", "packedCols", "maxVector", "name", "x", "inputVariable", "output", "outputVariable", "valueType", "threadMaxDecl", "tensorTypeToWsglStorageType", "getShaderSource", "shaderHelper", "sumVector", "context", "createAttributeWithCacheKey", "validateInputs", "createSplitAttributesFromInputs", "calculateOutputIndexImpl", "writeBufferDataImpl", "createSplitProgramInfo", "split", "parseSplitAttributes", "init_split", "__esmMin", "init_wasm_common", "init_util", "init_attribute_with_cache_key", "init_common", "inputs", "attributes", "splitSizes", "numOutputs", "v", "createAttributeWithCacheKey", "numberOfTensors", "getElementAt", "outputs", "codeLines", "i", "returnSnippet", "inputShape", "inputSize", "ShapeUtil", "dataType", "axis", "input", "inputVariable", "sizeInSplitAxis", "outputsTensorInfo", "outputShapes", "previousSum", "programUniforms", "outputShape", "outputVariable", "createTensorShapeVariables", "getShaderSource", "shaderHelper", "context", "updatedAttributes", "getRepeats", "validateInputs", "getOutputShape", "createTileProgramInfo", "tile", "init_tile", "__esmMin", "init_wasm_common", "init_util", "init_common", "repeatsTensorView", "inputs", "inputShape", "repeats", "outputShape", "i", "outputSize", "ShapeUtil", "dataType", "input", "inputVariable", "output", "outputVariable", "getShaderSource", "shaderHelper", "createTensorShapeVariables", "context", "createWhereOpProgramShader", "createWhereOpProgramInfo", "where", "init_where", "__esmMin", "init_wasm_common", "init_util", "init_common", "shaderHelper", "inputs", "dimsOutput", "isBroadcast", "typeOutput", "output", "outputVariable", "a", "inputVariable", "b", "c", "assignment", "expression", "singleAssignment", "resStr", "typeCast", "expressionA", "expressionB", "expressionC", "dimsA", "dimsB", "dimsC", "outputDataType", "ShapeUtil", "outputShape", "outputSize", "calculatedShape", "BroadcastUtil", "vecSize", "createTensorShapeVariables", "context", "WEBGPU_OP_RESOLVE_RULES", "init_op_resolve_rules", "__esmMin", "init_argminmax", "init_attention", "init_batch_norm", "init_bias_add", "init_bias_split_gelu", "init_binary_op", "init_concat", "init_conv", "init_conv_transpose", "init_cumsum", "init_depth_to_space", "init_einsum", "init_expand", "init_fast_gelu", "init_gather", "init_gather_elements", "init_gemm", "init_instance_norm", "init_layer_norm", "init_matmul", "init_matmulnbits", "init_multihead_attentiion", "init_pad", "init_pool", "init_range", "init_reduce", "init_resize", "init_rotary_embedding", "init_skip_layer_norm", "init_slice", "init_softmax", "init_split", "init_tile", "init_transpose", "init_unary_op", "init_where", "abs", "acos", "acosh", "add", "argMax", "parseArgMinMaxAttributes", "argMin", "asin", "asinh", "atan", "atanh", "attention", "averagePool", "parseAveragePoolAttributes", "batchNorm", "biasAdd", "biasSplitGelu", "cast", "parseCastAttributes", "ceil", "clip", "concat", "parseConcatAttributes", "conv", "parseConvAttributes", "convTranspose", "parseConvTransposeAttributes", "cos", "cosh", "cumsum", "parseCumSumAttributes", "depthToSpace", "parseDepthToSpaceAttributes", "div", "einsum", "parseEinsumAttributes", "elu", "parseAlphaAttributes", "equal", "erf", "exp", "expand", "fastGelu", "floor", "gather", "parseGatherAttributes", "gatherElements", "parseGatherElementsAttributes", "gelu", "gemm", "parseGemmAttributes", "globalAveragePool", "parseGlobalAveragePoolAttributes", "globalMaxPool", "parseGlobalMaxPoolAttributes", "greater", "greaterOrEqual", "hardSigmoid", "parseHardSigmoidAttributes", "instanceNorm", "layerNorm", "leakyRelu", "less", "lessOrEqual", "log", "matMul", "matMulNBits", "parseMatMulNBitsAttributes", "maxPool", "parseMaxPoolAttributes", "mul", "multiHeadAttention", "parseMultiHeadAttentionAttributes", "neg", "not", "pad", "pow", "range", "reciprocal", "reduceMin", "reduceMean", "reduceMax", "reduceSum", "reduceProd", "reduceL1", "reduceL2", "reduceLogSum", "reduceLogSumExp", "reduceSumSquare", "relu", "resize", "parseResizeAttributes", "rotaryEmbedding", "sigmoid", "sin", "sinh", "slice", "parseSliceAttributes", "skipLayerNorm", "split", "parseSplitAttributes", "sqrt", "softmax", "parseSoftmaxAttributes", "sub", "tan", "tanh", "thresholdedRelu", "tile", "transpose", "parseTransposeAttributes", "where", "ProgramManager", "init_program_manager", "__esmMin", "init_esm", "init_log", "init_common", "backend", "key", "artifact", "buildArtifact", "inputs", "outputs", "dispatchGroup", "uniformBufferBinding", "TRACE_FUNC_BEGIN", "device", "computePassEncoder", "entries", "input", "output", "bindGroup", "commandInfo", "TRACE_FUNC_END", "programInfo", "normalizedDispatchGroupSize", "extensions", "shaderHelper", "createShaderHelper", "userCode", "code", "shaderModule", "LOG_DEBUG", "computePipeline", "x", "y", "z", "limitPerDimension", "size", "dispatchAverage", "getProgramInputTensorInfoDependencyKey", "getProgramInfoUniqueKey", "AdapterInfoImpl", "WebGpuBackend", "init_backend_webgpu", "__esmMin", "init_esm", "init_wasm_common", "init_log", "init_tensor_view", "init_gpu_data_manager", "init_op_resolve_rules", "init_program_manager", "inputTensors", "inputDependencies", "inputInfos", "i", "type", "rank", "dims", "programInfo", "is1DimensionDispatch", "key", "adapterInfo", "architecture", "vendor", "data", "env", "adapter", "requiredFeatures", "deviceDescriptor", "createGpuDataManager", "ProgramManager", "configureLogger", "ev", "commandEncoder", "computePassDescriptor", "TRACE_FUNC_BEGIN", "queryReadBuffer", "mappedData", "pendingKernels", "pendingKernelInfo", "kernelId", "kernelInfo", "kernelType", "kernelName", "programName", "inputTensorViews", "outputTensorViews", "startTimeU64", "endTimeU64", "startTime", "endTime", "value", "tensorDataTypeEnumToString", "inputShapes", "outputShapes", "TRACE", "TRACE_FUNC_END", "program", "outputIndices", "createKernelOutput", "createIntermediateOutput", "outputCount", "inputDatas", "gpuData", "outputs", "dispatchGroup", "programUniforms", "validatedOutputIndices", "_", "outputDatas", "isTemporary", "isPersistent", "tensorView", "persistentData", "uniformBufferBinding", "currentOffset", "offsets", "v", "sizeOfElement", "sizeOfVecOrMat", "baseAlignment", "elementPerVecOrMat", "maxAlignmentOfField", "arrayBuffer", "offset", "uniformBufferData", "normalizedDispatchGroup", "artifact", "LOG_DEBUG", "uniform", "actualType", "actualLength", "length", "gpuDataId", "src", "dst", "getTargetBuffer", "size", "ptr", "attribute", "op", "WEBGPU_OP_RESOLVE_RULES", "context", "errors", "kernel", "kernelEntry", "attributes", "useErrorScope", "e", "err", "sessionId", "index", "buffer", "sessionInputOutputMapping", "previousBuffer", "id", "bufferInfo", "gpuBuffer", "downloadGpuData", "createView", "sessionCommandList", "sessionPendingKernels", "computePassEncoder", "command", "init_exports", "__export", "init", "TensorViewImpl", "ComputeContextImpl", "init_init", "__esmMin", "init_wasm_common", "init_backend_webgpu", "init_log", "init_util", "_TensorViewImpl", "module", "dataType", "data", "dims", "elementCount", "ShapeUtil", "newDims", "backend", "contextDataOffset", "heapU32", "dataIndex", "inputCount", "inputs", "i", "dim", "d", "program", "inputsOutputsMapping", "mappedInputs", "outputIndices", "createKernelOutput", "index", "createTemporaryOutput", "elementSize", "getTensorElementSize", "bufferSize", "gpuDataId", "stack", "offset", "e", "name", "env", "gpuAdapter", "jsepInit", "WebGpuBackend", "size", "ptr", "src", "dst", "isSourceGpu", "LOG_DEBUG", "dataOffset", "kernelType", "kernelId", "attribute", "kernel", "sessionHandle", "errors", "context", "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", "initJsep", "adapter", "powerPreference", "forceFallbackAdapter", "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", "location", "bindingState", "l", "dataLocationStringToEnum", "e", "buf", "alloc", "sessionId", "session", "ioBindingState", "tensor", "tensorHandles", "index", "dataType", "dims", "rawData", "dataByteLength", "gpuBuffer", "elementSizeInBytes", "getTensorElementSize", "tensorDataTypeStringToEnum", "a", "b", "registerBuffer", "dataIndex", "allocWasmString", "dimsOffset", "dimIndex", "d", "inputIndices", "inputTensors", "outputIndices", "outputTensors", "inputOutputBound", "runOptionsHandle", "runOptionsAllocs", "inputTensorHandles", "outputTensorHandles", "inputOutputAllocs", "beforeRunStack", "inputValuesOffset", "inputNamesOffset", "outputValuesOffset", "outputNamesOffset", "setRunOptions", "inputValuesIndex", "inputNamesIndex", "outputValuesIndex", "outputNamesIndex", "handle", "outputPreferredLocationsEncoded", "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"] +}