diff --git "a/demo/ort-phi3/dist/esm/ort.training.wasm.min.js.map" "b/demo/ort-phi3/dist/esm/ort.training.wasm.min.js.map" new file mode 100644--- /dev/null +++ "b/demo/ort-phi3/dist/esm/ort.training.wasm.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", "nodejs-ignore:fs", "nodejs-ignore:path", "../../lib/wasm/binding/ort-training-wasm-simd.js", "nodejs-ignore:worker_threads", "nodejs-ignore:perf_hooks", "nodejs-ignore:os", "../../lib/wasm/binding/ort-wasm-threaded.js", "../../lib/wasm/binding/ort-wasm-threaded.worker.js", "../../lib/wasm/wasm-factory.ts", "../../lib/wasm/wasm-utils.ts", "../../lib/wasm/run-options.ts", "../../lib/wasm/session-options.ts", "../../lib/wasm/wasm-common.ts", "../../lib/wasm/wasm-utils-load-file.ts", "../../lib/wasm/wasm-core-impl.ts", "proxy-worker:./proxy-worker/main", "../../lib/wasm/proxy-wrapper.ts", "../../lib/wasm/session-handler-inference.ts", "../../lib/backend-wasm.ts", "../../lib/wasm/wasm-training-core-impl.ts", "../../lib/wasm/session-handler-training.ts", "../../lib/backend-wasm-training.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", "export const readFile = undefined;export const readFileSync = undefined;export const createReadStream = undefined;", "export const join = undefined;", "\nvar ortWasm = (() => {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(moduleArg = {}) {\n\nvar d=moduleArg,k,l;d.ready=new Promise((a,b)=>{k=a;l=b});var r=Object.assign({},d),v=\"./this.program\",aa=\"object\"==typeof window,x=\"function\"==typeof importScripts,ba=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,y=\"\",A,B,C;\nif(ba){var fs=require(\"fs\"),D=require(\"path\");y=x?D.dirname(y)+\"/\":__dirname+\"/\";A=(a,b)=>{a=a.startsWith(\"file://\")?new URL(a):D.normalize(a);return fs.readFileSync(a,b?void 0:\"utf8\")};C=a=>{a=A(a,!0);a.buffer||(a=new Uint8Array(a));return a};B=(a,b,c,f=!0)=>{a=a.startsWith(\"file://\")?new URL(a):D.normalize(a);fs.readFile(a,f?void 0:\"utf8\",(g,h)=>{g?c(g):b(f?h.buffer:h)})};!d.thisProgram&&1\"[Emscripten Module object]\"}else if(aa||\nx)x?y=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(y=document.currentScript.src),_scriptDir&&(y=_scriptDir),0!==y.indexOf(\"blob:\")?y=y.substr(0,y.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):y=\"\",A=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},x&&(C=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),B=(a,b,c)=>{var f=new XMLHttpRequest;f.open(\"GET\",a,!0);f.responseType=\n\"arraybuffer\";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):c()};f.onerror=c;f.send(null)};var ca=d.print||console.log.bind(console),E=d.printErr||console.error.bind(console);Object.assign(d,r);r=null;d.thisProgram&&(v=d.thisProgram);var F;d.wasmBinary&&(F=d.wasmBinary);var noExitRuntime=d.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&G(\"no native wasm support detected\");var H,I,da=!1,J,K,L,M;\nfunction ea(){var a=H.buffer;d.HEAP8=J=new Int8Array(a);d.HEAP16=new Int16Array(a);d.HEAP32=L=new Int32Array(a);d.HEAPU8=K=new Uint8Array(a);d.HEAPU16=new Uint16Array(a);d.HEAPU32=M=new Uint32Array(a);d.HEAPF32=new Float32Array(a);d.HEAPF64=new Float64Array(a)}var fa=[],ha=[],ia=[];function ja(){var a=d.preRun.shift();fa.unshift(a)}var N=0,O=null,P=null;\nfunction G(a){if(d.onAbort)d.onAbort(a);a=\"Aborted(\"+a+\")\";E(a);da=!0;a=new WebAssembly.RuntimeError(a+\". Build with -sASSERTIONS for more info.\");l(a);throw a;}function ka(a){return a.startsWith(\"data:application/octet-stream;base64,\")}var Q;Q=\"ort-training-wasm-simd.wasm\";if(!ka(Q)){var la=Q;Q=d.locateFile?d.locateFile(la,y):y+la}function ma(a){if(a==Q&&F)return new Uint8Array(F);if(C)return C(a);throw\"both async and sync fetching of the wasm failed\";}\nfunction na(a){if(!F&&(aa||x)){if(\"function\"==typeof fetch&&!a.startsWith(\"file://\"))return fetch(a,{credentials:\"same-origin\"}).then(b=>{if(!b.ok)throw\"failed to load wasm binary file at '\"+a+\"'\";return b.arrayBuffer()}).catch(()=>ma(a));if(B)return new Promise((b,c)=>{B(a,f=>b(new Uint8Array(f)),c)})}return Promise.resolve().then(()=>ma(a))}function oa(a,b,c){return na(a).then(f=>WebAssembly.instantiate(f,b)).then(f=>f).then(c,f=>{E(\"failed to asynchronously prepare wasm: \"+f);G(f)})}\nfunction pa(a,b){var c=Q;return F||\"function\"!=typeof WebAssembly.instantiateStreaming||ka(c)||c.startsWith(\"file://\")||ba||\"function\"!=typeof fetch?oa(c,a,b):fetch(c,{credentials:\"same-origin\"}).then(f=>WebAssembly.instantiateStreaming(f,a).then(b,function(g){E(\"wasm streaming compile failed: \"+g);E(\"falling back to ArrayBuffer instantiation\");return oa(c,a,b)}))}var R,S=a=>{for(;0>2>>>0]=b};this.Ka=function(b){M[this.Ha+8>>2>>>0]=b};this.Ia=function(b,c){this.Ja();this.La(b);this.Ka(c)};this.Ja=function(){M[this.Ha+16>>2>>>0]=0}}\nvar ra=0,sa=0,ta=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,ua=(a,b,c)=>{b>>>=0;var f=b+c;for(c=b;a[c]&&!(c>=f);)++c;if(16g?f+=String.fromCharCode(g):(g-=65536,f+=String.fromCharCode(55296|g>>10,56320|g&1023))}}else f+=String.fromCharCode(g)}return f},\nT=(a,b)=>(a>>>=0)?ua(K,a,b):\"\",U=a=>{for(var b=0,c=0;c=f?b++:2047>=f?b+=2:55296<=f&&57343>=f?(b+=4,++c):b+=3}return b},V=(a,b,c,f)=>{c>>>=0;if(!(0=m){var q=a.charCodeAt(++h);m=65536+((m&1023)<<10)|q&1023}if(127>=m){if(c>=f)break;b[c++>>>0]=m}else{if(2047>=m){if(c+1>=f)break;b[c++>>>0]=192|m>>6}else{if(65535>=m){if(c+2>=f)break;b[c++>>>0]=224|m>>12}else{if(c+3>=\nf)break;b[c++>>>0]=240|m>>18;b[c++>>>0]=128|m>>12&63}b[c++>>>0]=128|m>>6&63}b[c++>>>0]=128|m&63}}b[c>>>0]=0;return c-g},W=a=>0===a%4&&(0!==a%100||0===a%400),va=[0,31,60,91,121,152,182,213,244,274,305,335],wa=[0,31,59,90,120,151,181,212,243,273,304,334],Ba=a=>{var b=U(a)+1,c=Aa(b);c&&V(a,K,c,b);return c},X={},Ca=()=>{if(!Y){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\n\"_\")+\".UTF-8\",_:v||\"./this.program\"},b;for(b in X)void 0===X[b]?delete a[b]:a[b]=X[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Y=c}return Y},Y,Da=[null,[],[]],Ea=[31,29,31,30,31,30,31,31,30,31,30,31],Fa=[31,28,31,30,31,30,31,31,30,31,30,31];function Ga(a){var b=Array(U(a)+1);V(a,b,0,b.length);return b}\nfunction Ha(a,b,c,f){function g(e,n,p){for(e=\"number\"==typeof e?e.toString():e||\"\";e.lengthxa?-1:0z-e.getDate())n-=z-e.getDate()+1,e.setDate(1),11>p?e.setMonth(p+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else{e.setDate(e.getDate()+n);break}}p=new Date(e.getFullYear()+1,0,4);n=q(new Date(e.getFullYear(),\n0,4));p=q(p);return 0>=m(n,e)?0>=m(p,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;f>>>=0;var t=L[f+40>>2>>>0];f={Oa:L[f>>2>>>0],Na:L[f+4>>2>>>0],Ea:L[f+8>>2>>>0],Ga:L[f+12>>2>>>0],Fa:L[f+16>>2>>>0],Da:L[f+20>>2>>>0],xa:L[f+24>>2>>>0],Ca:L[f+28>>2>>>0],Qa:L[f+32>>2>>>0],Ma:L[f+36>>2>>>0],Pa:t?T(t):\"\"};c=T(c);t={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\n\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var u in t)c=c.replace(new RegExp(u,\"g\"),t[u]);var ya=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),za=\"January February March April May June July August September October November December\".split(\" \");t={\"%a\":e=>ya[e.xa].substring(0,3),\"%A\":e=>ya[e.xa],\"%b\":e=>\nza[e.Fa].substring(0,3),\"%B\":e=>za[e.Fa],\"%C\":e=>h((e.Da+1900)/100|0,2),\"%d\":e=>h(e.Ga,2),\"%e\":e=>g(e.Ga,2,\" \"),\"%g\":e=>w(e).toString().substring(2),\"%G\":e=>w(e),\"%H\":e=>h(e.Ea,2),\"%I\":e=>{e=e.Ea;0==e?e=12:12{for(var n=0,p=0;p<=e.Fa-1;n+=(W(e.Da+1900)?Ea:Fa)[p++]);return h(e.Ga+n,3)},\"%m\":e=>h(e.Fa+1,2),\"%M\":e=>h(e.Na,2),\"%n\":()=>\"\\n\",\"%p\":e=>0<=e.Ea&&12>e.Ea?\"AM\":\"PM\",\"%S\":e=>h(e.Oa,2),\"%t\":()=>\"\\t\",\"%u\":e=>e.xa||7,\"%U\":e=>h(Math.floor((e.Ca+7-e.xa)/7),2),\"%V\":e=>\n{var n=Math.floor((e.Ca+7-(e.xa+6)%7)/7);2>=(e.xa+371-e.Ca-2)%7&&n++;if(n)53==n&&(p=(e.xa+371-e.Ca)%7,4==p||3==p&&W(e.Da)||(n=1));else{n=52;var p=(e.xa+7-e.Ca-1)%7;(4==p||5==p&&W(e.Da%400-1))&&n++}return h(n,2)},\"%w\":e=>e.xa,\"%W\":e=>h(Math.floor((e.Ca+7-(e.xa+6)%7)/7),2),\"%y\":e=>(e.Da+1900).toString().substring(2),\"%Y\":e=>e.Da+1900,\"%z\":e=>{e=e.Ma;var n=0<=e;e=Math.abs(e)/60;return(n?\"+\":\"-\")+String(\"0000\"+(e/60*100+e%60)).slice(-4)},\"%Z\":e=>e.Pa,\"%%\":()=>\"%\"};c=c.replace(/%%/g,\"\\x00\\x00\");for(u in t)c.includes(u)&&\n(c=c.replace(new RegExp(u,\"g\"),t[u](f)));c=c.replace(/\\0\\0/g,\"%\");u=Ga(c);if(u.length>b)return 0;J.set(u,a>>>0);return u.length-1}\nvar Ja={a:function(a,b,c){a>>>=0;(new qa(a)).Ia(b>>>0,c>>>0);ra=a;sa++;throw ra;},e:function(){return 0},H:function(){},x:function(){},z:function(){},k:function(){return 0},F:function(){},B:function(){},E:function(){},g:function(){},y:function(){},v:function(){},G:function(){},w:function(){},l:()=>!0,o:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);L[c>>2>>>0]=a.getUTCSeconds();L[c+4>>2>>>0]=a.getUTCMinutes();L[c+8>>2>>>0]=a.getUTCHours();L[c+12>>2>>>\n0]=a.getUTCDate();L[c+16>>2>>>0]=a.getUTCMonth();L[c+20>>2>>>0]=a.getUTCFullYear()-1900;L[c+24>>2>>>0]=a.getUTCDay();L[c+28>>2>>>0]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},p:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);L[c>>2>>>0]=a.getSeconds();L[c+4>>2>>>0]=a.getMinutes();L[c+8>>2>>>0]=a.getHours();L[c+12>>2>>>0]=a.getDate();L[c+16>>2>>>0]=a.getMonth();L[c+20>>2>>>0]=a.getFullYear()-1900;L[c+24>>2>>>0]=a.getDay();L[c+28>>2>>>\n0]=(W(a.getFullYear())?va:wa)[a.getMonth()]+a.getDate()-1|0;L[c+36>>2>>>0]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var f=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();L[c+32>>2>>>0]=(b!=f&&a.getTimezoneOffset()==Math.min(f,b))|0},q:function(a){a>>>=0;var b=new Date(L[a+20>>2>>>0]+1900,L[a+16>>2>>>0],L[a+12>>2>>>0],L[a+8>>2>>>0],L[a+4>>2>>>0],L[a>>2>>>0],0),c=L[a+32>>2>>>0],f=b.getTimezoneOffset(),g=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),\nh=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),m=Math.min(h,g);0>c?L[a+32>>2>>>0]=Number(g!=h&&m==f):0>2>>>0]=b.getDay();L[a+28>>2>>>0]=(W(b.getFullYear())?va:wa)[b.getMonth()]+b.getDate()-1|0;L[a>>2>>>0]=b.getSeconds();L[a+4>>2>>>0]=b.getMinutes();L[a+8>>2>>>0]=b.getHours();L[a+12>>2>>>0]=b.getDate();L[a+16>>2>>>0]=b.getMonth();L[a+20>>2>>>0]=b.getYear();a=b.getTime()/1E3;return Ia((R=a,1<=+Math.abs(R)?0>>0:~~+Math.ceil((R-+(~~R>>>0))/4294967296)>>>0:0)),a>>>0},m:function(){return-52},n:function(){},t:function(a,b,c){function f(w){return(w=w.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?w[1]:\"GMT\"}c>>>=0;var g=(new Date).getFullYear(),h=new Date(g,0,1),m=new Date(g,6,1);g=h.getTimezoneOffset();var q=m.getTimezoneOffset();M[a>>>0>>2>>>0]=60*Math.max(g,q);L[b>>>0>>2>>>0]=Number(g!=q);a=f(h);b=f(m);a=Ba(a);b=Ba(b);q>2>>>0]=a,M[c+4>>2>>>0]=b):(M[c>>2>>>0]=b,M[c+4>>2>>>0]=a)},d:()=>{G(\"\")},\nh:function(){return Date.now()},u:function(){return 4294901760},b:()=>performance.now(),I:function(a,b,c){b>>>=0;return K.copyWithin(a>>>0>>>0,b>>>0,b+(c>>>0)>>>0)},s:function(a){a>>>=0;var b=K.length;if(4294901760=c;c*=2){var f=b*(1+.2/c);f=Math.min(f,a+100663296);var g=Math;f=Math.max(a,f);a:{g=g.min.call(g,4294901760,f+(65536-f%65536)%65536)-H.buffer.byteLength+65535>>>16;try{H.grow(g);ea();var h=1;break a}catch(m){}h=void 0}if(h)return!0}return!1},C:function(a,b){a>>>=\n0;b>>>=0;var c=0;Ca().forEach(function(f,g){var h=b+c;g=M[a+4*g>>2>>>0]=h;for(h=0;h>0>>>0]=f.charCodeAt(h);J[g>>0>>>0]=0;c+=f.length+1});return 0},D:function(a,b){a>>>=0;b>>>=0;var c=Ca();M[a>>2>>>0]=c.length;var f=0;c.forEach(function(g){f+=g.length+1});M[b>>2>>>0]=f;return 0},f:()=>52,j:function(){return 52},r:function(){return 70},i:function(a,b,c,f){b>>>=0;c>>>=0;f>>>=0;for(var g=0,h=0;h>2>>>0],q=M[b+4>>2>>>0];b+=8;for(var w=0;w>>0],u=\nDa[a];0===t||10===t?((1===a?ca:E)(ua(u,0)),u.length=0):u.push(t)}g+=q}M[f>>2>>>0]=g;return 0},A:Ha,c:function(a,b,c,f){return Ha(a>>>0,b>>>0,c>>>0,f>>>0)}};\n(function(){function a(c){c=c.exports;I=c=Ka(c);H=I.J;ea();ha.unshift(I.K);N--;d.monitorRunDependencies&&d.monitorRunDependencies(N);if(0==N&&(null!==O&&(clearInterval(O),O=null),P)){var f=P;P=null;f()}return c}var b={a:Ja};N++;d.monitorRunDependencies&&d.monitorRunDependencies(N);if(d.instantiateWasm)try{return d.instantiateWasm(b,a)}catch(c){E(\"Module.instantiateWasm callback failed with error: \"+c),l(c)}pa(b,function(c){a(c.instance)}).catch(l);return{}})();\nd._OrtInit=(a,b)=>(d._OrtInit=I.L)(a,b);d._OrtGetLastError=(a,b)=>(d._OrtGetLastError=I.M)(a,b);d._OrtCreateSessionOptions=(a,b,c,f,g,h,m,q,w,t)=>(d._OrtCreateSessionOptions=I.N)(a,b,c,f,g,h,m,q,w,t);d._OrtAppendExecutionProvider=(a,b)=>(d._OrtAppendExecutionProvider=I.O)(a,b);d._OrtAddFreeDimensionOverride=(a,b,c)=>(d._OrtAddFreeDimensionOverride=I.P)(a,b,c);d._OrtAddSessionConfigEntry=(a,b,c)=>(d._OrtAddSessionConfigEntry=I.Q)(a,b,c);d._OrtReleaseSessionOptions=a=>(d._OrtReleaseSessionOptions=I.R)(a);\nd._OrtCreateSession=(a,b,c)=>(d._OrtCreateSession=I.S)(a,b,c);d._OrtReleaseSession=a=>(d._OrtReleaseSession=I.T)(a);d._OrtGetInputOutputCount=(a,b,c)=>(d._OrtGetInputOutputCount=I.U)(a,b,c);d._OrtGetInputName=(a,b)=>(d._OrtGetInputName=I.V)(a,b);d._OrtGetOutputName=(a,b)=>(d._OrtGetOutputName=I.W)(a,b);d._OrtFree=a=>(d._OrtFree=I.X)(a);d._OrtCreateTensor=(a,b,c,f,g,h)=>(d._OrtCreateTensor=I.Y)(a,b,c,f,g,h);d._OrtGetTensorData=(a,b,c,f,g)=>(d._OrtGetTensorData=I.Z)(a,b,c,f,g);\nd._OrtReleaseTensor=a=>(d._OrtReleaseTensor=I._)(a);d._OrtCreateRunOptions=(a,b,c,f)=>(d._OrtCreateRunOptions=I.$)(a,b,c,f);d._OrtAddRunConfigEntry=(a,b,c)=>(d._OrtAddRunConfigEntry=I.aa)(a,b,c);d._OrtReleaseRunOptions=a=>(d._OrtReleaseRunOptions=I.ba)(a);d._OrtCreateBinding=a=>(d._OrtCreateBinding=I.ca)(a);d._OrtBindInput=(a,b,c)=>(d._OrtBindInput=I.da)(a,b,c);d._OrtBindOutput=(a,b,c,f)=>(d._OrtBindOutput=I.ea)(a,b,c,f);d._OrtClearBoundOutputs=a=>(d._OrtClearBoundOutputs=I.fa)(a);\nd._OrtReleaseBinding=a=>(d._OrtReleaseBinding=I.ga)(a);d._OrtRunWithBinding=(a,b,c,f,g)=>(d._OrtRunWithBinding=I.ha)(a,b,c,f,g);d._OrtRun=(a,b,c,f,g,h,m,q)=>(d._OrtRun=I.ia)(a,b,c,f,g,h,m,q);d._OrtEndProfiling=a=>(d._OrtEndProfiling=I.ja)(a);d._OrtTrainingLoadCheckpoint=(a,b)=>(d._OrtTrainingLoadCheckpoint=I.ka)(a,b);d._OrtTrainingReleaseCheckpoint=a=>(d._OrtTrainingReleaseCheckpoint=I.la)(a);d._OrtTrainingCreateSession=(a,b,c,f,g,h,m,q)=>(d._OrtTrainingCreateSession=I.ma)(a,b,c,f,g,h,m,q);\nd._OrtTrainingLazyResetGrad=a=>(d._OrtTrainingLazyResetGrad=I.na)(a);d._OrtTrainingRunTrainStep=(a,b,c,f,g,h)=>(d._OrtTrainingRunTrainStep=I.oa)(a,b,c,f,g,h);d._OrtTrainingOptimizerStep=(a,b)=>(d._OrtTrainingOptimizerStep=I.pa)(a,b);d._OrtTrainingEvalStep=(a,b,c,f,g,h)=>(d._OrtTrainingEvalStep=I.qa)(a,b,c,f,g,h);d._OrtTrainingGetParametersSize=(a,b,c)=>(d._OrtTrainingGetParametersSize=I.ra)(a,b,c);d._OrtTrainingCopyParametersToBuffer=(a,b,c,f)=>(d._OrtTrainingCopyParametersToBuffer=I.sa)(a,b,c,f);\nd._OrtTrainingCopyParametersFromBuffer=(a,b,c,f)=>(d._OrtTrainingCopyParametersFromBuffer=I.ta)(a,b,c,f);d._OrtTrainingReleaseSession=a=>(d._OrtTrainingReleaseSession=I.ua)(a);var Aa=d._malloc=a=>(Aa=d._malloc=I.va)(a);d._free=a=>(d._free=I.wa)(a);var Ia=a=>(Ia=I.ya)(a),La=()=>(La=I.za)(),Ma=a=>(Ma=I.Aa)(a),Na=a=>(Na=I.Ba)(a);\nfunction Ka(a){a=Object.assign({},a);var b=f=>()=>f()>>>0,c=f=>g=>f(g)>>>0;a.__errno_location=b(a.__errno_location);a.malloc=c(a.malloc);a.stackSave=b(a.stackSave);a.stackAlloc=c(a.stackAlloc);return a}d.stackAlloc=Na;d.stackSave=La;d.stackRestore=Ma;d.UTF8ToString=T;d.stringToUTF8=(a,b,c)=>V(a,K,b,c);d.lengthBytesUTF8=U;var Z;P=function Oa(){Z||Pa();Z||(P=Oa)};\nfunction Pa(){function a(){if(!Z&&(Z=!0,d.calledRun=!0,!da)){S(ha);k(d);if(d.onRuntimeInitialized)d.onRuntimeInitialized();if(d.postRun)for(\"function\"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var b=d.postRun.shift();ia.unshift(b)}S(ia)}}if(!(0 ortWasm);\n", "", "", "export const cpus = undefined;", "\nvar ortWasmThreaded = (() => {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(moduleArg = {}) {\n\nfunction aa(){d.buffer!=l.buffer&&m();return l}function n(){d.buffer!=l.buffer&&m();return ba}function p(){d.buffer!=l.buffer&&m();return ca}function r(){d.buffer!=l.buffer&&m();return da}function ea(){d.buffer!=l.buffer&&m();return fa}var w=moduleArg,ha,x;w.ready=new Promise((a,b)=>{ha=a;x=b});\nvar ia=Object.assign({},w),ja=\"./this.program\",z=(a,b)=>{throw b;},ka=\"object\"==typeof window,A=\"function\"==typeof importScripts,B=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,D=w.ENVIRONMENT_IS_PTHREAD||!1,E=\"\";function la(a){return w.locateFile?w.locateFile(a,E):E+a}var ma,F,H;\nif(B){var fs=require(\"fs\"),na=require(\"path\");E=A?na.dirname(E)+\"/\":__dirname+\"/\";ma=(b,c)=>{b=b.startsWith(\"file://\")?new URL(b):na.normalize(b);return fs.readFileSync(b,c?void 0:\"utf8\")};H=b=>{b=ma(b,!0);b.buffer||(b=new Uint8Array(b));return b};F=(b,c,e,h=!0)=>{b=b.startsWith(\"file://\")?new URL(b):na.normalize(b);fs.readFile(b,h?void 0:\"utf8\",(g,k)=>{g?e(g):c(h?k.buffer:k)})};!w.thisProgram&&1{process.exitCode=\nb;throw c;};w.inspect=()=>\"[Emscripten Module object]\";let a;try{a=require(\"worker_threads\")}catch(b){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),b;}global.Worker=a.Worker}else if(ka||A)A?E=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(E=document.currentScript.src),(typeof _scriptDir !== \"undefined\" && _scriptDir)&&(E=_scriptDir),0!==E.indexOf(\"blob:\")?E=E.substr(0,E.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):E=\"\",B||(ma=a=>{var b=\nnew XMLHttpRequest;b.open(\"GET\",a,!1);b.send(null);return b.responseText},A&&(H=a=>{var b=new XMLHttpRequest;b.open(\"GET\",a,!1);b.responseType=\"arraybuffer\";b.send(null);return new Uint8Array(b.response)}),F=(a,b,c)=>{var e=new XMLHttpRequest;e.open(\"GET\",a,!0);e.responseType=\"arraybuffer\";e.onload=()=>{200==e.status||0==e.status&&e.response?b(e.response):c()};e.onerror=c;e.send(null)});B&&\"undefined\"==typeof performance&&(global.performance=require(\"perf_hooks\").performance);\nvar oa=console.log.bind(console),pa=console.error.bind(console);B&&(oa=(...a)=>fs.writeSync(1,a.join(\" \")+\"\\n\"),pa=(...a)=>fs.writeSync(2,a.join(\" \")+\"\\n\"));var qa=w.print||oa,I=w.printErr||pa;Object.assign(w,ia);ia=null;w.thisProgram&&(ja=w.thisProgram);w.quit&&(z=w.quit);var J;w.wasmBinary&&(J=w.wasmBinary);var noExitRuntime=w.noExitRuntime||!0;\"object\"!=typeof WebAssembly&&K(\"no native wasm support detected\");var d,L,ra,M=!1,N,l,ba,ca,da,fa;\nfunction m(){var a=d.buffer;w.HEAP8=l=new Int8Array(a);w.HEAP16=new Int16Array(a);w.HEAP32=ca=new Int32Array(a);w.HEAPU8=ba=new Uint8Array(a);w.HEAPU16=new Uint16Array(a);w.HEAPU32=da=new Uint32Array(a);w.HEAPF32=new Float32Array(a);w.HEAPF64=fa=new Float64Array(a)}var O=w.INITIAL_MEMORY||16777216;5242880<=O||K(\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+O+\"! (STACK_SIZE=5242880)\");\nif(D)d=w.wasmMemory;else if(w.wasmMemory)d=w.wasmMemory;else if(d=new WebAssembly.Memory({initial:O/65536,maximum:65536,shared:!0}),!(d.buffer instanceof SharedArrayBuffer))throw I(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),B&&I(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),\nError(\"bad memory\");m();O=d.buffer.byteLength;var sa,ta=[],ua=[],va=[],wa=0;function P(){return noExitRuntime||0{if(!b.ok)throw\"failed to load wasm binary file at '\"+a+\"'\";return b.arrayBuffer()}).catch(()=>Ba(a));if(F)return new Promise((b,c)=>{F(a,e=>b(new Uint8Array(e)),c)})}return Promise.resolve().then(()=>Ba(a))}function Da(a,b,c){return Ca(a).then(e=>WebAssembly.instantiate(e,b)).then(e=>e).then(c,e=>{I(\"failed to asynchronously prepare wasm: \"+e);K(e)})}\nfunction Ea(a,b){var c=S;return J||\"function\"!=typeof WebAssembly.instantiateStreaming||Aa(c)||c.startsWith(\"file://\")||B||\"function\"!=typeof fetch?Da(c,a,b):fetch(c,{credentials:\"same-origin\"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(h){I(\"wasm streaming compile failed: \"+h);I(\"falling back to ArrayBuffer instantiation\");return Da(c,a,b)}))}var T;function U(a){this.name=\"ExitStatus\";this.message=`Program terminated with exit(${a})`;this.status=a}\nfunction Fa(a){a.terminate();a.onmessage=()=>{}}function Ga(a){(a=V.La[a])||K();V.lb(a)}function Ha(a){var b=V.fb();if(!b)return 6;V.Oa.push(b);V.La[a.Na]=b;b.Na=a.Na;var c={cmd:\"run\",start_routine:a.mb,arg:a.eb,pthread_ptr:a.Na};B&&b.unref();b.postMessage(c,a.sb);return 0}\nvar Ia=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,Ja=(a,b,c)=>{b>>>=0;var e=b+c;for(c=b;a[c]&&!(c>=e);)++c;if(16h?e+=String.fromCharCode(h):(h-=65536,e+=String.fromCharCode(55296|h>>\n10,56320|h&1023))}}else e+=String.fromCharCode(h)}return e},Ka=(a,b)=>(a>>>=0)?Ja(n(),a,b):\"\";function La(a){if(D)return W(1,1,a);N=a;if(!P()){V.nb();if(w.onExit)w.onExit(a);M=!0}z(a,new U(a))}\nvar Na=a=>{N=a;if(D)throw Ma(a),\"unwind\";La(a)},V={Ra:[],Oa:[],Za:[],La:{},Va:function(){D?V.hb():V.gb()},gb:function(){ta.unshift(()=>{ya();V.ib(()=>za())})},hb:function(){V.receiveObjectTransfer=V.kb;V.threadInitTLS=V.Ya;V.setExitStatus=V.Xa;noExitRuntime=!1},Xa:function(a){N=a},xb:[\"$terminateWorker\"],nb:function(){for(var a of V.Oa)Fa(a);for(a of V.Ra)Fa(a);V.Ra=[];V.Oa=[];V.La=[]},lb:function(a){var b=a.Na;delete V.La[b];V.Ra.push(a);V.Oa.splice(V.Oa.indexOf(a),1);a.Na=0;Oa(b)},kb:function(){},\nYa:function(){V.Za.forEach(a=>a())},jb:a=>new Promise(b=>{a.onmessage=g=>{g=g.data;var k=g.cmd;if(g.targetThread&&g.targetThread!=X()){var t=V.La[g.wb];t?t.postMessage(g,g.transferList):I('Internal error! Worker sent a message \"'+k+'\" to target pthread '+g.targetThread+\", but that thread no longer exists!\")}else if(\"checkMailbox\"===k)Y();else if(\"spawnThread\"===k)Ha(g);else if(\"cleanupThread\"===k)Ga(g.thread);else if(\"killThread\"===k)g=g.thread,k=V.La[g],delete V.La[g],Fa(k),Oa(g),V.Oa.splice(V.Oa.indexOf(k),\n1),k.Na=0;else if(\"cancelThread\"===k)V.La[g.thread].postMessage({cmd:\"cancel\"});else if(\"loaded\"===k)a.loaded=!0,b(a);else if(\"alert\"===k)alert(\"Thread \"+g.threadId+\": \"+g.text);else if(\"setimmediate\"===g.target)a.postMessage(g);else if(\"callHandler\"===k)w[g.handler](...g.args);else k&&I(\"worker sent an unknown command \"+k)};a.onerror=g=>{I(\"worker sent an error! \"+g.filename+\":\"+g.lineno+\": \"+g.message);throw g;};B&&(a.on(\"message\",function(g){a.onmessage({data:g})}),a.on(\"error\",function(g){a.onerror(g)}));\nvar c=[],e=[\"onExit\",\"onAbort\",\"print\",\"printErr\"],h;for(h of e)w.hasOwnProperty(h)&&c.push(h);a.postMessage({cmd:\"load\",handlers:c,urlOrBlob:w.mainScriptUrlOrBlob||_scriptDir,wasmMemory:d,wasmModule:ra})}),ib:function(a){a()},cb:function(){var a=la(\"ort-wasm-threaded.worker.js\");a=new Worker(a);V.Ra.push(a)},fb:function(){0==V.Ra.length&&(V.cb(),V.jb(V.Ra[0]));return V.Ra.pop()}};w.PThread=V;var Pa=a=>{for(;0>2>>>0];a=p()[a+56>>2>>>0];Qa(b,b-a);Ra(b)};function Ma(a){if(D)return W(2,0,a);Na(a)}var Sa=[];w.invokeEntryPoint=function(a,b){var c=Sa[a];c||(a>=Sa.length&&(Sa.length=a+1),Sa[a]=c=sa.get(a));a=c(b);P()?V.Xa(a):Ta(a)};function Ua(a){this.Ua=a-24;this.bb=function(b){r()[this.Ua+4>>2>>>0]=b};this.ab=function(b){r()[this.Ua+8>>2>>>0]=b};this.Va=function(b,c){this.$a();this.bb(b);this.ab(c)};this.$a=function(){r()[this.Ua+16>>2>>>0]=0}}\nvar Va=0,Wa=0;function Xa(a,b,c,e){return D?W(3,1,a,b,c,e):Ya(a,b,c,e)}function Ya(a,b,c,e){a>>>=0;b>>>=0;c>>>=0;e>>>=0;if(\"undefined\"==typeof SharedArrayBuffer)return I(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var h=[];if(D&&0===h.length)return Xa(a,b,c,e);a={mb:c,Na:a,eb:e,sb:h};return D?(a.ub=\"spawnThread\",postMessage(a,h),0):Ha(a)}function Za(a,b,c){return D?W(4,1,a,b,c):0}function $a(a,b){if(D)return W(5,1,a,b)}\nvar ab=a=>{for(var b=0,c=0;c=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++c):b+=3}return b},bb=(a,b,c,e)=>{c>>>=0;if(!(0=k){var t=a.charCodeAt(++g);k=65536+((k&1023)<<10)|t&1023}if(127>=k){if(c>=e)break;b[c++>>>0]=k}else{if(2047>=k){if(c+1>=e)break;b[c++>>>0]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++>>>0]=224|k>>12}else{if(c+3>=e)break;b[c++>>>0]=240|k>>\n18;b[c++>>>0]=128|k>>12&63}b[c++>>>0]=128|k>>6&63}b[c++>>>0]=128|k&63}}b[c>>>0]=0;return c-h},cb=(a,b,c)=>bb(a,n(),b,c);function db(a,b){if(D)return W(6,1,a,b)}function eb(a,b,c){if(D)return W(7,1,a,b,c)}function fb(a,b,c){return D?W(8,1,a,b,c):0}function gb(a,b){if(D)return W(9,1,a,b)}function hb(a,b,c){if(D)return W(10,1,a,b,c)}function ib(a,b,c,e){if(D)return W(11,1,a,b,c,e)}function jb(a,b,c,e){if(D)return W(12,1,a,b,c,e)}function kb(a,b,c,e){if(D)return W(13,1,a,b,c,e)}\nfunction lb(a){if(D)return W(14,1,a)}function mb(a,b){if(D)return W(15,1,a,b)}function nb(a,b,c){if(D)return W(16,1,a,b,c)}var ob=a=>{if(!M)try{if(a(),!P())try{D?Ta(N):Na(N)}catch(b){b instanceof U||\"unwind\"==b||z(1,b)}}catch(b){b instanceof U||\"unwind\"==b||z(1,b)}};function pb(a){a>>>=0;\"function\"===typeof Atomics.tb&&(Atomics.tb(p(),a>>2,a).value.then(Y),a+=128,Atomics.store(p(),a>>2,1))}w.__emscripten_thread_mailbox_await=pb;function Y(){var a=X();a&&(pb(a),ob(()=>qb()))}w.checkMailbox=Y;\nvar Z=a=>0===a%4&&(0!==a%100||0===a%400),rb=[0,31,60,91,121,152,182,213,244,274,305,335],sb=[0,31,59,90,120,151,181,212,243,273,304,334];function tb(a,b,c,e,h,g,k,t){return D?W(17,1,a,b,c,e,h,g,k,t):-52}function ub(a,b,c,e,h,g,k){if(D)return W(18,1,a,b,c,e,h,g,k)}var wb=a=>{var b=ab(a)+1,c=vb(b);c&&cb(a,c,b);return c},yb=a=>{var b=xb();a=a();Ra(b);return a};\nfunction W(a,b){var c=arguments.length-2,e=arguments;return yb(()=>{for(var h=zb(8*c),g=h>>3,k=0;k>>0]=t}return Ab(a,c,h,b)})}\nvar Bb=[],Cb={},Eb=()=>{if(!Db){var a={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(\"object\"==typeof navigator&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:ja||\"./this.program\"},b;for(b in Cb)void 0===Cb[b]?delete a[b]:a[b]=Cb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Db=c}return Db},Db;\nfunction Fb(a,b){if(D)return W(19,1,a,b);a>>>=0;b>>>=0;var c=0;Eb().forEach(function(e,h){var g=b+c;h=r()[a+4*h>>2>>>0]=g;for(g=0;g>0>>>0]=e.charCodeAt(g);aa()[h>>0>>>0]=0;c+=e.length+1});return 0}function Gb(a,b){if(D)return W(20,1,a,b);a>>>=0;b>>>=0;var c=Eb();r()[a>>2>>>0]=c.length;var e=0;c.forEach(function(h){e+=h.length+1});r()[b>>2>>>0]=e;return 0}function Hb(a){return D?W(21,1,a):52}function Lb(a,b,c,e){return D?W(22,1,a,b,c,e):52}\nfunction Mb(a,b,c,e,h){return D?W(23,1,a,b,c,e,h):70}var Nb=[null,[],[]];function Ob(a,b,c,e){if(D)return W(24,1,a,b,c,e);b>>>=0;c>>>=0;e>>>=0;for(var h=0,g=0;g>2>>>0],t=r()[b+4>>2>>>0];b+=8;for(var C=0;C>>0],y=Nb[a];0===v||10===v?((1===a?qa:I)(Ja(y,0)),y.length=0):y.push(v)}h+=t}r()[e>>2>>>0]=h;return 0}var Pb=[31,29,31,30,31,30,31,31,30,31,30,31],Qb=[31,28,31,30,31,30,31,31,30,31,30,31];function Rb(a){var b=Array(ab(a)+1);bb(a,b,0,b.length);return b}\nvar Sb=(a,b)=>{aa().set(a,b>>>0)};\nfunction Tb(a,b,c,e){function h(f,q,u){for(f=\"number\"==typeof f?f.toString():f||\"\";f.lengthIb?-1:0G-f.getDate())q-=G-f.getDate()+1,f.setDate(1),11>u?f.setMonth(u+1):(f.setMonth(0),f.setFullYear(f.getFullYear()+1));else{f.setDate(f.getDate()+q);break}}u=new Date(f.getFullYear()+1,0,4);q=t(new Date(f.getFullYear(),\n0,4));u=t(u);return 0>=k(q,f)?0>=k(u,f)?f.getFullYear()+1:f.getFullYear():f.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;e>>>=0;var v=p()[e+40>>2>>>0];e={qb:p()[e>>2>>>0],pb:p()[e+4>>2>>>0],Sa:p()[e+8>>2>>>0],Wa:p()[e+12>>2>>>0],Ta:p()[e+16>>2>>>0],Qa:p()[e+20>>2>>>0],Ma:p()[e+24>>2>>>0],Pa:p()[e+28>>2>>>0],yb:p()[e+32>>2>>>0],ob:p()[e+36>>2>>>0],rb:v?Ka(v):\"\"};c=Ka(c);v={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\n\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var y in v)c=c.replace(new RegExp(y,\"g\"),v[y]);var Jb=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),Kb=\"January February March April May June July August September October November December\".split(\" \");v={\"%a\":f=>Jb[f.Ma].substring(0,3),\n\"%A\":f=>Jb[f.Ma],\"%b\":f=>Kb[f.Ta].substring(0,3),\"%B\":f=>Kb[f.Ta],\"%C\":f=>g((f.Qa+1900)/100|0,2),\"%d\":f=>g(f.Wa,2),\"%e\":f=>h(f.Wa,2,\" \"),\"%g\":f=>C(f).toString().substring(2),\"%G\":f=>C(f),\"%H\":f=>g(f.Sa,2),\"%I\":f=>{f=f.Sa;0==f?f=12:12{for(var q=0,u=0;u<=f.Ta-1;q+=(Z(f.Qa+1900)?Pb:Qb)[u++]);return g(f.Wa+q,3)},\"%m\":f=>g(f.Ta+1,2),\"%M\":f=>g(f.pb,2),\"%n\":()=>\"\\n\",\"%p\":f=>0<=f.Sa&&12>f.Sa?\"AM\":\"PM\",\"%S\":f=>g(f.qb,2),\"%t\":()=>\"\\t\",\"%u\":f=>f.Ma||7,\"%U\":f=>g(Math.floor((f.Pa+\n7-f.Ma)/7),2),\"%V\":f=>{var q=Math.floor((f.Pa+7-(f.Ma+6)%7)/7);2>=(f.Ma+371-f.Pa-2)%7&&q++;if(q)53==q&&(u=(f.Ma+371-f.Pa)%7,4==u||3==u&&Z(f.Qa)||(q=1));else{q=52;var u=(f.Ma+7-f.Pa-1)%7;(4==u||5==u&&Z(f.Qa%400-1))&&q++}return g(q,2)},\"%w\":f=>f.Ma,\"%W\":f=>g(Math.floor((f.Pa+7-(f.Ma+6)%7)/7),2),\"%y\":f=>(f.Qa+1900).toString().substring(2),\"%Y\":f=>f.Qa+1900,\"%z\":f=>{f=f.ob;var q=0<=f;f=Math.abs(f)/60;return(q?\"+\":\"-\")+String(\"0000\"+(f/60*100+f%60)).slice(-4)},\"%Z\":f=>f.rb,\"%%\":()=>\"%\"};c=c.replace(/%%/g,\n\"\\x00\\x00\");for(y in v)c.includes(y)&&(c=c.replace(new RegExp(y,\"g\"),v[y](e)));c=c.replace(/\\0\\0/g,\"%\");y=Rb(c);if(y.length>b)return 0;Sb(y,a);return y.length-1}V.Va();\nvar Ub=[null,La,Ma,Xa,Za,$a,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,tb,ub,Fb,Gb,Hb,Lb,Mb,Ob],Xb={b:function(a,b,c){a>>>=0;(new Ua(a)).Va(b>>>0,c>>>0);Va=a;Wa++;throw Va;},N:function(a){Vb(a>>>0,!A,1,!ka,131072,!1);V.Ya()},j:function(a){a>>>=0;D?postMessage({cmd:\"cleanupThread\",thread:a}):Ga(a)},I:Ya,h:Za,T:$a,D:db,F:eb,U:fb,R:gb,J:hb,Q:ib,n:jb,E:kb,B:lb,S:mb,C:nb,q:()=>!0,z:function(a,b){a>>>=0;a==b>>>0?setTimeout(()=>Y()):D?postMessage({targetThread:a,cmd:\"checkMailbox\"}):(a=V.La[a])&&a.postMessage({cmd:\"checkMailbox\"})},\nL:function(){return-1},M:pb,p:function(a){B&&V.La[a>>>0].ref()},t:function(a,b,c){a=b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);p()[c>>2>>>0]=a.getUTCSeconds();p()[c+4>>2>>>0]=a.getUTCMinutes();p()[c+8>>2>>>0]=a.getUTCHours();p()[c+12>>2>>>0]=a.getUTCDate();p()[c+16>>2>>>0]=a.getUTCMonth();p()[c+20>>2>>>0]=a.getUTCFullYear()-1900;p()[c+24>>2>>>0]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;p()[c+28>>2>>>0]=a},u:function(a,b,c){a=b+\n2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN;c>>>=0;a=new Date(1E3*a);p()[c>>2>>>0]=a.getSeconds();p()[c+4>>2>>>0]=a.getMinutes();p()[c+8>>2>>>0]=a.getHours();p()[c+12>>2>>>0]=a.getDate();p()[c+16>>2>>>0]=a.getMonth();p()[c+20>>2>>>0]=a.getFullYear()-1900;p()[c+24>>2>>>0]=a.getDay();b=(Z(a.getFullYear())?rb:sb)[a.getMonth()]+a.getDate()-1|0;p()[c+28>>2>>>0]=b;p()[c+36>>2>>>0]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();\na=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0;p()[c+32>>2>>>0]=a},v:function(a){a>>>=0;var b=new Date(p()[a+20>>2>>>0]+1900,p()[a+16>>2>>>0],p()[a+12>>2>>>0],p()[a+8>>2>>>0],p()[a+4>>2>>>0],p()[a>>2>>>0],0),c=p()[a+32>>2>>>0],e=b.getTimezoneOffset(),h=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),g=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),k=Math.min(g,h);0>c?p()[a+32>>2>>>0]=Number(h!=g&&k==e):0>2>>>\n0]=b.getDay();c=(Z(b.getFullYear())?rb:sb)[b.getMonth()]+b.getDate()-1|0;p()[a+28>>2>>>0]=c;p()[a>>2>>>0]=b.getSeconds();p()[a+4>>2>>>0]=b.getMinutes();p()[a+8>>2>>>0]=b.getHours();p()[a+12>>2>>>0]=b.getDate();p()[a+16>>2>>>0]=b.getMonth();p()[a+20>>2>>>0]=b.getYear();a=b.getTime()/1E3;return Wb((T=a,1<=+Math.abs(T)?0>>0:~~+Math.ceil((T-+(~~T>>>0))/4294967296)>>>0:0)),a>>>0},r:tb,s:ub,y:function(a,b,c){function e(v){return(v=v.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?\nv[1]:\"GMT\"}a>>>=0;b>>>=0;c>>>=0;var h=(new Date).getFullYear(),g=new Date(h,0,1),k=new Date(h,6,1);h=g.getTimezoneOffset();var t=k.getTimezoneOffset(),C=Math.max(h,t);r()[a>>2>>>0]=60*C;p()[b>>2>>>0]=Number(h!=t);a=e(g);b=e(k);a=wb(a);b=wb(b);t>2>>>0]=a,r()[c+4>>2>>>0]=b):(r()[c>>2>>>0]=b,r()[c+4>>2>>>0]=a)},c:()=>{K(\"\")},k:function(){},i:function(){return Date.now()},o:()=>{wa+=1;throw\"unwind\";},A:function(){return 4294901760},e:()=>performance.timeOrigin+performance.now(),f:function(){return B?\nrequire(\"os\").cpus().length:navigator.hardwareConcurrency},K:function(a,b,c,e){V.vb=b>>>0;Bb.length=c;b=e>>>0>>3;for(e=0;e>>0];return Ub[a].apply(null,Bb)},x:function(a){a>>>=0;var b=n().length;if(a<=b||4294901760=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var h=Math;e=Math.max(a,e);a:{h=h.min.call(h,4294901760,e+(65536-e%65536)%65536)-d.buffer.byteLength+65535>>>16;try{d.grow(h);m();var g=1;break a}catch(k){}g=void 0}if(g)return!0}return!1},\nO:Fb,P:Gb,H:Na,g:Hb,m:Lb,w:Mb,l:Ob,a:d||w.wasmMemory,G:Tb,d:function(a,b,c,e){return Tb(a>>>0,b>>>0,c>>>0,e>>>0)}};(function(){function a(c,e){c=c.exports;L=c=Yb(c);V.Za.push(L.ya);sa=L.za;ua.unshift(L.V);ra=e;za();return c}var b={a:Xb};ya();if(w.instantiateWasm)try{return w.instantiateWasm(b,a)}catch(c){I(\"Module.instantiateWasm callback failed with error: \"+c),x(c)}Ea(b,function(c){a(c.instance,c.module)}).catch(x);return{}})();w._OrtInit=(a,b)=>(w._OrtInit=L.W)(a,b);\nw._OrtGetLastError=(a,b)=>(w._OrtGetLastError=L.X)(a,b);w._OrtCreateSessionOptions=(a,b,c,e,h,g,k,t,C,v)=>(w._OrtCreateSessionOptions=L.Y)(a,b,c,e,h,g,k,t,C,v);w._OrtAppendExecutionProvider=(a,b)=>(w._OrtAppendExecutionProvider=L.Z)(a,b);w._OrtAddFreeDimensionOverride=(a,b,c)=>(w._OrtAddFreeDimensionOverride=L._)(a,b,c);w._OrtAddSessionConfigEntry=(a,b,c)=>(w._OrtAddSessionConfigEntry=L.$)(a,b,c);w._OrtReleaseSessionOptions=a=>(w._OrtReleaseSessionOptions=L.aa)(a);\nw._OrtCreateSession=(a,b,c)=>(w._OrtCreateSession=L.ba)(a,b,c);w._OrtReleaseSession=a=>(w._OrtReleaseSession=L.ca)(a);w._OrtGetInputOutputCount=(a,b,c)=>(w._OrtGetInputOutputCount=L.da)(a,b,c);w._OrtGetInputName=(a,b)=>(w._OrtGetInputName=L.ea)(a,b);w._OrtGetOutputName=(a,b)=>(w._OrtGetOutputName=L.fa)(a,b);w._OrtFree=a=>(w._OrtFree=L.ga)(a);w._OrtCreateTensor=(a,b,c,e,h,g)=>(w._OrtCreateTensor=L.ha)(a,b,c,e,h,g);w._OrtGetTensorData=(a,b,c,e,h)=>(w._OrtGetTensorData=L.ia)(a,b,c,e,h);\nw._OrtReleaseTensor=a=>(w._OrtReleaseTensor=L.ja)(a);w._OrtCreateRunOptions=(a,b,c,e)=>(w._OrtCreateRunOptions=L.ka)(a,b,c,e);w._OrtAddRunConfigEntry=(a,b,c)=>(w._OrtAddRunConfigEntry=L.la)(a,b,c);w._OrtReleaseRunOptions=a=>(w._OrtReleaseRunOptions=L.ma)(a);w._OrtCreateBinding=a=>(w._OrtCreateBinding=L.na)(a);w._OrtBindInput=(a,b,c)=>(w._OrtBindInput=L.oa)(a,b,c);w._OrtBindOutput=(a,b,c,e)=>(w._OrtBindOutput=L.pa)(a,b,c,e);w._OrtClearBoundOutputs=a=>(w._OrtClearBoundOutputs=L.qa)(a);\nw._OrtReleaseBinding=a=>(w._OrtReleaseBinding=L.ra)(a);w._OrtRunWithBinding=(a,b,c,e,h)=>(w._OrtRunWithBinding=L.sa)(a,b,c,e,h);w._OrtRun=(a,b,c,e,h,g,k,t)=>(w._OrtRun=L.ta)(a,b,c,e,h,g,k,t);w._OrtEndProfiling=a=>(w._OrtEndProfiling=L.ua)(a);var X=w._pthread_self=()=>(X=w._pthread_self=L.va)(),vb=w._malloc=a=>(vb=w._malloc=L.wa)(a);w._free=a=>(w._free=L.xa)(a);w.__emscripten_tls_init=()=>(w.__emscripten_tls_init=L.ya)();\nvar Vb=w.__emscripten_thread_init=(a,b,c,e,h,g)=>(Vb=w.__emscripten_thread_init=L.Aa)(a,b,c,e,h,g);w.__emscripten_thread_crashed=()=>(w.__emscripten_thread_crashed=L.Ba)();var Ab=(a,b,c,e)=>(Ab=L.Ca)(a,b,c,e),Oa=a=>(Oa=L.Da)(a),Ta=w.__emscripten_thread_exit=a=>(Ta=w.__emscripten_thread_exit=L.Ea)(a),qb=w.__emscripten_check_mailbox=()=>(qb=w.__emscripten_check_mailbox=L.Fa)(),Wb=a=>(Wb=L.Ga)(a),Qa=(a,b)=>(Qa=L.Ha)(a,b),xb=()=>(xb=L.Ia)(),Ra=a=>(Ra=L.Ja)(a),zb=a=>(zb=L.Ka)(a);\nfunction Yb(a){a=Object.assign({},a);var b=e=>()=>e()>>>0,c=e=>h=>e(h)>>>0;a.__errno_location=b(a.__errno_location);a.pthread_self=b(a.pthread_self);a.malloc=c(a.malloc);a.stackSave=b(a.stackSave);a.stackAlloc=c(a.stackAlloc);return a}w.keepRuntimeAlive=P;w.wasmMemory=d;w.stackAlloc=zb;w.stackSave=xb;w.stackRestore=Ra;w.UTF8ToString=Ka;w.stringToUTF8=cb;w.lengthBytesUTF8=ab;w.ExitStatus=U;w.PThread=V;var Zb;R=function $b(){Zb||ac();Zb||(R=$b)};\nfunction ac(){function a(){if(!Zb&&(Zb=!0,w.calledRun=!0,!M)){D||Pa(ua);ha(w);if(w.onRuntimeInitialized)w.onRuntimeInitialized();if(!D){if(w.postRun)for(\"function\"==typeof w.postRun&&(w.postRun=[w.postRun]);w.postRun.length;){var b=w.postRun.shift();va.unshift(b)}Pa(va)}}}if(!(0 ortWasmThreaded);\n", "\"use strict\";var Module={},ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\"),parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",e=>onmessage({data:e}));var fs=require(\"fs\");Object.assign(global,{self:global,require,Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:e=>(0,eval)(fs.readFileSync(e,\"utf8\")+\"//# sourceURL=\"+e),postMessage:e=>parentPort.postMessage(e),performance:global.performance||{now:Date.now}})}var initializedJS=!1;function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,e+`\n`);return}console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:e,threadId:Module._pthread_self()})}var err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(e,t)=>{var a=Module.wasmModule;Module.wasmModule=null;var r=new WebAssembly.Instance(a,e);return t(r)},self.onunhandledrejection=e=>{throw e.reason??e};function handleMessage(e){try{if(e.data.cmd===\"load\"){let a=[];self.onmessage=r=>a.push(r),self.startWorker=r=>{Module=r,postMessage({cmd:\"loaded\"});for(let s of a)handleMessage(s);self.onmessage=handleMessage},Module.wasmModule=e.data.wasmModule;for(const r of e.data.handlers)Module[r]=(...s)=>{postMessage({cmd:\"callHandler\",handler:r,args:s})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,typeof e.data.urlOrBlob==\"string\")importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}ortWasmThreaded(Module)}else if(e.data.cmd===\"run\"){Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.__emscripten_thread_mailbox_await(e.data.pthread_ptr),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(a){if(a!=\"unwind\")throw a}}else e.data.cmd===\"cancel\"?Module._pthread_self()&&Module.__emscripten_thread_exit(-1):e.data.target===\"setimmediate\"||(e.data.cmd===\"checkMailbox\"?initializedJS&&Module.checkMailbox():e.data.cmd&&(err(\"worker.js received unknown command \"+e.data.cmd),err(e.data)))}catch(a){throw Module.__emscripten_thread_crashed&&Module.__emscripten_thread_crashed(),a}}self.onmessage=handleMessage;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport * as path from 'node:path';\nimport {Env} from 'onnxruntime-common';\n\nimport {OrtWasmModule} from './binding/ort-wasm';\nimport {OrtWasmThreadedModule} from './binding/ort-wasm-threaded';\n\n/* eslint-disable @typescript-eslint/no-require-imports */\nlet ortWasmFactory: EmscriptenModuleFactory;\n\nif (!BUILD_DEFS.DISABLE_TRAINING) {\n ortWasmFactory = require('./binding/ort-training-wasm-simd.js');\n} else {\n ortWasmFactory =\n BUILD_DEFS.DISABLE_WEBGPU ? require('./binding/ort-wasm.js') : require('./binding/ort-wasm-simd.jsep.js');\n}\n\nconst ortWasmFactoryThreaded: EmscriptenModuleFactory = !BUILD_DEFS.DISABLE_WASM_THREAD ?\n (BUILD_DEFS.DISABLE_WEBGPU ? require('./binding/ort-wasm-threaded.js') :\n require('./binding/ort-wasm-simd-threaded.jsep.js')) :\n ortWasmFactory;\n/* eslint-enable @typescript-eslint/no-require-imports */\n\nlet wasm: OrtWasmModule|undefined;\nlet initialized = false;\nlet initializing = false;\nlet aborted = false;\n\nconst isMultiThreadSupported = (numThreads: number): boolean => {\n // WebAssembly threads are set to 1 (single thread).\n if (numThreads === 1) {\n return false;\n }\n\n // If 'SharedArrayBuffer' is not available, WebAssembly threads will not work.\n if (typeof SharedArrayBuffer === 'undefined') {\n if (typeof self !== 'undefined' && !self.crossOriginIsolated) {\n // eslint-disable-next-line no-console\n console.warn(\n 'env.wasm.numThreads is set to ' + numThreads +\n ', but this will not work unless you enable crossOriginIsolated mode. ' +\n 'See https://web.dev/cross-origin-isolation-guide/ for more info.');\n }\n return false;\n }\n\n // onnxruntime-web does not support multi-threads in Node.js.\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // eslint-disable-next-line no-console\n console.warn(\n 'env.wasm.numThreads is set to ' + numThreads +\n ', however, currently onnxruntime-web does not support multi-threads in Node.js. ' +\n 'Please consider using onnxruntime-node for performance critical scenarios.');\n }\n\n try {\n // Test for transferability of SABs (for browsers. needed for Firefox)\n // https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ\n if (typeof MessageChannel !== 'undefined') {\n new MessageChannel().port1.postMessage(new SharedArrayBuffer(1));\n }\n\n // Test for WebAssembly threads capability (for both browsers and Node.js)\n // This typed array is a WebAssembly program containing threaded instructions.\n return WebAssembly.validate(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5,\n 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11\n ]));\n } catch (e) {\n return false;\n }\n};\n\nconst isSimdSupported = (): boolean => {\n try {\n // Test for WebAssembly SIMD capability (for both browsers and Node.js)\n // This typed array is a WebAssembly program containing SIMD instructions.\n\n // The binary data is generated from the following code by wat2wasm:\n //\n // (module\n // (type $t0 (func))\n // (func $f0 (type $t0)\n // (drop\n // (i32x4.dot_i16x8_s\n // (i8x16.splat\n // (i32.const 0))\n // (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)))))\n\n return WebAssembly.validate(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 30, 1, 28, 0, 65, 0,\n 253, 15, 253, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 186, 1, 26, 11\n ]));\n } catch (e) {\n return false;\n }\n};\n\nconst getWasmFileName = (useSimd: boolean, useThreads: boolean) => {\n if (useSimd) {\n if (!BUILD_DEFS.DISABLE_TRAINING) {\n return 'ort-training-wasm-simd.wasm';\n }\n return useThreads ? 'ort-wasm-simd-threaded.wasm' : 'ort-wasm-simd.wasm';\n } else {\n return useThreads ? 'ort-wasm-threaded.wasm' : 'ort-wasm.wasm';\n }\n};\n\nexport const initializeWebAssembly = async(flags: Env.WebAssemblyFlags): Promise => {\n if (initialized) {\n return Promise.resolve();\n }\n if (initializing) {\n throw new Error('multiple calls to \\'initializeWebAssembly()\\' detected.');\n }\n if (aborted) {\n throw new Error('previous call to \\'initializeWebAssembly()\\' failed.');\n }\n\n initializing = true;\n\n // wasm flags are already initialized\n const timeout = flags.initTimeout!;\n const numThreads = flags.numThreads!;\n const simd = flags.simd!;\n\n const useThreads = isMultiThreadSupported(numThreads);\n const useSimd = simd && isSimdSupported();\n\n const wasmPaths = flags.wasmPaths;\n const wasmPrefixOverride = typeof wasmPaths === 'string' ? wasmPaths : undefined;\n const wasmFileName = getWasmFileName(useSimd, useThreads);\n const wasmPathOverride = typeof wasmPaths === 'object' ? wasmPaths[wasmFileName] : undefined;\n\n let isTimeout = false;\n\n const tasks: Array> = [];\n\n // promise for timeout\n if (timeout > 0) {\n tasks.push(new Promise((resolve) => {\n setTimeout(() => {\n isTimeout = true;\n resolve();\n }, timeout);\n }));\n }\n\n // promise for module initialization\n tasks.push(new Promise((resolve, reject) => {\n const factory = useThreads ? ortWasmFactoryThreaded : ortWasmFactory;\n const config: Partial = {\n locateFile: (fileName: string, scriptDirectory: string) => {\n if (!BUILD_DEFS.DISABLE_WASM_THREAD && useThreads && fileName.endsWith('.worker.js') &&\n typeof Blob !== 'undefined') {\n return URL.createObjectURL(new Blob(\n [\n // This require() function is handled by esbuild plugin to load file content as string.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('./binding/ort-wasm-threaded.worker.js')\n ],\n {type: 'text/javascript'}));\n }\n\n if (fileName.endsWith('.wasm')) {\n if (wasmPathOverride) {\n return wasmPathOverride;\n }\n\n const prefix = wasmPrefixOverride ?? scriptDirectory;\n\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n if (wasmFileName === 'ort-wasm-simd.wasm') {\n return prefix + 'ort-wasm-simd.jsep.wasm';\n } else if (wasmFileName === 'ort-wasm-simd-threaded.wasm') {\n return prefix + 'ort-wasm-simd-threaded.jsep.wasm';\n }\n }\n\n return prefix + wasmFileName;\n }\n\n return scriptDirectory + fileName;\n }\n };\n\n if (!BUILD_DEFS.DISABLE_WASM_THREAD && useThreads) {\n config.numThreads = numThreads;\n if (typeof Blob === 'undefined') {\n config.mainScriptUrlOrBlob = path.join(__dirname, 'ort-wasm-threaded.js');\n } else {\n const scriptSourceCode = `var ortWasmThreaded=${factory.toString()};`;\n config.mainScriptUrlOrBlob = new Blob([scriptSourceCode], {type: 'text/javascript'});\n }\n }\n\n factory(config).then(\n // wasm module initialized successfully\n module => {\n initializing = false;\n initialized = true;\n wasm = module;\n resolve();\n },\n // wasm module failed to initialize\n (what) => {\n initializing = false;\n aborted = true;\n reject(what);\n });\n }));\n\n await Promise.race(tasks);\n\n if (isTimeout) {\n throw new Error(`WebAssembly backend initializing failed due to timeout: ${timeout}ms`);\n }\n};\n\nexport const getInstance = (): OrtWasmModule => {\n if (initialized && wasm) {\n return wasm;\n }\n\n throw new Error('WebAssembly is not initialized yet.');\n};\n\nexport const dispose = (): void => {\n if (initialized && !initializing && !aborted) {\n initializing = true;\n\n (wasm as OrtWasmThreadedModule).PThread?.terminateAllThreads();\n wasm = undefined;\n\n initializing = false;\n initialized = false;\n aborted = true;\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {getInstance} from './wasm-factory';\n\nexport const allocWasmString = (data: string, allocs: number[]): number => {\n const wasm = getInstance();\n\n const dataLength = wasm.lengthBytesUTF8(data) + 1;\n const dataOffset = wasm._malloc(dataLength);\n wasm.stringToUTF8(data, dataOffset, dataLength);\n allocs.push(dataOffset);\n\n return dataOffset;\n};\n\ninterface ExtraOptionsHandler {\n (name: string, value: string): void;\n}\n\nexport const iterateExtraOptions =\n (options: Record, prefix: string, seen: WeakSet>,\n handler: ExtraOptionsHandler): void => {\n if (typeof options == 'object' && options !== null) {\n if (seen.has(options)) {\n throw new Error('Circular reference in options');\n } else {\n seen.add(options);\n }\n }\n\n Object.entries(options).forEach(([key, value]) => {\n const name = (prefix) ? prefix + key : key;\n if (typeof value === 'object') {\n iterateExtraOptions(value as Record, name + '.', seen, handler);\n } else if (typeof value === 'string' || typeof value === 'number') {\n handler(name, value.toString());\n } else if (typeof value === 'boolean') {\n handler(name, (value) ? '1' : '0');\n } else {\n throw new Error(`Can't handle extra config type: ${typeof value}`);\n }\n });\n };\n\n/**\n * check web assembly API's last error and throw error if any error occurred.\n * @param message a message used when an error occurred.\n */\nexport const checkLastError = (message: string): void => {\n const wasm = getInstance();\n\n const stack = wasm.stackSave();\n try {\n const paramsOffset = wasm.stackAlloc(8);\n wasm._OrtGetLastError(paramsOffset, paramsOffset + 4);\n const errorCode = wasm.HEAP32[paramsOffset / 4];\n const errorMessagePointer = wasm.HEAPU32[paramsOffset / 4 + 1];\n const errorMessage = errorMessagePointer ? wasm.UTF8ToString(errorMessagePointer) : '';\n throw new Error(`${message} ERROR_CODE: ${errorCode}, ERROR_MESSAGE: ${errorMessage}`);\n } finally {\n wasm.stackRestore(stack);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession} from 'onnxruntime-common';\n\nimport {getInstance} from './wasm-factory';\nimport {allocWasmString, checkLastError, iterateExtraOptions} from './wasm-utils';\n\nexport const setRunOptions = (options: InferenceSession.RunOptions): [number, number[]] => {\n const wasm = getInstance();\n let runOptionsHandle = 0;\n const allocs: number[] = [];\n\n const runOptions: InferenceSession.RunOptions = options || {};\n\n try {\n if (options?.logSeverityLevel === undefined) {\n runOptions.logSeverityLevel = 2; // Default to warning\n } else if (\n typeof options.logSeverityLevel !== 'number' || !Number.isInteger(options.logSeverityLevel) ||\n options.logSeverityLevel < 0 || options.logSeverityLevel > 4) {\n throw new Error(`log serverity level is not valid: ${options.logSeverityLevel}`);\n }\n\n if (options?.logVerbosityLevel === undefined) {\n runOptions.logVerbosityLevel = 0; // Default to 0\n } else if (typeof options.logVerbosityLevel !== 'number' || !Number.isInteger(options.logVerbosityLevel)) {\n throw new Error(`log verbosity level is not valid: ${options.logVerbosityLevel}`);\n }\n\n if (options?.terminate === undefined) {\n runOptions.terminate = false;\n }\n\n let tagDataOffset = 0;\n if (options?.tag !== undefined) {\n tagDataOffset = allocWasmString(options.tag, allocs);\n }\n\n runOptionsHandle = wasm._OrtCreateRunOptions(\n runOptions.logSeverityLevel!, runOptions.logVerbosityLevel!, !!runOptions.terminate!, tagDataOffset);\n if (runOptionsHandle === 0) {\n checkLastError('Can\\'t create run options.');\n }\n\n if (options?.extra !== undefined) {\n iterateExtraOptions(options.extra, '', new WeakSet>(), (key, value) => {\n const keyDataOffset = allocWasmString(key, allocs);\n const valueDataOffset = allocWasmString(value, allocs);\n\n if (wasm._OrtAddRunConfigEntry(runOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n checkLastError(`Can't set a run config entry: ${key} - ${value}.`);\n }\n });\n }\n\n return [runOptionsHandle, allocs];\n } catch (e) {\n if (runOptionsHandle !== 0) {\n wasm._OrtReleaseRunOptions(runOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n throw e;\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession} from 'onnxruntime-common';\n\nimport {getInstance} from './wasm-factory';\nimport {allocWasmString, checkLastError, iterateExtraOptions} from './wasm-utils';\n\nconst getGraphOptimzationLevel = (graphOptimizationLevel: string|unknown): number => {\n switch (graphOptimizationLevel) {\n case 'disabled':\n return 0;\n case 'basic':\n return 1;\n case 'extended':\n return 2;\n case 'all':\n return 99;\n default:\n throw new Error(`unsupported graph optimization level: ${graphOptimizationLevel}`);\n }\n};\n\nconst getExecutionMode = (executionMode: 'sequential'|'parallel'): number => {\n switch (executionMode) {\n case 'sequential':\n return 0;\n case 'parallel':\n return 1;\n default:\n throw new Error(`unsupported execution mode: ${executionMode}`);\n }\n};\n\nconst appendDefaultOptions = (options: InferenceSession.SessionOptions): void => {\n if (!options.extra) {\n options.extra = {};\n }\n if (!options.extra.session) {\n options.extra.session = {};\n }\n const session = options.extra.session as Record;\n if (!session.use_ort_model_bytes_directly) {\n // eslint-disable-next-line camelcase\n session.use_ort_model_bytes_directly = '1';\n }\n\n // if using JSEP with WebGPU, always disable memory pattern\n if (options.executionProviders &&\n options.executionProviders.some(ep => (typeof ep === 'string' ? ep : ep.name) === 'webgpu')) {\n options.enableMemPattern = false;\n }\n};\n\nconst setExecutionProviders =\n (sessionOptionsHandle: number, executionProviders: readonly InferenceSession.ExecutionProviderConfig[],\n allocs: number[]): void => {\n for (const ep of executionProviders) {\n let epName = typeof ep === 'string' ? ep : ep.name;\n\n // check EP name\n switch (epName) {\n case 'webnn':\n epName = 'WEBNN';\n if (typeof ep !== 'string') {\n const webnnOptions = ep as InferenceSession.WebNNExecutionProviderOption;\n if (webnnOptions?.deviceType) {\n const keyDataOffset = allocWasmString('deviceType', allocs);\n const valueDataOffset = allocWasmString(webnnOptions.deviceType, allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(`Can't set a session config entry: 'deviceType' - ${webnnOptions.deviceType}.`);\n }\n }\n if (webnnOptions?.numThreads) {\n let numThreads = webnnOptions.numThreads;\n // Just ignore invalid webnnOptions.numThreads.\n if (typeof numThreads != 'number' || !Number.isInteger(numThreads) || numThreads < 0) {\n numThreads = 0;\n }\n const keyDataOffset = allocWasmString('numThreads', allocs);\n const valueDataOffset = allocWasmString(numThreads.toString(), allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(`Can't set a session config entry: 'numThreads' - ${webnnOptions.numThreads}.`);\n }\n }\n if (webnnOptions?.powerPreference) {\n const keyDataOffset = allocWasmString('powerPreference', allocs);\n const valueDataOffset = allocWasmString(webnnOptions.powerPreference, allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(\n `Can't set a session config entry: 'powerPreference' - ${webnnOptions.powerPreference}.`);\n }\n }\n }\n break;\n case 'webgpu':\n epName = 'JS';\n if (typeof ep !== 'string') {\n const webgpuOptions = ep as InferenceSession.WebGpuExecutionProviderOption;\n if (webgpuOptions?.preferredLayout) {\n if (webgpuOptions.preferredLayout !== 'NCHW' && webgpuOptions.preferredLayout !== 'NHWC') {\n throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${webgpuOptions.preferredLayout}`);\n }\n const keyDataOffset = allocWasmString('preferredLayout', allocs);\n const valueDataOffset = allocWasmString(webgpuOptions.preferredLayout, allocs);\n if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !==\n 0) {\n checkLastError(\n `Can't set a session config entry: 'preferredLayout' - ${webgpuOptions.preferredLayout}.`);\n }\n }\n }\n break;\n case 'wasm':\n case 'cpu':\n continue;\n default:\n throw new Error(`not supported execution provider: ${epName}`);\n }\n\n const epNameDataOffset = allocWasmString(epName, allocs);\n if (getInstance()._OrtAppendExecutionProvider(sessionOptionsHandle, epNameDataOffset) !== 0) {\n checkLastError(`Can't append execution provider: ${epName}.`);\n }\n }\n };\n\nexport const setSessionOptions = (options?: InferenceSession.SessionOptions): [number, number[]] => {\n const wasm = getInstance();\n let sessionOptionsHandle = 0;\n const allocs: number[] = [];\n\n const sessionOptions: InferenceSession.SessionOptions = options || {};\n appendDefaultOptions(sessionOptions);\n\n try {\n const graphOptimizationLevel = getGraphOptimzationLevel(sessionOptions.graphOptimizationLevel ?? 'all');\n const executionMode = getExecutionMode(sessionOptions.executionMode ?? 'sequential');\n const logIdDataOffset =\n typeof sessionOptions.logId === 'string' ? allocWasmString(sessionOptions.logId, allocs) : 0;\n\n const logSeverityLevel = sessionOptions.logSeverityLevel ?? 2; // Default to 2 - warning\n if (!Number.isInteger(logSeverityLevel) || logSeverityLevel < 0 || logSeverityLevel > 4) {\n throw new Error(`log serverity level is not valid: ${logSeverityLevel}`);\n }\n\n const logVerbosityLevel = sessionOptions.logVerbosityLevel ?? 0; // Default to 0 - verbose\n if (!Number.isInteger(logVerbosityLevel) || logVerbosityLevel < 0 || logVerbosityLevel > 4) {\n throw new Error(`log verbosity level is not valid: ${logVerbosityLevel}`);\n }\n\n const optimizedModelFilePathOffset = typeof sessionOptions.optimizedModelFilePath === 'string' ?\n allocWasmString(sessionOptions.optimizedModelFilePath, allocs) :\n 0;\n\n sessionOptionsHandle = wasm._OrtCreateSessionOptions(\n graphOptimizationLevel, !!sessionOptions.enableCpuMemArena, !!sessionOptions.enableMemPattern, executionMode,\n !!sessionOptions.enableProfiling, 0, logIdDataOffset, logSeverityLevel, logVerbosityLevel,\n optimizedModelFilePathOffset);\n if (sessionOptionsHandle === 0) {\n checkLastError('Can\\'t create session options.');\n }\n\n if (sessionOptions.executionProviders) {\n setExecutionProviders(sessionOptionsHandle, sessionOptions.executionProviders, allocs);\n }\n\n if (sessionOptions.enableGraphCapture !== undefined) {\n if (typeof sessionOptions.enableGraphCapture !== 'boolean') {\n throw new Error(`enableGraphCapture must be a boolean value: ${sessionOptions.enableGraphCapture}`);\n }\n const keyDataOffset = allocWasmString('enableGraphCapture', allocs);\n const valueDataOffset = allocWasmString(sessionOptions.enableGraphCapture.toString(), allocs);\n if (wasm._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n checkLastError(\n `Can't set a session config entry: 'enableGraphCapture' - ${sessionOptions.enableGraphCapture}.`);\n }\n }\n\n if (sessionOptions.freeDimensionOverrides) {\n for (const [name, value] of Object.entries(sessionOptions.freeDimensionOverrides)) {\n if (typeof name !== 'string') {\n throw new Error(`free dimension override name must be a string: ${name}`);\n }\n if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) {\n throw new Error(`free dimension override value must be a non-negative integer: ${value}`);\n }\n const nameOffset = allocWasmString(name, allocs);\n if (wasm._OrtAddFreeDimensionOverride(sessionOptionsHandle, nameOffset, value) !== 0) {\n checkLastError(`Can't set a free dimension override: ${name} - ${value}.`);\n }\n }\n }\n\n if (sessionOptions.extra !== undefined) {\n iterateExtraOptions(sessionOptions.extra, '', new WeakSet>(), (key, value) => {\n const keyDataOffset = allocWasmString(key, allocs);\n const valueDataOffset = allocWasmString(value, allocs);\n\n if (wasm._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n checkLastError(`Can't set a session config entry: ${key} - ${value}.`);\n }\n });\n }\n\n return [sessionOptionsHandle, allocs];\n } catch (e) {\n if (sessionOptionsHandle !== 0) {\n wasm._OrtReleaseSessionOptions(sessionOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n throw e;\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Tensor} from 'onnxruntime-common';\n\n// a dummy type declaration for Float16Array in case any polyfill is available.\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any\n const Float16Array: any;\n}\n\n// This file includes common definitions. They do NOT have dependency on the WebAssembly instance.\n\n/**\n * Copied from ONNX definition. Use this to drop dependency 'onnx_proto' to decrease compiled .js file size.\n */\nexport const enum DataType {\n undefined = 0,\n float = 1,\n uint8 = 2,\n int8 = 3,\n uint16 = 4,\n int16 = 5,\n int32 = 6,\n int64 = 7,\n string = 8,\n bool = 9,\n float16 = 10,\n double = 11,\n uint32 = 12,\n uint64 = 13,\n complex64 = 14,\n complex128 = 15,\n bfloat16 = 16\n}\n\n/**\n * Map string tensor data to enum value\n */\nexport const tensorDataTypeStringToEnum = (type: string): DataType => {\n switch (type) {\n case 'int8':\n return DataType.int8;\n case 'uint8':\n return DataType.uint8;\n case 'bool':\n return DataType.bool;\n case 'int16':\n return DataType.int16;\n case 'uint16':\n return DataType.uint16;\n case 'int32':\n return DataType.int32;\n case 'uint32':\n return DataType.uint32;\n case 'float16':\n return DataType.float16;\n case 'float32':\n return DataType.float;\n case 'float64':\n return DataType.double;\n case 'string':\n return DataType.string;\n case 'int64':\n return DataType.int64;\n case 'uint64':\n return DataType.uint64;\n\n default:\n throw new Error(`unsupported data type: ${type}`);\n }\n};\n\n/**\n * Map enum value to string tensor data\n */\nexport const tensorDataTypeEnumToString = (typeProto: DataType): Tensor.Type => {\n switch (typeProto) {\n case DataType.int8:\n return 'int8';\n case DataType.uint8:\n return 'uint8';\n case DataType.bool:\n return 'bool';\n case DataType.int16:\n return 'int16';\n case DataType.uint16:\n return 'uint16';\n case DataType.int32:\n return 'int32';\n case DataType.uint32:\n return 'uint32';\n case DataType.float16:\n return 'float16';\n case DataType.float:\n return 'float32';\n case DataType.double:\n return 'float64';\n case DataType.string:\n return 'string';\n case DataType.int64:\n return 'int64';\n case DataType.uint64:\n return 'uint64';\n\n default:\n throw new Error(`unsupported data type: ${typeProto}`);\n }\n};\n\n/**\n * get tensor element size in bytes by the given data type\n * @returns size in integer or undefined if the data type is not supported\n */\nexport const getTensorElementSize = (dateType: number): number|\n undefined => [undefined, 4, 1, 1, 2, 2, 4, 8, undefined, 1, 2, 8, 4, 8, undefined, undefined, undefined][dateType];\n\n/**\n * get typed array constructor by the given tensor type\n */\nexport const tensorTypeToTypedArrayConstructor = (type: Tensor.Type): Float32ArrayConstructor|Uint8ArrayConstructor|\n Int8ArrayConstructor|Uint16ArrayConstructor|Int16ArrayConstructor|Int32ArrayConstructor|BigInt64ArrayConstructor|\n Uint8ArrayConstructor|Float64ArrayConstructor|Uint32ArrayConstructor|BigUint64ArrayConstructor => {\n switch (type) {\n case 'float16':\n // allow Float16Array polyfill.\n return typeof Float16Array !== 'undefined' && Float16Array.from ? Float16Array : Uint16Array;\n case 'float32':\n return Float32Array;\n case 'uint8':\n return Uint8Array;\n case 'int8':\n return Int8Array;\n case 'uint16':\n return Uint16Array;\n case 'int16':\n return Int16Array;\n case 'int32':\n return Int32Array;\n case 'bool':\n return Uint8Array;\n case 'float64':\n return Float64Array;\n case 'uint32':\n return Uint32Array;\n case 'int64':\n return BigInt64Array;\n case 'uint64':\n return BigUint64Array;\n default:\n throw new Error(`unsupported type: ${type}`);\n }\n };\n\n/**\n * Map string log level to integer value\n */\nexport const logLevelStringToEnum = (logLevel?: 'verbose'|'info'|'warning'|'error'|'fatal'): number => {\n switch (logLevel) {\n case 'verbose':\n return 0;\n case 'info':\n return 1;\n case 'warning':\n return 2;\n case 'error':\n return 3;\n case 'fatal':\n return 4;\n default:\n throw new Error(`unsupported logging level: ${logLevel}`);\n }\n};\n\n/**\n * Check whether the given tensor type is supported by GPU buffer\n */\nexport const isGpuBufferSupportedType = (type: Tensor.Type): type is Tensor.GpuBufferDataTypes => type === 'float32' ||\n type === 'float16' || type === 'int32' || type === 'int64' || type === 'uint32' || type === 'uint8' ||\n type === 'bool';\n\n/**\n * Map string data location to integer value\n */\nexport const dataLocationStringToEnum = (location: Tensor.DataLocation): number => {\n switch (location) {\n case 'none':\n return 0;\n case 'cpu':\n return 1;\n case 'cpu-pinned':\n return 2;\n case 'texture':\n return 3;\n case 'gpu-buffer':\n return 4;\n default:\n throw new Error(`unsupported data location: ${location}`);\n }\n};\n\n/**\n * Map integer data location to string value\n */\nexport const dataLocationEnumToString = (location: number): Tensor.DataLocation|undefined =>\n (['none', 'cpu', 'cpu-pinned', 'texture', 'gpu-buffer'] as const)[location];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport * as fs from 'fs';\nimport {readFile} from 'node:fs/promises';\n\n/**\n * Load a file into a Uint8Array.\n *\n * @param file - the file to load. Can be a URL/path, a Blob, an ArrayBuffer, or a Uint8Array.\n * @returns a Uint8Array containing the file data.\n */\nexport const loadFile = async(file: string|Blob|ArrayBufferLike|Uint8Array): Promise => {\n if (typeof file === 'string') {\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // load file into ArrayBuffer in Node.js\n try {\n return new Uint8Array(await readFile(file));\n } catch (e) {\n if (e.code === 'ERR_FS_FILE_TOO_LARGE') {\n // file is too large, use fs.createReadStream instead\n const stream = fs.createReadStream(file);\n const chunks: Uint8Array[] = [];\n for await (const chunk of stream) {\n chunks.push(chunk);\n }\n return new Uint8Array(Buffer.concat(chunks));\n }\n throw e;\n }\n } else {\n // load file into ArrayBuffer in browsers\n const response = await fetch(file);\n if (!response.ok) {\n throw new Error(`failed to load external data file: ${file}`);\n }\n const contentLengthHeader = response.headers.get('Content-Length');\n const fileSize = contentLengthHeader ? parseInt(contentLengthHeader, 10) : 0;\n if (fileSize < 1073741824 /* 1GB */) {\n // when Content-Length header is not set, we cannot determine the file size. We assume it is small enough to\n // load into memory.\n return new Uint8Array(await response.arrayBuffer());\n } else {\n // file is too large, use stream instead\n if (!response.body) {\n throw new Error(`failed to load external data file: ${file}, no response body.`);\n }\n const reader = response.body.getReader();\n\n let buffer;\n try {\n // try to create ArrayBuffer directly\n buffer = new ArrayBuffer(fileSize);\n } catch (e) {\n if (e instanceof RangeError) {\n // use WebAssembly Memory to allocate larger ArrayBuffer\n const pages = Math.ceil(fileSize / 65536);\n buffer = new WebAssembly.Memory({initial: pages, maximum: pages}).buffer;\n } else {\n throw e;\n }\n }\n\n let offset = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n const chunkSize = value.byteLength;\n const chunk = new Uint8Array(buffer, offset, chunkSize);\n chunk.set(value);\n offset += chunkSize;\n }\n return new Uint8Array(buffer, 0, fileSize);\n }\n }\n\n } else if (file instanceof Blob) {\n return new Uint8Array(await file.arrayBuffer());\n } else if (file instanceof Uint8Array) {\n return file;\n } else {\n return new Uint8Array(file);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {Env, InferenceSession, Tensor} from 'onnxruntime-common';\n\nimport {SerializableInternalBuffer, SerializableSessionMetadata, SerializableTensorMetadata, TensorMetadata} from './proxy-messages';\nimport {setRunOptions} from './run-options';\nimport {setSessionOptions} from './session-options';\nimport {dataLocationStringToEnum, getTensorElementSize, isGpuBufferSupportedType, logLevelStringToEnum, tensorDataTypeEnumToString, tensorDataTypeStringToEnum, tensorTypeToTypedArrayConstructor} from './wasm-common';\nimport {getInstance} from './wasm-factory';\nimport {allocWasmString, checkLastError} from './wasm-utils';\nimport {loadFile} from './wasm-utils-load-file';\n\n// #region Initializations\n\n/**\n * There are 4 different \"initialization\" steps for ORT. They happen in different places and different time.\n *\n * 1. JavaScript initialization for onnxruntime-common and onnxruntime-web.\n * This is the first initialization step. In this step, onnxruntime-web calls onnxruntime-common's registerBackend()\n * function multiple times to register all the available backends. The backend registration is very fast. It only\n * registers the backend name with the uninitialized backend object. No heavy initialization is done in this step.\n * Refer to web/lib/index.ts for the backend registration.\n *\n * 2. WebAssembly artifact initialization.\n * This happens when any registered wasm backend is used for the first time (ie. `ort.InferenceSession.create()` or\n * `ort.TrainingSession.create()` is called). In this step, onnxruntime-web does the followings:\n * - create a proxy worker and make sure the proxy worker is ready to receive messages, if proxy is enabled.\n * - perform feature detection, locate correct WebAssembly artifact path and call the Emscripten generated\n * JavaScript code to initialize the WebAssembly runtime.\n * - if proxy is enabled, this step happens in the proxy worker using message 'init-wasm'.\n * - downloading the 'ort-wasm{...}.wasm' file is done in this step.\n * - if multi-thread is enabled, one or more webworker will be created to initialize the PThread threadpool.\n *\n * 3. ORT environment initialization.\n * This happens after step 2. In this step, onnxruntime-web performs ONNX Runtime environment initialization.\n * Function `_OrtInit()` is called in this step.\n * - if proxy is enabled, this step happens in the proxy worker using message 'init-ort'.\n * - logging level (ort.env.logLevel) and thread number (ort.env.wasm.numThreads) are set in this step.\n *\n * 4. Session initialization.\n * This happens when `ort.InferenceSession.create()` or `ort.TrainingSession.create()` is called. Unlike the first 3\n * steps (they only called once), this step will be done for each session. In this step, onnxruntime-web does the\n * followings:\n * If the parameter is a URL:\n * - download the model data from the URL.\n * - copy the model data to the WASM heap. (proxy: 'copy-from')\n * - dereference the model buffer. This step allows the original ArrayBuffer to be garbage collected.\n * - call `_OrtCreateSession()` to create the session. (proxy: 'create')\n *\n * If the parameter is a Uint8Array object:\n * - copy the model data to the WASM heap. (proxy: 'copy-from')\n * - call `_OrtCreateSession()` to create the session. (proxy: 'create')\n *\n *\n */\n\n/**\n * initialize ORT environment.\n *\n * @param numThreads SetGlobalIntraOpNumThreads(numThreads)\n * @param loggingLevel CreateEnv(static_cast(logging_level))\n */\nconst initOrt = (numThreads: number, loggingLevel: number): void => {\n const errorCode = getInstance()._OrtInit(numThreads, loggingLevel);\n if (errorCode !== 0) {\n checkLastError('Can\\'t initialize onnxruntime.');\n }\n};\n\n/**\n * intialize runtime environment.\n * @param env passed in the environment config object.\n */\nexport const initRuntime = async(env: Env): Promise => {\n // init ORT\n initOrt(env.wasm.numThreads!, logLevelStringToEnum(env.logLevel));\n};\n\n/**\n * perform EP specific initialization.\n *\n * @param env\n * @param epName\n */\nexport const initEp = async(env: Env, epName: string): Promise => {\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const initJsep = require('./jsep/init').init;\n\n if (epName === 'webgpu') {\n // perform WebGPU availability check\n if (typeof navigator === 'undefined' || !navigator.gpu) {\n throw new Error('WebGPU is not supported in current environment');\n }\n\n let adapter = env.webgpu.adapter as GPUAdapter | null;\n if (!adapter) {\n // if adapter is not set, request a new adapter.\n const powerPreference = env.webgpu.powerPreference;\n if (powerPreference !== undefined && powerPreference !== 'low-power' &&\n powerPreference !== 'high-performance') {\n throw new Error(`Invalid powerPreference setting: \"${powerPreference}\"`);\n }\n const forceFallbackAdapter = env.webgpu.forceFallbackAdapter;\n if (forceFallbackAdapter !== undefined && typeof forceFallbackAdapter !== 'boolean') {\n throw new Error(`Invalid forceFallbackAdapter setting: \"${forceFallbackAdapter}\"`);\n }\n adapter = await navigator.gpu.requestAdapter({powerPreference, forceFallbackAdapter});\n if (!adapter) {\n throw new Error(\n 'Failed to get GPU adapter. ' +\n 'You may need to enable flag \"--enable-unsafe-webgpu\" if you are using Chrome.');\n }\n } else {\n // if adapter is set, validate it.\n if (typeof adapter.limits !== 'object' || typeof adapter.features !== 'object' ||\n typeof adapter.requestDevice !== 'function') {\n throw new Error('Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.');\n }\n }\n\n if (!env.wasm.simd) {\n throw new Error(\n 'Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using `webgpu` EP');\n }\n\n await initJsep('webgpu', getInstance(), env, adapter);\n }\n if (epName === 'webnn') {\n // perform WebNN availability check\n if (typeof navigator === 'undefined' || !(navigator as unknown as {ml: unknown}).ml) {\n throw new Error('WebNN is not supported in current environment');\n }\n\n await initJsep('webnn', getInstance(), env);\n }\n }\n};\n\n// #endregion Initializations\n\n/**\n * valid data locations for input/output tensors.\n */\ntype SupportedTensorDataLocationForInputOutput = 'cpu'|'cpu-pinned'|'gpu-buffer';\n\ntype IOBindingState = {\n /**\n * the handle of IO binding.\n */\n readonly handle: number;\n\n /**\n * the preferred location for each output tensor.\n *\n * value is one of 'cpu', 'cpu-pinned', 'gpu-buffer'.\n */\n readonly outputPreferredLocations: readonly SupportedTensorDataLocationForInputOutput[];\n\n /**\n * enum value of the preferred location for each output tensor.\n */\n readonly outputPreferredLocationsEncoded: readonly number[];\n};\n\n/**\n * tuple elements are: InferenceSession ID; inputNamesUTF8Encoded; outputNamesUTF8Encoded; bindingState\n */\ntype SessionMetadata = [\n inferenceSessionId: number, inputNamesUTF8Encoded: number[], outputNamesUTF8Encoded: number[],\n bindingState: IOBindingState|null, enableGraphCapture: boolean, inputOutputBound: boolean\n];\n\nconst activeSessions = new Map();\n\n/**\n * get the input/output count of the session.\n * @param sessionHandle the handle representing the session. should be non-zero.\n * @returns a tuple including 2 numbers, representing the input count and output count.\n */\nconst getSessionInputOutputCount = (sessionHandle: number): [number, number] => {\n const wasm = getInstance();\n const stack = wasm.stackSave();\n try {\n const dataOffset = wasm.stackAlloc(8);\n const errorCode = wasm._OrtGetInputOutputCount(sessionHandle, dataOffset, dataOffset + 4);\n if (errorCode !== 0) {\n checkLastError('Can\\'t get session input/output count.');\n }\n return [wasm.HEAP32[dataOffset / 4], wasm.HEAP32[dataOffset / 4 + 1]];\n } finally {\n wasm.stackRestore(stack);\n }\n};\n\n/**\n * allocate the memory and memcpy the external buffer.\n *\n * @param model - the external buffer containing the model data. Must not be the same buffer as the WASM heap.\n * @returns a 2-elements tuple - the pointer and size of the allocated buffer\n */\nexport const copyFromExternalBuffer = (model: Uint8Array): [number, number] => {\n const wasm = getInstance();\n const modelDataOffset = wasm._malloc(model.byteLength);\n if (modelDataOffset === 0) {\n throw new Error(`Can't create a session. failed to allocate a buffer of size ${model.byteLength}.`);\n }\n wasm.HEAPU8.set(model, modelDataOffset);\n return [modelDataOffset, model.byteLength];\n};\n\n/**\n * create an inference session from a model data buffer.\n *\n * @param modelData - either a Uint8Array object representing the model data, or a 2-elements tuple containing the\n * pointer and size of the model data buffer.\n * @param options an optional session options object.\n * @returns a 3-elements tuple containing [session handle, input names, output names]\n */\nexport const createSession = async(\n modelData: Uint8Array|SerializableInternalBuffer,\n options?: InferenceSession.SessionOptions): Promise => {\n let modelDataOffset: number, modelDataLength: number;\n const wasm = getInstance();\n\n if (Array.isArray(modelData)) {\n // if model data is an array, it must be a 2-elements tuple containing the pointer and size of the model data\n [modelDataOffset, modelDataLength] = modelData;\n } else if (modelData.buffer === wasm.HEAPU8.buffer) {\n // if model data uses the same buffer as the WASM heap, we don't need to copy it.\n [modelDataOffset, modelDataLength] = [modelData.byteOffset, modelData.byteLength];\n } else {\n // otherwise, copy the model data to the WASM heap.\n [modelDataOffset, modelDataLength] = copyFromExternalBuffer(modelData);\n }\n\n let sessionHandle = 0;\n let sessionOptionsHandle = 0;\n let ioBindingHandle = 0;\n let allocs: number[] = [];\n const inputNamesUTF8Encoded = [];\n const outputNamesUTF8Encoded = [];\n\n try {\n [sessionOptionsHandle, allocs] = setSessionOptions(options);\n\n if (options?.externalData && wasm.mountExternalData) {\n const loadingPromises = [];\n for (const file of options.externalData) {\n const path = typeof file === 'string' ? file : file.path;\n loadingPromises.push(loadFile(typeof file === 'string' ? file : file.data).then(data => {\n wasm.mountExternalData!(path, data);\n }));\n }\n\n // wait for all external data files to be loaded\n await Promise.all(loadingPromises);\n }\n\n sessionHandle = await wasm._OrtCreateSession(modelDataOffset, modelDataLength, sessionOptionsHandle);\n if (sessionHandle === 0) {\n checkLastError('Can\\'t create a session.');\n }\n\n const [inputCount, outputCount] = getSessionInputOutputCount(sessionHandle);\n\n const enableGraphCapture = !!options?.enableGraphCapture;\n\n const inputNames = [];\n const outputNames = [];\n const outputPreferredLocations: SupportedTensorDataLocationForInputOutput[] = [];\n for (let i = 0; i < inputCount; i++) {\n const name = wasm._OrtGetInputName(sessionHandle, i);\n if (name === 0) {\n checkLastError('Can\\'t get an input name.');\n }\n inputNamesUTF8Encoded.push(name);\n inputNames.push(wasm.UTF8ToString(name));\n }\n for (let i = 0; i < outputCount; i++) {\n const name = wasm._OrtGetOutputName(sessionHandle, i);\n if (name === 0) {\n checkLastError('Can\\'t get an output name.');\n }\n outputNamesUTF8Encoded.push(name);\n const nameString = wasm.UTF8ToString(name);\n outputNames.push(nameString);\n\n if (!BUILD_DEFS.DISABLE_WEBGPU) {\n if (enableGraphCapture && options?.preferredOutputLocation === undefined) {\n outputPreferredLocations.push('gpu-buffer');\n continue;\n }\n const location = typeof options?.preferredOutputLocation === 'string' ?\n options.preferredOutputLocation :\n options?.preferredOutputLocation?.[nameString] ?? 'cpu';\n if (location !== 'cpu' && location !== 'cpu-pinned' && location !== 'gpu-buffer') {\n throw new Error(`Not supported preferred output location: ${location}.`);\n }\n if (enableGraphCapture && location !== 'gpu-buffer') {\n throw new Error(`Not supported preferred output location: ${\n location}. Only 'gpu-buffer' location is supported when enableGraphCapture is true.`);\n }\n outputPreferredLocations.push(location);\n }\n }\n\n // use IO binding only when at least one output is preffered to be on GPU.\n let bindingState: IOBindingState|null = null;\n if (!BUILD_DEFS.DISABLE_WEBGPU && outputPreferredLocations.some(l => l === 'gpu-buffer')) {\n ioBindingHandle = wasm._OrtCreateBinding(sessionHandle);\n if (ioBindingHandle === 0) {\n checkLastError('Can\\'t create IO binding.');\n }\n\n bindingState = {\n handle: ioBindingHandle,\n outputPreferredLocations,\n outputPreferredLocationsEncoded: outputPreferredLocations.map(l => dataLocationStringToEnum(l)),\n };\n }\n\n activeSessions.set(\n sessionHandle,\n [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, bindingState, enableGraphCapture, false]);\n return [sessionHandle, inputNames, outputNames];\n } catch (e) {\n inputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n outputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n\n if (ioBindingHandle !== 0) {\n wasm._OrtReleaseBinding(ioBindingHandle);\n }\n\n if (sessionHandle !== 0) {\n wasm._OrtReleaseSession(sessionHandle);\n }\n throw e;\n } finally {\n wasm._free(modelDataOffset);\n if (sessionOptionsHandle !== 0) {\n wasm._OrtReleaseSessionOptions(sessionOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n\n // unmount external data if necessary\n wasm.unmountExternalData?.();\n }\n};\n\nexport const releaseSession = (sessionId: number): void => {\n const wasm = getInstance();\n const session = activeSessions.get(sessionId);\n if (!session) {\n throw new Error(`cannot release session. invalid session id: ${sessionId}`);\n }\n const [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture] = session;\n\n if (ioBindingState) {\n if (enableGraphCapture) {\n wasm._OrtClearBoundOutputs(ioBindingState.handle);\n }\n wasm._OrtReleaseBinding(ioBindingState.handle);\n }\n\n wasm.jsepOnReleaseSession?.(sessionId);\n\n inputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n outputNamesUTF8Encoded.forEach(buf => wasm._OrtFree(buf));\n wasm._OrtReleaseSession(sessionHandle);\n activeSessions.delete(sessionId);\n};\n\nexport const prepareInputOutputTensor =\n (tensor: TensorMetadata|null, tensorHandles: number[], allocs: number[], sessionId: number, index: number,\n enableGraphCapture = false): void => {\n if (!tensor) {\n tensorHandles.push(0);\n return;\n }\n\n const wasm = getInstance();\n\n const dataType = tensor[0];\n const dims = tensor[1];\n const location = tensor[3];\n\n let rawData: number;\n let dataByteLength: number;\n\n if (dataType === 'string' && location === 'gpu-buffer') {\n throw new Error('String tensor is not supported on GPU.');\n }\n\n if (enableGraphCapture && location !== 'gpu-buffer') {\n throw new Error(\n `External buffer must be provided for input/output index ${index} when enableGraphCapture is true.`);\n }\n\n if (location === 'gpu-buffer') {\n const gpuBuffer = tensor[2].gpuBuffer as GPUBuffer;\n const elementSizeInBytes = getTensorElementSize(tensorDataTypeStringToEnum(dataType))!;\n dataByteLength = dims.reduce((a, b) => a * b, 1) * elementSizeInBytes;\n\n const registerBuffer = wasm.jsepRegisterBuffer;\n if (!registerBuffer) {\n throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');\n }\n rawData = registerBuffer(sessionId, index, gpuBuffer, dataByteLength);\n } else {\n const data = tensor[2];\n\n if (Array.isArray(data)) {\n // string tensor\n dataByteLength = 4 * data.length;\n rawData = wasm._malloc(dataByteLength);\n allocs.push(rawData);\n let dataIndex = rawData / 4;\n for (let i = 0; i < data.length; i++) {\n if (typeof data[i] !== 'string') {\n throw new TypeError(`tensor data at index ${i} is not a string`);\n }\n wasm.HEAPU32[dataIndex++] = allocWasmString(data[i], allocs);\n }\n } else {\n dataByteLength = data.byteLength;\n rawData = wasm._malloc(dataByteLength);\n allocs.push(rawData);\n wasm.HEAPU8.set(new Uint8Array(data.buffer, data.byteOffset, dataByteLength), rawData);\n }\n }\n\n const stack = wasm.stackSave();\n const dimsOffset = wasm.stackAlloc(4 * dims.length);\n try {\n let dimIndex = dimsOffset / 4;\n dims.forEach(d => wasm.HEAP32[dimIndex++] = d);\n const tensor = wasm._OrtCreateTensor(\n tensorDataTypeStringToEnum(dataType), rawData, dataByteLength, dimsOffset, dims.length,\n dataLocationStringToEnum(location));\n if (tensor === 0) {\n checkLastError(`Can't create tensor for input/output. session=${sessionId}, index=${index}.`);\n }\n tensorHandles.push(tensor);\n } finally {\n wasm.stackRestore(stack);\n }\n };\n\n/**\n * perform inference run\n */\nexport const run = async(\n sessionId: number, inputIndices: number[], inputTensors: TensorMetadata[], outputIndices: number[],\n outputTensors: Array, options: InferenceSession.RunOptions): Promise => {\n const wasm = getInstance();\n const session = activeSessions.get(sessionId);\n if (!session) {\n throw new Error(`cannot run inference. invalid session id: ${sessionId}`);\n }\n const sessionHandle = session[0];\n const inputNamesUTF8Encoded = session[1];\n const outputNamesUTF8Encoded = session[2];\n const ioBindingState = session[3];\n const enableGraphCapture = session[4];\n const inputOutputBound = session[5];\n\n const inputCount = inputIndices.length;\n const outputCount = outputIndices.length;\n\n let runOptionsHandle = 0;\n let runOptionsAllocs: number[] = [];\n\n const inputTensorHandles: number[] = [];\n const outputTensorHandles: number[] = [];\n const inputOutputAllocs: number[] = [];\n\n const beforeRunStack = wasm.stackSave();\n const inputValuesOffset = wasm.stackAlloc(inputCount * 4);\n const inputNamesOffset = wasm.stackAlloc(inputCount * 4);\n const outputValuesOffset = wasm.stackAlloc(outputCount * 4);\n const outputNamesOffset = wasm.stackAlloc(outputCount * 4);\n\n try {\n [runOptionsHandle, runOptionsAllocs] = setRunOptions(options);\n\n // create input tensors\n for (let i = 0; i < inputCount; i++) {\n prepareInputOutputTensor(\n inputTensors[i], inputTensorHandles, inputOutputAllocs, sessionId, inputIndices[i], enableGraphCapture);\n }\n\n // create output tensors\n for (let i = 0; i < outputCount; i++) {\n prepareInputOutputTensor(\n outputTensors[i], outputTensorHandles, inputOutputAllocs, sessionId, inputCount + outputIndices[i],\n enableGraphCapture);\n }\n\n let inputValuesIndex = inputValuesOffset / 4;\n let inputNamesIndex = inputNamesOffset / 4;\n let outputValuesIndex = outputValuesOffset / 4;\n let outputNamesIndex = outputNamesOffset / 4;\n for (let i = 0; i < inputCount; i++) {\n wasm.HEAPU32[inputValuesIndex++] = inputTensorHandles[i];\n wasm.HEAPU32[inputNamesIndex++] = inputNamesUTF8Encoded[inputIndices[i]];\n }\n for (let i = 0; i < outputCount; i++) {\n wasm.HEAPU32[outputValuesIndex++] = outputTensorHandles[i];\n wasm.HEAPU32[outputNamesIndex++] = outputNamesUTF8Encoded[outputIndices[i]];\n }\n\n if (!BUILD_DEFS.DISABLE_WEBGPU && ioBindingState && !inputOutputBound) {\n const {handle, outputPreferredLocations, outputPreferredLocationsEncoded} = ioBindingState;\n\n if (inputNamesUTF8Encoded.length !== inputCount) {\n throw new Error(`input count from feeds (${\n inputCount}) is expected to be always equal to model's input count (${inputNamesUTF8Encoded.length}).`);\n }\n\n // process inputs\n for (let i = 0; i < inputCount; i++) {\n const index = inputIndices[i];\n const errorCode = await wasm._OrtBindInput(handle, inputNamesUTF8Encoded[index], inputTensorHandles[i]);\n if (errorCode !== 0) {\n checkLastError(`Can't bind input[${i}] for session=${sessionId}.`);\n }\n }\n\n // process pre-allocated outputs\n for (let i = 0; i < outputCount; i++) {\n const index = outputIndices[i];\n const location = outputTensors[i]?.[3]; // undefined means output is not pre-allocated.\n\n if (location) {\n // output is pre-allocated. bind the tensor.\n const errorCode = wasm._OrtBindOutput(handle, outputNamesUTF8Encoded[index], outputTensorHandles[i], 0);\n if (errorCode !== 0) {\n checkLastError(`Can't bind pre-allocated output[${i}] for session=${sessionId}.`);\n }\n } else {\n // output is not pre-allocated. reset preferred location.\n const errorCode =\n wasm._OrtBindOutput(handle, outputNamesUTF8Encoded[index], 0, outputPreferredLocationsEncoded[index]);\n if (errorCode !== 0) {\n checkLastError(`Can't bind output[${i}] to ${outputPreferredLocations[i]} for session=${sessionId}.`);\n }\n }\n }\n activeSessions.set(\n sessionId,\n [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture, true]);\n }\n\n wasm.jsepOnRunStart?.(sessionHandle);\n let errorCode: number;\n if (!BUILD_DEFS.DISABLE_WEBGPU && ioBindingState) {\n errorCode = await wasm._OrtRunWithBinding(\n sessionHandle, ioBindingState.handle, outputCount, outputValuesOffset, runOptionsHandle);\n } else {\n errorCode = await wasm._OrtRun(\n sessionHandle, inputNamesOffset, inputValuesOffset, inputCount, outputNamesOffset, outputCount,\n outputValuesOffset, runOptionsHandle);\n }\n\n if (errorCode !== 0) {\n checkLastError('failed to call OrtRun().');\n }\n\n const output: TensorMetadata[] = [];\n\n for (let i = 0; i < outputCount; i++) {\n const tensor = wasm.HEAPU32[outputValuesOffset / 4 + i];\n if (tensor === outputTensorHandles[i]) {\n // output tensor is pre-allocated. no need to copy data.\n output.push(outputTensors[i]!);\n continue;\n }\n\n const beforeGetTensorDataStack = wasm.stackSave();\n // stack allocate 4 pointer value\n const tensorDataOffset = wasm.stackAlloc(4 * 4);\n\n let keepOutputTensor = false;\n let type: Tensor.Type|undefined, dataOffset = 0;\n try {\n const errorCode = wasm._OrtGetTensorData(\n tensor, tensorDataOffset, tensorDataOffset + 4, tensorDataOffset + 8, tensorDataOffset + 12);\n if (errorCode !== 0) {\n checkLastError(`Can't access output tensor data on index ${i}.`);\n }\n let tensorDataIndex = tensorDataOffset / 4;\n const dataType = wasm.HEAPU32[tensorDataIndex++];\n dataOffset = wasm.HEAPU32[tensorDataIndex++];\n const dimsOffset = wasm.HEAPU32[tensorDataIndex++];\n const dimsLength = wasm.HEAPU32[tensorDataIndex++];\n const dims = [];\n for (let i = 0; i < dimsLength; i++) {\n dims.push(wasm.HEAPU32[dimsOffset / 4 + i]);\n }\n wasm._OrtFree(dimsOffset);\n\n const size = dims.reduce((a, b) => a * b, 1);\n type = tensorDataTypeEnumToString(dataType);\n\n const preferredLocation = ioBindingState?.outputPreferredLocations[outputIndices[i]];\n\n if (type === 'string') {\n if (preferredLocation === 'gpu-buffer') {\n throw new Error('String tensor is not supported on GPU.');\n }\n const stringData: string[] = [];\n let dataIndex = dataOffset / 4;\n for (let i = 0; i < size; i++) {\n const offset = wasm.HEAPU32[dataIndex++];\n const maxBytesToRead = i === size - 1 ? undefined : wasm.HEAPU32[dataIndex] - offset;\n stringData.push(wasm.UTF8ToString(offset, maxBytesToRead));\n }\n output.push([type, dims, stringData, 'cpu']);\n } else {\n // If a certain output's preferred location is GPU but the tensor is empty, we still need to create a CPU\n // tensor for it. There is no mapping GPU buffer for an empty tensor.\n if (preferredLocation === 'gpu-buffer' && size > 0) {\n const getBuffer = wasm.jsepGetBuffer;\n if (!getBuffer) {\n throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');\n }\n const gpuBuffer = getBuffer(dataOffset);\n const elementSize = getTensorElementSize(dataType);\n if (elementSize === undefined || !isGpuBufferSupportedType(type)) {\n throw new Error(`Unsupported data type: ${type}`);\n }\n\n // do not release the tensor right now. it will be released when user calls tensor.dispose().\n keepOutputTensor = true;\n\n output.push([\n type, dims, {\n gpuBuffer,\n download: wasm.jsepCreateDownloader!(gpuBuffer, size * elementSize, type),\n dispose: () => {\n wasm._OrtReleaseTensor(tensor);\n }\n },\n 'gpu-buffer'\n ]);\n } else {\n const typedArrayConstructor = tensorTypeToTypedArrayConstructor(type);\n const data = new typedArrayConstructor(size);\n new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n .set(wasm.HEAPU8.subarray(dataOffset, dataOffset + data.byteLength));\n output.push([type, dims, data, 'cpu']);\n }\n }\n } finally {\n wasm.stackRestore(beforeGetTensorDataStack);\n if (type === 'string' && dataOffset) {\n wasm._free(dataOffset);\n }\n if (!keepOutputTensor) {\n wasm._OrtReleaseTensor(tensor);\n }\n }\n }\n\n if (ioBindingState && !enableGraphCapture) {\n wasm._OrtClearBoundOutputs(ioBindingState.handle);\n activeSessions.set(\n sessionId,\n [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture, false]);\n }\n return output;\n } finally {\n wasm.stackRestore(beforeRunStack);\n\n inputTensorHandles.forEach(v => wasm._OrtReleaseTensor(v));\n outputTensorHandles.forEach(v => wasm._OrtReleaseTensor(v));\n inputOutputAllocs.forEach(p => wasm._free(p));\n\n if (runOptionsHandle !== 0) {\n wasm._OrtReleaseRunOptions(runOptionsHandle);\n }\n runOptionsAllocs.forEach(p => wasm._free(p));\n }\n};\n\n/**\n * end profiling\n */\nexport const endProfiling = (sessionId: number): void => {\n const wasm = getInstance();\n const session = activeSessions.get(sessionId);\n if (!session) {\n throw new Error('invalid session id');\n }\n const sessionHandle = session[0];\n\n // profile file name is not used yet, but it must be freed.\n const profileFileName = wasm._OrtEndProfiling(sessionHandle);\n if (profileFileName === 0) {\n checkLastError('Can\\'t get an profile file name.');\n }\n wasm._OrtFree(profileFileName);\n};\n\nexport const extractTransferableBuffers = (tensors: readonly SerializableTensorMetadata[]): ArrayBufferLike[] => {\n const buffers: ArrayBufferLike[] = [];\n for (const tensor of tensors) {\n const data = tensor[2];\n if (!Array.isArray(data) && 'buffer' in data) {\n buffers.push(data.buffer);\n }\n }\n return buffers;\n};\n", "/*!\n * ONNX Runtime Web v1.18.0\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\"use strict\";(()=>{var vt=Object.defineProperty;var Vr=Object.getOwnPropertyDescriptor;var Jr=Object.getOwnPropertyNames;var Xr=Object.prototype.hasOwnProperty;var _t=(u,c)=>()=>(u&&(c=u(u=0)),c);var nt=(u,c)=>()=>(c||u((c={exports:{}}).exports,c),c.exports),Et=(u,c)=>{for(var n in c)vt(u,n,{get:c[n],enumerable:!0})},Qr=(u,c,n,h)=>{if(c&&typeof c==\"object\"||typeof c==\"function\")for(let f of Jr(c))!Xr.call(u,f)&&f!==n&&vt(u,f,{get:()=>c[f],enumerable:!(h=Vr(c,f))||h.enumerable});return u};var at=u=>Qr(vt({},\"__esModule\",{value:!0}),u);var St={};Et(St,{createReadStream:()=>fr,readFile:()=>Zr,readFileSync:()=>Kr});var Zr,Kr,fr,Tt=_t(()=>{Zr=void 0,Kr=void 0,fr=void 0});var At={};Et(At,{join:()=>en});var en,Mt=_t(()=>{en=void 0});var dr=nt((cr,Ct)=>{\"use strict\";var lr=(()=>{var u=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(u=u||__filename),function(c={}){var n=c,h,f;n.ready=new Promise((t,i)=>{h=t,f=i});var w=Object.assign({},n),g=\"./this.program\",o=typeof window==\"object\",T=typeof importScripts==\"function\",P=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",I=\"\",R,D,ee;if(P){var U=(Tt(),at(St)),L=(Mt(),at(At));I=T?L.dirname(I)+\"/\":__dirname+\"/\",R=(t,i)=>(t=t.startsWith(\"file://\")?new URL(t):L.normalize(t),U.readFileSync(t,i?void 0:\"utf8\")),ee=t=>(t=R(t,!0),t.buffer||(t=new Uint8Array(t)),t),D=(t,i,s,p=!0)=>{t=t.startsWith(\"file://\")?new URL(t):L.normalize(t),U.readFile(t,p?void 0:\"utf8\",(O,S)=>{O?s(O):i(p?S.buffer:S)})},!n.thisProgram&&1\"[Emscripten Module object]\"}else(o||T)&&(T?I=self.location.href:typeof document<\"u\"&&document.currentScript&&(I=document.currentScript.src),u&&(I=u),I.indexOf(\"blob:\")!==0?I=I.substr(0,I.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):I=\"\",R=t=>{var i=new XMLHttpRequest;return i.open(\"GET\",t,!1),i.send(null),i.responseText},T&&(ee=t=>{var i=new XMLHttpRequest;return i.open(\"GET\",t,!1),i.responseType=\"arraybuffer\",i.send(null),new Uint8Array(i.response)}),D=(t,i,s)=>{var p=new XMLHttpRequest;p.open(\"GET\",t,!0),p.responseType=\"arraybuffer\",p.onload=()=>{p.status==200||p.status==0&&p.response?i(p.response):s()},p.onerror=s,p.send(null)});var v=n.print||console.log.bind(console),k=n.printErr||console.error.bind(console);Object.assign(n,w),w=null,n.thisProgram&&(g=n.thisProgram);var W;n.wasmBinary&&(W=n.wasmBinary);var z=n.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&re(\"no native wasm support detected\");var ae,E,ve=!1,Oe,ce,M,N;function oe(){var t=ae.buffer;n.HEAP8=Oe=new Int8Array(t),n.HEAP16=new Int16Array(t),n.HEAP32=M=new Int32Array(t),n.HEAPU8=ce=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=N=new Uint32Array(t),n.HEAPF32=new Float32Array(t),n.HEAPF64=new Float64Array(t)}var _e=[],Fe=[],V=[];function A(){var t=n.preRun.shift();_e.unshift(t)}var x=0,de=null,ue=null;function re(t){throw n.onAbort&&n.onAbort(t),t=\"Aborted(\"+t+\")\",k(t),ve=!0,t=new WebAssembly.RuntimeError(t+\". Build with -sASSERTIONS for more info.\"),f(t),t}function Ee(t){return t.startsWith(\"data:application/octet-stream;base64,\")}var J;if(J=\"ort-training-wasm-simd.wasm\",!Ee(J)){var fe=J;J=n.locateFile?n.locateFile(fe,I):I+fe}function ke(t){if(t==J&&W)return new Uint8Array(W);if(ee)return ee(t);throw\"both async and sync fetching of the wasm failed\"}function pe(t){if(!W&&(o||T)){if(typeof fetch==\"function\"&&!t.startsWith(\"file://\"))return fetch(t,{credentials:\"same-origin\"}).then(i=>{if(!i.ok)throw\"failed to load wasm binary file at '\"+t+\"'\";return i.arrayBuffer()}).catch(()=>ke(t));if(D)return new Promise((i,s)=>{D(t,p=>i(new Uint8Array(p)),s)})}return Promise.resolve().then(()=>ke(t))}function Se(t,i,s){return pe(t).then(p=>WebAssembly.instantiate(p,i)).then(p=>p).then(s,p=>{k(\"failed to asynchronously prepare wasm: \"+p),re(p)})}function Pe(t,i){var s=J;return W||typeof WebAssembly.instantiateStreaming!=\"function\"||Ee(s)||s.startsWith(\"file://\")||P||typeof fetch!=\"function\"?Se(s,t,i):fetch(s,{credentials:\"same-origin\"}).then(p=>WebAssembly.instantiateStreaming(p,t).then(i,function(O){return k(\"wasm streaming compile failed: \"+O),k(\"falling back to ArrayBuffer instantiation\"),Se(s,t,i)}))}var ye,ge=t=>{for(;0>2>>>0]=i},this.Ka=function(i){N[this.Ha+8>>2>>>0]=i},this.Ia=function(i,s){this.Ja(),this.La(i),this.Ka(s)},this.Ja=function(){N[this.Ha+16>>2>>>0]=0}}var Re=0,te=0,j=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,he=(t,i,s)=>{i>>>=0;var p=i+s;for(s=i;t[s]&&!(s>=p);)++s;if(16O?p+=String.fromCharCode(O):(O-=65536,p+=String.fromCharCode(55296|O>>10,56320|O&1023))}}else p+=String.fromCharCode(O)}return p},be=(t,i)=>(t>>>=0)?he(ce,t,i):\"\",De=t=>{for(var i=0,s=0;s=p?i++:2047>=p?i+=2:55296<=p&&57343>=p?(i+=4,++s):i+=3}return i},We=(t,i,s,p)=>{if(s>>>=0,!(0=F){var Z=t.charCodeAt(++S);F=65536+((F&1023)<<10)|Z&1023}if(127>=F){if(s>=p)break;i[s++>>>0]=F}else{if(2047>=F){if(s+1>=p)break;i[s++>>>0]=192|F>>6}else{if(65535>=F){if(s+2>=p)break;i[s++>>>0]=224|F>>12}else{if(s+3>=p)break;i[s++>>>0]=240|F>>18,i[s++>>>0]=128|F>>12&63}i[s++>>>0]=128|F>>6&63}i[s++>>>0]=128|F&63}}return i[s>>>0]=0,s-O},we=t=>t%4===0&&(t%100!==0||t%400===0),$e=[0,31,60,91,121,152,182,213,244,274,305,335],Ce=[0,31,59,90,120,151,181,212,243,273,304,334],qe=t=>{var i=De(t)+1,s=Ze(i);return s&&We(t,ce,s,i),s},Ve={},Je=()=>{if(!Xe){var t={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:g||\"./this.program\"},i;for(i in Ve)Ve[i]===void 0?delete t[i]:t[i]=Ve[i];var s=[];for(i in t)s.push(`${i}=${t[i]}`);Xe=s}return Xe},Xe,xe=[null,[],[]],Ie=[31,29,31,30,31,30,31,31,30,31,30,31],Ne=[31,28,31,30,31,30,31,31,30,31,30,31];function it(t){var i=Array(De(t)+1);return We(t,i,0,i.length),i}function Qe(t,i,s,p){function O(d,B,G){for(d=typeof d==\"number\"?d.toString():d||\"\";d.lengthrt?-1:0Ae-d.getDate())B-=Ae-d.getDate()+1,d.setDate(1),11>G?d.setMonth(G+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else{d.setDate(d.getDate()+B);break}}return G=new Date(d.getFullYear()+1,0,4),B=Z(new Date(d.getFullYear(),0,4)),G=Z(G),0>=F(B,d)?0>=F(G,d)?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}t>>>=0,i>>>=0,s>>>=0,p>>>=0;var ie=M[p+40>>2>>>0];p={Oa:M[p>>2>>>0],Na:M[p+4>>2>>>0],Ea:M[p+8>>2>>>0],Ga:M[p+12>>2>>>0],Fa:M[p+16>>2>>>0],Da:M[p+20>>2>>>0],xa:M[p+24>>2>>>0],Ca:M[p+28>>2>>>0],Qa:M[p+32>>2>>>0],Ma:M[p+36>>2>>>0],Pa:ie?be(ie):\"\"},s=be(s),ie={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var se in ie)s=s.replace(new RegExp(se,\"g\"),ie[se]);var et=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),tt=\"January February March April May June July August September October November December\".split(\" \");ie={\"%a\":d=>et[d.xa].substring(0,3),\"%A\":d=>et[d.xa],\"%b\":d=>tt[d.Fa].substring(0,3),\"%B\":d=>tt[d.Fa],\"%C\":d=>S((d.Da+1900)/100|0,2),\"%d\":d=>S(d.Ga,2),\"%e\":d=>O(d.Ga,2,\" \"),\"%g\":d=>le(d).toString().substring(2),\"%G\":d=>le(d),\"%H\":d=>S(d.Ea,2),\"%I\":d=>(d=d.Ea,d==0?d=12:12{for(var B=0,G=0;G<=d.Fa-1;B+=(we(d.Da+1900)?Ie:Ne)[G++]);return S(d.Ga+B,3)},\"%m\":d=>S(d.Fa+1,2),\"%M\":d=>S(d.Na,2),\"%n\":()=>`\n`,\"%p\":d=>0<=d.Ea&&12>d.Ea?\"AM\":\"PM\",\"%S\":d=>S(d.Oa,2),\"%t\":()=>\"\t\",\"%u\":d=>d.xa||7,\"%U\":d=>S(Math.floor((d.Ca+7-d.xa)/7),2),\"%V\":d=>{var B=Math.floor((d.Ca+7-(d.xa+6)%7)/7);if(2>=(d.xa+371-d.Ca-2)%7&&B++,B)B==53&&(G=(d.xa+371-d.Ca)%7,G==4||G==3&&we(d.Da)||(B=1));else{B=52;var G=(d.xa+7-d.Ca-1)%7;(G==4||G==5&&we(d.Da%400-1))&&B++}return S(B,2)},\"%w\":d=>d.xa,\"%W\":d=>S(Math.floor((d.Ca+7-(d.xa+6)%7)/7),2),\"%y\":d=>(d.Da+1900).toString().substring(2),\"%Y\":d=>d.Da+1900,\"%z\":d=>{d=d.Ma;var B=0<=d;return d=Math.abs(d)/60,(B?\"+\":\"-\")+(\"0000\"+(d/60*100+d%60)).slice(-4)},\"%Z\":d=>d.Pa,\"%%\":()=>\"%\"},s=s.replace(/%%/g,\"\\0\\0\");for(se in ie)s.includes(se)&&(s=s.replace(new RegExp(se,\"g\"),ie[se](p)));return s=s.replace(/\\0\\0/g,\"%\"),se=it(s),se.length>i?0:(Oe.set(se,t>>>0),se.length-1)}var st={a:function(t,i,s){throw t>>>=0,new Te(t).Ia(i>>>0,s>>>0),Re=t,te++,Re},e:function(){return 0},H:function(){},x:function(){},z:function(){},k:function(){return 0},F:function(){},B:function(){},E:function(){},g:function(){},y:function(){},v:function(){},G:function(){},w:function(){},l:()=>!0,o:function(t,i,s){t=i+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*i:NaN,s>>>=0,t=new Date(1e3*t),M[s>>2>>>0]=t.getUTCSeconds(),M[s+4>>2>>>0]=t.getUTCMinutes(),M[s+8>>2>>>0]=t.getUTCHours(),M[s+12>>2>>>0]=t.getUTCDate(),M[s+16>>2>>>0]=t.getUTCMonth(),M[s+20>>2>>>0]=t.getUTCFullYear()-1900,M[s+24>>2>>>0]=t.getUTCDay(),M[s+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},p:function(t,i,s){t=i+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*i:NaN,s>>>=0,t=new Date(1e3*t),M[s>>2>>>0]=t.getSeconds(),M[s+4>>2>>>0]=t.getMinutes(),M[s+8>>2>>>0]=t.getHours(),M[s+12>>2>>>0]=t.getDate(),M[s+16>>2>>>0]=t.getMonth(),M[s+20>>2>>>0]=t.getFullYear()-1900,M[s+24>>2>>>0]=t.getDay(),M[s+28>>2>>>0]=(we(t.getFullYear())?$e:Ce)[t.getMonth()]+t.getDate()-1|0,M[s+36>>2>>>0]=-(60*t.getTimezoneOffset()),i=new Date(t.getFullYear(),6,1).getTimezoneOffset();var p=new Date(t.getFullYear(),0,1).getTimezoneOffset();M[s+32>>2>>>0]=(i!=p&&t.getTimezoneOffset()==Math.min(p,i))|0},q:function(t){t>>>=0;var i=new Date(M[t+20>>2>>>0]+1900,M[t+16>>2>>>0],M[t+12>>2>>>0],M[t+8>>2>>>0],M[t+4>>2>>>0],M[t>>2>>>0],0),s=M[t+32>>2>>>0],p=i.getTimezoneOffset(),O=new Date(i.getFullYear(),6,1).getTimezoneOffset(),S=new Date(i.getFullYear(),0,1).getTimezoneOffset(),F=Math.min(S,O);return 0>s?M[t+32>>2>>>0]=+(O!=S&&F==p):0>2>>>0]=i.getDay(),M[t+28>>2>>>0]=(we(i.getFullYear())?$e:Ce)[i.getMonth()]+i.getDate()-1|0,M[t>>2>>>0]=i.getSeconds(),M[t+4>>2>>>0]=i.getMinutes(),M[t+8>>2>>>0]=i.getHours(),M[t+12>>2>>>0]=i.getDate(),M[t+16>>2>>>0]=i.getMonth(),M[t+20>>2>>>0]=i.getYear(),t=i.getTime()/1e3,He((ye=t,1<=+Math.abs(ye)?0>>0:~~+Math.ceil((ye-+(~~ye>>>0))/4294967296)>>>0:0)),t>>>0},m:function(){return-52},n:function(){},t:function(t,i,s){function p(le){return(le=le.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?le[1]:\"GMT\"}s>>>=0;var O=new Date().getFullYear(),S=new Date(O,0,1),F=new Date(O,6,1);O=S.getTimezoneOffset();var Z=F.getTimezoneOffset();N[t>>>0>>2>>>0]=60*Math.max(O,Z),M[i>>>0>>2>>>0]=+(O!=Z),t=p(S),i=p(F),t=qe(t),i=qe(i),Z>2>>>0]=t,N[s+4>>2>>>0]=i):(N[s>>2>>>0]=i,N[s+4>>2>>>0]=t)},d:()=>{re(\"\")},h:function(){return Date.now()},u:function(){return 4294901760},b:()=>performance.now(),I:function(t,i,s){return i>>>=0,ce.copyWithin(t>>>0>>>0,i>>>0,i+(s>>>0)>>>0)},s:function(t){t>>>=0;var i=ce.length;if(4294901760=s;s*=2){var p=i*(1+.2/s);p=Math.min(p,t+100663296);var O=Math;p=Math.max(t,p);e:{O=O.min.call(O,4294901760,p+(65536-p%65536)%65536)-ae.buffer.byteLength+65535>>>16;try{ae.grow(O),oe();var S=1;break e}catch{}S=void 0}if(S)return!0}return!1},C:function(t,i){t>>>=0,i>>>=0;var s=0;return Je().forEach(function(p,O){var S=i+s;for(O=N[t+4*O>>2>>>0]=S,S=0;S>0>>>0]=p.charCodeAt(S);Oe[O>>0>>>0]=0,s+=p.length+1}),0},D:function(t,i){t>>>=0,i>>>=0;var s=Je();N[t>>2>>>0]=s.length;var p=0;return s.forEach(function(O){p+=O.length+1}),N[i>>2>>>0]=p,0},f:()=>52,j:function(){return 52},r:function(){return 70},i:function(t,i,s,p){i>>>=0,s>>>=0,p>>>=0;for(var O=0,S=0;S>2>>>0],Z=N[i+4>>2>>>0];i+=8;for(var le=0;le>>0],se=xe[t];ie===0||ie===10?((t===1?v:k)(he(se,0)),se.length=0):se.push(ie)}O+=Z}return N[p>>2>>>0]=O,0},A:Qe,c:function(t,i,s,p){return Qe(t>>>0,i>>>0,s>>>0,p>>>0)}};(function(){function t(s){if(s=s.exports,E=s=ze(s),ae=E.J,oe(),Fe.unshift(E.K),x--,n.monitorRunDependencies&&n.monitorRunDependencies(x),x==0&&(de!==null&&(clearInterval(de),de=null),ue)){var p=ue;ue=null,p()}return s}var i={a:st};if(x++,n.monitorRunDependencies&&n.monitorRunDependencies(x),n.instantiateWasm)try{return n.instantiateWasm(i,t)}catch(s){k(\"Module.instantiateWasm callback failed with error: \"+s),f(s)}return Pe(i,function(s){t(s.instance)}).catch(f),{}})(),n._OrtInit=(t,i)=>(n._OrtInit=E.L)(t,i),n._OrtGetLastError=(t,i)=>(n._OrtGetLastError=E.M)(t,i),n._OrtCreateSessionOptions=(t,i,s,p,O,S,F,Z,le,ie)=>(n._OrtCreateSessionOptions=E.N)(t,i,s,p,O,S,F,Z,le,ie),n._OrtAppendExecutionProvider=(t,i)=>(n._OrtAppendExecutionProvider=E.O)(t,i),n._OrtAddFreeDimensionOverride=(t,i,s)=>(n._OrtAddFreeDimensionOverride=E.P)(t,i,s),n._OrtAddSessionConfigEntry=(t,i,s)=>(n._OrtAddSessionConfigEntry=E.Q)(t,i,s),n._OrtReleaseSessionOptions=t=>(n._OrtReleaseSessionOptions=E.R)(t),n._OrtCreateSession=(t,i,s)=>(n._OrtCreateSession=E.S)(t,i,s),n._OrtReleaseSession=t=>(n._OrtReleaseSession=E.T)(t),n._OrtGetInputOutputCount=(t,i,s)=>(n._OrtGetInputOutputCount=E.U)(t,i,s),n._OrtGetInputName=(t,i)=>(n._OrtGetInputName=E.V)(t,i),n._OrtGetOutputName=(t,i)=>(n._OrtGetOutputName=E.W)(t,i),n._OrtFree=t=>(n._OrtFree=E.X)(t),n._OrtCreateTensor=(t,i,s,p,O,S)=>(n._OrtCreateTensor=E.Y)(t,i,s,p,O,S),n._OrtGetTensorData=(t,i,s,p,O)=>(n._OrtGetTensorData=E.Z)(t,i,s,p,O),n._OrtReleaseTensor=t=>(n._OrtReleaseTensor=E._)(t),n._OrtCreateRunOptions=(t,i,s,p)=>(n._OrtCreateRunOptions=E.$)(t,i,s,p),n._OrtAddRunConfigEntry=(t,i,s)=>(n._OrtAddRunConfigEntry=E.aa)(t,i,s),n._OrtReleaseRunOptions=t=>(n._OrtReleaseRunOptions=E.ba)(t),n._OrtCreateBinding=t=>(n._OrtCreateBinding=E.ca)(t),n._OrtBindInput=(t,i,s)=>(n._OrtBindInput=E.da)(t,i,s),n._OrtBindOutput=(t,i,s,p)=>(n._OrtBindOutput=E.ea)(t,i,s,p),n._OrtClearBoundOutputs=t=>(n._OrtClearBoundOutputs=E.fa)(t),n._OrtReleaseBinding=t=>(n._OrtReleaseBinding=E.ga)(t),n._OrtRunWithBinding=(t,i,s,p,O)=>(n._OrtRunWithBinding=E.ha)(t,i,s,p,O),n._OrtRun=(t,i,s,p,O,S,F,Z)=>(n._OrtRun=E.ia)(t,i,s,p,O,S,F,Z),n._OrtEndProfiling=t=>(n._OrtEndProfiling=E.ja)(t),n._OrtTrainingLoadCheckpoint=(t,i)=>(n._OrtTrainingLoadCheckpoint=E.ka)(t,i),n._OrtTrainingReleaseCheckpoint=t=>(n._OrtTrainingReleaseCheckpoint=E.la)(t),n._OrtTrainingCreateSession=(t,i,s,p,O,S,F,Z)=>(n._OrtTrainingCreateSession=E.ma)(t,i,s,p,O,S,F,Z),n._OrtTrainingLazyResetGrad=t=>(n._OrtTrainingLazyResetGrad=E.na)(t),n._OrtTrainingRunTrainStep=(t,i,s,p,O,S)=>(n._OrtTrainingRunTrainStep=E.oa)(t,i,s,p,O,S),n._OrtTrainingOptimizerStep=(t,i)=>(n._OrtTrainingOptimizerStep=E.pa)(t,i),n._OrtTrainingEvalStep=(t,i,s,p,O,S)=>(n._OrtTrainingEvalStep=E.qa)(t,i,s,p,O,S),n._OrtTrainingGetParametersSize=(t,i,s)=>(n._OrtTrainingGetParametersSize=E.ra)(t,i,s),n._OrtTrainingCopyParametersToBuffer=(t,i,s,p)=>(n._OrtTrainingCopyParametersToBuffer=E.sa)(t,i,s,p),n._OrtTrainingCopyParametersFromBuffer=(t,i,s,p)=>(n._OrtTrainingCopyParametersFromBuffer=E.ta)(t,i,s,p),n._OrtTrainingReleaseSession=t=>(n._OrtTrainingReleaseSession=E.ua)(t);var Ze=n._malloc=t=>(Ze=n._malloc=E.va)(t);n._free=t=>(n._free=E.wa)(t);var He=t=>(He=E.ya)(t),Ke=()=>(Ke=E.za)(),Ge=t=>(Ge=E.Aa)(t),C=t=>(C=E.Ba)(t);function ze(t){t=Object.assign({},t);var i=p=>()=>p()>>>0,s=p=>O=>p(O)>>>0;return t.__errno_location=i(t.__errno_location),t.malloc=s(t.malloc),t.stackSave=i(t.stackSave),t.stackAlloc=s(t.stackAlloc),t}n.stackAlloc=C,n.stackSave=Ke,n.stackRestore=Ge,n.UTF8ToString=be,n.stringToUTF8=(t,i,s)=>We(t,ce,i,s),n.lengthBytesUTF8=De;var Ue;ue=function t(){Ue||Le(),Ue||(ue=t)};function Le(){function t(){if(!Ue&&(Ue=!0,n.calledRun=!0,!ve)){if(ge(Fe),h(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for(typeof n.postRun==\"function\"&&(n.postRun=[n.postRun]);n.postRun.length;){var i=n.postRun.shift();V.unshift(i)}ge(V)}}if(!(0lr)});var pr=nt(()=>{});var mr=nt(()=>{});var gr={};Et(gr,{cpus:()=>tn});var tn,hr=_t(()=>{tn=void 0});var wr=nt((br,Rt)=>{\"use strict\";var yr=(()=>{var u=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(u=u||__filename),function(c={}){function n(){return V.buffer!=re.buffer&&pe(),re}function h(){return V.buffer!=re.buffer&&pe(),Ee}function f(){return V.buffer!=re.buffer&&pe(),J}function w(){return V.buffer!=re.buffer&&pe(),fe}function g(){return V.buffer!=re.buffer&&pe(),ke}var o=c,T,P;o.ready=new Promise((e,r)=>{T=e,P=r});var I=Object.assign({},o),R=\"./this.program\",D=(e,r)=>{throw r},ee=typeof window==\"object\",U=typeof importScripts==\"function\",L=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",v=o.ENVIRONMENT_IS_PTHREAD||!1,k=\"\";function W(e){return o.locateFile?o.locateFile(e,k):k+e}var z,ae,E;if(L){var ve=(Tt(),at(St)),Oe=(Mt(),at(At));k=U?Oe.dirname(k)+\"/\":__dirname+\"/\",z=(r,a)=>(r=r.startsWith(\"file://\")?new URL(r):Oe.normalize(r),ve.readFileSync(r,a?void 0:\"utf8\")),E=r=>(r=z(r,!0),r.buffer||(r=new Uint8Array(r)),r),ae=(r,a,l,b=!0)=>{r=r.startsWith(\"file://\")?new URL(r):Oe.normalize(r),ve.readFile(r,b?void 0:\"utf8\",(y,_)=>{y?l(y):a(b?_.buffer:_)})},!o.thisProgram&&1{throw process.exitCode=r,a},o.inspect=()=>\"[Emscripten Module object]\";let e;try{e=pr()}catch(r){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),r}global.Worker=e.Worker}else(ee||U)&&(U?k=self.location.href:typeof document<\"u\"&&document.currentScript&&(k=document.currentScript.src),typeof u<\"u\"&&u&&(k=u),k.indexOf(\"blob:\")!==0?k=k.substr(0,k.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):k=\"\",L||(z=e=>{var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.send(null),r.responseText},U&&(E=e=>{var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}),ae=(e,r,a)=>{var l=new XMLHttpRequest;l.open(\"GET\",e,!0),l.responseType=\"arraybuffer\",l.onload=()=>{l.status==200||l.status==0&&l.response?r(l.response):a()},l.onerror=a,l.send(null)}));L&&typeof performance>\"u\"&&(global.performance=mr().performance);var ce=console.log.bind(console),M=console.error.bind(console);L&&(ce=(...e)=>ve.writeSync(1,e.join(\" \")+`\n`),M=(...e)=>ve.writeSync(2,e.join(\" \")+`\n`));var N=o.print||ce,oe=o.printErr||M;Object.assign(o,I),I=null,o.thisProgram&&(R=o.thisProgram),o.quit&&(D=o.quit);var _e;o.wasmBinary&&(_e=o.wasmBinary);var Fe=o.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&we(\"no native wasm support detected\");var V,A,x,de=!1,ue,re,Ee,J,fe,ke;function pe(){var e=V.buffer;o.HEAP8=re=new Int8Array(e),o.HEAP16=new Int16Array(e),o.HEAP32=J=new Int32Array(e),o.HEAPU8=Ee=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=fe=new Uint32Array(e),o.HEAPF32=new Float32Array(e),o.HEAPF64=ke=new Float64Array(e)}var Se=o.INITIAL_MEMORY||16777216;if(5242880<=Se||we(\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+Se+\"! (STACK_SIZE=5242880)\"),v)V=o.wasmMemory;else if(o.wasmMemory)V=o.wasmMemory;else if(V=new WebAssembly.Memory({initial:Se/65536,maximum:65536,shared:!0}),!(V.buffer instanceof SharedArrayBuffer))throw oe(\"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag\"),L&&oe(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");pe(),Se=V.buffer.byteLength;var Pe,ye=[],ge=[],Te=[],Re=0;function te(){return Fe||0{if(!r.ok)throw\"failed to load wasm binary file at '\"+e+\"'\";return r.arrayBuffer()}).catch(()=>qe(e));if(ae)return new Promise((r,a)=>{ae(e,l=>r(new Uint8Array(l)),a)})}return Promise.resolve().then(()=>qe(e))}function Je(e,r,a){return Ve(e).then(l=>WebAssembly.instantiate(l,r)).then(l=>l).then(a,l=>{oe(\"failed to asynchronously prepare wasm: \"+l),we(l)})}function Xe(e,r){var a=Ce;return _e||typeof WebAssembly.instantiateStreaming!=\"function\"||$e(a)||a.startsWith(\"file://\")||L||typeof fetch!=\"function\"?Je(a,e,r):fetch(a,{credentials:\"same-origin\"}).then(l=>WebAssembly.instantiateStreaming(l,e).then(r,function(b){return oe(\"wasm streaming compile failed: \"+b),oe(\"falling back to ArrayBuffer instantiation\"),Je(a,e,r)}))}var xe;function Ie(e){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${e})`,this.status=e}function Ne(e){e.terminate(),e.onmessage=()=>{}}function it(e){(e=C.La[e])||we(),C.lb(e)}function Qe(e){var r=C.fb();if(!r)return 6;C.Oa.push(r),C.La[e.Na]=r,r.Na=e.Na;var a={cmd:\"run\",start_routine:e.mb,arg:e.eb,pthread_ptr:e.Na};return L&&r.unref(),r.postMessage(a,e.sb),0}var st=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,Ze=(e,r,a)=>{r>>>=0;var l=r+a;for(a=r;e[a]&&!(a>=l);)++a;if(16b?l+=String.fromCharCode(b):(b-=65536,l+=String.fromCharCode(55296|b>>10,56320|b&1023))}}else l+=String.fromCharCode(b)}return l},He=(e,r)=>(e>>>=0)?Ze(h(),e,r):\"\";function Ke(e){if(v)return Y(1,1,e);ue=e,te()||(C.nb(),o.onExit&&o.onExit(e),de=!0),D(e,new Ie(e))}var Ge=e=>{if(ue=e,v)throw Ue(e),\"unwind\";Ke(e)},C={Ra:[],Oa:[],Za:[],La:{},Va:function(){v?C.hb():C.gb()},gb:function(){ye.unshift(()=>{De(),C.ib(()=>We())})},hb:function(){C.receiveObjectTransfer=C.kb,C.threadInitTLS=C.Ya,C.setExitStatus=C.Xa,Fe=!1},Xa:function(e){ue=e},xb:[\"$terminateWorker\"],nb:function(){for(var e of C.Oa)Ne(e);for(e of C.Ra)Ne(e);C.Ra=[],C.Oa=[],C.La=[]},lb:function(e){var r=e.Na;delete C.La[r],C.Ra.push(e),C.Oa.splice(C.Oa.indexOf(e),1),e.Na=0,yt(r)},kb:function(){},Ya:function(){C.Za.forEach(e=>e())},jb:e=>new Promise(r=>{e.onmessage=y=>{y=y.data;var _=y.cmd;if(y.targetThread&&y.targetThread!=ft()){var X=C.La[y.wb];X?X.postMessage(y,y.transferList):oe('Internal error! Worker sent a message \"'+_+'\" to target pthread '+y.targetThread+\", but that thread no longer exists!\")}else _===\"checkMailbox\"?ut():_===\"spawnThread\"?Qe(y):_===\"cleanupThread\"?it(y.thread):_===\"killThread\"?(y=y.thread,_=C.La[y],delete C.La[y],Ne(_),yt(y),C.Oa.splice(C.Oa.indexOf(_),1),_.Na=0):_===\"cancelThread\"?C.La[y.thread].postMessage({cmd:\"cancel\"}):_===\"loaded\"?(e.loaded=!0,r(e)):_===\"alert\"?alert(\"Thread \"+y.threadId+\": \"+y.text):y.target===\"setimmediate\"?e.postMessage(y):_===\"callHandler\"?o[y.handler](...y.args):_&&oe(\"worker sent an unknown command \"+_)},e.onerror=y=>{throw oe(\"worker sent an error! \"+y.filename+\":\"+y.lineno+\": \"+y.message),y},L&&(e.on(\"message\",function(y){e.onmessage({data:y})}),e.on(\"error\",function(y){e.onerror(y)}));var a=[],l=[\"onExit\",\"onAbort\",\"print\",\"printErr\"],b;for(b of l)o.hasOwnProperty(b)&&a.push(b);e.postMessage({cmd:\"load\",handlers:a,urlOrBlob:o.mainScriptUrlOrBlob||u,wasmMemory:V,wasmModule:x})}),ib:function(e){e()},cb:function(){var e=W(\"ort-wasm-threaded.worker.js\");e=new Worker(e),C.Ra.push(e)},fb:function(){return C.Ra.length==0&&(C.cb(),C.jb(C.Ra[0])),C.Ra.pop()}};o.PThread=C;var ze=e=>{for(;0>2>>>0];e=f()[e+56>>2>>>0],ar(r,r-e),lt(r)};function Ue(e){if(v)return Y(2,0,e);Ge(e)}var Le=[];o.invokeEntryPoint=function(e,r){var a=Le[e];a||(e>=Le.length&&(Le.length=e+1),Le[e]=a=Pe.get(e)),e=a(r),te()?C.Xa(e):bt(e)};function t(e){this.Ua=e-24,this.bb=function(r){w()[this.Ua+4>>2>>>0]=r},this.ab=function(r){w()[this.Ua+8>>2>>>0]=r},this.Va=function(r,a){this.$a(),this.bb(r),this.ab(a)},this.$a=function(){w()[this.Ua+16>>2>>>0]=0}}var i=0,s=0;function p(e,r,a,l){return v?Y(3,1,e,r,a,l):O(e,r,a,l)}function O(e,r,a,l){if(e>>>=0,r>>>=0,a>>>=0,l>>>=0,typeof SharedArrayBuffer>\"u\")return oe(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var b=[];return v&&b.length===0?p(e,r,a,l):(e={mb:a,Na:e,eb:l,sb:b},v?(e.ub=\"spawnThread\",postMessage(e,b),0):Qe(e))}function S(e,r,a){return v?Y(4,1,e,r,a):0}function F(e,r){if(v)return Y(5,1,e,r)}var Z=e=>{for(var r=0,a=0;a=l?r++:2047>=l?r+=2:55296<=l&&57343>=l?(r+=4,++a):r+=3}return r},le=(e,r,a,l)=>{if(a>>>=0,!(0=_){var X=e.charCodeAt(++y);_=65536+((_&1023)<<10)|X&1023}if(127>=_){if(a>=l)break;r[a++>>>0]=_}else{if(2047>=_){if(a+1>=l)break;r[a++>>>0]=192|_>>6}else{if(65535>=_){if(a+2>=l)break;r[a++>>>0]=224|_>>12}else{if(a+3>=l)break;r[a++>>>0]=240|_>>18,r[a++>>>0]=128|_>>12&63}r[a++>>>0]=128|_>>6&63}r[a++>>>0]=128|_&63}}return r[a>>>0]=0,a-b},ie=(e,r,a)=>le(e,h(),r,a);function se(e,r){if(v)return Y(6,1,e,r)}function et(e,r,a){if(v)return Y(7,1,e,r,a)}function tt(e,r,a){return v?Y(8,1,e,r,a):0}function d(e,r){if(v)return Y(9,1,e,r)}function B(e,r,a){if(v)return Y(10,1,e,r,a)}function G(e,r,a,l){if(v)return Y(11,1,e,r,a,l)}function Ae(e,r,a,l){if(v)return Y(12,1,e,r,a,l)}function rt(e,r,a,l){if(v)return Y(13,1,e,r,a,l)}function Ut(e){if(v)return Y(14,1,e)}function Lt(e,r){if(v)return Y(15,1,e,r)}function Bt(e,r,a){if(v)return Y(16,1,e,r,a)}var Nr=e=>{if(!de)try{if(e(),!te())try{v?bt(ue):Ge(ue)}catch(r){r instanceof Ie||r==\"unwind\"||D(1,r)}}catch(r){r instanceof Ie||r==\"unwind\"||D(1,r)}};function pt(e){e>>>=0,typeof Atomics.tb==\"function\"&&(Atomics.tb(f(),e>>2,e).value.then(ut),e+=128,Atomics.store(f(),e>>2,1))}o.__emscripten_thread_mailbox_await=pt;function ut(){var e=ft();e&&(pt(e),Nr(()=>rr()))}o.checkMailbox=ut;var je=e=>e%4===0&&(e%100!==0||e%400===0),kt=[0,31,60,91,121,152,182,213,244,274,305,335],Wt=[0,31,59,90,120,151,181,212,243,273,304,334];function Nt(e,r,a,l,b,y,_,X){return v?Y(17,1,e,r,a,l,b,y,_,X):-52}function Ht(e,r,a,l,b,y,_){if(v)return Y(18,1,e,r,a,l,b,y,_)}var Gt=e=>{var r=Z(e)+1,a=Kt(r);return a&&ie(e,a,r),a},Hr=e=>{var r=wt();return e=e(),lt(r),e};function Y(e,r){var a=arguments.length-2,l=arguments;return Hr(()=>{for(var b=Ot(8*a),y=b>>3,_=0;_>>0]=X}return tr(e,a,b,r)})}var mt=[],gt={},zt=()=>{if(!ht){var e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:R||\"./this.program\"},r;for(r in gt)gt[r]===void 0?delete e[r]:e[r]=gt[r];var a=[];for(r in e)a.push(`${r}=${e[r]}`);ht=a}return ht},ht;function jt(e,r){if(v)return Y(19,1,e,r);e>>>=0,r>>>=0;var a=0;return zt().forEach(function(l,b){var y=r+a;for(b=w()[e+4*b>>2>>>0]=y,y=0;y>0>>>0]=l.charCodeAt(y);n()[b>>0>>>0]=0,a+=l.length+1}),0}function Yt(e,r){if(v)return Y(20,1,e,r);e>>>=0,r>>>=0;var a=zt();w()[e>>2>>>0]=a.length;var l=0;return a.forEach(function(b){l+=b.length+1}),w()[r>>2>>>0]=l,0}function $t(e){return v?Y(21,1,e):52}function qt(e,r,a,l){return v?Y(22,1,e,r,a,l):52}function Vt(e,r,a,l,b){return v?Y(23,1,e,r,a,l,b):70}var Gr=[null,[],[]];function Jt(e,r,a,l){if(v)return Y(24,1,e,r,a,l);r>>>=0,a>>>=0,l>>>=0;for(var b=0,y=0;y>2>>>0],X=w()[r+4>>2>>>0];r+=8;for(var Me=0;Me>>0],me=Gr[e];ne===0||ne===10?((e===1?N:oe)(Ze(me,0)),me.length=0):me.push(ne)}b+=X}return w()[l>>2>>>0]=b,0}var Xt=[31,29,31,30,31,30,31,31,30,31,30,31],Qt=[31,28,31,30,31,30,31,31,30,31,30,31];function zr(e){var r=Array(Z(e)+1);return le(e,r,0,r.length),r}var jr=(e,r)=>{n().set(e,r>>>0)};function Zt(e,r,a,l){function b(m,H,Q){for(m=typeof m==\"number\"?m.toString():m||\"\";m.lengthur?-1:0Be-m.getDate())H-=Be-m.getDate()+1,m.setDate(1),11>Q?m.setMonth(Q+1):(m.setMonth(0),m.setFullYear(m.getFullYear()+1));else{m.setDate(m.getDate()+H);break}}return Q=new Date(m.getFullYear()+1,0,4),H=X(new Date(m.getFullYear(),0,4)),Q=X(Q),0>=_(H,m)?0>=_(Q,m)?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}e>>>=0,r>>>=0,a>>>=0,l>>>=0;var ne=f()[l+40>>2>>>0];l={qb:f()[l>>2>>>0],pb:f()[l+4>>2>>>0],Sa:f()[l+8>>2>>>0],Wa:f()[l+12>>2>>>0],Ta:f()[l+16>>2>>>0],Qa:f()[l+20>>2>>>0],Ma:f()[l+24>>2>>>0],Pa:f()[l+28>>2>>>0],yb:f()[l+32>>2>>>0],ob:f()[l+36>>2>>>0],rb:ne?He(ne):\"\"},a=He(a),ne={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var me in ne)a=a.replace(new RegExp(me,\"g\"),ne[me]);var ir=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),sr=\"January February March April May June July August September October November December\".split(\" \");ne={\"%a\":m=>ir[m.Ma].substring(0,3),\"%A\":m=>ir[m.Ma],\"%b\":m=>sr[m.Ta].substring(0,3),\"%B\":m=>sr[m.Ta],\"%C\":m=>y((m.Qa+1900)/100|0,2),\"%d\":m=>y(m.Wa,2),\"%e\":m=>b(m.Wa,2,\" \"),\"%g\":m=>Me(m).toString().substring(2),\"%G\":m=>Me(m),\"%H\":m=>y(m.Sa,2),\"%I\":m=>(m=m.Sa,m==0?m=12:12{for(var H=0,Q=0;Q<=m.Ta-1;H+=(je(m.Qa+1900)?Xt:Qt)[Q++]);return y(m.Wa+H,3)},\"%m\":m=>y(m.Ta+1,2),\"%M\":m=>y(m.pb,2),\"%n\":()=>`\n`,\"%p\":m=>0<=m.Sa&&12>m.Sa?\"AM\":\"PM\",\"%S\":m=>y(m.qb,2),\"%t\":()=>\"\t\",\"%u\":m=>m.Ma||7,\"%U\":m=>y(Math.floor((m.Pa+7-m.Ma)/7),2),\"%V\":m=>{var H=Math.floor((m.Pa+7-(m.Ma+6)%7)/7);if(2>=(m.Ma+371-m.Pa-2)%7&&H++,H)H==53&&(Q=(m.Ma+371-m.Pa)%7,Q==4||Q==3&&je(m.Qa)||(H=1));else{H=52;var Q=(m.Ma+7-m.Pa-1)%7;(Q==4||Q==5&&je(m.Qa%400-1))&&H++}return y(H,2)},\"%w\":m=>m.Ma,\"%W\":m=>y(Math.floor((m.Pa+7-(m.Ma+6)%7)/7),2),\"%y\":m=>(m.Qa+1900).toString().substring(2),\"%Y\":m=>m.Qa+1900,\"%z\":m=>{m=m.ob;var H=0<=m;return m=Math.abs(m)/60,(H?\"+\":\"-\")+(\"0000\"+(m/60*100+m%60)).slice(-4)},\"%Z\":m=>m.rb,\"%%\":()=>\"%\"},a=a.replace(/%%/g,\"\\0\\0\");for(me in ne)a.includes(me)&&(a=a.replace(new RegExp(me,\"g\"),ne[me](l)));return a=a.replace(/\\0\\0/g,\"%\"),me=zr(a),me.length>r?0:(jr(me,e),me.length-1)}C.Va();var Yr=[null,Ke,Ue,p,S,F,se,et,tt,d,B,G,Ae,rt,Ut,Lt,Bt,Nt,Ht,jt,Yt,$t,qt,Vt,Jt],$r={b:function(e,r,a){throw e>>>=0,new t(e).Va(r>>>0,a>>>0),i=e,s++,i},N:function(e){er(e>>>0,!U,1,!ee,131072,!1),C.Ya()},j:function(e){e>>>=0,v?postMessage({cmd:\"cleanupThread\",thread:e}):it(e)},I:O,h:S,T:F,D:se,F:et,U:tt,R:d,J:B,Q:G,n:Ae,E:rt,B:Ut,S:Lt,C:Bt,q:()=>!0,z:function(e,r){e>>>=0,e==r>>>0?setTimeout(()=>ut()):v?postMessage({targetThread:e,cmd:\"checkMailbox\"}):(e=C.La[e])&&e.postMessage({cmd:\"checkMailbox\"})},L:function(){return-1},M:pt,p:function(e){L&&C.La[e>>>0].ref()},t:function(e,r,a){e=r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,a>>>=0,e=new Date(1e3*e),f()[a>>2>>>0]=e.getUTCSeconds(),f()[a+4>>2>>>0]=e.getUTCMinutes(),f()[a+8>>2>>>0]=e.getUTCHours(),f()[a+12>>2>>>0]=e.getUTCDate(),f()[a+16>>2>>>0]=e.getUTCMonth(),f()[a+20>>2>>>0]=e.getUTCFullYear()-1900,f()[a+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,f()[a+28>>2>>>0]=e},u:function(e,r,a){e=r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,a>>>=0,e=new Date(1e3*e),f()[a>>2>>>0]=e.getSeconds(),f()[a+4>>2>>>0]=e.getMinutes(),f()[a+8>>2>>>0]=e.getHours(),f()[a+12>>2>>>0]=e.getDate(),f()[a+16>>2>>>0]=e.getMonth(),f()[a+20>>2>>>0]=e.getFullYear()-1900,f()[a+24>>2>>>0]=e.getDay(),r=(je(e.getFullYear())?kt:Wt)[e.getMonth()]+e.getDate()-1|0,f()[a+28>>2>>>0]=r,f()[a+36>>2>>>0]=-(60*e.getTimezoneOffset()),r=new Date(e.getFullYear(),6,1).getTimezoneOffset();var l=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=(r!=l&&e.getTimezoneOffset()==Math.min(l,r))|0,f()[a+32>>2>>>0]=e},v:function(e){e>>>=0;var r=new Date(f()[e+20>>2>>>0]+1900,f()[e+16>>2>>>0],f()[e+12>>2>>>0],f()[e+8>>2>>>0],f()[e+4>>2>>>0],f()[e>>2>>>0],0),a=f()[e+32>>2>>>0],l=r.getTimezoneOffset(),b=new Date(r.getFullYear(),6,1).getTimezoneOffset(),y=new Date(r.getFullYear(),0,1).getTimezoneOffset(),_=Math.min(y,b);return 0>a?f()[e+32>>2>>>0]=+(b!=y&&_==l):0>2>>>0]=r.getDay(),a=(je(r.getFullYear())?kt:Wt)[r.getMonth()]+r.getDate()-1|0,f()[e+28>>2>>>0]=a,f()[e>>2>>>0]=r.getSeconds(),f()[e+4>>2>>>0]=r.getMinutes(),f()[e+8>>2>>>0]=r.getHours(),f()[e+12>>2>>>0]=r.getDate(),f()[e+16>>2>>>0]=r.getMonth(),f()[e+20>>2>>>0]=r.getYear(),e=r.getTime()/1e3,nr((xe=e,1<=+Math.abs(xe)?0>>0:~~+Math.ceil((xe-+(~~xe>>>0))/4294967296)>>>0:0)),e>>>0},r:Nt,s:Ht,y:function(e,r,a){function l(ne){return(ne=ne.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?ne[1]:\"GMT\"}e>>>=0,r>>>=0,a>>>=0;var b=new Date().getFullYear(),y=new Date(b,0,1),_=new Date(b,6,1);b=y.getTimezoneOffset();var X=_.getTimezoneOffset(),Me=Math.max(b,X);w()[e>>2>>>0]=60*Me,f()[r>>2>>>0]=+(b!=X),e=l(y),r=l(_),e=Gt(e),r=Gt(r),X>2>>>0]=e,w()[a+4>>2>>>0]=r):(w()[a>>2>>>0]=r,w()[a+4>>2>>>0]=e)},c:()=>{we(\"\")},k:function(){},i:function(){return Date.now()},o:()=>{throw Re+=1,\"unwind\"},A:function(){return 4294901760},e:()=>performance.timeOrigin+performance.now(),f:function(){return L?(hr(),at(gr)).cpus().length:navigator.hardwareConcurrency},K:function(e,r,a,l){for(C.vb=r>>>0,mt.length=a,r=l>>>0>>3,l=0;l>>0];return Yr[e].apply(null,mt)},x:function(e){e>>>=0;var r=h().length;if(e<=r||4294901760=a;a*=2){var l=r*(1+.2/a);l=Math.min(l,e+100663296);var b=Math;l=Math.max(e,l);e:{b=b.min.call(b,4294901760,l+(65536-l%65536)%65536)-V.buffer.byteLength+65535>>>16;try{V.grow(b),pe();var y=1;break e}catch{}y=void 0}if(y)return!0}return!1},O:jt,P:Yt,H:Ge,g:$t,m:qt,w:Vt,l:Jt,a:V||o.wasmMemory,G:Zt,d:function(e,r,a,l){return Zt(e>>>0,r>>>0,a>>>0,l>>>0)}};(function(){function e(a,l){return a=a.exports,A=a=qr(a),C.Za.push(A.ya),Pe=A.za,ge.unshift(A.V),x=l,We(),a}var r={a:$r};if(De(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(a){oe(\"Module.instantiateWasm callback failed with error: \"+a),P(a)}return Xe(r,function(a){e(a.instance,a.module)}).catch(P),{}})(),o._OrtInit=(e,r)=>(o._OrtInit=A.W)(e,r),o._OrtGetLastError=(e,r)=>(o._OrtGetLastError=A.X)(e,r),o._OrtCreateSessionOptions=(e,r,a,l,b,y,_,X,Me,ne)=>(o._OrtCreateSessionOptions=A.Y)(e,r,a,l,b,y,_,X,Me,ne),o._OrtAppendExecutionProvider=(e,r)=>(o._OrtAppendExecutionProvider=A.Z)(e,r),o._OrtAddFreeDimensionOverride=(e,r,a)=>(o._OrtAddFreeDimensionOverride=A._)(e,r,a),o._OrtAddSessionConfigEntry=(e,r,a)=>(o._OrtAddSessionConfigEntry=A.$)(e,r,a),o._OrtReleaseSessionOptions=e=>(o._OrtReleaseSessionOptions=A.aa)(e),o._OrtCreateSession=(e,r,a)=>(o._OrtCreateSession=A.ba)(e,r,a),o._OrtReleaseSession=e=>(o._OrtReleaseSession=A.ca)(e),o._OrtGetInputOutputCount=(e,r,a)=>(o._OrtGetInputOutputCount=A.da)(e,r,a),o._OrtGetInputName=(e,r)=>(o._OrtGetInputName=A.ea)(e,r),o._OrtGetOutputName=(e,r)=>(o._OrtGetOutputName=A.fa)(e,r),o._OrtFree=e=>(o._OrtFree=A.ga)(e),o._OrtCreateTensor=(e,r,a,l,b,y)=>(o._OrtCreateTensor=A.ha)(e,r,a,l,b,y),o._OrtGetTensorData=(e,r,a,l,b)=>(o._OrtGetTensorData=A.ia)(e,r,a,l,b),o._OrtReleaseTensor=e=>(o._OrtReleaseTensor=A.ja)(e),o._OrtCreateRunOptions=(e,r,a,l)=>(o._OrtCreateRunOptions=A.ka)(e,r,a,l),o._OrtAddRunConfigEntry=(e,r,a)=>(o._OrtAddRunConfigEntry=A.la)(e,r,a),o._OrtReleaseRunOptions=e=>(o._OrtReleaseRunOptions=A.ma)(e),o._OrtCreateBinding=e=>(o._OrtCreateBinding=A.na)(e),o._OrtBindInput=(e,r,a)=>(o._OrtBindInput=A.oa)(e,r,a),o._OrtBindOutput=(e,r,a,l)=>(o._OrtBindOutput=A.pa)(e,r,a,l),o._OrtClearBoundOutputs=e=>(o._OrtClearBoundOutputs=A.qa)(e),o._OrtReleaseBinding=e=>(o._OrtReleaseBinding=A.ra)(e),o._OrtRunWithBinding=(e,r,a,l,b)=>(o._OrtRunWithBinding=A.sa)(e,r,a,l,b),o._OrtRun=(e,r,a,l,b,y,_,X)=>(o._OrtRun=A.ta)(e,r,a,l,b,y,_,X),o._OrtEndProfiling=e=>(o._OrtEndProfiling=A.ua)(e);var ft=o._pthread_self=()=>(ft=o._pthread_self=A.va)(),Kt=o._malloc=e=>(Kt=o._malloc=A.wa)(e);o._free=e=>(o._free=A.xa)(e),o.__emscripten_tls_init=()=>(o.__emscripten_tls_init=A.ya)();var er=o.__emscripten_thread_init=(e,r,a,l,b,y)=>(er=o.__emscripten_thread_init=A.Aa)(e,r,a,l,b,y);o.__emscripten_thread_crashed=()=>(o.__emscripten_thread_crashed=A.Ba)();var tr=(e,r,a,l)=>(tr=A.Ca)(e,r,a,l),yt=e=>(yt=A.Da)(e),bt=o.__emscripten_thread_exit=e=>(bt=o.__emscripten_thread_exit=A.Ea)(e),rr=o.__emscripten_check_mailbox=()=>(rr=o.__emscripten_check_mailbox=A.Fa)(),nr=e=>(nr=A.Ga)(e),ar=(e,r)=>(ar=A.Ha)(e,r),wt=()=>(wt=A.Ia)(),lt=e=>(lt=A.Ja)(e),Ot=e=>(Ot=A.Ka)(e);function qr(e){e=Object.assign({},e);var r=l=>()=>l()>>>0,a=l=>b=>l(b)>>>0;return e.__errno_location=r(e.__errno_location),e.pthread_self=r(e.pthread_self),e.malloc=a(e.malloc),e.stackSave=r(e.stackSave),e.stackAlloc=a(e.stackAlloc),e}o.keepRuntimeAlive=te,o.wasmMemory=V,o.stackAlloc=Ot,o.stackSave=wt,o.stackRestore=lt,o.UTF8ToString=He,o.stringToUTF8=ie,o.lengthBytesUTF8=Z,o.ExitStatus=Ie,o.PThread=C;var ct;be=function e(){ct||or(),ct||(be=e)};function or(){function e(){if(!ct&&(ct=!0,o.calledRun=!0,!de)&&(v||ze(ge),T(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),!v)){if(o.postRun)for(typeof o.postRun==\"function\"&&(o.postRun=[o.postRun]);o.postRun.length;){var r=o.postRun.shift();Te.unshift(r)}ze(Te)}}if(!(0yr)});var Or=nt((wn,rn)=>{rn.exports='\"use strict\";var Module={},ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\"),parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",e=>onmessage({data:e}));var fs=require(\"fs\");Object.assign(global,{self:global,require,Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:e=>(0,eval)(fs.readFileSync(e,\"utf8\")+\"//# sourceURL=\"+e),postMessage:e=>parentPort.postMessage(e),performance:global.performance||{now:Date.now}})}var initializedJS=!1;function threadPrintErr(){var e=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,e+`\\n`);return}console.error(e)}function threadAlert(){var e=Array.prototype.slice.call(arguments).join(\" \");postMessage({cmd:\"alert\",text:e,threadId:Module._pthread_self()})}var err=threadPrintErr;self.alert=threadAlert,Module.instantiateWasm=(e,t)=>{var a=Module.wasmModule;Module.wasmModule=null;var r=new WebAssembly.Instance(a,e);return t(r)},self.onunhandledrejection=e=>{throw e.reason??e};function handleMessage(e){try{if(e.data.cmd===\"load\"){let a=[];self.onmessage=r=>a.push(r),self.startWorker=r=>{Module=r,postMessage({cmd:\"loaded\"});for(let s of a)handleMessage(s);self.onmessage=handleMessage},Module.wasmModule=e.data.wasmModule;for(const r of e.data.handlers)Module[r]=(...s)=>{postMessage({cmd:\"callHandler\",handler:r,args:s})};if(Module.wasmMemory=e.data.wasmMemory,Module.buffer=Module.wasmMemory.buffer,Module.ENVIRONMENT_IS_PTHREAD=!0,typeof e.data.urlOrBlob==\"string\")importScripts(e.data.urlOrBlob);else{var t=URL.createObjectURL(e.data.urlOrBlob);importScripts(t),URL.revokeObjectURL(t)}ortWasmThreaded(Module)}else if(e.data.cmd===\"run\"){Module.__emscripten_thread_init(e.data.pthread_ptr,0,0,1),Module.__emscripten_thread_mailbox_await(e.data.pthread_ptr),Module.establishStackSpace(),Module.PThread.receiveObjectTransfer(e.data),Module.PThread.threadInitTLS(),initializedJS||(initializedJS=!0);try{Module.invokeEntryPoint(e.data.start_routine,e.data.arg)}catch(a){if(a!=\"unwind\")throw a}}else e.data.cmd===\"cancel\"?Module._pthread_self()&&Module.__emscripten_thread_exit(-1):e.data.target===\"setimmediate\"||(e.data.cmd===\"checkMailbox\"?initializedJS&&Module.checkMailbox():e.data.cmd&&(err(\"worker.js received unknown command \"+e.data.cmd),err(e.data)))}catch(a){throw Module.__emscripten_thread_crashed&&Module.__emscripten_thread_crashed(),a}}self.onmessage=handleMessage;\\n'});var _r;_r=dr();var nn=wr(),Dt,xt=!1,dt=!1,vr=!1,an=u=>{if(u===1)return!1;if(typeof SharedArrayBuffer>\"u\")return typeof self<\"u\"&&!self.crossOriginIsolated&&console.warn(\"env.wasm.numThreads is set to \"+u+\", 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 \"+u+\", 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}},on=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},sn=(u,c)=>u?\"ort-training-wasm-simd.wasm\":c?\"ort-wasm-threaded.wasm\":\"ort-wasm.wasm\",Er=async u=>{if(xt)return Promise.resolve();if(dt)throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");if(vr)throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");dt=!0;let c=u.initTimeout,n=u.numThreads,h=u.simd,f=an(n),w=h&&on(),g=u.wasmPaths,o=typeof g==\"string\"?g:void 0,T=sn(w,f),P=typeof g==\"object\"?g[T]:void 0,I=!1,R=[];if(c>0&&R.push(new Promise(D=>{setTimeout(()=>{I=!0,D()},c)})),R.push(new Promise((D,ee)=>{let U=f?nn:_r,L={locateFile:(v,k)=>f&&v.endsWith(\".worker.js\")&&typeof Blob<\"u\"?URL.createObjectURL(new Blob([Or()],{type:\"text/javascript\"})):v.endsWith(\".wasm\")?P||(o??k)+T:k+v};if(f)if(L.numThreads=n,typeof Blob>\"u\")L.mainScriptUrlOrBlob=(void 0)(__dirname,\"ort-wasm-threaded.js\");else{let v=`var ortWasmThreaded=${U.toString()};`;L.mainScriptUrlOrBlob=new Blob([v],{type:\"text/javascript\"})}U(L).then(v=>{dt=!1,xt=!0,Dt=v,D()},v=>{dt=!1,vr=!0,ee(v)})})),await Promise.race(R),I)throw new Error(`WebAssembly backend initializing failed due to timeout: ${c}ms`)},K=()=>{if(xt&&Dt)return Dt;throw new Error(\"WebAssembly is not initialized yet.\")};var $=(u,c)=>{let n=K(),h=n.lengthBytesUTF8(u)+1,f=n._malloc(h);return n.stringToUTF8(u,f,h),c.push(f),f},ot=(u,c,n,h)=>{if(typeof u==\"object\"&&u!==null){if(n.has(u))throw new Error(\"Circular reference in options\");n.add(u)}Object.entries(u).forEach(([f,w])=>{let g=c?c+f:f;if(typeof w==\"object\")ot(w,g+\".\",n,h);else if(typeof w==\"string\"||typeof w==\"number\")h(g,w.toString());else if(typeof w==\"boolean\")h(g,w?\"1\":\"0\");else throw new Error(`Can't handle extra config type: ${typeof w}`)})},q=u=>{let c=K(),n=c.stackSave();try{let h=c.stackAlloc(8);c._OrtGetLastError(h,h+4);let f=c.HEAP32[h/4],w=c.HEAPU32[h/4+1],g=w?c.UTF8ToString(w):\"\";throw new Error(`${u} ERROR_CODE: ${f}, ERROR_MESSAGE: ${g}`)}finally{c.stackRestore(n)}};var Sr=u=>{let c=K(),n=0,h=[],f=u||{};try{if(u?.logSeverityLevel===void 0)f.logSeverityLevel=2;else if(typeof u.logSeverityLevel!=\"number\"||!Number.isInteger(u.logSeverityLevel)||u.logSeverityLevel<0||u.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${u.logSeverityLevel}`);if(u?.logVerbosityLevel===void 0)f.logVerbosityLevel=0;else if(typeof u.logVerbosityLevel!=\"number\"||!Number.isInteger(u.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${u.logVerbosityLevel}`);u?.terminate===void 0&&(f.terminate=!1);let w=0;return u?.tag!==void 0&&(w=$(u.tag,h)),n=c._OrtCreateRunOptions(f.logSeverityLevel,f.logVerbosityLevel,!!f.terminate,w),n===0&&q(\"Can't create run options.\"),u?.extra!==void 0&&ot(u.extra,\"\",new WeakSet,(g,o)=>{let T=$(g,h),P=$(o,h);c._OrtAddRunConfigEntry(n,T,P)!==0&&q(`Can't set a run config entry: ${g} - ${o}.`)}),[n,h]}catch(w){throw n!==0&&c._OrtReleaseRunOptions(n),h.forEach(g=>c._free(g)),w}};var un=u=>{switch(u){case\"disabled\":return 0;case\"basic\":return 1;case\"extended\":return 2;case\"all\":return 99;default:throw new Error(`unsupported graph optimization level: ${u}`)}},fn=u=>{switch(u){case\"sequential\":return 0;case\"parallel\":return 1;default:throw new Error(`unsupported execution mode: ${u}`)}},ln=u=>{u.extra||(u.extra={}),u.extra.session||(u.extra.session={});let c=u.extra.session;c.use_ort_model_bytes_directly||(c.use_ort_model_bytes_directly=\"1\"),u.executionProviders&&u.executionProviders.some(n=>(typeof n==\"string\"?n:n.name)===\"webgpu\")&&(u.enableMemPattern=!1)},cn=(u,c,n)=>{for(let h of c){let f=typeof h==\"string\"?h:h.name;switch(f){case\"webnn\":if(f=\"WEBNN\",typeof h!=\"string\"){let g=h;if(g?.deviceType){let o=$(\"deviceType\",n),T=$(g.deviceType,n);K()._OrtAddSessionConfigEntry(u,o,T)!==0&&q(`Can't set a session config entry: 'deviceType' - ${g.deviceType}.`)}if(g?.numThreads){let o=g.numThreads;(typeof o!=\"number\"||!Number.isInteger(o)||o<0)&&(o=0);let T=$(\"numThreads\",n),P=$(o.toString(),n);K()._OrtAddSessionConfigEntry(u,T,P)!==0&&q(`Can't set a session config entry: 'numThreads' - ${g.numThreads}.`)}if(g?.powerPreference){let o=$(\"powerPreference\",n),T=$(g.powerPreference,n);K()._OrtAddSessionConfigEntry(u,o,T)!==0&&q(`Can't set a session config entry: 'powerPreference' - ${g.powerPreference}.`)}}break;case\"webgpu\":if(f=\"JS\",typeof h!=\"string\"){let g=h;if(g?.preferredLayout){if(g.preferredLayout!==\"NCHW\"&&g.preferredLayout!==\"NHWC\")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${g.preferredLayout}`);let o=$(\"preferredLayout\",n),T=$(g.preferredLayout,n);K()._OrtAddSessionConfigEntry(u,o,T)!==0&&q(`Can't set a session config entry: 'preferredLayout' - ${g.preferredLayout}.`)}}break;case\"wasm\":case\"cpu\":continue;default:throw new Error(`not supported execution provider: ${f}`)}let w=$(f,n);K()._OrtAppendExecutionProvider(u,w)!==0&&q(`Can't append execution provider: ${f}.`)}},Tr=u=>{let c=K(),n=0,h=[],f=u||{};ln(f);try{let w=un(f.graphOptimizationLevel??\"all\"),g=fn(f.executionMode??\"sequential\"),o=typeof f.logId==\"string\"?$(f.logId,h):0,T=f.logSeverityLevel??2;if(!Number.isInteger(T)||T<0||T>4)throw new Error(`log serverity level is not valid: ${T}`);let P=f.logVerbosityLevel??0;if(!Number.isInteger(P)||P<0||P>4)throw new Error(`log verbosity level is not valid: ${P}`);let I=typeof f.optimizedModelFilePath==\"string\"?$(f.optimizedModelFilePath,h):0;if(n=c._OrtCreateSessionOptions(w,!!f.enableCpuMemArena,!!f.enableMemPattern,g,!!f.enableProfiling,0,o,T,P,I),n===0&&q(\"Can't create session options.\"),f.executionProviders&&cn(n,f.executionProviders,h),f.enableGraphCapture!==void 0){if(typeof f.enableGraphCapture!=\"boolean\")throw new Error(`enableGraphCapture must be a boolean value: ${f.enableGraphCapture}`);let R=$(\"enableGraphCapture\",h),D=$(f.enableGraphCapture.toString(),h);c._OrtAddSessionConfigEntry(n,R,D)!==0&&q(`Can't set a session config entry: 'enableGraphCapture' - ${f.enableGraphCapture}.`)}if(f.freeDimensionOverrides)for(let[R,D]of Object.entries(f.freeDimensionOverrides)){if(typeof R!=\"string\")throw new Error(`free dimension override name must be a string: ${R}`);if(typeof D!=\"number\"||!Number.isInteger(D)||D<0)throw new Error(`free dimension override value must be a non-negative integer: ${D}`);let ee=$(R,h);c._OrtAddFreeDimensionOverride(n,ee,D)!==0&&q(`Can't set a free dimension override: ${R} - ${D}.`)}return f.extra!==void 0&&ot(f.extra,\"\",new WeakSet,(R,D)=>{let ee=$(R,h),U=$(D,h);c._OrtAddSessionConfigEntry(n,ee,U)!==0&&q(`Can't set a session config entry: ${R} - ${D}.`)}),[n,h]}catch(w){throw n!==0&&c._OrtReleaseSessionOptions(n),h.forEach(g=>c._free(g)),w}};var Ft=u=>{switch(u){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: ${u}`)}},Ar=u=>{switch(u){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: ${u}`)}},Pt=u=>[void 0,4,1,1,2,2,4,8,void 0,1,2,8,4,8,void 0,void 0,void 0][u],Mr=u=>{switch(u){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: ${u}`)}},Cr=u=>{switch(u){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: ${u}`)}},Rr=u=>u===\"float32\"||u===\"float16\"||u===\"int32\"||u===\"int64\"||u===\"uint32\"||u===\"uint8\"||u===\"bool\",Dr=u=>{switch(u){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: ${u}`)}};var xr=async u=>{if(typeof u==\"string\")if(typeof process<\"u\"&&process.versions&&process.versions.node)try{return new Uint8Array(await(void 0)(u))}catch(c){if(c.code===\"ERR_FS_FILE_TOO_LARGE\"){let n=(void 0)(u),h=[];for await(let f of n)h.push(f);return new Uint8Array(Buffer.concat(h))}throw c}else{let c=await fetch(u);if(!c.ok)throw new Error(`failed to load external data file: ${u}`);let n=c.headers.get(\"Content-Length\"),h=n?parseInt(n,10):0;if(h<1073741824)return new Uint8Array(await c.arrayBuffer());{if(!c.body)throw new Error(`failed to load external data file: ${u}, no response body.`);let f=c.body.getReader(),w;try{w=new ArrayBuffer(h)}catch(o){if(o instanceof RangeError){let T=Math.ceil(h/65536);w=new WebAssembly.Memory({initial:T,maximum:T}).buffer}else throw o}let g=0;for(;;){let{done:o,value:T}=await f.read();if(o)break;let P=T.byteLength;new Uint8Array(w,g,P).set(T),g+=P}return new Uint8Array(w,0,h)}}else return u instanceof Blob?new Uint8Array(await u.arrayBuffer()):u instanceof Uint8Array?u:new Uint8Array(u)};var dn=(u,c)=>{K()._OrtInit(u,c)!==0&&q(\"Can't initialize onnxruntime.\")},Pr=async u=>{dn(u.wasm.numThreads,Cr(u.logLevel))},Ir=async(u,c)=>{},Ye=new Map,pn=u=>{let c=K(),n=c.stackSave();try{let h=c.stackAlloc(8);return c._OrtGetInputOutputCount(u,h,h+4)!==0&&q(\"Can't get session input/output count.\"),[c.HEAP32[h/4],c.HEAP32[h/4+1]]}finally{c.stackRestore(n)}},It=u=>{let c=K(),n=c._malloc(u.byteLength);if(n===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${u.byteLength}.`);return c.HEAPU8.set(u,n),[n,u.byteLength]},Ur=async(u,c)=>{let n,h,f=K();Array.isArray(u)?[n,h]=u:u.buffer===f.HEAPU8.buffer?[n,h]=[u.byteOffset,u.byteLength]:[n,h]=It(u);let w=0,g=0,o=0,T=[],P=[],I=[];try{if([g,T]=Tr(c),c?.externalData&&f.mountExternalData){let W=[];for(let z of c.externalData){let ae=typeof z==\"string\"?z:z.path;W.push(xr(typeof z==\"string\"?z:z.data).then(E=>{f.mountExternalData(ae,E)}))}await Promise.all(W)}w=await f._OrtCreateSession(n,h,g),w===0&&q(\"Can't create a session.\");let[R,D]=pn(w),ee=!!c?.enableGraphCapture,U=[],L=[],v=[];for(let W=0;Wf._OrtFree(D)),I.forEach(D=>f._OrtFree(D)),o!==0&&f._OrtReleaseBinding(o),w!==0&&f._OrtReleaseSession(w),R}finally{f._free(n),g!==0&&f._OrtReleaseSessionOptions(g),T.forEach(R=>f._free(R)),f.unmountExternalData?.()}},Lr=u=>{let c=K(),n=Ye.get(u);if(!n)throw new Error(`cannot release session. invalid session id: ${u}`);let[h,f,w,g,o]=n;g&&(o&&c._OrtClearBoundOutputs(g.handle),c._OrtReleaseBinding(g.handle)),c.jsepOnReleaseSession?.(u),f.forEach(T=>c._OrtFree(T)),w.forEach(T=>c._OrtFree(T)),c._OrtReleaseSession(h),Ye.delete(u)},Fr=(u,c,n,h,f,w=!1)=>{if(!u){c.push(0);return}let g=K(),o=u[0],T=u[1],P=u[3],I,R;if(o===\"string\"&&P===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");if(w&&P!==\"gpu-buffer\")throw new Error(`External buffer must be provided for input/output index ${f} when enableGraphCapture is true.`);if(P===\"gpu-buffer\"){let U=u[2].gpuBuffer,L=Pt(Ft(o));R=T.reduce((k,W)=>k*W,1)*L;let v=g.jsepRegisterBuffer;if(!v)throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');I=v(h,f,U,R)}else{let U=u[2];if(Array.isArray(U)){R=4*U.length,I=g._malloc(R),n.push(I);let L=I/4;for(let v=0;vg.HEAP32[U++]=v);let L=g._OrtCreateTensor(Ft(o),I,R,ee,T.length,Dr(P));L===0&&q(`Can't create tensor for input/output. session=${h}, index=${f}.`),c.push(L)}finally{g.stackRestore(D)}},Br=async(u,c,n,h,f,w)=>{let g=K(),o=Ye.get(u);if(!o)throw new Error(`cannot run inference. invalid session id: ${u}`);let T=o[0],P=o[1],I=o[2],R=o[3],D=o[4],ee=o[5],U=c.length,L=h.length,v=0,k=[],W=[],z=[],ae=[],E=g.stackSave(),ve=g.stackAlloc(U*4),Oe=g.stackAlloc(U*4),ce=g.stackAlloc(L*4),M=g.stackAlloc(L*4);try{[v,k]=Sr(w);for(let x=0;xte*j,1);J=Ar(Se);let Re=R?.outputPreferredLocations[h[x]];if(J===\"string\"){if(Re===\"gpu-buffer\")throw new Error(\"String tensor is not supported on GPU.\");let te=[],j=fe/4;for(let he=0;he0){let te=g.jsepGetBuffer;if(!te)throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');let j=te(fe),he=Pt(Se);if(he===void 0||!Rr(J))throw new Error(`Unsupported data type: ${J}`);Ee=!0,A.push([J,ge,{gpuBuffer:j,download:g.jsepCreateDownloader(j,Te*he,J),dispose:()=>{g._OrtReleaseTensor(de)}},\"gpu-buffer\"])}else{let te=Mr(J),j=new te(Te);new Uint8Array(j.buffer,j.byteOffset,j.byteLength).set(g.HEAPU8.subarray(fe,fe+j.byteLength)),A.push([J,ge,j,\"cpu\"])}}finally{g.stackRestore(ue),J===\"string\"&&fe&&g._free(fe),Ee||g._OrtReleaseTensor(de)}}return R&&!D&&(g._OrtClearBoundOutputs(R.handle),Ye.set(u,[T,P,I,R,D,!1])),A}finally{g.stackRestore(E),W.forEach(N=>g._OrtReleaseTensor(N)),z.forEach(N=>g._OrtReleaseTensor(N)),ae.forEach(N=>g._free(N)),v!==0&&g._OrtReleaseRunOptions(v),k.forEach(N=>g._free(N))}},kr=u=>{let c=K(),n=Ye.get(u);if(!n)throw new Error(\"invalid session id\");let h=n[0],f=c._OrtEndProfiling(h);f===0&&q(\"Can't get an profile file name.\"),c._OrtFree(f)},Wr=u=>{let c=[];for(let n of u){let h=n[2];!Array.isArray(h)&&\"buffer\"in h&&c.push(h.buffer)}return c};self.onmessage=u=>{let{type:c,in:n}=u.data;try{switch(c){case\"init-wasm\":Er(n.wasm).then(()=>{Pr(n).then(()=>{postMessage({type:c})},h=>{postMessage({type:c,err:h})})},h=>{postMessage({type:c,err:h})});break;case\"init-ep\":{let{epName:h,env:f}=n;Ir(f,h).then(()=>{postMessage({type:c})},w=>{postMessage({type:c,err:w})});break}case\"copy-from\":{let{buffer:h}=n,f=It(h);postMessage({type:c,out:f});break}case\"create\":{let{model:h,options:f}=n;Ur(h,f).then(w=>{postMessage({type:c,out:w})},w=>{postMessage({type:c,err:w})});break}case\"release\":Lr(n),postMessage({type:c});break;case\"run\":{let{sessionId:h,inputIndices:f,inputs:w,outputIndices:g,options:o}=n;Br(h,f,w,g,new Array(g.length).fill(null),o).then(T=>{T.some(P=>P[3]!==\"cpu\")?postMessage({type:c,err:\"Proxy does not support non-cpu tensor location.\"}):postMessage({type:c,out:T},Wr([...w,...T]))},T=>{postMessage({type:c,err:T})});break}case\"end-profiling\":kr(n),postMessage({type:c});break;default:}}catch(h){postMessage({type:c,err:h})}};})();\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {env, InferenceSession} from 'onnxruntime-common';\n\nimport {OrtWasmMessage, SerializableInternalBuffer, SerializableSessionMetadata, SerializableTensorMetadata, TensorMetadata} from './proxy-messages';\nimport * as core from './wasm-core-impl';\nimport {initializeWebAssembly} from './wasm-factory';\n\nconst isProxy = (): boolean => !!env.wasm.proxy && typeof document !== 'undefined';\nlet proxyWorker: Worker|undefined;\nlet initializing = false;\nlet initialized = false;\nlet aborted = false;\n\ntype PromiseCallbacks = [resolve: (result: T) => void, reject: (reason: unknown) => void];\nlet initWasmCallbacks: PromiseCallbacks;\nconst queuedCallbacks: Map>> = new Map();\n\nconst enqueueCallbacks = (type: OrtWasmMessage['type'], callbacks: PromiseCallbacks): void => {\n const queue = queuedCallbacks.get(type);\n if (queue) {\n queue.push(callbacks);\n } else {\n queuedCallbacks.set(type, [callbacks]);\n }\n};\n\nconst ensureWorker = (): void => {\n if (initializing || !initialized || aborted || !proxyWorker) {\n throw new Error('worker not ready');\n }\n};\n\nconst onProxyWorkerMessage = (ev: MessageEvent): void => {\n switch (ev.data.type) {\n case 'init-wasm':\n initializing = false;\n if (ev.data.err) {\n aborted = true;\n initWasmCallbacks[1](ev.data.err);\n } else {\n initialized = true;\n initWasmCallbacks[0]();\n }\n break;\n case 'init-ep':\n case 'copy-from':\n case 'create':\n case 'release':\n case 'run':\n case 'end-profiling': {\n const callbacks = queuedCallbacks.get(ev.data.type)!;\n if (ev.data.err) {\n callbacks.shift()![1](ev.data.err);\n } else {\n callbacks.shift()![0](ev.data.out!);\n }\n break;\n }\n default:\n }\n};\n\nconst scriptSrc = typeof document !== 'undefined' ? (document?.currentScript as HTMLScriptElement)?.src : undefined;\n\nexport const initializeWebAssemblyAndOrtRuntime = async(): Promise => {\n if (initialized) {\n return;\n }\n if (initializing) {\n throw new Error('multiple calls to \\'initWasm()\\' detected.');\n }\n if (aborted) {\n throw new Error('previous call to \\'initWasm()\\' failed.');\n }\n\n initializing = true;\n\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n // overwrite wasm filepaths\n if (env.wasm.wasmPaths === undefined) {\n if (scriptSrc && scriptSrc.indexOf('blob:') !== 0) {\n env.wasm.wasmPaths = scriptSrc.substr(0, +(scriptSrc).lastIndexOf('/') + 1);\n }\n }\n\n return new Promise((resolve, reject) => {\n proxyWorker?.terminate();\n\n const workerUrl = URL.createObjectURL(new Blob(\n [\n // This require() function is handled by esbuild plugin to load file content as string.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('./proxy-worker/main')\n ],\n {type: 'text/javascript'}));\n proxyWorker = new Worker(workerUrl, {name: 'ort-wasm-proxy-worker'});\n proxyWorker.onerror = (ev: ErrorEvent) => reject(ev);\n proxyWorker.onmessage = onProxyWorkerMessage;\n URL.revokeObjectURL(workerUrl);\n initWasmCallbacks = [resolve, reject];\n const message: OrtWasmMessage = {type: 'init-wasm', in : env};\n proxyWorker.postMessage(message);\n });\n\n } else {\n try {\n await initializeWebAssembly(env.wasm);\n await core.initRuntime(env);\n initialized = true;\n } catch (e) {\n aborted = true;\n throw e;\n } finally {\n initializing = false;\n }\n }\n};\n\nexport const initializeOrtEp = async(epName: string): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('init-ep', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'init-ep', in : {epName, env}};\n proxyWorker!.postMessage(message);\n });\n } else {\n await core.initEp(env, epName);\n }\n};\n\nexport const copyFromExternalBuffer = async(buffer: Uint8Array): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('copy-from', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'copy-from', in : {buffer}};\n proxyWorker!.postMessage(message, [buffer.buffer]);\n });\n } else {\n return core.copyFromExternalBuffer(buffer);\n }\n};\n\nexport const createSession =\n async(model: SerializableInternalBuffer|Uint8Array, options?: InferenceSession.SessionOptions):\n Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n // check unsupported options\n if (options?.preferredOutputLocation) {\n throw new Error('session option \"preferredOutputLocation\" is not supported for proxy.');\n }\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('create', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'create', in : {model, options: {...options}}};\n const transferable: Transferable[] = [];\n if (model instanceof Uint8Array) {\n transferable.push(model.buffer);\n }\n proxyWorker!.postMessage(message, transferable);\n });\n } else {\n return core.createSession(model, options);\n }\n };\n\nexport const releaseSession = async(sessionId: number): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('release', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'release', in : sessionId};\n proxyWorker!.postMessage(message);\n });\n } else {\n core.releaseSession(sessionId);\n }\n};\n\nexport const run = async(\n sessionId: number, inputIndices: number[], inputs: TensorMetadata[], outputIndices: number[],\n outputs: Array, options: InferenceSession.RunOptions): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n // check inputs location\n if (inputs.some(t => t[3] !== 'cpu')) {\n throw new Error('input tensor on GPU is not supported for proxy.');\n }\n // check outputs location\n if (outputs.some(t => t)) {\n throw new Error('pre-allocated output tensor is not supported for proxy.');\n }\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('run', [resolve, reject]);\n const serializableInputs = inputs as SerializableTensorMetadata[]; // every input is on CPU.\n const message: OrtWasmMessage =\n {type: 'run', in : {sessionId, inputIndices, inputs: serializableInputs, outputIndices, options}};\n proxyWorker!.postMessage(message, core.extractTransferableBuffers(serializableInputs));\n });\n } else {\n return core.run(sessionId, inputIndices, inputs, outputIndices, outputs, options);\n }\n};\n\nexport const endProfiling = async(sessionId: number): Promise => {\n if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n ensureWorker();\n return new Promise((resolve, reject) => {\n enqueueCallbacks('end-profiling', [resolve, reject]);\n const message: OrtWasmMessage = {type: 'end-profiling', in : sessionId};\n proxyWorker!.postMessage(message);\n });\n } else {\n core.endProfiling(sessionId);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession, InferenceSessionHandler, SessionHandler, Tensor, TRACE_FUNC_BEGIN, TRACE_FUNC_END} from 'onnxruntime-common';\n\nimport {SerializableInternalBuffer, TensorMetadata} from './proxy-messages';\nimport {copyFromExternalBuffer, createSession, endProfiling, releaseSession, run} from './proxy-wrapper';\nimport {isGpuBufferSupportedType} from './wasm-common';\nimport {loadFile} from './wasm-utils-load-file';\n\nexport const encodeTensorMetadata = (tensor: Tensor, getName: () => string): TensorMetadata => {\n switch (tensor.location) {\n case 'cpu':\n return [tensor.type, tensor.dims, tensor.data, 'cpu'];\n case 'gpu-buffer':\n return [tensor.type, tensor.dims, {gpuBuffer: tensor.gpuBuffer}, 'gpu-buffer'];\n default:\n throw new Error(`invalid data location: ${tensor.location} for ${getName()}`);\n }\n};\n\nexport const decodeTensorMetadata = (tensor: TensorMetadata): Tensor => {\n switch (tensor[3]) {\n case 'cpu':\n return new Tensor(tensor[0], tensor[2], tensor[1]);\n case 'gpu-buffer': {\n const dataType = tensor[0];\n if (!isGpuBufferSupportedType(dataType)) {\n throw new Error(`not supported data type: ${dataType} for deserializing GPU tensor`);\n }\n const {gpuBuffer, download, dispose} = tensor[2];\n return Tensor.fromGpuBuffer(gpuBuffer, {dataType, dims: tensor[1], download, dispose});\n }\n default:\n throw new Error(`invalid data location: ${tensor[3]}`);\n }\n};\n\nexport class OnnxruntimeWebAssemblySessionHandler implements InferenceSessionHandler {\n private sessionId: number;\n\n inputNames: string[];\n outputNames: string[];\n\n async fetchModelAndCopyToWasmMemory(path: string): Promise {\n // fetch model from url and move to wasm heap.\n return copyFromExternalBuffer(await loadFile(path));\n }\n\n async loadModel(pathOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions): Promise {\n TRACE_FUNC_BEGIN();\n let model: Parameters[0];\n\n if (typeof pathOrBuffer === 'string') {\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n // node\n model = await loadFile(pathOrBuffer);\n } else {\n // browser\n // fetch model and copy to wasm heap.\n model = await this.fetchModelAndCopyToWasmMemory(pathOrBuffer);\n }\n } else {\n model = pathOrBuffer;\n }\n\n [this.sessionId, this.inputNames, this.outputNames] = await createSession(model, options);\n TRACE_FUNC_END();\n }\n\n async dispose(): Promise {\n return releaseSession(this.sessionId);\n }\n\n async run(feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType, options: InferenceSession.RunOptions):\n Promise {\n TRACE_FUNC_BEGIN();\n const inputArray: Tensor[] = [];\n const inputIndices: number[] = [];\n Object.entries(feeds).forEach(kvp => {\n const name = kvp[0];\n const tensor = kvp[1];\n const index = this.inputNames.indexOf(name);\n if (index === -1) {\n throw new Error(`invalid input '${name}'`);\n }\n inputArray.push(tensor);\n inputIndices.push(index);\n });\n\n const outputArray: Array = [];\n const outputIndices: number[] = [];\n Object.entries(fetches).forEach(kvp => {\n const name = kvp[0];\n const tensor = kvp[1];\n const index = this.outputNames.indexOf(name);\n if (index === -1) {\n throw new Error(`invalid output '${name}'`);\n }\n outputArray.push(tensor);\n outputIndices.push(index);\n });\n\n const inputs =\n inputArray.map((t, i) => encodeTensorMetadata(t, () => `input \"${this.inputNames[inputIndices[i]]}\"`));\n const outputs = outputArray.map(\n (t, i) => t ? encodeTensorMetadata(t, () => `output \"${this.outputNames[outputIndices[i]]}\"`) : null);\n\n const results = await run(this.sessionId, inputIndices, inputs, outputIndices, outputs, options);\n\n const resultMap: SessionHandler.ReturnType = {};\n for (let i = 0; i < results.length; i++) {\n resultMap[this.outputNames[outputIndices[i]]] = outputArray[i] ?? decodeTensorMetadata(results[i]);\n }\n TRACE_FUNC_END();\n return resultMap;\n }\n\n startProfiling(): void {\n // TODO: implement profiling\n }\n\n endProfiling(): void {\n void endProfiling(this.sessionId);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {cpus} from 'node:os';\nimport {Backend, env, InferenceSession, InferenceSessionHandler} from 'onnxruntime-common';\n\nimport {initializeOrtEp, initializeWebAssemblyAndOrtRuntime} from './wasm/proxy-wrapper';\nimport {OnnxruntimeWebAssemblySessionHandler} from './wasm/session-handler-inference';\n\n/**\n * This function initializes all flags for WebAssembly.\n *\n * Those flags are accessible from `ort.env.wasm`. Users are allow to set those flags before the first inference session\n * being created, to override default value.\n */\nexport const initializeFlags = (): void => {\n if (typeof env.wasm.initTimeout !== 'number' || env.wasm.initTimeout < 0) {\n env.wasm.initTimeout = 0;\n }\n\n if (typeof env.wasm.simd !== 'boolean') {\n env.wasm.simd = true;\n }\n\n if (typeof env.wasm.proxy !== 'boolean') {\n env.wasm.proxy = false;\n }\n\n if (typeof env.wasm.trace !== 'boolean') {\n env.wasm.trace = false;\n }\n\n if (typeof env.wasm.numThreads !== 'number' || !Number.isInteger(env.wasm.numThreads) || env.wasm.numThreads <= 0) {\n // Web: when crossOriginIsolated is false, SharedArrayBuffer is not available so WebAssembly threads will not work.\n // Node.js: onnxruntime-web does not support multi-threads in Node.js.\n if ((typeof self !== 'undefined' && !self.crossOriginIsolated) ||\n (typeof process !== 'undefined' && process.versions && process.versions.node)) {\n env.wasm.numThreads = 1;\n }\n const numCpuLogicalCores = typeof navigator === 'undefined' ? cpus().length : navigator.hardwareConcurrency;\n env.wasm.numThreads = Math.min(4, Math.ceil((numCpuLogicalCores || 1) / 2));\n }\n};\n\nexport class OnnxruntimeWebAssemblyBackend implements Backend {\n /**\n * This function initializes the WebAssembly backend.\n *\n * This function will be called only once for each backend name. It will be called the first time when\n * `ort.InferenceSession.create()` is called with a registered backend name.\n *\n * @param backendName - the registered backend name.\n */\n async init(backendName: string): Promise {\n // populate wasm flags\n initializeFlags();\n\n // init wasm\n await initializeWebAssemblyAndOrtRuntime();\n\n // performe EP specific initialization\n await initializeOrtEp(backendName);\n }\n createInferenceSessionHandler(path: string, options?: InferenceSession.SessionOptions):\n Promise;\n createInferenceSessionHandler(buffer: Uint8Array, options?: InferenceSession.SessionOptions):\n Promise;\n async createInferenceSessionHandler(pathOrBuffer: string|Uint8Array, options?: InferenceSession.SessionOptions):\n Promise {\n const handler = new OnnxruntimeWebAssemblySessionHandler();\n await handler.loadModel(pathOrBuffer, options);\n return Promise.resolve(handler);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession, Tensor} from 'onnxruntime-common';\n\nimport {SerializableInternalBuffer, TensorMetadata} from './proxy-messages';\nimport {setRunOptions} from './run-options';\nimport {setSessionOptions} from './session-options';\nimport {dataLocationStringToEnum, tensorDataTypeEnumToString, tensorDataTypeStringToEnum, tensorTypeToTypedArrayConstructor} from './wasm-common';\nimport {prepareInputOutputTensor} from './wasm-core-impl';\nimport {getInstance} from './wasm-factory';\nimport {checkLastError} from './wasm-utils';\n\nconst NO_TRAIN_FUNCS_MSG =\n 'Built without training API\\'s enabled. Use the onnxruntime-web/training import for training ' +\n 'functionality, and make sure that all the correct artifacts are built & moved to the correct folder if ' +\n 'using a custom build. Check https://onnxruntime.ai/docs/build/web.html for more information.';\n\n/**\n * Runs the checkLastError function which will throw an error, if the provided error code matches the specified\n * pattern for an error code.\n * @param errCode number to evaluated for if it's an error\n * @param message message to pass into checkLastError\n * @param checkNeqZero when true, treats not equal to zero as an error.\n * When false, treats equal to zero as an error.\n */\nconst ifErrCodeCheckLastError = (errCode: number, message: string, checkNeqZero = true) => {\n if (checkNeqZero && errCode !== 0) {\n checkLastError(message);\n } else if (!checkNeqZero && errCode === 0) {\n checkLastError(message);\n }\n};\n\nexport const createCheckpointHandle = (checkpointData: SerializableInternalBuffer): number => {\n const wasm = getInstance();\n\n const [checkpointDataOffset, checkpointDataLength] = checkpointData;\n let checkpointHandle = 0;\n\n try {\n if (wasm._OrtTrainingLoadCheckpoint) {\n checkpointHandle = wasm._OrtTrainingLoadCheckpoint(checkpointDataOffset, checkpointDataLength);\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n\n ifErrCodeCheckLastError(checkpointHandle, 'Error occurred when trying to create a CheckpointState', false);\n return checkpointHandle;\n } catch (e) {\n if (wasm._OrtTrainingReleaseCheckpoint && checkpointHandle !== 0) {\n wasm._OrtTrainingReleaseCheckpoint(checkpointHandle);\n }\n throw e;\n } finally {\n // free buffer from wasm heap\n wasm._OrtFree(checkpointData[0]);\n }\n};\n\nconst getModelInputOutputCount = (trainingSessionId: number, isEvalModel: boolean): [number, number] => {\n const wasm = getInstance();\n const stack = wasm.stackSave();\n try {\n const dataOffset = wasm.stackAlloc(8);\n if (wasm._OrtTrainingGetModelInputOutputCount) {\n const errorCode =\n wasm._OrtTrainingGetModelInputOutputCount(trainingSessionId, dataOffset, dataOffset + 4, isEvalModel);\n ifErrCodeCheckLastError(errorCode, 'Can\\'t get session input/output count.');\n return [wasm.HEAP32[dataOffset / 4], wasm.HEAP32[dataOffset / 4 + 1]];\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n } finally {\n wasm.stackRestore(stack);\n }\n};\n\nconst getModelInputOutputNamesLoop =\n (trainingSessionId: number, count: number, isInput: boolean, isEvalModel: boolean): string[] => {\n const names = [];\n const wasm = getInstance();\n\n for (let i = 0; i < count; i++) {\n if (wasm._OrtTrainingGetModelInputOutputName) {\n const name = wasm._OrtTrainingGetModelInputOutputName(trainingSessionId, i, isInput, isEvalModel);\n ifErrCodeCheckLastError(name, `Can't get input or output name -- is input: ${isInput}, index ${i}`, false);\n\n names.push(wasm.UTF8ToString(name));\n wasm._free(name);\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n }\n return names;\n };\n\nexport const getModelInputOutputNames = (trainingSessionId: number, isEvalModel: boolean): [string[], string[]] => {\n let inputNames: string[] = [];\n let outputNames: string[] = [];\n\n const [inputCount, outputCount] = getModelInputOutputCount(trainingSessionId, isEvalModel);\n\n inputNames = getModelInputOutputNamesLoop(trainingSessionId, inputCount, true, isEvalModel);\n outputNames = getModelInputOutputNamesLoop(trainingSessionId, outputCount, false, isEvalModel);\n\n return [inputNames, outputNames];\n};\n\nexport const createTrainingSessionHandle =\n (checkpointHandle: number, trainModelData: SerializableInternalBuffer, evalModelData: SerializableInternalBuffer,\n optimizerModelData: SerializableInternalBuffer, options: InferenceSession.SessionOptions): number => {\n const wasm = getInstance();\n\n let trainingSessionHandle = 0;\n let sessionOptionsHandle = 0;\n let allocs: number[] = [];\n\n try {\n [sessionOptionsHandle, allocs] = setSessionOptions(options);\n if (wasm._OrtTrainingCreateSession) {\n trainingSessionHandle = wasm._OrtTrainingCreateSession(\n sessionOptionsHandle, checkpointHandle, trainModelData[0], trainModelData[1], evalModelData[0],\n evalModelData[1], optimizerModelData[0], optimizerModelData[1]);\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n\n ifErrCodeCheckLastError(trainingSessionHandle, 'Error occurred when trying to create a TrainingSession', false);\n return trainingSessionHandle;\n } catch (e) {\n if (wasm._OrtTrainingReleaseSession && trainingSessionHandle !== 0) {\n wasm._OrtTrainingReleaseSession(trainingSessionHandle);\n }\n throw e;\n } finally {\n wasm._free(trainModelData[0]);\n wasm._free(evalModelData[0]);\n wasm._free(optimizerModelData[0]);\n\n if (sessionOptionsHandle !== 0) {\n wasm._OrtReleaseSessionOptions(sessionOptionsHandle);\n }\n allocs.forEach(alloc => wasm._free(alloc));\n }\n };\n\n/**\n * Prepares input and output tensors by creating the tensors in the WASM side then creates a list of the handles of the\n * WASM tensors.\n *\n * @param trainingSessionId\n * @param indices for each tensor, the index of the input or output name that the tensor corresponds with\n * @param tensors list of TensorMetaData\n * @param tensorHandles should pass in an empty list of numbers; modified in-place by this method & stores the resulting\n * handles of the allocated tensors on the heap\n * @param inputOutputAllocs modified in-place by this method\n * @param indexAdd constant to add to the index that is passed to prepareInputOutputTensor\n */\nconst createAndAllocateTensors =\n (trainingSessionId: number, indices: number[], tensors: Array, tensorHandles: number[],\n inputOutputAllocs: number[], indexAdd: number) => {\n const count = indices.length;\n\n // creates the tensors\n for (let i = 0; i < count; i++) {\n prepareInputOutputTensor(\n tensors[i], tensorHandles, inputOutputAllocs, trainingSessionId, indexAdd + indices[i]);\n }\n\n // moves to heap\n const wasm = getInstance();\n const valuesOffset = wasm.stackAlloc(count * 4);\n let valuesIndex = valuesOffset / 4;\n for (let i = 0; i < count; i++) {\n wasm.HEAPU32[valuesIndex++] = tensorHandles[i];\n }\n\n return valuesOffset;\n };\n\n/**\n * Retrieves the information from the output tensor handles, copies to an array, and frees the WASM information\n * associated with the tensor handle.\n *\n * @param outputValuesOffset\n * @param outputCount\n * @returns list of TensorMetadata retrieved from the output handles.\n */\nconst moveOutputToTensorMetadataArr =\n (outputValuesOffset: number, outputCount: number, outputTensorHandles: number[],\n outputTensors: Array) => {\n const wasm = getInstance();\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 type: Tensor.Type|undefined, dataOffset = 0;\n try {\n const errorCode = wasm._OrtGetTensorData(\n tensor, tensorDataOffset, tensorDataOffset + 4, tensorDataOffset + 8, tensorDataOffset + 12);\n ifErrCodeCheckLastError(errorCode, `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 if (type === 'string') {\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 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 } finally {\n wasm.stackRestore(beforeGetTensorDataStack);\n if (type === 'string' && dataOffset) {\n wasm._free(dataOffset);\n }\n wasm._OrtReleaseTensor(tensor);\n }\n }\n\n return output;\n };\n\nexport const lazyResetGrad = async(trainingSessionId: number): Promise => {\n const wasm = getInstance();\n\n if (wasm._OrtTrainingLazyResetGrad) {\n const errorCode = wasm._OrtTrainingLazyResetGrad(trainingSessionId);\n ifErrCodeCheckLastError(errorCode, 'Can\\'t call lazyResetGrad.');\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n};\n\nexport const runTrainStep = async(\n trainingSessionId: number, inputIndices: number[], inputTensors: TensorMetadata[], outputIndices: number[],\n outputTensors: Array, options: InferenceSession.RunOptions): Promise => {\n const wasm = getInstance();\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\n try {\n // prepare parameters by moving them to heap\n [runOptionsHandle, runOptionsAllocs] = setRunOptions(options);\n\n // handle inputs -- you don't want anything added to the index\n const inputValuesOffset = createAndAllocateTensors(\n trainingSessionId, inputIndices, inputTensors, inputTensorHandles, inputOutputAllocs, 0);\n // handle outputs\n // you want inputCount to be added to the index of every output tensor passed to prepareInputOutputTensor\n const outputValuesOffset = createAndAllocateTensors(\n trainingSessionId, outputIndices, outputTensors, outputTensorHandles, inputOutputAllocs, inputCount);\n\n if (wasm._OrtTrainingRunTrainStep) {\n const errorCode = wasm._OrtTrainingRunTrainStep(\n trainingSessionId, inputValuesOffset, inputCount, outputValuesOffset, outputCount, runOptionsHandle);\n ifErrCodeCheckLastError(errorCode, 'failed to call OrtTrainingRunTrainStep in the WebAssembly layer');\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n\n return moveOutputToTensorMetadataArr(outputValuesOffset, outputCount, outputTensorHandles, outputTensors);\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\nexport const runOptimizerStep =\n async(trainingSessionId: number, options: InferenceSession.RunOptions): Promise => {\n const wasm = getInstance();\n\n let runOptionsHandle = 0;\n let runOptionsAllocs: number[] = [];\n\n try {\n [runOptionsHandle, runOptionsAllocs] = setRunOptions(options);\n\n if (wasm._OrtTrainingOptimizerStep) {\n const errCode = wasm._OrtTrainingOptimizerStep(trainingSessionId, runOptionsHandle);\n ifErrCodeCheckLastError(errCode, 'Failed to call OrtTrainingOptimizerStep in the WebAssembly layer');\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n } finally {\n if (runOptionsHandle !== 0) {\n wasm._OrtReleaseRunOptions(runOptionsHandle);\n }\n runOptionsAllocs.forEach(p => wasm._free(p));\n }\n};\n\nexport const runEvalStep = async(\n trainingSessionId: number, inputIndices: number[], inputTensors: TensorMetadata[], outputIndices: number[],\n outputTensors: Array, options: InferenceSession.RunOptions): Promise => {\n const wasm = getInstance();\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\n try {\n // prepare parameters by moving them to heap\n [runOptionsHandle, runOptionsAllocs] = setRunOptions(options);\n\n // handle inputs -- you don't want anything added to the index\n const inputValuesOffset = createAndAllocateTensors(\n trainingSessionId, inputIndices, inputTensors, inputTensorHandles, inputOutputAllocs, 0);\n // handle outputs\n // you want inputCount to be added to the index of every output tensor passed to prepareInputOutputTensor\n const outputValuesOffset = createAndAllocateTensors(\n trainingSessionId, outputIndices, outputTensors, outputTensorHandles, inputOutputAllocs, inputCount);\n\n if (wasm._OrtTrainingEvalStep) {\n const errorCode = wasm._OrtTrainingEvalStep(\n trainingSessionId, inputValuesOffset, inputCount, outputValuesOffset, outputCount, runOptionsHandle);\n\n ifErrCodeCheckLastError(errorCode, 'failed to call OrtTrainingEvalStep in the WebAssembly layer');\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n\n return moveOutputToTensorMetadataArr(outputValuesOffset, outputCount, outputTensorHandles, outputTensors);\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\nexport const getParametersSize = (trainingSessionId: number, trainableOnly: boolean): number => {\n const wasm = getInstance();\n const stack = wasm.stackSave();\n\n try {\n const sizeOffset = wasm.stackAlloc(4);\n if (wasm._OrtTrainingGetParametersSize) {\n const errorCode = wasm._OrtTrainingGetParametersSize(trainingSessionId, sizeOffset, trainableOnly);\n ifErrCodeCheckLastError(errorCode, 'Can\\'t get parameters size');\n\n return wasm.HEAP32[sizeOffset / 4];\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n } finally {\n wasm.stackRestore(stack);\n }\n};\n\nexport const getContiguousParameters =\n async(trainingSessionId: number, trainableOnly: boolean): Promise => {\n const wasm = getInstance();\n const stack = wasm.stackSave();\n\n const tensorTypeAsString = 'float32';\n const locationAsString = 'cpu';\n\n const parametersSize = getParametersSize(trainingSessionId, trainableOnly);\n let tensor = 0;\n\n // allocates a buffer of the correct size on the WASM heap\n const paramsByteLength = 4 * parametersSize;\n const paramsOffset = wasm._malloc(paramsByteLength);\n\n // handles the dimensions-related createTensor parameters\n const dims = [parametersSize];\n\n const dimsOffset = wasm.stackAlloc(4);\n const dimsIndex = dimsOffset / 4;\n wasm.HEAP32[dimsIndex] = parametersSize;\n\n try {\n // wraps allocated array in a tensor\n tensor = wasm._OrtCreateTensor(\n tensorDataTypeStringToEnum(tensorTypeAsString), paramsOffset, paramsByteLength, dimsOffset, dims.length,\n dataLocationStringToEnum(locationAsString));\n ifErrCodeCheckLastError(\n tensor, `Can't create tensor for getContiguousParameters. session=${trainingSessionId}.`, false);\n\n if (wasm._OrtTrainingCopyParametersToBuffer) {\n const errCode = wasm._OrtTrainingCopyParametersToBuffer(trainingSessionId, tensor, parametersSize, trainableOnly);\n ifErrCodeCheckLastError(errCode, 'Can\\'t get contiguous parameters.');\n\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n\n // copies from WASM memory to a JavaScript typed array, which is then put into a TensorMetadata object\n const typedArrayConstructor = tensorTypeToTypedArrayConstructor(tensorTypeAsString);\n const data = new typedArrayConstructor(parametersSize);\n const output: TensorMetadata[] = [];\n new Uint8Array(data.buffer, data.byteOffset, data.byteLength)\n .set(wasm.HEAPU8.subarray(paramsOffset, paramsOffset + paramsByteLength));\n output.push([tensorTypeAsString, dims, data, locationAsString]);\n if (output.length !== 1) {\n throw new Error(`something unexpected happened in the getContiguousParameters function. Expected output length of\n one, got ${output.length}`);\n } else {\n return output[0];\n }\n } finally {\n if (tensor !== 0) {\n wasm._OrtReleaseTensor(tensor);\n }\n wasm._free(paramsOffset);\n wasm._free(dimsOffset);\n wasm.stackRestore(stack);\n }\n};\n\nexport const loadParametersBuffer =\n async(trainingSessionId: number, buffer: Uint8Array, trainableOnly: boolean): Promise => {\n const wasm = getInstance();\n const stack = wasm.stackSave();\n\n const tensorTypeAsString = 'float32';\n const locationAsString = 'cpu';\n\n // allocates & copies JavaScript buffer to WASM heap\n const bufferByteLength = buffer.length;\n const bufferCount = bufferByteLength / 4;\n const bufferOffset = wasm._malloc(bufferByteLength);\n wasm.HEAPU8.set(buffer, bufferOffset);\n\n // allocates and handles moving dimensions information to WASM memory\n const dimsOffset = wasm.stackAlloc(4);\n wasm.HEAP32[dimsOffset / 4] = bufferCount;\n const dimsLength = 1;\n let tensor = 0;\n\n try {\n tensor = wasm._OrtCreateTensor(\n tensorDataTypeStringToEnum(tensorTypeAsString), bufferOffset, bufferByteLength, dimsOffset, dimsLength,\n dataLocationStringToEnum(locationAsString));\n ifErrCodeCheckLastError(tensor, `Can't create tensor for input/output. session=${trainingSessionId}`, false);\n\n if (wasm._OrtTrainingCopyParametersFromBuffer) {\n const errCode = wasm._OrtTrainingCopyParametersFromBuffer(trainingSessionId, tensor, bufferCount, trainableOnly);\n ifErrCodeCheckLastError(errCode, 'Can\\'t copy buffer to parameters.');\n } else {\n throw new Error(NO_TRAIN_FUNCS_MSG);\n }\n } finally {\n if (tensor !== 0) {\n wasm._OrtReleaseTensor(tensor);\n }\n wasm.stackRestore(stack);\n wasm._free(bufferOffset);\n wasm._free(dimsOffset);\n }\n};\n\nexport const releaseTrainingSessionAndCheckpoint = (checkpointId: number, sessionId: number): void => {\n const wasm = getInstance();\n\n if (wasm._OrtTrainingReleaseSession) {\n wasm._OrtTrainingReleaseSession(sessionId);\n }\n if (wasm._OrtTrainingReleaseCheckpoint) {\n wasm._OrtTrainingReleaseCheckpoint(checkpointId);\n }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession, OnnxValue, SessionHandler, Tensor, TrainingSessionHandler} from 'onnxruntime-common';\n\nimport {SerializableInternalBuffer, TensorMetadata} from './proxy-messages';\nimport {decodeTensorMetadata, encodeTensorMetadata} from './session-handler-inference';\nimport {copyFromExternalBuffer} from './wasm-core-impl';\nimport {createCheckpointHandle, createTrainingSessionHandle, getContiguousParameters, getModelInputOutputNames, getParametersSize, lazyResetGrad, loadParametersBuffer, releaseTrainingSessionAndCheckpoint, runEvalStep, runOptimizerStep, runTrainStep} from './wasm-training-core-impl';\n\nexport class OnnxruntimeWebAssemblyTrainingSessionHandler implements TrainingSessionHandler {\n private sessionId: number;\n private checkpointId: number;\n\n inputNames: string[];\n outputNames: string[];\n\n evalInputNames: string[] = [];\n evalOutputNames: string[] = [];\n\n async uriOrBufferToHeap(uriOrBuffer: string|Uint8Array): Promise {\n let buffer: Uint8Array;\n if (typeof uriOrBuffer === 'string') {\n const response = await fetch(uriOrBuffer);\n const arrayBuffer = await response.arrayBuffer();\n buffer = new Uint8Array(arrayBuffer);\n } else {\n buffer = uriOrBuffer;\n }\n return copyFromExternalBuffer(buffer);\n }\n\n async createTrainingSession(\n checkpointStateUriOrBuffer: string|Uint8Array, trainModelUriOrBuffer: string|Uint8Array,\n evalModelUriOrBuffer: string|Uint8Array, optimizerModelUriOrBuffer: string|Uint8Array,\n options: InferenceSession.SessionOptions) {\n const checkpointData: SerializableInternalBuffer = await this.uriOrBufferToHeap(checkpointStateUriOrBuffer);\n const trainModelData: SerializableInternalBuffer = await this.uriOrBufferToHeap(trainModelUriOrBuffer);\n // 0 is supposed to be the nullptr\n let evalModelData: SerializableInternalBuffer = [0, 0];\n let optimizerModelData: SerializableInternalBuffer = [0, 0];\n\n if (evalModelUriOrBuffer !== '') {\n evalModelData = await this.uriOrBufferToHeap(evalModelUriOrBuffer);\n }\n if (optimizerModelUriOrBuffer !== '') {\n optimizerModelData = await this.uriOrBufferToHeap(optimizerModelUriOrBuffer);\n }\n\n this.checkpointId = createCheckpointHandle(checkpointData);\n this.sessionId =\n createTrainingSessionHandle(this.checkpointId, trainModelData, evalModelData, optimizerModelData, options);\n [this.inputNames, this.outputNames] = getModelInputOutputNames(this.sessionId, false);\n if (evalModelUriOrBuffer !== '') {\n [this.evalInputNames, this.evalOutputNames] = getModelInputOutputNames(this.sessionId, true);\n }\n }\n\n /**\n * Helper method that converts a feeds or fetches datatype to two arrays, one of values and one that stores the\n * corresponding name as a number referring to the index in the list of names provided.\n *\n * @param feeds meant to match either SessionHandler.FeedsType or SessionHandler.FetchesType\n * @param names either inputNames or outputNames\n * @returns a tuple of a list of values and a list of indices.\n */\n convertMapIntoValuesArrayAndIndicesArray(\n feeds: {[name: string]: T}, names: string[], mapFunc: (val: T, index: number) => U): [T[], number[], U[]] {\n const values: T[] = [];\n const indices: number[] = [];\n Object.entries(feeds).forEach(kvp => {\n const name = kvp[0];\n const tensor = kvp[1];\n const index = names.indexOf(name);\n if (index === -1) {\n throw new Error(`invalid input '${name}`);\n }\n values.push(tensor);\n indices.push(index);\n });\n\n const uList = values.map(mapFunc);\n return [values, indices, uList];\n }\n\n /**\n * Helper method that converts the TensorMetadata that the wasm-core functions return to the\n * SessionHandler.ReturnType. Any outputs in the provided outputArray that are falsy will be populated with the\n * corresponding result.\n *\n * @param results used to populate the resultMap if there is no value for that outputName already\n * @param outputArray used to populate the resultMap. If null or undefined, use the corresponding result from results\n * @param outputIndices specifies which outputName the corresponding value for outputArray refers to.\n * @returns a map of output names and OnnxValues.\n */\n convertTensorMetadataToReturnType(\n results: TensorMetadata[], outputArray: Array, outputIndices: number[]): SessionHandler.ReturnType {\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 return resultMap;\n }\n\n async lazyResetGrad(): Promise {\n await lazyResetGrad(this.sessionId);\n }\n\n async runTrainStep(\n feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType,\n options: InferenceSession.RunOptions): Promise {\n const [, inputIndices, inputs] = this.convertMapIntoValuesArrayAndIndicesArray(\n feeds, this.inputNames,\n (t, i): TensorMetadata => encodeTensorMetadata(t, () => `input \"${this.inputNames[inputIndices[i]]}\"`));\n\n const [outputArray, outputIndices, outputs] =\n this.convertMapIntoValuesArrayAndIndicesArray(\n fetches, this.outputNames,\n (t, i): TensorMetadata|null =>\n t ? encodeTensorMetadata(t, () => `output \"${this.outputNames[outputIndices[i]]}\"`) : null);\n\n const results = await runTrainStep(this.sessionId, inputIndices, inputs, outputIndices, outputs, options);\n return this.convertTensorMetadataToReturnType(results, outputArray, outputIndices);\n }\n\n async runOptimizerStep(options: InferenceSession.RunOptions): Promise {\n await runOptimizerStep(this.sessionId, options);\n }\n\n async runEvalStep(\n feeds: SessionHandler.FeedsType, fetches: SessionHandler.FetchesType,\n options: InferenceSession.RunOptions): Promise {\n const [, inputIndices, inputs] = this.convertMapIntoValuesArrayAndIndicesArray(\n feeds, this.evalInputNames,\n (t, i): TensorMetadata => encodeTensorMetadata(t, () => `input \"${this.evalInputNames[inputIndices[i]]}\"`));\n\n const [outputArray, outputIndices, outputs] =\n this.convertMapIntoValuesArrayAndIndicesArray(\n fetches, this.evalOutputNames,\n (t, i): TensorMetadata|null =>\n t ? encodeTensorMetadata(t, () => `output \"${this.evalOutputNames[outputIndices[i]]}\"`) : null);\n\n const results = await runEvalStep(this.sessionId, inputIndices, inputs, outputIndices, outputs, options);\n return this.convertTensorMetadataToReturnType(results, outputArray, outputIndices);\n }\n\n async getParametersSize(trainableOnly: boolean): Promise {\n return getParametersSize(this.sessionId, trainableOnly);\n }\n\n async loadParametersBuffer(array: Uint8Array, trainableOnly: boolean): Promise {\n await loadParametersBuffer(this.sessionId, array, trainableOnly);\n }\n async getContiguousParameters(trainableOnly: boolean): Promise {\n const tensorResult = await getContiguousParameters(this.sessionId, trainableOnly);\n return decodeTensorMetadata(tensorResult);\n }\n\n async dispose(): Promise {\n return releaseTrainingSessionAndCheckpoint(this.checkpointId, this.sessionId);\n }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {InferenceSession, TrainingSessionHandler} from 'onnxruntime-common';\n\nimport {OnnxruntimeWebAssemblyBackend} from './backend-wasm';\nimport {OnnxruntimeWebAssemblyTrainingSessionHandler} from './wasm/session-handler-training';\n\nclass OnnxruntimeTrainingWebAssemblyBackend extends OnnxruntimeWebAssemblyBackend {\n async createTrainingSessionHandler(\n checkpointStateUriOrBuffer: string|Uint8Array, trainModelUriOrBuffer: string|Uint8Array,\n evalModelUriOrBuffer: string|Uint8Array, optimizerModelUriOrBuffer: string|Uint8Array,\n options: InferenceSession.SessionOptions): Promise {\n const handler = new OnnxruntimeWebAssemblyTrainingSessionHandler();\n await handler.createTrainingSession(\n checkpointStateUriOrBuffer, trainModelUriOrBuffer, evalModelUriOrBuffer, optimizerModelUriOrBuffer, options);\n return Promise.resolve(handler);\n }\n}\n\nexport const wasmBackend = new OnnxruntimeTrainingWebAssemblyBackend();\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": ";;;;;wgBAAA,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,EAA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AC9E,CACF,ICjKA,IAAAC,GAAA,GAAAC,GAAAD,GAAA,iBAAAE,KAAA,IAQMC,GAYOD,GApBbE,GAAAC,EAAA,kBAKAC,KACAC,KAEMJ,GAAN,cAAoDK,EAA8B,CAChF,MAAM,6BACFC,EAA+CC,EAC/CC,EAAyCC,EACzCC,EAA2E,CAC7E,IAAMC,EAAU,IAAIC,GACpB,aAAMD,EAAQ,sBACVL,EAA4BC,EAAuBC,EAAsBC,EAA2BC,CAAO,EACxG,QAAQ,QAAQC,CAAO,CAChC,CACF,EAEaZ,GAAc,IAAIC,KCZ/Ba,KACAA,KAGAA,KCNO,IAAMC,GAAU,SDIvB,IAAOC,GAAQC,GAUe,CAC5B,IAAMC,EAC4C,cAAmC,YAKrFC,GAAgB,MAAOD,EAAa,EAAE,EACtCC,GAAgB,OAAQD,EAAa,EAAE,CACzC,CAEA,OAAO,eAAeE,EAAI,SAAU,MAAO,CAAC,MAAOC,GAAS,WAAY,EAAI,CAAC", + "names": ["backends", "backendsSortedByPriority", "registerBackend", "tryResolveAndInitializeBackend", "resolveBackendAndExecutionProviders", "init_backend_impl", "__esmMin", "name", "backend", "priority", "currentBackend", "i", "backendName", "backendInfo", "isInitializing", "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", "i", "InferenceSession", "init_inference_session_impl", "__esmMin", "init_backend_impl", "init_tensor", "init_trace", "_InferenceSession", "handler", "feeds", "arg1", "arg2", "TRACE_FUNC_BEGIN", "fetches", "options", "Tensor", "isFetchesEmpty", "name", "isFetches", "arg1Keys", "v", "results", "returnValue", "key", "result", "TRACE_FUNC_END", "arg0", "arg3", "filePathOrUint8Array", "buffer", "byteOffset", "byteLength", "backend", "optionsWithValidatedEPs", "resolveBackendAndExecutionProviders", "InferenceSession", "init_inference_session", "__esmMin", "init_inference_session_impl", "init_tensor_conversion", "__esmMin", "init_tensor_factory", "__esmMin", "init_onnx_model", "__esmMin", "init_onnx_value", "__esmMin", "noBackendErrMsg", "TrainingSession", "init_training_session_impl", "__esmMin", "init_backend_impl", "init_tensor", "_TrainingSession", "handler", "hasOptimizerModel", "hasEvalModel", "trainingOptions", "sessionOptions", "evalModel", "optimizerModel", "options", "backend", "optionsWithValidatedEPs", "resolveBackendAndExecutionProviders", "inputNames", "outputNames", "feeds", "arg1", "arg2", "fetches", "Tensor", "isFetchesEmpty", "name", "isFetches", "arg1Keys", "v", "results", "returnValue", "key", "result", "trainableOnly", "array", "paramsSize", "TrainingSession", "init_training_session", "__esmMin", "init_training_session_impl", "esm_exports", "__export", "InferenceSession", "TRACE", "TRACE_FUNC_BEGIN", "TRACE_FUNC_END", "Tensor", "TrainingSession", "env", "registerBackend", "init_esm", "__esmMin", "init_backend", "init_env", "init_inference_session", "init_tensor", "init_tensor_conversion", "init_tensor_factory", "init_trace", "init_onnx_model", "init_onnx_value", "init_training_session", "fs_exports", "__export", "createReadStream", "readFile", "readFileSync", "init_fs", "__esmMin", "path_exports", "__export", "join", "init_path", "__esmMin", "require_ort_training_wasm_simd", "__commonJSMin", "exports", "module", "ortWasm", "_scriptDir", "moduleArg", "d", "k", "l", "a", "b", "r", "v", "aa", "x", "ba", "y", "A", "B", "C", "fs", "D", "c", "f", "g", "h", "ca", "E", "F", "noExitRuntime", "G", "H", "I", "da", "J", "K", "L", "M", "ea", "fa", "ha", "ia", "ja", "O", "P", "ka", "Q", "la", "ma", "na", "oa", "pa", "R", "S", "qa", "ra", "sa", "ta", "ua", "m", "T", "U", "V", "q", "W", "va", "wa", "Ba", "Aa", "X", "Ca", "Y", "Da", "Ea", "Fa", "Ga", "Ha", "e", "n", "p", "xa", "z", "w", "t", "u", "ya", "za", "Ja", "Ia", "Ka", "La", "Ma", "Na", "Z", "Oa", "Pa", "require_worker_threads", "__commonJSMin", "require_perf_hooks", "__commonJSMin", "os_exports", "__export", "cpus", "init_os", "__esmMin", "require_ort_wasm_threaded", "__commonJSMin", "exports", "module", "ortWasmThreaded", "_scriptDir", "moduleArg", "aa", "d", "l", "m", "n", "ba", "p", "ca", "r", "da", "ea", "fa", "w", "ha", "x", "a", "b", "ia", "ja", "z", "ka", "A", "B", "D", "E", "la", "ma", "F", "H", "fs", "na", "c", "e", "h", "g", "k", "oa", "pa", "qa", "I", "J", "noExitRuntime", "K", "L", "ra", "M", "N", "O", "sa", "ta", "ua", "va", "wa", "P", "Q", "xa", "R", "ya", "za", "Aa", "S", "Ba", "Ca", "Da", "Ea", "T", "U", "Fa", "Ga", "V", "Ha", "Ia", "Ja", "Ka", "La", "W", "Na", "Ma", "Oa", "X", "t", "Y", "Pa", "Qa", "Ra", "Sa", "Ta", "Ua", "Va", "Wa", "Xa", "Ya", "Za", "$a", "ab", "bb", "cb", "db", "eb", "fb", "gb", "hb", "ib", "jb", "kb", "lb", "mb", "nb", "ob", "pb", "qb", "Z", "rb", "sb", "tb", "ub", "wb", "vb", "yb", "xb", "zb", "Ab", "Bb", "Cb", "Eb", "Db", "Fb", "Gb", "Hb", "Lb", "Mb", "Nb", "Ob", "C", "v", "y", "Pb", "Qb", "Rb", "Sb", "Tb", "f", "q", "u", "Ib", "G", "Jb", "Kb", "Ub", "Xb", "Vb", "Wb", "Yb", "Zb", "$b", "ac", "require_ort_wasm_threaded_worker", "__commonJSMin", "exports", "module", "ortWasmFactory", "ortWasmFactoryThreaded", "wasm", "initialized", "initializing", "aborted", "isMultiThreadSupported", "isSimdSupported", "getWasmFileName", "initializeWebAssembly", "getInstance", "init_wasm_factory", "__esmMin", "numThreads", "useSimd", "useThreads", "flags", "timeout", "simd", "wasmPaths", "wasmPrefixOverride", "wasmFileName", "wasmPathOverride", "isTimeout", "tasks", "resolve", "reject", "factory", "config", "fileName", "scriptDirectory", "scriptSourceCode", "module", "what", "allocWasmString", "iterateExtraOptions", "checkLastError", "init_wasm_utils", "__esmMin", "init_wasm_factory", "data", "allocs", "wasm", "getInstance", "dataLength", "dataOffset", "options", "prefix", "seen", "handler", "key", "value", "name", "message", "stack", "paramsOffset", "errorCode", "errorMessagePointer", "errorMessage", "setRunOptions", "init_run_options", "__esmMin", "init_wasm_factory", "init_wasm_utils", "options", "wasm", "getInstance", "runOptionsHandle", "allocs", "runOptions", "tagDataOffset", "allocWasmString", "checkLastError", "iterateExtraOptions", "key", "value", "keyDataOffset", "valueDataOffset", "e", "alloc", "getGraphOptimzationLevel", "getExecutionMode", "appendDefaultOptions", "setExecutionProviders", "setSessionOptions", "init_session_options", "__esmMin", "init_wasm_factory", "init_wasm_utils", "graphOptimizationLevel", "executionMode", "options", "session", "ep", "sessionOptionsHandle", "executionProviders", "allocs", "epName", "webnnOptions", "keyDataOffset", "allocWasmString", "valueDataOffset", "getInstance", "checkLastError", "numThreads", "webgpuOptions", "epNameDataOffset", "wasm", "sessionOptions", "logIdDataOffset", "logSeverityLevel", "logVerbosityLevel", "optimizedModelFilePathOffset", "name", "value", "nameOffset", "iterateExtraOptions", "key", "e", "alloc", "tensorDataTypeStringToEnum", "tensorDataTypeEnumToString", "getTensorElementSize", "tensorTypeToTypedArrayConstructor", "logLevelStringToEnum", "isGpuBufferSupportedType", "dataLocationStringToEnum", "init_wasm_common", "__esmMin", "type", "typeProto", "dateType", "logLevel", "location", "loadFile", "init_wasm_utils_load_file", "__esmMin", "file", "e", "stream", "chunks", "chunk", "response", "contentLengthHeader", "fileSize", "reader", "buffer", "pages", "offset", "done", "value", "chunkSize", "initOrt", "initRuntime", "initEp", "activeSessions", "getSessionInputOutputCount", "copyFromExternalBuffer", "createSession", "releaseSession", "prepareInputOutputTensor", "run", "endProfiling", "extractTransferableBuffers", "init_wasm_core_impl", "__esmMin", "init_run_options", "init_session_options", "init_wasm_common", "init_wasm_factory", "init_wasm_utils", "init_wasm_utils_load_file", "numThreads", "loggingLevel", "getInstance", "checkLastError", "env", "logLevelStringToEnum", "epName", "sessionHandle", "wasm", "stack", "dataOffset", "model", "modelDataOffset", "modelData", "options", "modelDataLength", "sessionOptionsHandle", "ioBindingHandle", "allocs", "inputNamesUTF8Encoded", "outputNamesUTF8Encoded", "setSessionOptions", "loadingPromises", "file", "path", "loadFile", "data", "inputCount", "outputCount", "enableGraphCapture", "inputNames", "outputNames", "outputPreferredLocations", "i", "name", "nameString", "bindingState", "e", "buf", "alloc", "sessionId", "session", "ioBindingState", "tensor", "tensorHandles", "index", "dataType", "dims", "location", "rawData", "dataByteLength", "gpuBuffer", "elementSizeInBytes", "getTensorElementSize", "tensorDataTypeStringToEnum", "a", "b", "registerBuffer", "dataIndex", "allocWasmString", "dimsOffset", "dimIndex", "d", "dataLocationStringToEnum", "inputIndices", "inputTensors", "outputIndices", "outputTensors", "inputOutputBound", "runOptionsHandle", "runOptionsAllocs", "inputTensorHandles", "outputTensorHandles", "inputOutputAllocs", "beforeRunStack", "inputValuesOffset", "inputNamesOffset", "outputValuesOffset", "outputNamesOffset", "setRunOptions", "inputValuesIndex", "inputNamesIndex", "outputValuesIndex", "outputNamesIndex", "errorCode", "output", "beforeGetTensorDataStack", "tensorDataOffset", "keepOutputTensor", "type", "tensorDataIndex", "dimsLength", "size", "tensorDataTypeEnumToString", "preferredLocation", "stringData", "offset", "maxBytesToRead", "getBuffer", "elementSize", "isGpuBufferSupportedType", "typedArrayConstructor", "tensorTypeToTypedArrayConstructor", "v", "p", "profileFileName", "tensors", "buffers", "require_main", "__commonJSMin", "exports", "module", "isProxy", "proxyWorker", "initializing", "initialized", "aborted", "initWasmCallbacks", "queuedCallbacks", "enqueueCallbacks", "ensureWorker", "onProxyWorkerMessage", "scriptSrc", "initializeWebAssemblyAndOrtRuntime", "initializeOrtEp", "copyFromExternalBuffer", "createSession", "releaseSession", "run", "endProfiling", "init_proxy_wrapper", "__esmMin", "init_esm", "init_wasm_core_impl", "init_wasm_factory", "env", "type", "callbacks", "queue", "ev", "resolve", "reject", "workerUrl", "message", "initializeWebAssembly", "initRuntime", "e", "epName", "initEp", "buffer", "model", "options", "transferable", "sessionId", "inputIndices", "inputs", "outputIndices", "outputs", "t", "serializableInputs", "extractTransferableBuffers", "encodeTensorMetadata", "decodeTensorMetadata", "OnnxruntimeWebAssemblySessionHandler", "init_session_handler_inference", "__esmMin", "init_esm", "init_proxy_wrapper", "init_wasm_common", "init_wasm_utils_load_file", "tensor", "getName", "Tensor", "dataType", "isGpuBufferSupportedType", "gpuBuffer", "download", "dispose", "path", "copyFromExternalBuffer", "loadFile", "pathOrBuffer", "options", "TRACE_FUNC_BEGIN", "model", "createSession", "TRACE_FUNC_END", "releaseSession", "feeds", "fetches", "inputArray", "inputIndices", "kvp", "name", "index", "outputArray", "outputIndices", "inputs", "t", "i", "outputs", "results", "run", "resultMap", "endProfiling", "initializeFlags", "OnnxruntimeWebAssemblyBackend", "init_backend_wasm", "__esmMin", "init_esm", "init_proxy_wrapper", "init_session_handler_inference", "env", "numCpuLogicalCores", "backendName", "initializeWebAssemblyAndOrtRuntime", "initializeOrtEp", "pathOrBuffer", "options", "handler", "OnnxruntimeWebAssemblySessionHandler", "NO_TRAIN_FUNCS_MSG", "ifErrCodeCheckLastError", "createCheckpointHandle", "getModelInputOutputCount", "getModelInputOutputNamesLoop", "getModelInputOutputNames", "createTrainingSessionHandle", "createAndAllocateTensors", "moveOutputToTensorMetadataArr", "lazyResetGrad", "runTrainStep", "runOptimizerStep", "runEvalStep", "getParametersSize", "getContiguousParameters", "loadParametersBuffer", "releaseTrainingSessionAndCheckpoint", "init_wasm_training_core_impl", "__esmMin", "init_run_options", "init_session_options", "init_wasm_common", "init_wasm_core_impl", "init_wasm_factory", "init_wasm_utils", "errCode", "message", "checkNeqZero", "checkLastError", "checkpointData", "wasm", "getInstance", "checkpointDataOffset", "checkpointDataLength", "checkpointHandle", "e", "trainingSessionId", "isEvalModel", "stack", "dataOffset", "errorCode", "count", "isInput", "names", "i", "name", "inputNames", "outputNames", "inputCount", "outputCount", "trainModelData", "evalModelData", "optimizerModelData", "options", "trainingSessionHandle", "sessionOptionsHandle", "allocs", "setSessionOptions", "alloc", "indices", "tensors", "tensorHandles", "inputOutputAllocs", "indexAdd", "prepareInputOutputTensor", "valuesOffset", "valuesIndex", "outputValuesOffset", "outputTensorHandles", "outputTensors", "output", "tensor", "beforeGetTensorDataStack", "tensorDataOffset", "type", "tensorDataIndex", "dataType", "dimsOffset", "dimsLength", "dims", "size", "a", "b", "tensorDataTypeEnumToString", "stringData", "dataIndex", "offset", "maxBytesToRead", "typedArrayConstructor", "tensorTypeToTypedArrayConstructor", "data", "inputIndices", "inputTensors", "outputIndices", "runOptionsHandle", "runOptionsAllocs", "inputTensorHandles", "beforeRunStack", "setRunOptions", "inputValuesOffset", "v", "p", "trainableOnly", "sizeOffset", "tensorTypeAsString", "locationAsString", "parametersSize", "paramsByteLength", "paramsOffset", "dimsIndex", "tensorDataTypeStringToEnum", "dataLocationStringToEnum", "buffer", "bufferByteLength", "bufferCount", "bufferOffset", "checkpointId", "sessionId", "OnnxruntimeWebAssemblyTrainingSessionHandler", "init_session_handler_training", "__esmMin", "init_session_handler_inference", "init_wasm_core_impl", "init_wasm_training_core_impl", "uriOrBuffer", "buffer", "arrayBuffer", "copyFromExternalBuffer", "checkpointStateUriOrBuffer", "trainModelUriOrBuffer", "evalModelUriOrBuffer", "optimizerModelUriOrBuffer", "options", "checkpointData", "trainModelData", "evalModelData", "optimizerModelData", "createCheckpointHandle", "createTrainingSessionHandle", "getModelInputOutputNames", "feeds", "names", "mapFunc", "values", "indices", "kvp", "name", "tensor", "index", "uList", "results", "outputArray", "outputIndices", "resultMap", "i", "decodeTensorMetadata", "lazyResetGrad", "fetches", "inputIndices", "inputs", "t", "encodeTensorMetadata", "outputs", "runTrainStep", "runOptimizerStep", "runEvalStep", "trainableOnly", "getParametersSize", "array", "loadParametersBuffer", "tensorResult", "getContiguousParameters", "releaseTrainingSessionAndCheckpoint", "backend_wasm_training_exports", "__export", "wasmBackend", "OnnxruntimeTrainingWebAssemblyBackend", "init_backend_wasm_training", "__esmMin", "init_backend_wasm", "init_session_handler_training", "OnnxruntimeWebAssemblyBackend", "checkpointStateUriOrBuffer", "trainModelUriOrBuffer", "evalModelUriOrBuffer", "optimizerModelUriOrBuffer", "options", "handler", "OnnxruntimeWebAssemblyTrainingSessionHandler", "init_esm", "version", "lib_default", "esm_exports", "wasmBackend", "registerBackend", "env", "version"] +}