{
  "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/index.ts", "../lib/onnxjs/instrument.ts", "../lib/onnxjs/opset.ts", "../node_modules/guid-typescript/dist/guid.js", "../node_modules/long/index.js", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/arg-type.ts", "../node_modules/flatbuffers/js/constants.js", "../node_modules/flatbuffers/js/utils.js", "../node_modules/flatbuffers/js/encoding.js", "../node_modules/flatbuffers/js/byte-buffer.js", "../node_modules/flatbuffers/js/builder.js", "../node_modules/flatbuffers/js/flatbuffers.js", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/arg-type-and-index.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/attribute-type.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/node-type.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/node.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/edge-end.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/node-edge.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/nodes-to-optimize-indices.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/runtime-optimization-record.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/runtime-optimization-record-container-entry.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/runtime-optimizations.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/tensor-data-type.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/tensor.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/sparse-tensor.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/map-type.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/sequence-type.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/dimension-value-type.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/dimension-value.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/dimension.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/shape.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/tensor-type-and-shape.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/type-info-value.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/type-info.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/value-info.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/graph.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/attribute.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/deprecated-kernel-create-infos.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/deprecated-node-index-and-kernel-def-hash.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/deprecated-sub-graph-session-state.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/deprecated-session-state.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/kernel-type-str-args-entry.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/op-id-kernel-type-str-args-entry.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/kernel-type-str-resolver.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/operator-set-id.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/string-string-entry.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/model.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs/inference-session.ts", "../lib/onnxjs/ort-schema/flatbuffers/onnxruntime/fbs.ts", "../lib/onnxjs/ort-schema/flatbuffers/ort-generated.ts", "../node_modules/@protobufjs/aspromise/index.js", "../node_modules/@protobufjs/base64/index.js", "../node_modules/@protobufjs/eventemitter/index.js", "../node_modules/@protobufjs/float/index.js", "../node_modules/@protobufjs/inquire/index.js", "../node_modules/@protobufjs/utf8/index.js", "../node_modules/@protobufjs/pool/index.js", "../node_modules/protobufjs/src/util/longbits.js", "../node_modules/protobufjs/src/util/minimal.js", "../node_modules/protobufjs/src/writer.js", "../node_modules/protobufjs/src/writer_buffer.js", "../node_modules/protobufjs/src/reader.js", "../node_modules/protobufjs/src/reader_buffer.js", "../node_modules/protobufjs/src/rpc/service.js", "../node_modules/protobufjs/src/rpc.js", "../node_modules/protobufjs/src/roots.js", "../node_modules/protobufjs/src/index-minimal.js", "../node_modules/protobufjs/minimal.js", "../lib/onnxjs/ort-schema/protobuf/onnx.js", "../lib/onnxjs/util.ts", "../lib/onnxjs/tensor.ts", "../lib/onnxjs/backends/webgl/glsl-source.ts", "../lib/onnxjs/backends/webgl/types.ts", "../lib/onnxjs/backends/webgl/utils.ts", "../lib/onnxjs/backends/webgl/ops/packing-utils.ts", "../lib/onnxjs/backends/webgl/ops/pack.ts", "../lib/onnxjs/backends/webgl/ops/reshape-packed.ts", "../lib/onnxjs/backends/webgl/ops/uint8-encode.ts", "../lib/onnxjs/backends/webgl/ops/unpack.ts", "../lib/onnxjs/backends/webgl/texture-data-encoder.ts", "../lib/onnxjs/backends/webgl/texture-layout.ts", "../lib/onnxjs/backends/webgl/inference-handler.ts", "../lib/onnxjs/attribute-with-cache-key.ts", "../lib/onnxjs/backends/webgl/ops/batch-normalization.ts", "../lib/onnxjs/backends/webgl/glsl-definitions.ts", "../lib/onnxjs/backends/webgl/ops/binary-op.ts", "../lib/onnxjs/backends/webgl/ops/cast.ts", "../lib/onnxjs/backends/webgl/ops/concat-packed.ts", "../lib/onnxjs/backends/webgl/ops/concat.ts", "../lib/onnxjs/backends/webgl/ops/unary-op.ts", "../lib/onnxjs/backends/webgl/ops/fuse-utils.ts", "../lib/onnxjs/backends/webgl/ops/conv-grouped.ts", "../lib/onnxjs/backends/webgl/ops/im2col-pack.ts", "../lib/onnxjs/backends/webgl/ops/matmul.ts", "../lib/onnxjs/backends/webgl/ops/matmul-pack.ts", "../lib/onnxjs/backends/webgl/ops/conv-pack.ts", "../lib/onnxjs/backends/webgl/ops/im2col.ts", "../lib/onnxjs/backends/webgl/ops/dot-product.ts", "../lib/onnxjs/backends/webgl/ops/conv.ts", "../lib/onnxjs/backends/webgl/ops/conv-transpose.ts", "../lib/onnxjs/backends/webgl/ops/transpose.ts", "../lib/onnxjs/backends/webgl/ops/depth-to-space.ts", "../lib/onnxjs/backends/webgl/ops/flatten.ts", "../lib/onnxjs/operators.ts", "../lib/onnxjs/backends/webgl/ops/gather.ts", "../lib/onnxjs/backends/webgl/ops/gemm.ts", "../lib/onnxjs/backends/webgl/ops/image-scaler.ts", "../lib/onnxjs/backends/webgl/ops/instance-normalization.ts", "../lib/onnxjs/backends/webgl/ops/lrn.ts", "../lib/onnxjs/backends/webgl/ops/pad.ts", "../lib/onnxjs/backends/webgl/ops/pool.ts", "../lib/onnxjs/backends/webgl/ops/reduce.ts", "../lib/onnxjs/backends/webgl/ops/reshape.ts", "../lib/onnxjs/backends/webgl/ops/upsample.ts", "../lib/onnxjs/backends/webgl/ops/resize-packed.ts", "../lib/onnxjs/backends/webgl/ops/shape.ts", "../lib/onnxjs/backends/webgl/ops/slice.ts", "../lib/onnxjs/backends/webgl/ops/softmax.ts", "../lib/onnxjs/backends/webgl/ops/split.ts", "../lib/onnxjs/backends/webgl/ops/squeeze.ts", "../lib/onnxjs/backends/webgl/ops/sum.ts", "../lib/onnxjs/backends/webgl/ops/tile.ts", "../lib/onnxjs/backends/webgl/ops/unsqueeze.ts", "../lib/onnxjs/backends/webgl/op-resolve-rules.ts", "../lib/onnxjs/backends/webgl/glsl-function-inliner.ts", "../lib/onnxjs/backends/webgl/texture-layout-strategy.ts", "../lib/onnxjs/backends/webgl/glsl-coordinate-lib.ts", "../lib/onnxjs/backends/webgl/glsl-encoding-lib.ts", "../lib/onnxjs/backends/webgl/glsl-fragcolor-lib.ts", "../lib/onnxjs/backends/webgl/glsl-shape-utils-lib.ts", "../lib/onnxjs/backends/webgl/glsl-vec-lib.ts", "../lib/onnxjs/backends/webgl/glsl-registered-libs.ts", "../lib/onnxjs/backends/webgl/glsl-preprocessor.ts", "../lib/onnxjs/backends/webgl/program-manager.ts", "../lib/onnxjs/backends/webgl/texture-manager.ts", "../lib/onnxjs/backends/webgl/session-handler.ts", "../lib/onnxjs/backends/webgl/webgl-context.ts", "../lib/onnxjs/backends/webgl/webgl-context-factory.ts", "../lib/onnxjs/backends/backend-webgl.ts", "../lib/onnxjs/backend.ts", "../lib/onnxjs/execution-plan.ts", "../lib/onnxjs/attribute.ts", "../lib/onnxjs/graph.ts", "../lib/onnxjs/model.ts", "../lib/onnxjs/session.ts", "../lib/onnxjs/session-handler-inference.ts", "../lib/backend-onnxjs.ts", "../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<void>;\n  initialized?: boolean;\n  aborted?: boolean;\n  error?: string;\n}\n\nconst backends: Map<string, BackendInfo> = 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<Backend | string> => {\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 (\n  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<string>();\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(\n        `removing requested execution provider \"${name}\" from session options because it is not available: ${err}`,\n      );\n    }\n  }\n\n  const filteredEps = eps.filter((i) => availableBackendNames.has(typeof i === 'string' ? i : i.name));\n\n  return [\n    backend,\n    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';\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<void>;\n\n  readonly inputNames: readonly string[];\n  readonly outputNames: readonly string[];\n\n  readonly inputMetadata: readonly InferenceSession.ValueMetadata[];\n  readonly outputMetadata: readonly InferenceSession.ValueMetadata[];\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(\n    feeds: SessionHandler.FeedsType,\n    fetches: SessionHandler.FetchesType,\n    options: InferenceSession.RunOptions,\n  ): Promise<SessionHandler.ReturnType>;\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<void>;\n\n  createInferenceSessionHandler(\n    uriOrBuffer: string | Uint8Array,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSessionHandler>;\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.22.0-dev.20250409-89f8206ba4';\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<LogLevelType> = '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<LogLevelType> {\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';\nimport { TryGetGlobalType } from './type-helper.js';\n\nexport declare namespace Env {\n  export type WasmPathPrefix = string;\n  export interface WasmFilePaths {\n    /**\n     * Specify the override path for the main .wasm file.\n     *\n     * This path should be an absolute path.\n     *\n     * If not modified, the filename of the .wasm file is:\n     * - `ort-wasm-simd-threaded.wasm` for default build\n     * - `ort-wasm-simd-threaded.jsep.wasm` for JSEP build (with WebGPU and WebNN)\n     */\n    wasm?: URL | string;\n    /**\n     * Specify the override path for the main .mjs file.\n     *\n     * This path should be an absolute path.\n     *\n     * If not modified, the filename of the .mjs file is:\n     * - `ort-wasm-simd-threaded.mjs` for default build\n     * - `ort-wasm-simd-threaded.jsep.mjs` for JSEP build (with WebGPU and WebNN)\n     */\n    mjs?: URL | string;\n  }\n  export type WasmPrefixOrFilePaths = WasmPathPrefix | WasmFilePaths;\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 a value indicating whether to enable SIMD.\n     *\n     * ONNX Runtime will perform feature detection based on the value of this property. Specifically, when the value is\n     * set to:\n     * - `undefined`, `true` or `\"fixed\"`: will check availability of Fixed-width SIMD.\n     * - `\"relaxed\"`: will check availability of Relaxed SIMD.\n     * - `false`: will not perform SIMD feature checking.\n     *\n     * Setting this property does not make ONNX Runtime to switch to the corresponding runtime automatically. User need\n     * to set `wasmPaths` or `wasmBinary` property to load the corresponding runtime.\n     *\n     * This setting is available only when WebAssembly SIMD feature is available in current context.\n     *\n     * @defaultValue `true`\n     */\n    simd?: boolean | 'fixed' | 'relaxed';\n\n    /**\n     * set or get a boolean value indicating whether to enable trace.\n     *\n     * @defaultValue `false`\n     *\n     * @deprecated Use `env.trace` instead. If `env.trace` is set, this property will be ignored.\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/.mjs files, or an object of overrides for both .wasm/.mjs file. The override\n     * path should be an absolute path.\n     */\n    wasmPaths?: WasmPrefixOrFilePaths;\n\n    /**\n     * Set a custom buffer which contains the WebAssembly binary. If this property is set, the `wasmPaths` property will\n     * be ignored.\n     */\n    wasmBinary?: ArrayBufferLike | Uint8Array;\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     * @deprecated Create your own GPUAdapter, use it to create a GPUDevice instance and set {@link device} property if\n     * you want to use a specific power preference.\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     * @deprecated Create your own GPUAdapter, use it to create a GPUDevice instance and set {@link device} property if\n     * you want to use a specific fallback option.\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     *\n     * @deprecated It is no longer recommended to use this property. The latest WebGPU spec adds `GPUDevice.adapterInfo`\n     * (https://www.w3.org/TR/webgpu/#dom-gpudevice-adapterinfo), which allows to get the adapter information from the\n     * device. When it's available, there is no need to set/get the {@link adapter} property.\n     */\n    adapter: TryGetGlobalType<'GPUAdapter'>;\n    /**\n     * Set or get the GPU device for WebGPU.\n     *\n     * There are 3 valid scenarios of accessing this property:\n     * - Set a value before the first WebGPU inference session is created. The value will be used by the WebGPU backend\n     * to perform calculations. If the value is not a `GPUDevice` object, an error will be thrown.\n     * - Get the value before the first WebGPU inference session is created. This will try to create a new GPUDevice\n     * instance. Returns a `Promise` that resolves to a `GPUDevice` object.\n     * - Get the value after the first WebGPU inference session is created. Returns a resolved `Promise` to the\n     * `GPUDevice` object used by the WebGPU backend.\n     */\n    get device(): Promise<TryGetGlobalType<'GPUDevice'>>;\n    set device(value: TryGetGlobalType<'GPUDevice'>);\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 = canvas.getContext('2d') as\n    | CanvasRenderingContext2D\n    | OffscreenCanvasRenderingContext2D\n    | 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 {\n      // 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,\n      gTensorPointer = stride,\n      bTensorPointer = stride * 2,\n      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 ? 255 : ((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 =\n    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 {\n      // 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 (\n        (options.format !== undefined && channels === 4 && options.format !== 'RGBA') ||\n        (channels === 3 && options.format !== 'RGB' && options.format !== 'BGR')\n      ) {\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,\n      gImagePointer = 1,\n      bImagePointer = 2,\n      aImagePointer = 3;\n    let rTensorPointer = 0,\n      gTensorPointer = stride,\n      bTensorPointer = stride * 2,\n      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 (\n      let i = 0;\n      i < height * width;\n      rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++\n    ) {\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] =\n        aTensorPointer === -1 ? 255 : ((tensor.data[aTensorPointer++] as number) - normBias[3]) * normMean[3]; // A value\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 {\n  OptionsDimensions,\n  OptionsFormat,\n  OptionsNormalizationParameters,\n  OptionsTensorFormat,\n  OptionsTensorLayout,\n  TensorFromGpuBufferOptions,\n  TensorFromImageBitmapOptions,\n  TensorFromImageDataOptions,\n  TensorFromImageElementOptions,\n  TensorFromMLTensorOptions,\n  TensorFromTextureOptions,\n  TensorFromUrlOptions,\n} from './tensor-factory.js';\nimport { Tensor } from './tensor-impl.js';\nimport { Tensor as TensorInterface } from './tensor.js';\n\ninterface BufferToTensorOptions\n  extends OptionsDimensions,\n    OptionsTensorLayout,\n    OptionsNormalizationParameters,\n    OptionsFormat,\n    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,\n    rImagePointer = 0,\n    gImagePointer = 1,\n    bImagePointer = 2,\n    aImagePointer = 3;\n  let rTensorPointer = 0,\n    gTensorPointer = stride,\n    bTensorPointer = stride * 2,\n    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 (\n    let i = 0;\n    i < stride;\n    i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step\n  ) {\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 =\n    outputformat === 'RGBA'\n      ? 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?:\n    | TensorFromImageDataOptions\n    | TensorFromImageElementOptions\n    | TensorFromImageBitmapOptions\n    | TensorFromUrlOptions,\n): Promise<Tensor> => {\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 (typeof HTMLCanvasElement !== 'undefined' && 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 = <T extends TensorInterface.TextureDataTypes>(\n  texture: TensorInterface.TextureType,\n  options: TensorFromTextureOptions<T>,\n): 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 = <T extends TensorInterface.GpuBufferDataTypes>(\n  gpuBuffer: TensorInterface.GpuBufferType,\n  options: TensorFromGpuBufferOptions<T>,\n): 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.fromMLTensor().\n */\nexport const tensorFromMLTensor = <T extends TensorInterface.MLTensorDataTypes>(\n  mlTensor: TensorInterface.MLTensorType,\n  options: TensorFromMLTensorOptions<T>,\n): Tensor => {\n  const { dataType, dims, download, dispose } = options;\n  return new Tensor({ location: 'ml-tensor', type: dataType ?? 'float32', mlTensor, dims, download, dispose });\n};\n\n/**\n * implementation of Tensor.fromPinnedBuffer().\n */\nexport const tensorFromPinnedBuffer = <T extends TensorInterface.CpuPinnedDataTypes>(\n  type: T,\n  buffer: TensorInterface.DataTypeMap[T],\n  dims?: readonly number[],\n): Tensor => 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 =\n  | Float32ArrayConstructor\n  | Uint8ArrayConstructor\n  | Int8ArrayConstructor\n  | Uint16ArrayConstructor\n  | Int16ArrayConstructor\n  | Int32ArrayConstructor\n  | BigInt64ArrayConstructor\n  | Uint8ArrayConstructor\n  | Float64ArrayConstructor\n  | Uint32ArrayConstructor\n  | BigUint64ArrayConstructor;\nexport type SupportedTypedArray = InstanceType<SupportedTypedArrayConstructors>;\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<string, SupportedTypedArrayConstructors>([\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  ['int4', Uint8Array],\n  ['uint4', Uint8Array],\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<SupportedTypedArrayConstructors, Tensor.Type>([\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// 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\n    // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any\n    const Float16Array = (globalThis as any).Float16Array;\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 {\n  CpuPinnedConstructorParameters,\n  GpuBufferConstructorParameters,\n  MLTensorConstructorParameters,\n  TextureConstructorParameters,\n} 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    case 'ml-tensor':\n      return new Tensor({\n        location: 'ml-tensor',\n        mlTensor: tensor.mlTensor,\n        type: tensor.type as MLTensorConstructorParameters['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 {\n  tensorFromGpuBuffer,\n  tensorFromImage,\n  tensorFromMLTensor,\n  tensorFromPinnedBuffer,\n  tensorFromTexture,\n} from './tensor-factory-impl.js';\nimport {\n  CpuPinnedConstructorParameters,\n  GpuBufferConstructorParameters,\n  MLTensorConstructorParameters,\n  TensorFromGpuBufferOptions,\n  TensorFromImageBitmapOptions,\n  TensorFromImageDataOptions,\n  TensorFromImageElementOptions,\n  TensorFromMLTensorOptions,\n  TensorFromTextureOptions,\n  TensorFromUrlOptions,\n  TextureConstructorParameters,\n} from './tensor-factory.js';\nimport {\n  checkTypedArray,\n  NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP,\n  NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP,\n  SupportedTypedArray,\n  SupportedTypedArrayConstructors,\n} 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;\ntype TensorMLTensorType = TensorInterface.MLTensorType;\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,\n    data: TensorDataType | Uint8ClampedArray | readonly string[] | readonly number[] | readonly boolean[],\n    dims?: readonly number[],\n  );\n  /**\n   * Construct a new CPU tensor object from the given data and dims. Type is inferred from data.\n   */\n  constructor(\n    data: TensorDataType | Uint8ClampedArray | readonly string[] | readonly boolean[],\n    dims?: readonly number[],\n  );\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   * Construct a new tensor object from the WebNN MLTensor with the given type and dims.\n   *\n   * Tensor's location will be set to 'ml-tensor'.\n   *\n   * @param params - Specify the parameters to construct the tensor.\n   */\n  constructor(params: MLTensorConstructorParameters);\n\n  /**\n   * implementation.\n   */\n  constructor(\n    arg0:\n      | TensorType\n      | TensorDataType\n      | Uint8ClampedArray\n      | readonly string[]\n      | readonly boolean[]\n      | CpuPinnedConstructorParameters\n      | TextureConstructorParameters\n      | GpuBufferConstructorParameters\n      | MLTensorConstructorParameters,\n    arg1?: TensorDataType | Uint8ClampedArray | readonly number[] | readonly string[] | readonly boolean[],\n    arg2?: readonly number[],\n  ) {\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 (\n            type !== 'float32' &&\n            type !== 'float16' &&\n            type !== 'int32' &&\n            type !== 'int64' &&\n            type !== 'uint32' &&\n            type !== 'uint8' &&\n            type !== 'bool' &&\n            type !== 'uint4' &&\n            type !== 'int4'\n          ) {\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        case 'ml-tensor': {\n          if (\n            type !== 'float32' &&\n            type !== 'float16' &&\n            type !== 'int32' &&\n            type !== 'int64' &&\n            type !== 'uint32' &&\n            type !== 'uint64' &&\n            type !== 'int8' &&\n            type !== 'uint8' &&\n            type !== 'bool' &&\n            type !== 'uint4' &&\n            type !== 'int4'\n          ) {\n            throw new TypeError(`unsupported type \"${type}\" to create tensor from MLTensor`);\n          }\n          this.mlTensorData = arg0.mlTensor;\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) || arg0 === 'uint4' || arg0 === 'int4') {\n              // - 'float16':\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              //\n              // - 'uint4' and 'int4':\n              //   Uint8Array.from(arg1) will generate wrong data for 'uint4' and 'int4' tensor.\n              //\n              throw new TypeError(\n                `Creating a ${arg0} tensor from number array is not supported. Please use ${typedArrayConstructor.name} as data.`,\n              );\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 if (arg1 instanceof Uint8ClampedArray) {\n            if (arg0 === 'uint8') {\n              data = Uint8Array.from(arg1);\n            } else {\n              throw new TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);\n            }\n          } else if (arg0 === 'float16' && arg1 instanceof Uint16Array && typedArrayConstructor !== Uint16Array) {\n            // when Float16Array is available and data is of type Uint16Array.\n            // We allow Uint16Array to be passed in as data for 'float16' tensor until Float16Array is generally\n            // supported in JavaScript environment.\n\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any\n            data = new (globalThis as any).Float16Array(arg1.buffer, arg1.byteOffset, arg1.length);\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 if (arg0 instanceof Uint8ClampedArray) {\n          type = 'uint8';\n          data = Uint8Array.from(arg0);\n        } else {\n          // get tensor type from TypedArray\n          const mappedType = NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(\n            arg0.constructor as SupportedTypedArrayConstructors,\n          );\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      if ((type === 'uint4' || type === 'int4') && Math.ceil(size / 2) === this.cpuData.length) {\n        // for (u)int4, the data length is half of the tensor size. So we check this special case when size is odd.\n      } else {\n        throw new Error(`Tensor's size(${size}) does not match data length(${this.cpuData.length}).`);\n      }\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?:\n      | TensorFromImageDataOptions\n      | TensorFromImageElementOptions\n      | TensorFromImageBitmapOptions\n      | TensorFromUrlOptions,\n  ): Promise<TensorInterface> {\n    return tensorFromImage(image, options);\n  }\n\n  static fromTexture<T extends TensorInterface.TextureDataTypes>(\n    texture: TensorTextureType,\n    options: TensorFromTextureOptions<T>,\n  ): TensorInterface {\n    return tensorFromTexture(texture, options);\n  }\n\n  static fromGpuBuffer<T extends TensorInterface.GpuBufferDataTypes>(\n    gpuBuffer: TensorGpuBufferType,\n    options: TensorFromGpuBufferOptions<T>,\n  ): TensorInterface {\n    return tensorFromGpuBuffer(gpuBuffer, options);\n  }\n\n  static fromMLTensor<T extends TensorInterface.MLTensorDataTypes>(\n    mlTensor: TensorMLTensorType,\n    options: TensorFromMLTensorOptions<T>,\n  ): TensorInterface {\n    return tensorFromMLTensor(mlTensor, options);\n  }\n\n  static fromPinnedBuffer<T extends TensorInterface.CpuPinnedDataTypes>(\n    type: T,\n    buffer: TensorInterface.DataTypeMap[T],\n    dims?: readonly number[],\n  ): 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 the underlying WebNN MLTensor when location is 'ml-tensor'. otherwise empty.\n   */\n  private mlTensorData?: TensorMLTensorType;\n\n  /**\n   * stores an optional downloader function to download data from GPU to CPU.\n   */\n  private downloader?(): Promise<TensorDataType>;\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    }\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\n  get mlTensor(): TensorMLTensorType {\n    this.ensureValid();\n    if (!this.mlTensorData) {\n      throw new Error('The data is not stored as a WebNN MLTensor.');\n    }\n    return this.mlTensorData;\n  }\n  // #endregion\n\n  // #region methods\n\n  async getData(releaseData?: boolean): Promise<TensorDataType> {\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      case 'ml-tensor': {\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        } 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.mlTensorData = 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';\nimport { TryGetGlobalType } from './type-helper.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<T extends Tensor.Type> {\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 WebNN MLTensor that holds the tensor data.\n   *\n   * If the data is not in a WebNN MLTensor, throw error.\n   */\n  readonly mlTensor: Tensor.MLTensorType;\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<Tensor.DataTypeMap[T]>;\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    uint4: Uint8Array;\n    int4: Int8Array;\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    uint4: number;\n    int4: number;\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<Tensor.Type, 'string'>;\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  type GpuBufferTypeFallback = { size: number; mapState: 'unmapped' | 'pending' | 'mapped' };\n  /**\n   * type alias for WebGPU buffer\n   */\n  export type GpuBufferType = TryGetGlobalType<'GPUBuffer', GpuBufferTypeFallback>;\n\n  type MLTensorTypeFallback = { destroy(): void };\n  /**\n   * type alias for WebNN MLTensor\n   *\n   * The specification for WebNN's MLTensor is currently in flux.\n   */\n  export type MLTensorType = TryGetGlobalType<'MLTensor', MLTensorTypeFallback>;\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   * supported data types for constructing a tensor from a WebNN MLTensor\n   */\n  export type MLTensorDataTypes =\n    | 'float32'\n    | 'float16'\n    | 'int8'\n    | 'uint8'\n    | 'int32'\n    | 'uint32'\n    | 'int64'\n    | 'uint64'\n    | 'bool'\n    | 'uint4'\n    | 'int4';\n\n  /**\n   * represent where the tensor data is stored\n   */\n  export type DataLocation = 'none' | 'cpu' | 'cpu-pinned' | 'texture' | 'gpu-buffer' | 'ml-tensor';\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<T extends Tensor.Type> extends TypedTensorBase<T>, TypedTensorUtils<T> {}\n/**\n * Represent multi-dimensional arrays to feed to or fetch from model inferencing.\n */\nexport interface Tensor extends TypedTensorBase<Tensor.Type>, TypedTensorUtils<Tensor.Type> {}\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 (\n    type: 'string',\n    data: Tensor.DataTypeMap['string'] | readonly string[],\n    dims?: readonly number[],\n  ): 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 (\n    type: 'bool',\n    data: Tensor.DataTypeMap['bool'] | readonly boolean[],\n    dims?: readonly number[],\n  ): TypedTensor<'bool'>;\n\n  /**\n   * Construct a new uint8 tensor object from a Uint8ClampedArray, 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: 'uint8', data: Uint8ClampedArray, dims?: readonly number[]): TypedTensor<'uint8'>;\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 <T extends 'uint64' | 'int64'>(\n    type: T,\n    data: Tensor.DataTypeMap[T] | readonly bigint[] | readonly number[],\n    dims?: readonly number[],\n  ): TypedTensor<T>;\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 <T extends Exclude<Tensor.Type, 'string' | 'bool' | 'uint64' | 'int64'>>(\n    type: T,\n    data: Tensor.DataTypeMap[T] | readonly number[],\n    dims?: readonly number[],\n  ): TypedTensor<T>;\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 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: Uint8ClampedArray, 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 (\n    type: Tensor.Type,\n    data: Tensor.DataType | readonly number[] | readonly string[] | readonly bigint[] | readonly boolean[],\n    dims?: readonly number[],\n  ): 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<ReturnType>;\n  run(feeds: FeedsType, fetches: FetchesType, options?: RunOptions): Promise<ReturnType>;\n  async run(feeds: FeedsType, arg1?: FetchesType | RunOptions, arg2?: RunOptions): Promise<ReturnType> {\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\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<void> {\n    return this.handler.dispose();\n  }\n\n  static create(path: string, options?: SessionOptions): Promise<InferenceSessionInterface>;\n  static create(buffer: ArrayBufferLike, options?: SessionOptions): Promise<InferenceSessionInterface>;\n  static create(\n    buffer: ArrayBufferLike,\n    byteOffset: number,\n    byteLength?: number,\n    options?: SessionOptions,\n  ): Promise<InferenceSessionInterface>;\n  static create(buffer: Uint8Array, options?: SessionOptions): Promise<InferenceSessionInterface>;\n  static async create(\n    arg0: string | ArrayBufferLike | Uint8Array,\n    arg1?: SessionOptions | number,\n    arg2?: number,\n    arg3?: SessionOptions,\n  ): Promise<InferenceSessionInterface> {\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    ) {\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  get inputMetadata(): readonly InferenceSessionInterface.ValueMetadata[] {\n    return this.handler.inputMetadata;\n  }\n\n  get outputMetadata(): readonly InferenceSessionInterface.ValueMetadata[] {\n    return this.handler.outputMetadata;\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';\nimport type { Tensor } from './tensor.js';\nimport { TryGetGlobalType } from './type-helper.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<string, unknown>;\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    qnn: QnnExecutionProviderOption;\n    xnnpack: XnnpackExecutionProviderOption;\n  }\n\n  type ExecutionProviderName = keyof ExecutionProviderOptionMap;\n  type ExecutionProviderConfig =\n    | ExecutionProviderOptionMap[ExecutionProviderName]\n    | ExecutionProviderOption\n    | ExecutionProviderName\n    | 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\n  // #region WebNN options\n\n  interface WebNNExecutionProviderName extends ExecutionProviderOption {\n    readonly name: 'webnn';\n  }\n\n  /**\n   * Represents a set of options for creating a WebNN MLContext.\n   *\n   * @see https://www.w3.org/TR/webnn/#dictdef-mlcontextoptions\n   */\n  export interface WebNNContextOptions {\n    deviceType?: 'cpu' | 'gpu' | 'npu';\n    numThreads?: number;\n    powerPreference?: 'default' | 'low-power' | 'high-performance';\n  }\n\n  /**\n   * Represents a set of options for WebNN execution provider without MLContext.\n   */\n  export interface WebNNOptionsWithoutMLContext extends WebNNExecutionProviderName, WebNNContextOptions {\n    context?: never;\n  }\n\n  /**\n   * Represents a set of options for WebNN execution provider with MLContext.\n   *\n   * When MLContext is provided, the deviceType is also required so that the WebNN EP can determine the preferred\n   * channel layout.\n   *\n   * @see https://www.w3.org/TR/webnn/#dom-ml-createcontext\n   */\n  export interface WebNNOptionsWithMLContext\n    extends WebNNExecutionProviderName,\n      Omit<WebNNContextOptions, 'deviceType'>,\n      Required<Pick<WebNNContextOptions, 'deviceType'>> {\n    context: TryGetGlobalType<'MLContext'>;\n  }\n\n  /**\n   * Represents a set of options for WebNN execution provider with MLContext which is created from GPUDevice.\n   *\n   * @see https://www.w3.org/TR/webnn/#dom-ml-createcontext-gpudevice\n   */\n  export interface WebNNOptionsWebGpu extends WebNNExecutionProviderName {\n    context: TryGetGlobalType<'MLContext'>;\n    gpuDevice: TryGetGlobalType<'GPUDevice'>;\n  }\n\n  /**\n   * Options for WebNN execution provider.\n   */\n  export type WebNNExecutionProviderOption =\n    | WebNNOptionsWithoutMLContext\n    | WebNNOptionsWithMLContext\n    | WebNNOptionsWebGpu;\n\n  // #endregion\n\n  export interface QnnExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'qnn';\n    /**\n     * Specify the QNN backend type. E.g., 'cpu' or 'htp'.\n     * Mutually exclusive with `backendPath`.\n     *\n     * @default 'htp'\n     */\n    backendType?: string;\n    /**\n     * Specify a path to the QNN backend library.\n     * Mutually exclusive with `backendType`.\n     */\n    backendPath?: string;\n    /**\n     * Specify whether to enable HTP FP16 precision.\n     *\n     * @default true\n     */\n    enableFp16Precision?: boolean;\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     * COREML_FLAG_USE_CPU_AND_GPU = 0x020\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    useCPUAndGPU?: 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<string, unknown>;\n  }\n\n  // #endregion\n\n  // #region value metadata\n\n  /**\n   * The common part of the value metadata type for both tensor and non-tensor values.\n   */\n  export interface ValueMetadataBase {\n    /**\n     * The name of the specified input or output.\n     */\n    readonly name: string;\n  }\n\n  /**\n   * Represents the metadata of a non-tensor value.\n   */\n  export interface NonTensorValueMetadata extends ValueMetadataBase {\n    /**\n     * Get a value indicating whether the value is a tensor.\n     */\n    readonly isTensor: false;\n  }\n\n  /**\n   * Represents the metadata of a tensor value.\n   */\n  export interface TensorValueMetadata extends ValueMetadataBase {\n    /**\n     * Get a value indicating whether the value is a tensor.\n     */\n    readonly isTensor: true;\n    /**\n     * Get the data type of the tensor.\n     */\n    readonly type: Tensor.Type;\n    /**\n     * Get the shape of the tensor.\n     *\n     * If the shape is not defined, the value will an empty array. Otherwise, it will be an array representing the shape\n     * of the tensor. Each element in the array can be a number or a string. If the element is a number, it represents\n     * the corresponding dimension size. If the element is a string, it represents a symbolic dimension.\n     */\n    readonly shape: ReadonlyArray<number | string>;\n  }\n\n  /**\n   * Represents the metadata of a value.\n   */\n  export type ValueMetadata = NonTensorValueMetadata | TensorValueMetadata;\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<InferenceSession.ReturnType>;\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(\n    feeds: InferenceSession.FeedsType,\n    fetches: InferenceSession.FetchesType,\n    options?: InferenceSession.RunOptions,\n  ): Promise<InferenceSession.ReturnType>;\n\n  // #endregion\n\n  // #region release()\n\n  /**\n   * Release the inference session and the underlying resources.\n   */\n  release(): Promise<void>;\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: readonly InferenceSession.ValueMetadata[];\n\n  /**\n   * Get output metadata of the loaded model.\n   */\n  readonly outputMetadata: readonly InferenceSession.ValueMetadata[];\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<InferenceSession>;\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<InferenceSession>;\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(\n    buffer: ArrayBufferLike,\n    byteOffset: number,\n    byteLength?: number,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSession>;\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<InferenceSession>;\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<T> extends Pick<Tensor, 'dims'> {\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<T extends Tensor.Type> {\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<Tensor.DataTypeMap[T]>;\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<T extends Tensor.CpuPinnedDataTypes = Tensor.CpuPinnedDataTypes>\n  extends CommonConstructorParameters<T> {\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<T extends Tensor.TextureDataTypes = Tensor.TextureDataTypes>\n  extends CommonConstructorParameters<T>,\n    GpuResourceConstructorParameters<T> {\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<T extends Tensor.GpuBufferDataTypes = Tensor.GpuBufferDataTypes>\n  extends CommonConstructorParameters<T>,\n    GpuResourceConstructorParameters<T> {\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\nexport interface MLTensorConstructorParameters<T extends Tensor.MLTensorDataTypes = Tensor.MLTensorDataTypes>\n  extends CommonConstructorParameters<T>,\n    GpuResourceConstructorParameters<T> {\n  /**\n   * Specify the location of the data to be 'ml-tensor'.\n   */\n  readonly location: 'ml-tensor';\n\n  /**\n   * Specify the WebNN MLTensor that holds the tensor data.\n   */\n  readonly mlTensor: Tensor.MLTensorType;\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\n  extends OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromImageElementOptions\n  extends OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromUrlOptions\n  extends OptionsDimensions,\n    OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromImageBitmapOptions\n  extends OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromTextureOptions<T extends Tensor.TextureDataTypes>\n  extends Required<OptionsDimensions>,\n    OptionsFormat,\n    GpuResourceConstructorParameters<T> /* TODO: add more */ {}\n\nexport interface TensorFromGpuBufferOptions<T extends Tensor.GpuBufferDataTypes>\n  extends Pick<Tensor, 'dims'>,\n    GpuResourceConstructorParameters<T> {\n  /**\n   * Describes the data type of the tensor.\n   */\n  dataType?: T;\n}\n\nexport interface TensorFromMLTensorOptions<T extends Tensor.MLTensorDataTypes>\n  extends Pick<Tensor, 'dims'>,\n    GpuResourceConstructorParameters<T> {\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(\n    imageData: ImageData,\n    options?: TensorFromImageDataOptions,\n  ): Promise<TypedTensor<'float32'> | 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(\n    imageElement: HTMLImageElement,\n    options?: TensorFromImageElementOptions,\n  ): Promise<TypedTensor<'float32'> | 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<'float32'> | 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(\n    bitmap: ImageBitmap,\n    options: TensorFromImageBitmapOptions,\n  ): Promise<TypedTensor<'float32'> | 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<T extends Tensor.TextureDataTypes = 'float32'>(\n    texture: Tensor.TextureType,\n    options: TensorFromTextureOptions<T>,\n  ): 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<T extends Tensor.GpuBufferDataTypes>(\n    buffer: Tensor.GpuBufferType,\n    options: TensorFromGpuBufferOptions<T>,\n  ): TypedTensor<T>;\n\n  /**\n   * create a tensor from a WebNN MLTensor\n   *\n   * @param tensor - the MLTensor object to create tensor from\n   * @param options - An optional object representing options for creating tensor from a WebNN MLTensor.\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 the MLTensor to CPU. If omitted, the MLTensor\n   * data will not be able to download. Usually, this is provided by the WebNN backend for the inference outputs.\n   * Users don't need to provide this function.\n   * - `dispose`: an optional function to dispose the tensor data on the WebNN MLTensor. If omitted, the MLTensor will\n   * not be disposed. Usually, this is provided by the WebNN backend for the inference outputs. Users don't need to\n   * provide this function.\n   *\n   * @returns a tensor object\n   */\n  fromMLTensor<T extends Tensor.MLTensorDataTypes>(\n    tensor: Tensor.MLTensorType,\n    options: TensorFromMLTensorOptions<T>,\n  ): TypedTensor<T>;\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<T extends Exclude<Tensor.Type, 'string'>>(\n    type: T,\n    buffer: Tensor.DataTypeMap[T],\n    dims?: readonly number[],\n  ): TypedTensor<T>;\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\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';\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Env } from 'onnxruntime-common';\n\nimport { WebGLContext } from './backends/webgl/webgl-context';\n\nexport declare namespace Logger {\n  export interface SeverityTypeMap {\n    verbose: 'v';\n    info: 'i';\n    warning: 'w';\n    error: 'e';\n    fatal: 'f';\n  }\n\n  export type Severity = keyof SeverityTypeMap;\n\n  export type Provider = 'none' | 'console';\n\n  /**\n   * Logging config that used to control the behavior of logger\n   */\n  export interface Config {\n    /**\n     * Specify the logging provider. 'console' by default\n     */\n    provider?: Provider;\n    /**\n     * Specify the minimal logger serverity. 'warning' by default\n     */\n    minimalSeverity?: Logger.Severity;\n    /**\n     * Whether to output date time in log. true by default\n     */\n    logDateTime?: boolean;\n    /**\n     * Whether to output source information (Not yet supported). false by default\n     */\n    logSourceLocation?: boolean;\n  }\n\n  export interface CategorizedLogger {\n    verbose(content: string): void;\n    info(content: string): void;\n    warning(content: string): void;\n    error(content: string): void;\n    fatal(content: string): void;\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport interface Logger {\n  (category: string): Logger.CategorizedLogger;\n\n  verbose(content: string): void;\n  verbose(category: string, content: string): void;\n  info(content: string): void;\n  info(category: string, content: string): void;\n  warning(content: string): void;\n  warning(category: string, content: string): void;\n  error(content: string): void;\n  error(category: string, content: string): void;\n  fatal(content: string): void;\n  fatal(category: string, content: string): void;\n\n  /**\n   * Reset the logger configuration.\n   * @param config specify an optional default config\n   */\n  reset(config?: Logger.Config): void;\n  /**\n   * Set the logger's behavior on the given category\n   * @param category specify a category string. If '*' is specified, all previous configuration will be overwritten. If\n   * '' is specified, the default behavior will be updated.\n   * @param config the config object to indicate the logger's behavior\n   */\n  set(category: string, config: Logger.Config): void;\n\n  /**\n   * Set the logger's behavior from ort-common env\n   * @param env the env used to set logger. Currently only setting loglevel is supported through Env.\n   */\n  setWithEnv(env: Env): void;\n}\n\ninterface LoggerProvider {\n  log(severity: Logger.Severity, content: string, category?: string): void;\n}\nclass NoOpLoggerProvider implements LoggerProvider {\n  log(_severity: Logger.Severity, _content: string, _category?: string) {\n    // do nothing\n  }\n}\nclass ConsoleLoggerProvider implements LoggerProvider {\n  log(severity: Logger.Severity, content: string, category?: string) {\n    // eslint-disable-next-line no-console\n    console.log(`${this.color(severity)} ${category ? '\\x1b[35m' + category + '\\x1b[0m ' : ''}${content}`);\n  }\n\n  private color(severity: Logger.Severity) {\n    switch (severity) {\n      case 'verbose':\n        return '\\x1b[34;40mv\\x1b[0m';\n      case 'info':\n        return '\\x1b[32mi\\x1b[0m';\n      case 'warning':\n        return '\\x1b[30;43mw\\x1b[0m';\n      case 'error':\n        return '\\x1b[31;40me\\x1b[0m';\n      case 'fatal':\n        return '\\x1b[101mf\\x1b[0m';\n      default:\n        throw new Error(`unsupported severity: ${severity}`);\n    }\n  }\n}\n\nconst SEVERITY_VALUE = {\n  verbose: 1000,\n  info: 2000,\n  warning: 4000,\n  error: 5000,\n  fatal: 6000,\n};\n\nconst LOGGER_PROVIDER_MAP: { readonly [provider: string]: Readonly<LoggerProvider> } = {\n  ['none']: new NoOpLoggerProvider(),\n  ['console']: new ConsoleLoggerProvider(),\n};\nconst LOGGER_DEFAULT_CONFIG = {\n  provider: 'console',\n  minimalSeverity: 'warning',\n  logDateTime: true,\n  logSourceLocation: false,\n};\nlet LOGGER_CONFIG_MAP: { [category: string]: Readonly<Required<Logger.Config>> } = {\n  ['']: LOGGER_DEFAULT_CONFIG as Required<Logger.Config>,\n};\n\nfunction log(category: string): Logger.CategorizedLogger;\nfunction log(severity: Logger.Severity, content: string): void;\nfunction log(severity: Logger.Severity, category: string, content: string): void;\nfunction log(severity: Logger.Severity, arg1: string, arg2?: string): void;\nfunction log(\n  arg0: string | Logger.Severity,\n  arg1?: string,\n  arg2?: string | number,\n  arg3?: number,\n): Logger.CategorizedLogger | void {\n  if (arg1 === undefined) {\n    // log(category: string): Logger.CategorizedLogger;\n    return createCategorizedLogger(arg0);\n  } else if (arg2 === undefined) {\n    // log(severity, content);\n    logInternal(arg0 as Logger.Severity, arg1, 1);\n  } else if (typeof arg2 === 'number' && arg3 === undefined) {\n    // log(severity, content, stack)\n    logInternal(arg0 as Logger.Severity, arg1, arg2);\n  } else if (typeof arg2 === 'string' && arg3 === undefined) {\n    // log(severity, category, content)\n    logInternal(arg0 as Logger.Severity, arg2, 1, arg1);\n  } else if (typeof arg2 === 'string' && typeof arg3 === 'number') {\n    // log(severity, category, content, stack)\n    logInternal(arg0 as Logger.Severity, arg2, arg3, arg1);\n  } else {\n    throw new TypeError('input is valid');\n  }\n}\n\nfunction createCategorizedLogger(category: string): Logger.CategorizedLogger {\n  return {\n    verbose: log.verbose.bind(null, category),\n    info: log.info.bind(null, category),\n    warning: log.warning.bind(null, category),\n    error: log.error.bind(null, category),\n    fatal: log.fatal.bind(null, category),\n  };\n}\n\n// NOTE: argument 'category' is put the last parameter beacause typescript\n// doesn't allow optional argument put in front of required argument. This\n// order is different from a usual logging API.\nfunction logInternal(severity: Logger.Severity, content: string, _stack: number, category?: string) {\n  const config = LOGGER_CONFIG_MAP[category || ''] || LOGGER_CONFIG_MAP[''];\n  if (SEVERITY_VALUE[severity] < SEVERITY_VALUE[config.minimalSeverity]) {\n    return;\n  }\n\n  if (config.logDateTime) {\n    content = `${new Date().toISOString()}|${content}`;\n  }\n\n  if (config.logSourceLocation) {\n    // TODO: calculate source location from 'stack'\n  }\n\n  LOGGER_PROVIDER_MAP[config.provider].log(severity, content, category);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nnamespace log {\n  export function verbose(content: string): void;\n  export function verbose(category: string, content: string): void;\n  export function verbose(arg0: string, arg1?: string) {\n    log('verbose', arg0, arg1);\n  }\n  export function info(content: string): void;\n  export function info(category: string, content: string): void;\n  export function info(arg0: string, arg1?: string) {\n    log('info', arg0, arg1);\n  }\n  export function warning(content: string): void;\n  export function warning(category: string, content: string): void;\n  export function warning(arg0: string, arg1?: string) {\n    log('warning', arg0, arg1);\n  }\n  export function error(content: string): void;\n  export function error(category: string, content: string): void;\n  export function error(arg0: string, arg1?: string) {\n    log('error', arg0, arg1);\n  }\n  export function fatal(content: string): void;\n  export function fatal(category: string, content: string): void;\n  export function fatal(arg0: string, arg1?: string) {\n    log('fatal', arg0, arg1);\n  }\n\n  export function reset(config?: Logger.Config): void {\n    LOGGER_CONFIG_MAP = {};\n    set('', config || {});\n  }\n  export function set(category: string, config: Logger.Config): void {\n    if (category === '*') {\n      reset(config);\n    } else {\n      const previousConfig = LOGGER_CONFIG_MAP[category] || LOGGER_DEFAULT_CONFIG;\n      LOGGER_CONFIG_MAP[category] = {\n        provider: config.provider || previousConfig.provider,\n        minimalSeverity: config.minimalSeverity || previousConfig.minimalSeverity,\n        logDateTime: config.logDateTime === undefined ? previousConfig.logDateTime : config.logDateTime,\n        logSourceLocation:\n          config.logSourceLocation === undefined ? previousConfig.logSourceLocation : config.logSourceLocation,\n      };\n    }\n\n    // TODO: we want to support wildcard or regex?\n  }\n\n  export function setWithEnv(env: Env): void {\n    const config: Logger.Config = {};\n    if (env.logLevel) {\n      config.minimalSeverity = env.logLevel as Logger.Severity;\n    }\n    set('', config);\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare, @typescript-eslint/naming-convention\nexport const Logger: Logger = log;\n\nexport declare namespace Profiler {\n  export interface Config {\n    maxNumberEvents?: number;\n    flushBatchSize?: number;\n    flushIntervalInMilliseconds?: number;\n  }\n\n  export type EventCategory = 'session' | 'node' | 'op' | 'backend';\n\n  export interface Event {\n    end(): void | Promise<void>;\n  }\n}\n// TODO\n// class WebGLEvent implements Profiler.Event {}\n\nclass Event implements Profiler.Event {\n  constructor(\n    public category: Profiler.EventCategory,\n    public name: string,\n    public startTime: number,\n    private endCallback: (e: Event) => void | Promise<void>,\n    public timer?: WebGLQuery,\n    public ctx?: WebGLContext,\n  ) {}\n\n  async end() {\n    return this.endCallback(this);\n  }\n\n  async checkTimer(): Promise<number> {\n    if (this.ctx === undefined || this.timer === undefined) {\n      throw new Error('No webgl timer found');\n    } else {\n      this.ctx.endTimer();\n      return this.ctx.waitForQueryAndGetTime(this.timer);\n    }\n  }\n}\n\nclass EventRecord {\n  constructor(\n    public category: Profiler.EventCategory,\n    public name: string,\n    public startTime: number,\n    public endTime: number,\n  ) {}\n}\n\nexport class Profiler {\n  static create(config?: Profiler.Config): Profiler {\n    if (config === undefined) {\n      return new this();\n    }\n    return new this(config.maxNumberEvents, config.flushBatchSize, config.flushIntervalInMilliseconds);\n  }\n\n  private constructor(maxNumberEvents?: number, flushBatchSize?: number, flushIntervalInMilliseconds?: number) {\n    this._started = false;\n    this._maxNumberEvents = maxNumberEvents === undefined ? 10000 : maxNumberEvents;\n    this._flushBatchSize = flushBatchSize === undefined ? 10 : flushBatchSize;\n    this._flushIntervalInMilliseconds = flushIntervalInMilliseconds === undefined ? 5000 : flushIntervalInMilliseconds;\n  }\n\n  // start profiling\n  start() {\n    this._started = true;\n    this._timingEvents = [];\n    this._flushTime = now();\n    this._flushPointer = 0;\n  }\n\n  // stop profiling\n  stop() {\n    this._started = false;\n    for (; this._flushPointer < this._timingEvents.length; this._flushPointer++) {\n      this.logOneEvent(this._timingEvents[this._flushPointer]);\n    }\n  }\n\n  // create an event scope for the specific function\n  event<T>(category: Profiler.EventCategory, name: string, func: () => T, ctx?: WebGLContext): T;\n  event<T>(category: Profiler.EventCategory, name: string, func: () => Promise<T>, ctx?: WebGLContext): Promise<T>;\n\n  event<T>(\n    category: Profiler.EventCategory,\n    name: string,\n    func: () => T | Promise<T>,\n    ctx?: WebGLContext,\n  ): T | Promise<T> {\n    const event = this._started ? this.begin(category, name, ctx) : undefined;\n    let isPromise = false;\n\n    const res = func();\n\n    // we consider a then-able object is a promise\n    if (res && typeof (res as Promise<T>).then === 'function') {\n      isPromise = true;\n      return new Promise<T>((resolve, reject) => {\n        (res as Promise<T>).then(\n          async (value) => {\n            // fulfilled\n            if (event) {\n              await event.end();\n            }\n            resolve(value);\n          },\n          async (reason) => {\n            // rejected\n            if (event) {\n              await event.end();\n            }\n            reject(reason);\n          },\n        );\n      });\n    }\n    if (!isPromise && event) {\n      const eventRes = event.end();\n      if (eventRes && typeof eventRes.then === 'function') {\n        return new Promise<T>((resolve, reject) => {\n          eventRes.then(\n            () => {\n              // fulfilled\n              resolve(res);\n            },\n            (reason) => {\n              // rejected\n              reject(reason);\n            },\n          );\n        });\n      }\n    }\n    return res;\n  }\n\n  // begin an event\n  begin(category: Profiler.EventCategory, name: string, ctx?: WebGLContext): Event {\n    if (!this._started) {\n      throw new Error('profiler is not started yet');\n    }\n    if (ctx === undefined) {\n      const startTime = now();\n      this.flush(startTime);\n      return new Event(category, name, startTime, (e) => this.endSync(e));\n    } else {\n      const timer: WebGLQuery = ctx.beginTimer();\n      return new Event(category, name, 0, async (e) => this.end(e), timer, ctx);\n    }\n  }\n\n  // end the specific event\n  private async end(event: Event): Promise<void> {\n    const endTime: number = await event.checkTimer();\n    if (this._timingEvents.length < this._maxNumberEvents) {\n      this._timingEvents.push(new EventRecord(event.category, event.name, event.startTime, endTime));\n      this.flush(endTime);\n    }\n  }\n\n  private endSync(event: Event): void {\n    const endTime: number = now();\n    if (this._timingEvents.length < this._maxNumberEvents) {\n      this._timingEvents.push(new EventRecord(event.category, event.name, event.startTime, endTime));\n      this.flush(endTime);\n    }\n  }\n\n  private logOneEvent(event: EventRecord) {\n    Logger.verbose(\n      `Profiler.${event.category}`,\n      `${(event.endTime - event.startTime).toFixed(2)}ms on event '${event.name}' at ${event.endTime.toFixed(2)}`,\n    );\n  }\n\n  private flush(currentTime: number) {\n    if (\n      this._timingEvents.length - this._flushPointer >= this._flushBatchSize ||\n      currentTime - this._flushTime >= this._flushIntervalInMilliseconds\n    ) {\n      // should flush when either batch size accumlated or interval elepsed\n\n      for (\n        const previousPointer = this._flushPointer;\n        this._flushPointer < previousPointer + this._flushBatchSize && this._flushPointer < this._timingEvents.length;\n        this._flushPointer++\n      ) {\n        this.logOneEvent(this._timingEvents[this._flushPointer]);\n      }\n\n      this._flushTime = now();\n    }\n  }\n\n  get started() {\n    return this._started;\n  }\n  private _started = false;\n  private _timingEvents: EventRecord[];\n\n  private readonly _maxNumberEvents: number;\n\n  private readonly _flushBatchSize: number;\n  private readonly _flushIntervalInMilliseconds: number;\n\n  private _flushTime: number;\n  private _flushPointer = 0;\n}\n\n/**\n * returns a number to represent the current timestamp in a resolution as high as possible.\n */\nexport const now = typeof performance !== 'undefined' && performance.now ? () => performance.now() : Date.now;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from './graph';\nimport { OperatorImplementation, OperatorInitialization } from './operators';\n\nexport interface OpSet {\n  domain: string;\n  version: number;\n}\nexport declare namespace OpSet {\n  /**\n   * Domain of an opset, it can be an empty string(default value, represent for ai.onnx), or 'ai.onnx.ml'\n   */\n  type Domain = '' | 'ai.onnx.ml' | 'com.microsoft';\n  /**\n   * A resolve rule consists of 4 or 5 items: opType, opSetDomain, versionSelector, operatorImplementation and\n   * operatorInitialization (optional)\n   */\n  type ResolveRule =\n    | [string, Domain, string, OperatorImplementation<Graph.Node>]\n    | [string, Domain, string, OperatorImplementation<unknown>, OperatorInitialization<unknown>];\n}\n\nexport function resolveOperator(node: Graph.Node, opsets: readonly OpSet[], rules: readonly OpSet.ResolveRule[]) {\n  for (const rule of rules) {\n    const opType = rule[0];\n    const domain = rule[1];\n    const versionSelector = rule[2];\n    const opImpl = rule[3];\n    const opInit = rule[4];\n\n    if (node.opType === opType) {\n      // operator type matches\n      for (const opset of opsets) {\n        // opset '' and 'ai.onnx' are considered the same.\n        if (opset.domain === domain || (opset.domain === 'ai.onnx' && domain === '')) {\n          // opset domain found\n          if (matchSelector(opset.version, versionSelector)) {\n            return { opImpl, opInit };\n          }\n        }\n      }\n    }\n  }\n\n  throw new TypeError(\n    `cannot resolve operator '${node.opType}' with opsets: ${opsets\n      .map((set) => `${set.domain || 'ai.onnx'} v${set.version}`)\n      .join(', ')}`,\n  );\n}\n\nfunction matchSelector(version: number, selector: string): boolean {\n  if (selector.endsWith('+')) {\n    // minimum version match ('7+' expects version>=7)\n    const rangeStart = Number.parseInt(selector.substring(0, selector.length - 1), 10);\n    return !isNaN(rangeStart) && rangeStart <= version;\n  } else if (selector.split('-').length === 2) {\n    // range match ('6-8' expects 6<=version<=8)\n    const pair = selector.split('-');\n    const rangeStart = Number.parseInt(pair[0], 10);\n    const rangeEnd = Number.parseInt(pair[1], 10);\n    return !isNaN(rangeStart) && !isNaN(rangeEnd) && rangeStart <= version && version <= rangeEnd;\n  } else {\n    // exact match ('7' expects version===7)\n    return Number.parseInt(selector, 10) === version;\n  }\n}\n", "\"use strict\";\r\nexports.__esModule = true;\r\nvar Guid = /** @class */ (function () {\r\n    function Guid(guid) {\r\n        if (!guid) {\r\n            throw new TypeError(\"Invalid argument; `value` has no value.\");\r\n        }\r\n        this.value = Guid.EMPTY;\r\n        if (guid && Guid.isGuid(guid)) {\r\n            this.value = guid;\r\n        }\r\n    }\r\n    Guid.isGuid = function (guid) {\r\n        var value = guid.toString();\r\n        return guid && (guid instanceof Guid || Guid.validator.test(value));\r\n    };\r\n    Guid.create = function () {\r\n        return new Guid([Guid.gen(2), Guid.gen(1), Guid.gen(1), Guid.gen(1), Guid.gen(3)].join(\"-\"));\r\n    };\r\n    Guid.createEmpty = function () {\r\n        return new Guid(\"emptyguid\");\r\n    };\r\n    Guid.parse = function (guid) {\r\n        return new Guid(guid);\r\n    };\r\n    Guid.raw = function () {\r\n        return [Guid.gen(2), Guid.gen(1), Guid.gen(1), Guid.gen(1), Guid.gen(3)].join(\"-\");\r\n    };\r\n    Guid.gen = function (count) {\r\n        var out = \"\";\r\n        for (var i = 0; i < count; i++) {\r\n            // tslint:disable-next-line:no-bitwise\r\n            out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n        }\r\n        return out;\r\n    };\r\n    Guid.prototype.equals = function (other) {\r\n        // Comparing string `value` against provided `guid` will auto-call\r\n        // toString on `guid` for comparison\r\n        return Guid.isGuid(other) && this.value === other.toString();\r\n    };\r\n    Guid.prototype.isEmpty = function () {\r\n        return this.value === Guid.EMPTY;\r\n    };\r\n    Guid.prototype.toString = function () {\r\n        return this.value;\r\n    };\r\n    Guid.prototype.toJSON = function () {\r\n        return {\r\n            value: this.value\r\n        };\r\n    };\r\n    Guid.validator = new RegExp(\"^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$\", \"i\");\r\n    Guid.EMPTY = \"00000000-0000-0000-0000-000000000000\";\r\n    return Guid;\r\n}());\r\nexports.Guid = Guid;\r\n", "/**\n * @license\n * Copyright 2009 The Closure Library Authors\n * Copyright 2020 Daniel Wirtz / The long.js Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// WebAssembly optimizations to do native i64 multiplication and divide\nvar wasm = null;\ntry {\n  wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n    0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n  ])), {}).exports;\n} catch (e) {\n  // no wasm support :(\n}\n\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n *  See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nfunction Long(low, high, unsigned) {\n\n  /**\n   * The low 32 bits as a signed value.\n   * @type {number}\n   */\n  this.low = low | 0;\n\n  /**\n   * The high 32 bits as a signed value.\n   * @type {number}\n   */\n  this.high = high | 0;\n\n  /**\n   * Whether unsigned or not.\n   * @type {boolean}\n   */\n  this.unsigned = !!unsigned;\n}\n\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations.  For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative).  Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\n\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nfunction isLong(obj) {\n  return (obj && obj[\"__isLong__\"]) === true;\n}\n\n/**\n * @function\n * @param {*} value number\n * @returns {number}\n * @inner\n */\nfunction ctz32(value) {\n  var c = Math.clz32(value & -value);\n  return value ? 31 - c : c;\n}\n\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\nLong.isLong = isLong;\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromInt(value, unsigned) {\n  var obj, cachedObj, cache;\n  if (unsigned) {\n    value >>>= 0;\n    if (cache = (0 <= value && value < 256)) {\n      cachedObj = UINT_CACHE[value];\n      if (cachedObj)\n        return cachedObj;\n    }\n    obj = fromBits(value, 0, true);\n    if (cache)\n      UINT_CACHE[value] = obj;\n    return obj;\n  } else {\n    value |= 0;\n    if (cache = (-128 <= value && value < 128)) {\n      cachedObj = INT_CACHE[value];\n      if (cachedObj)\n        return cachedObj;\n    }\n    obj = fromBits(value, value < 0 ? -1 : 0, false);\n    if (cache)\n      INT_CACHE[value] = obj;\n    return obj;\n  }\n}\n\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromInt = fromInt;\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromNumber(value, unsigned) {\n  if (isNaN(value))\n    return unsigned ? UZERO : ZERO;\n  if (unsigned) {\n    if (value < 0)\n      return UZERO;\n    if (value >= TWO_PWR_64_DBL)\n      return MAX_UNSIGNED_VALUE;\n  } else {\n    if (value <= -TWO_PWR_63_DBL)\n      return MIN_VALUE;\n    if (value + 1 >= TWO_PWR_63_DBL)\n      return MAX_VALUE;\n  }\n  if (value < 0)\n    return fromNumber(-value, unsigned).neg();\n  return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromNumber = fromNumber;\n\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromBits(lowBits, highBits, unsigned) {\n  return new Long(lowBits, highBits, unsigned);\n}\n\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n *  assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromBits = fromBits;\n\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nfunction fromString(str, unsigned, radix) {\n  if (str.length === 0)\n    throw Error('empty string');\n  if (typeof unsigned === 'number') {\n    // For goog.math.long compatibility\n    radix = unsigned;\n    unsigned = false;\n  } else {\n    unsigned = !!unsigned;\n  }\n  if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n    return unsigned ? UZERO : ZERO;\n  radix = radix || 10;\n  if (radix < 2 || 36 < radix)\n    throw RangeError('radix');\n\n  var p;\n  if ((p = str.indexOf('-')) > 0)\n    throw Error('interior hyphen');\n  else if (p === 0) {\n    return fromString(str.substring(1), unsigned, radix).neg();\n  }\n\n  // Do several (8) digits each time through the loop, so as to\n  // minimize the calls to the very expensive emulated div.\n  var radixToPower = fromNumber(pow_dbl(radix, 8));\n\n  var result = ZERO;\n  for (var i = 0; i < str.length; i += 8) {\n    var size = Math.min(8, str.length - i),\n      value = parseInt(str.substring(i, i + size), radix);\n    if (size < 8) {\n      var power = fromNumber(pow_dbl(radix, size));\n      result = result.mul(power).add(fromNumber(value));\n    } else {\n      result = result.mul(radixToPower);\n      result = result.add(fromNumber(value));\n    }\n  }\n  result.unsigned = unsigned;\n  return result;\n}\n\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\nLong.fromString = fromString;\n\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromValue(val, unsigned) {\n  if (typeof val === 'number')\n    return fromNumber(val, unsigned);\n  if (typeof val === 'string')\n    return fromString(val, unsigned);\n  // Throws for non-objects, converts non-instanceof Long:\n  return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\nLong.fromValue = fromValue;\n\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ZERO = fromInt(0);\n\n/**\n * Signed zero.\n * @type {!Long}\n */\nLong.ZERO = ZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UZERO = fromInt(0, true);\n\n/**\n * Unsigned zero.\n * @type {!Long}\n */\nLong.UZERO = UZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ONE = fromInt(1);\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UONE = fromInt(1, true);\n\n/**\n * Unsigned one.\n * @type {!Long}\n */\nLong.UONE = UONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar NEG_ONE = fromInt(-1);\n\n/**\n * Signed negative one.\n * @type {!Long}\n */\nLong.NEG_ONE = NEG_ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n\n/**\n * Maximum signed value.\n * @type {!Long}\n */\nLong.MAX_VALUE = MAX_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n\n/**\n * Minimum signed value.\n * @type {!Long}\n */\nLong.MIN_VALUE = MIN_VALUE;\n\n/**\n * @alias Long.prototype\n * @inner\n */\nvar LongPrototype = Long.prototype;\n\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toInt = function toInt() {\n  return this.unsigned ? this.low >>> 0 : this.low;\n};\n\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toNumber = function toNumber() {\n  if (this.unsigned)\n    return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\n  return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nLongPrototype.toString = function toString(radix) {\n  radix = radix || 10;\n  if (radix < 2 || 36 < radix)\n    throw RangeError('radix');\n  if (this.isZero())\n    return '0';\n  if (this.isNegative()) { // Unsigned Longs are never negative\n    if (this.eq(MIN_VALUE)) {\n      // We need to change the Long value before it can be negated, so we remove\n      // the bottom-most digit in this base and then recurse to do the rest.\n      var radixLong = fromNumber(radix),\n        div = this.div(radixLong),\n        rem1 = div.mul(radixLong).sub(this);\n      return div.toString(radix) + rem1.toInt().toString(radix);\n    } else\n      return '-' + this.neg().toString(radix);\n  }\n\n  // Do several (6) digits each time through the loop, so as to\n  // minimize the calls to the very expensive emulated div.\n  var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n    rem = this;\n  var result = '';\n  while (true) {\n    var remDiv = rem.div(radixToPower),\n      intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n      digits = intval.toString(radix);\n    rem = remDiv;\n    if (rem.isZero())\n      return digits + result;\n    else {\n      while (digits.length < 6)\n        digits = '0' + digits;\n      result = '' + digits + result;\n    }\n  }\n};\n\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nLongPrototype.getHighBits = function getHighBits() {\n  return this.high;\n};\n\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n  return this.high >>> 0;\n};\n\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nLongPrototype.getLowBits = function getLowBits() {\n  return this.low;\n};\n\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n  return this.low >>> 0;\n};\n\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n  if (this.isNegative()) // Unsigned Longs are never negative\n    return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n  var val = this.high != 0 ? this.high : this.low;\n  for (var bit = 31; bit > 0; bit--)\n    if ((val & (1 << bit)) != 0)\n      break;\n  return this.high != 0 ? bit + 33 : bit + 1;\n};\n\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isZero = function isZero() {\n  return this.high === 0 && this.low === 0;\n};\n\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\nLongPrototype.eqz = LongPrototype.isZero;\n\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isNegative = function isNegative() {\n  return !this.unsigned && this.high < 0;\n};\n\n/**\n * Tests if this Long's value is positive or zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isPositive = function isPositive() {\n  return this.unsigned || this.high >= 0;\n};\n\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isOdd = function isOdd() {\n  return (this.low & 1) === 1;\n};\n\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isEven = function isEven() {\n  return (this.low & 1) === 0;\n};\n\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.equals = function equals(other) {\n  if (!isLong(other))\n    other = fromValue(other);\n  if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n    return false;\n  return this.high === other.high && this.low === other.low;\n};\n\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.eq = LongPrototype.equals;\n\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.notEquals = function notEquals(other) {\n  return !this.eq(/* validates */ other);\n};\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.neq = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ne = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThan = function lessThan(other) {\n  return this.comp(/* validates */ other) < 0;\n};\n\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lt = LongPrototype.lessThan;\n\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n  return this.comp(/* validates */ other) <= 0;\n};\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThan = function greaterThan(other) {\n  return this.comp(/* validates */ other) > 0;\n};\n\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gt = LongPrototype.greaterThan;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n  return this.comp(/* validates */ other) >= 0;\n};\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n *  if the given one is greater\n */\nLongPrototype.compare = function compare(other) {\n  if (!isLong(other))\n    other = fromValue(other);\n  if (this.eq(other))\n    return 0;\n  var thisNeg = this.isNegative(),\n    otherNeg = other.isNegative();\n  if (thisNeg && !otherNeg)\n    return -1;\n  if (!thisNeg && otherNeg)\n    return 1;\n  // At this point the sign bits are the same\n  if (!this.unsigned)\n    return this.sub(other).isNegative() ? -1 : 1;\n  // Both are positive if at least one is unsigned\n  return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\n};\n\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n *  if the given one is greater\n */\nLongPrototype.comp = LongPrototype.compare;\n\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nLongPrototype.negate = function negate() {\n  if (!this.unsigned && this.eq(MIN_VALUE))\n    return MIN_VALUE;\n  return this.not().add(ONE);\n};\n\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\nLongPrototype.neg = LongPrototype.negate;\n\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nLongPrototype.add = function add(addend) {\n  if (!isLong(addend))\n    addend = fromValue(addend);\n\n  // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n  var a48 = this.high >>> 16;\n  var a32 = this.high & 0xFFFF;\n  var a16 = this.low >>> 16;\n  var a00 = this.low & 0xFFFF;\n\n  var b48 = addend.high >>> 16;\n  var b32 = addend.high & 0xFFFF;\n  var b16 = addend.low >>> 16;\n  var b00 = addend.low & 0xFFFF;\n\n  var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n  c00 += a00 + b00;\n  c16 += c00 >>> 16;\n  c00 &= 0xFFFF;\n  c16 += a16 + b16;\n  c32 += c16 >>> 16;\n  c16 &= 0xFFFF;\n  c32 += a32 + b32;\n  c48 += c32 >>> 16;\n  c32 &= 0xFFFF;\n  c48 += a48 + b48;\n  c48 &= 0xFFFF;\n  return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.subtract = function subtract(subtrahend) {\n  if (!isLong(subtrahend))\n    subtrahend = fromValue(subtrahend);\n  return this.add(subtrahend.neg());\n};\n\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.sub = LongPrototype.subtract;\n\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.multiply = function multiply(multiplier) {\n  if (this.isZero())\n    return this;\n  if (!isLong(multiplier))\n    multiplier = fromValue(multiplier);\n\n  // use wasm support if present\n  if (wasm) {\n    var low = wasm[\"mul\"](this.low,\n      this.high,\n      multiplier.low,\n      multiplier.high);\n    return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n  }\n\n  if (multiplier.isZero())\n    return this.unsigned ? UZERO : ZERO;\n  if (this.eq(MIN_VALUE))\n    return multiplier.isOdd() ? MIN_VALUE : ZERO;\n  if (multiplier.eq(MIN_VALUE))\n    return this.isOdd() ? MIN_VALUE : ZERO;\n\n  if (this.isNegative()) {\n    if (multiplier.isNegative())\n      return this.neg().mul(multiplier.neg());\n    else\n      return this.neg().mul(multiplier).neg();\n  } else if (multiplier.isNegative())\n    return this.mul(multiplier.neg()).neg();\n\n  // If both longs are small, use float multiplication\n  if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n    return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\n\n  // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n  // We can skip products that would overflow.\n\n  var a48 = this.high >>> 16;\n  var a32 = this.high & 0xFFFF;\n  var a16 = this.low >>> 16;\n  var a00 = this.low & 0xFFFF;\n\n  var b48 = multiplier.high >>> 16;\n  var b32 = multiplier.high & 0xFFFF;\n  var b16 = multiplier.low >>> 16;\n  var b00 = multiplier.low & 0xFFFF;\n\n  var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n  c00 += a00 * b00;\n  c16 += c00 >>> 16;\n  c00 &= 0xFFFF;\n  c16 += a16 * b00;\n  c32 += c16 >>> 16;\n  c16 &= 0xFFFF;\n  c16 += a00 * b16;\n  c32 += c16 >>> 16;\n  c16 &= 0xFFFF;\n  c32 += a32 * b00;\n  c48 += c32 >>> 16;\n  c32 &= 0xFFFF;\n  c32 += a16 * b16;\n  c48 += c32 >>> 16;\n  c32 &= 0xFFFF;\n  c32 += a00 * b32;\n  c48 += c32 >>> 16;\n  c32 &= 0xFFFF;\n  c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n  c48 &= 0xFFFF;\n  return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.mul = LongPrototype.multiply;\n\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n *  unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.divide = function divide(divisor) {\n  if (!isLong(divisor))\n    divisor = fromValue(divisor);\n  if (divisor.isZero())\n    throw Error('division by zero');\n\n  // use wasm support if present\n  if (wasm) {\n    // guard against signed division overflow: the largest\n    // negative number / -1 would be 1 larger than the largest\n    // positive number, due to two's complement.\n    if (!this.unsigned &&\n      this.high === -0x80000000 &&\n      divisor.low === -1 && divisor.high === -1) {\n      // be consistent with non-wasm code path\n      return this;\n    }\n    var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n      this.low,\n      this.high,\n      divisor.low,\n      divisor.high\n    );\n    return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n  }\n\n  if (this.isZero())\n    return this.unsigned ? UZERO : ZERO;\n  var approx, rem, res;\n  if (!this.unsigned) {\n    // This section is only relevant for signed longs and is derived from the\n    // closure library as a whole.\n    if (this.eq(MIN_VALUE)) {\n      if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n        return MIN_VALUE;  // recall that -MIN_VALUE == MIN_VALUE\n      else if (divisor.eq(MIN_VALUE))\n        return ONE;\n      else {\n        // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n        var halfThis = this.shr(1);\n        approx = halfThis.div(divisor).shl(1);\n        if (approx.eq(ZERO)) {\n          return divisor.isNegative() ? ONE : NEG_ONE;\n        } else {\n          rem = this.sub(divisor.mul(approx));\n          res = approx.add(rem.div(divisor));\n          return res;\n        }\n      }\n    } else if (divisor.eq(MIN_VALUE))\n      return this.unsigned ? UZERO : ZERO;\n    if (this.isNegative()) {\n      if (divisor.isNegative())\n        return this.neg().div(divisor.neg());\n      return this.neg().div(divisor).neg();\n    } else if (divisor.isNegative())\n      return this.div(divisor.neg()).neg();\n    res = ZERO;\n  } else {\n    // The algorithm below has not been made for unsigned longs. It's therefore\n    // required to take special care of the MSB prior to running it.\n    if (!divisor.unsigned)\n      divisor = divisor.toUnsigned();\n    if (divisor.gt(this))\n      return UZERO;\n    if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n      return UONE;\n    res = UZERO;\n  }\n\n  // Repeat the following until the remainder is less than other:  find a\n  // floating-point that approximates remainder / other *from below*, add this\n  // into the result, and subtract it from the remainder.  It is critical that\n  // the approximate value is less than or equal to the real value so that the\n  // remainder never becomes negative.\n  rem = this;\n  while (rem.gte(divisor)) {\n    // Approximate the result of division. This may be a little greater or\n    // smaller than the actual value.\n    approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n    // We will tweak the approximate result by changing it in the 48-th digit or\n    // the smallest non-fractional digit, whichever is larger.\n    var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n      delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\n\n      // Decrease the approximation until it is smaller than the remainder.  Note\n      // that if it is too large, the product overflows and is negative.\n      approxRes = fromNumber(approx),\n      approxRem = approxRes.mul(divisor);\n    while (approxRem.isNegative() || approxRem.gt(rem)) {\n      approx -= delta;\n      approxRes = fromNumber(approx, this.unsigned);\n      approxRem = approxRes.mul(divisor);\n    }\n\n    // We know the answer can't be zero... and actually, zero would cause\n    // infinite recursion since we would make no progress.\n    if (approxRes.isZero())\n      approxRes = ONE;\n\n    res = res.add(approxRes);\n    rem = rem.sub(approxRem);\n  }\n  return res;\n};\n\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.div = LongPrototype.divide;\n\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.modulo = function modulo(divisor) {\n  if (!isLong(divisor))\n    divisor = fromValue(divisor);\n\n  // use wasm support if present\n  if (wasm) {\n    var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n      this.low,\n      this.high,\n      divisor.low,\n      divisor.high\n    );\n    return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n  }\n\n  return this.sub(this.div(divisor).mul(divisor));\n};\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.mod = LongPrototype.modulo;\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.rem = LongPrototype.modulo;\n\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nLongPrototype.not = function not() {\n  return fromBits(~this.low, ~this.high, this.unsigned);\n};\n\n/**\n * Returns count leading zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countLeadingZeros = function countLeadingZeros() {\n  return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;\n};\n\n/**\n * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.clz = LongPrototype.countLeadingZeros;\n\n/**\n * Returns count trailing zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countTrailingZeros = function countTrailingZeros() {\n  return this.low ? ctz32(this.low) : ctz32(this.high) + 32;\n};\n\n/**\n * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.ctz = LongPrototype.countTrailingZeros;\n\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.and = function and(other) {\n  if (!isLong(other))\n    other = fromValue(other);\n  return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.or = function or(other) {\n  if (!isLong(other))\n    other = fromValue(other);\n  return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.xor = function xor(other) {\n  if (!isLong(other))\n    other = fromValue(other);\n  return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n  if (isLong(numBits))\n    numBits = numBits.toInt();\n  if ((numBits &= 63) === 0)\n    return this;\n  else if (numBits < 32)\n    return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\n  else\n    return fromBits(0, this.low << (numBits - 32), this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shl = LongPrototype.shiftLeft;\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRight = function shiftRight(numBits) {\n  if (isLong(numBits))\n    numBits = numBits.toInt();\n  if ((numBits &= 63) === 0)\n    return this;\n  else if (numBits < 32)\n    return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\n  else\n    return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\n};\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr = LongPrototype.shiftRight;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n  if (isLong(numBits)) numBits = numBits.toInt();\n  if ((numBits &= 63) === 0) return this;\n  if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned);\n  if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n  return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n};\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateLeft = function rotateLeft(numBits) {\n  var b;\n  if (isLong(numBits)) numBits = numBits.toInt();\n  if ((numBits &= 63) === 0) return this;\n  if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n  if (numBits < 32) {\n    b = (32 - numBits);\n    return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n  }\n  numBits -= 32;\n  b = (32 - numBits);\n  return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotl = LongPrototype.rotateLeft;\n\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateRight = function rotateRight(numBits) {\n  var b;\n  if (isLong(numBits)) numBits = numBits.toInt();\n  if ((numBits &= 63) === 0) return this;\n  if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n  if (numBits < 32) {\n    b = (32 - numBits);\n    return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n  }\n  numBits -= 32;\n  b = (32 - numBits);\n  return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotr = LongPrototype.rotateRight;\n\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nLongPrototype.toSigned = function toSigned() {\n  if (!this.unsigned)\n    return this;\n  return fromBits(this.low, this.high, false);\n};\n\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nLongPrototype.toUnsigned = function toUnsigned() {\n  if (this.unsigned)\n    return this;\n  return fromBits(this.low, this.high, true);\n};\n\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.<number>} Byte representation\n */\nLongPrototype.toBytes = function toBytes(le) {\n  return le ? this.toBytesLE() : this.toBytesBE();\n};\n\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.<number>} Little endian byte representation\n */\nLongPrototype.toBytesLE = function toBytesLE() {\n  var hi = this.high,\n    lo = this.low;\n  return [\n    lo & 0xff,\n    lo >>> 8 & 0xff,\n    lo >>> 16 & 0xff,\n    lo >>> 24,\n    hi & 0xff,\n    hi >>> 8 & 0xff,\n    hi >>> 16 & 0xff,\n    hi >>> 24\n  ];\n};\n\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.<number>} Big endian byte representation\n */\nLongPrototype.toBytesBE = function toBytesBE() {\n  var hi = this.high,\n    lo = this.low;\n  return [\n    hi >>> 24,\n    hi >>> 16 & 0xff,\n    hi >>> 8 & 0xff,\n    hi & 0xff,\n    lo >>> 24,\n    lo >>> 16 & 0xff,\n    lo >>> 8 & 0xff,\n    lo & 0xff\n  ];\n};\n\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.<number>} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n  return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.<number>} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n  return new Long(\n    bytes[0] |\n    bytes[1] << 8 |\n    bytes[2] << 16 |\n    bytes[3] << 24,\n    bytes[4] |\n    bytes[5] << 8 |\n    bytes[6] << 16 |\n    bytes[7] << 24,\n    unsigned\n  );\n};\n\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.<number>} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n  return new Long(\n    bytes[4] << 24 |\n    bytes[5] << 16 |\n    bytes[6] << 8 |\n    bytes[7],\n    bytes[0] << 24 |\n    bytes[1] << 16 |\n    bytes[2] << 8 |\n    bytes[3],\n    unsigned\n  );\n};\n\nexport default Long;\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nexport enum ArgType {\n  INPUT = 0,\n  OUTPUT = 1,\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SIZE_PREFIX_LENGTH = exports.FILE_IDENTIFIER_LENGTH = exports.SIZEOF_INT = exports.SIZEOF_SHORT = void 0;\nexports.SIZEOF_SHORT = 2;\nexports.SIZEOF_INT = 4;\nexports.FILE_IDENTIFIER_LENGTH = 4;\nexports.SIZE_PREFIX_LENGTH = 4;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isLittleEndian = exports.float64 = exports.float32 = exports.int32 = void 0;\nexports.int32 = new Int32Array(2);\nexports.float32 = new Float32Array(exports.int32.buffer);\nexports.float64 = new Float64Array(exports.int32.buffer);\nexports.isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Encoding = void 0;\nvar Encoding;\n(function (Encoding) {\n    Encoding[Encoding[\"UTF8_BYTES\"] = 1] = \"UTF8_BYTES\";\n    Encoding[Encoding[\"UTF16_STRING\"] = 2] = \"UTF16_STRING\";\n})(Encoding || (exports.Encoding = Encoding = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ByteBuffer = void 0;\nconst constants_js_1 = require(\"./constants.js\");\nconst utils_js_1 = require(\"./utils.js\");\nconst encoding_js_1 = require(\"./encoding.js\");\nclass ByteBuffer {\n    /**\n     * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)\n     */\n    constructor(bytes_) {\n        this.bytes_ = bytes_;\n        this.position_ = 0;\n        this.text_decoder_ = new TextDecoder();\n    }\n    /**\n     * Create and allocate a new ByteBuffer with a given size.\n     */\n    static allocate(byte_size) {\n        return new ByteBuffer(new Uint8Array(byte_size));\n    }\n    clear() {\n        this.position_ = 0;\n    }\n    /**\n     * Get the underlying `Uint8Array`.\n     */\n    bytes() {\n        return this.bytes_;\n    }\n    /**\n     * Get the buffer's position.\n     */\n    position() {\n        return this.position_;\n    }\n    /**\n     * Set the buffer's position.\n     */\n    setPosition(position) {\n        this.position_ = position;\n    }\n    /**\n     * Get the buffer's capacity.\n     */\n    capacity() {\n        return this.bytes_.length;\n    }\n    readInt8(offset) {\n        return this.readUint8(offset) << 24 >> 24;\n    }\n    readUint8(offset) {\n        return this.bytes_[offset];\n    }\n    readInt16(offset) {\n        return this.readUint16(offset) << 16 >> 16;\n    }\n    readUint16(offset) {\n        return this.bytes_[offset] | this.bytes_[offset + 1] << 8;\n    }\n    readInt32(offset) {\n        return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;\n    }\n    readUint32(offset) {\n        return this.readInt32(offset) >>> 0;\n    }\n    readInt64(offset) {\n        return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));\n    }\n    readUint64(offset) {\n        return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));\n    }\n    readFloat32(offset) {\n        utils_js_1.int32[0] = this.readInt32(offset);\n        return utils_js_1.float32[0];\n    }\n    readFloat64(offset) {\n        utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1] = this.readInt32(offset);\n        utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);\n        return utils_js_1.float64[0];\n    }\n    writeInt8(offset, value) {\n        this.bytes_[offset] = value;\n    }\n    writeUint8(offset, value) {\n        this.bytes_[offset] = value;\n    }\n    writeInt16(offset, value) {\n        this.bytes_[offset] = value;\n        this.bytes_[offset + 1] = value >> 8;\n    }\n    writeUint16(offset, value) {\n        this.bytes_[offset] = value;\n        this.bytes_[offset + 1] = value >> 8;\n    }\n    writeInt32(offset, value) {\n        this.bytes_[offset] = value;\n        this.bytes_[offset + 1] = value >> 8;\n        this.bytes_[offset + 2] = value >> 16;\n        this.bytes_[offset + 3] = value >> 24;\n    }\n    writeUint32(offset, value) {\n        this.bytes_[offset] = value;\n        this.bytes_[offset + 1] = value >> 8;\n        this.bytes_[offset + 2] = value >> 16;\n        this.bytes_[offset + 3] = value >> 24;\n    }\n    writeInt64(offset, value) {\n        this.writeInt32(offset, Number(BigInt.asIntN(32, value)));\n        this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));\n    }\n    writeUint64(offset, value) {\n        this.writeUint32(offset, Number(BigInt.asUintN(32, value)));\n        this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));\n    }\n    writeFloat32(offset, value) {\n        utils_js_1.float32[0] = value;\n        this.writeInt32(offset, utils_js_1.int32[0]);\n    }\n    writeFloat64(offset, value) {\n        utils_js_1.float64[0] = value;\n        this.writeInt32(offset, utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1]);\n        this.writeInt32(offset + 4, utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0]);\n    }\n    /**\n     * Return the file identifier.   Behavior is undefined for FlatBuffers whose\n     * schema does not include a file_identifier (likely points at padding or the\n     * start of a the root vtable).\n     */\n    getBufferIdentifier() {\n        if (this.bytes_.length < this.position_ + constants_js_1.SIZEOF_INT +\n            constants_js_1.FILE_IDENTIFIER_LENGTH) {\n            throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');\n        }\n        let result = \"\";\n        for (let i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {\n            result += String.fromCharCode(this.readInt8(this.position_ + constants_js_1.SIZEOF_INT + i));\n        }\n        return result;\n    }\n    /**\n     * Look up a field in the vtable, return an offset into the object, or 0 if the\n     * field is not present.\n     */\n    __offset(bb_pos, vtable_offset) {\n        const vtable = bb_pos - this.readInt32(bb_pos);\n        return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;\n    }\n    /**\n     * Initialize any Table-derived type to point to the union at the given offset.\n     */\n    __union(t, offset) {\n        t.bb_pos = offset + this.readInt32(offset);\n        t.bb = this;\n        return t;\n    }\n    /**\n     * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.\n     * This allocates a new string and converts to wide chars upon each access.\n     *\n     * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the\n     * \"optionalEncoding\" argument. This is useful for avoiding conversion when\n     * the data will just be packaged back up in another FlatBuffer later on.\n     *\n     * @param offset\n     * @param opt_encoding Defaults to UTF16_STRING\n     */\n    __string(offset, opt_encoding) {\n        offset += this.readInt32(offset);\n        const length = this.readInt32(offset);\n        offset += constants_js_1.SIZEOF_INT;\n        const utf8bytes = this.bytes_.subarray(offset, offset + length);\n        if (opt_encoding === encoding_js_1.Encoding.UTF8_BYTES)\n            return utf8bytes;\n        else\n            return this.text_decoder_.decode(utf8bytes);\n    }\n    /**\n     * Handle unions that can contain string as its member, if a Table-derived type then initialize it,\n     * if a string then return a new one\n     *\n     * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this\n     * makes the behaviour of __union_with_string different compared to __union\n     */\n    __union_with_string(o, offset) {\n        if (typeof o === 'string') {\n            return this.__string(offset);\n        }\n        return this.__union(o, offset);\n    }\n    /**\n     * Retrieve the relative offset stored at \"offset\"\n     */\n    __indirect(offset) {\n        return offset + this.readInt32(offset);\n    }\n    /**\n     * Get the start of data of a vector whose offset is stored at \"offset\" in this object.\n     */\n    __vector(offset) {\n        return offset + this.readInt32(offset) + constants_js_1.SIZEOF_INT; // data starts after the length\n    }\n    /**\n     * Get the length of a vector whose offset is stored at \"offset\" in this object.\n     */\n    __vector_len(offset) {\n        return this.readInt32(offset + this.readInt32(offset));\n    }\n    __has_identifier(ident) {\n        if (ident.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {\n            throw new Error('FlatBuffers: file identifier must be length ' +\n                constants_js_1.FILE_IDENTIFIER_LENGTH);\n        }\n        for (let i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {\n            if (ident.charCodeAt(i) != this.readInt8(this.position() + constants_js_1.SIZEOF_INT + i)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    /**\n     * A helper function for generating list for obj api\n     */\n    createScalarList(listAccessor, listLength) {\n        const ret = [];\n        for (let i = 0; i < listLength; ++i) {\n            const val = listAccessor(i);\n            if (val !== null) {\n                ret.push(val);\n            }\n        }\n        return ret;\n    }\n    /**\n     * A helper function for generating list for obj api\n     * @param listAccessor function that accepts an index and return data at that index\n     * @param listLength listLength\n     * @param res result list\n     */\n    createObjList(listAccessor, listLength) {\n        const ret = [];\n        for (let i = 0; i < listLength; ++i) {\n            const val = listAccessor(i);\n            if (val !== null) {\n                ret.push(val.unpack());\n            }\n        }\n        return ret;\n    }\n}\nexports.ByteBuffer = ByteBuffer;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Builder = void 0;\nconst byte_buffer_js_1 = require(\"./byte-buffer.js\");\nconst constants_js_1 = require(\"./constants.js\");\nclass Builder {\n    /**\n     * Create a FlatBufferBuilder.\n     */\n    constructor(opt_initial_size) {\n        /** Minimum alignment encountered so far. */\n        this.minalign = 1;\n        /** The vtable for the current table. */\n        this.vtable = null;\n        /** The amount of fields we're actually using. */\n        this.vtable_in_use = 0;\n        /** Whether we are currently serializing a table. */\n        this.isNested = false;\n        /** Starting offset of the current struct/table. */\n        this.object_start = 0;\n        /** List of offsets of all vtables. */\n        this.vtables = [];\n        /** For the current vector being built. */\n        this.vector_num_elems = 0;\n        /** False omits default values from the serialized data */\n        this.force_defaults = false;\n        this.string_maps = null;\n        this.text_encoder = new TextEncoder();\n        let initial_size;\n        if (!opt_initial_size) {\n            initial_size = 1024;\n        }\n        else {\n            initial_size = opt_initial_size;\n        }\n        /**\n         * @type {ByteBuffer}\n         * @private\n         */\n        this.bb = byte_buffer_js_1.ByteBuffer.allocate(initial_size);\n        this.space = initial_size;\n    }\n    clear() {\n        this.bb.clear();\n        this.space = this.bb.capacity();\n        this.minalign = 1;\n        this.vtable = null;\n        this.vtable_in_use = 0;\n        this.isNested = false;\n        this.object_start = 0;\n        this.vtables = [];\n        this.vector_num_elems = 0;\n        this.force_defaults = false;\n        this.string_maps = null;\n    }\n    /**\n     * In order to save space, fields that are set to their default value\n     * don't get serialized into the buffer. Forcing defaults provides a\n     * way to manually disable this optimization.\n     *\n     * @param forceDefaults true always serializes default values\n     */\n    forceDefaults(forceDefaults) {\n        this.force_defaults = forceDefaults;\n    }\n    /**\n     * Get the ByteBuffer representing the FlatBuffer. Only call this after you've\n     * called finish(). The actual data starts at the ByteBuffer's current position,\n     * not necessarily at 0.\n     */\n    dataBuffer() {\n        return this.bb;\n    }\n    /**\n     * Get the bytes representing the FlatBuffer. Only call this after you've\n     * called finish().\n     */\n    asUint8Array() {\n        return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());\n    }\n    /**\n     * Prepare to write an element of `size` after `additional_bytes` have been\n     * written, e.g. if you write a string, you need to align such the int length\n     * field is aligned to 4 bytes, and the string data follows it directly. If all\n     * you need to do is alignment, `additional_bytes` will be 0.\n     *\n     * @param size This is the of the new element to write\n     * @param additional_bytes The padding size\n     */\n    prep(size, additional_bytes) {\n        // Track the biggest thing we've ever aligned to.\n        if (size > this.minalign) {\n            this.minalign = size;\n        }\n        // Find the amount of alignment needed such that `size` is properly\n        // aligned after `additional_bytes`\n        const align_size = ((~(this.bb.capacity() - this.space + additional_bytes)) + 1) & (size - 1);\n        // Reallocate the buffer if needed.\n        while (this.space < align_size + size + additional_bytes) {\n            const old_buf_size = this.bb.capacity();\n            this.bb = Builder.growByteBuffer(this.bb);\n            this.space += this.bb.capacity() - old_buf_size;\n        }\n        this.pad(align_size);\n    }\n    pad(byte_size) {\n        for (let i = 0; i < byte_size; i++) {\n            this.bb.writeInt8(--this.space, 0);\n        }\n    }\n    writeInt8(value) {\n        this.bb.writeInt8(this.space -= 1, value);\n    }\n    writeInt16(value) {\n        this.bb.writeInt16(this.space -= 2, value);\n    }\n    writeInt32(value) {\n        this.bb.writeInt32(this.space -= 4, value);\n    }\n    writeInt64(value) {\n        this.bb.writeInt64(this.space -= 8, value);\n    }\n    writeFloat32(value) {\n        this.bb.writeFloat32(this.space -= 4, value);\n    }\n    writeFloat64(value) {\n        this.bb.writeFloat64(this.space -= 8, value);\n    }\n    /**\n     * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).\n     * @param value The `int8` to add the buffer.\n     */\n    addInt8(value) {\n        this.prep(1, 0);\n        this.writeInt8(value);\n    }\n    /**\n     * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).\n     * @param value The `int16` to add the buffer.\n     */\n    addInt16(value) {\n        this.prep(2, 0);\n        this.writeInt16(value);\n    }\n    /**\n     * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).\n     * @param value The `int32` to add the buffer.\n     */\n    addInt32(value) {\n        this.prep(4, 0);\n        this.writeInt32(value);\n    }\n    /**\n     * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).\n     * @param value The `int64` to add the buffer.\n     */\n    addInt64(value) {\n        this.prep(8, 0);\n        this.writeInt64(value);\n    }\n    /**\n     * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).\n     * @param value The `float32` to add the buffer.\n     */\n    addFloat32(value) {\n        this.prep(4, 0);\n        this.writeFloat32(value);\n    }\n    /**\n     * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).\n     * @param value The `float64` to add the buffer.\n     */\n    addFloat64(value) {\n        this.prep(8, 0);\n        this.writeFloat64(value);\n    }\n    addFieldInt8(voffset, value, defaultValue) {\n        if (this.force_defaults || value != defaultValue) {\n            this.addInt8(value);\n            this.slot(voffset);\n        }\n    }\n    addFieldInt16(voffset, value, defaultValue) {\n        if (this.force_defaults || value != defaultValue) {\n            this.addInt16(value);\n            this.slot(voffset);\n        }\n    }\n    addFieldInt32(voffset, value, defaultValue) {\n        if (this.force_defaults || value != defaultValue) {\n            this.addInt32(value);\n            this.slot(voffset);\n        }\n    }\n    addFieldInt64(voffset, value, defaultValue) {\n        if (this.force_defaults || value !== defaultValue) {\n            this.addInt64(value);\n            this.slot(voffset);\n        }\n    }\n    addFieldFloat32(voffset, value, defaultValue) {\n        if (this.force_defaults || value != defaultValue) {\n            this.addFloat32(value);\n            this.slot(voffset);\n        }\n    }\n    addFieldFloat64(voffset, value, defaultValue) {\n        if (this.force_defaults || value != defaultValue) {\n            this.addFloat64(value);\n            this.slot(voffset);\n        }\n    }\n    addFieldOffset(voffset, value, defaultValue) {\n        if (this.force_defaults || value != defaultValue) {\n            this.addOffset(value);\n            this.slot(voffset);\n        }\n    }\n    /**\n     * Structs are stored inline, so nothing additional is being added. `d` is always 0.\n     */\n    addFieldStruct(voffset, value, defaultValue) {\n        if (value != defaultValue) {\n            this.nested(value);\n            this.slot(voffset);\n        }\n    }\n    /**\n     * Structures are always stored inline, they need to be created right\n     * where they're used.  You'll get this assertion failure if you\n     * created it elsewhere.\n     */\n    nested(obj) {\n        if (obj != this.offset()) {\n            throw new TypeError('FlatBuffers: struct must be serialized inline.');\n        }\n    }\n    /**\n     * Should not be creating any other object, string or vector\n     * while an object is being constructed\n     */\n    notNested() {\n        if (this.isNested) {\n            throw new TypeError('FlatBuffers: object serialization must not be nested.');\n        }\n    }\n    /**\n     * Set the current vtable at `voffset` to the current location in the buffer.\n     */\n    slot(voffset) {\n        if (this.vtable !== null)\n            this.vtable[voffset] = this.offset();\n    }\n    /**\n     * @returns Offset relative to the end of the buffer.\n     */\n    offset() {\n        return this.bb.capacity() - this.space;\n    }\n    /**\n     * Doubles the size of the backing ByteBuffer and copies the old data towards\n     * the end of the new buffer (since we build the buffer backwards).\n     *\n     * @param bb The current buffer with the existing data\n     * @returns A new byte buffer with the old data copied\n     * to it. The data is located at the end of the buffer.\n     *\n     * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass\n     * it a uint8Array we need to suppress the type check:\n     * @suppress {checkTypes}\n     */\n    static growByteBuffer(bb) {\n        const old_buf_size = bb.capacity();\n        // Ensure we don't grow beyond what fits in an int.\n        if (old_buf_size & 0xC0000000) {\n            throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');\n        }\n        const new_buf_size = old_buf_size << 1;\n        const nbb = byte_buffer_js_1.ByteBuffer.allocate(new_buf_size);\n        nbb.setPosition(new_buf_size - old_buf_size);\n        nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);\n        return nbb;\n    }\n    /**\n     * Adds on offset, relative to where it will be written.\n     *\n     * @param offset The offset to add.\n     */\n    addOffset(offset) {\n        this.prep(constants_js_1.SIZEOF_INT, 0); // Ensure alignment is already done.\n        this.writeInt32(this.offset() - offset + constants_js_1.SIZEOF_INT);\n    }\n    /**\n     * Start encoding a new object in the buffer.  Users will not usually need to\n     * call this directly. The FlatBuffers compiler will generate helper methods\n     * that call this method internally.\n     */\n    startObject(numfields) {\n        this.notNested();\n        if (this.vtable == null) {\n            this.vtable = [];\n        }\n        this.vtable_in_use = numfields;\n        for (let i = 0; i < numfields; i++) {\n            this.vtable[i] = 0; // This will push additional elements as needed\n        }\n        this.isNested = true;\n        this.object_start = this.offset();\n    }\n    /**\n     * Finish off writing the object that is under construction.\n     *\n     * @returns The offset to the object inside `dataBuffer`\n     */\n    endObject() {\n        if (this.vtable == null || !this.isNested) {\n            throw new Error('FlatBuffers: endObject called without startObject');\n        }\n        this.addInt32(0);\n        const vtableloc = this.offset();\n        // Trim trailing zeroes.\n        let i = this.vtable_in_use - 1;\n        // eslint-disable-next-line no-empty\n        for (; i >= 0 && this.vtable[i] == 0; i--) { }\n        const trimmed_size = i + 1;\n        // Write out the current vtable.\n        for (; i >= 0; i--) {\n            // Offset relative to the start of the table.\n            this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);\n        }\n        const standard_fields = 2; // The fields below:\n        this.addInt16(vtableloc - this.object_start);\n        const len = (trimmed_size + standard_fields) * constants_js_1.SIZEOF_SHORT;\n        this.addInt16(len);\n        // Search for an existing vtable that matches the current one.\n        let existing_vtable = 0;\n        const vt1 = this.space;\n        outer_loop: for (i = 0; i < this.vtables.length; i++) {\n            const vt2 = this.bb.capacity() - this.vtables[i];\n            if (len == this.bb.readInt16(vt2)) {\n                for (let j = constants_js_1.SIZEOF_SHORT; j < len; j += constants_js_1.SIZEOF_SHORT) {\n                    if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {\n                        continue outer_loop;\n                    }\n                }\n                existing_vtable = this.vtables[i];\n                break;\n            }\n        }\n        if (existing_vtable) {\n            // Found a match:\n            // Remove the current vtable.\n            this.space = this.bb.capacity() - vtableloc;\n            // Point table to existing vtable.\n            this.bb.writeInt32(this.space, existing_vtable - vtableloc);\n        }\n        else {\n            // No match:\n            // Add the location of the current vtable to the list of vtables.\n            this.vtables.push(this.offset());\n            // Point table to current vtable.\n            this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);\n        }\n        this.isNested = false;\n        return vtableloc;\n    }\n    /**\n     * Finalize a buffer, poiting to the given `root_table`.\n     */\n    finish(root_table, opt_file_identifier, opt_size_prefix) {\n        const size_prefix = opt_size_prefix ? constants_js_1.SIZE_PREFIX_LENGTH : 0;\n        if (opt_file_identifier) {\n            const file_identifier = opt_file_identifier;\n            this.prep(this.minalign, constants_js_1.SIZEOF_INT +\n                constants_js_1.FILE_IDENTIFIER_LENGTH + size_prefix);\n            if (file_identifier.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {\n                throw new TypeError('FlatBuffers: file identifier must be length ' +\n                    constants_js_1.FILE_IDENTIFIER_LENGTH);\n            }\n            for (let i = constants_js_1.FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {\n                this.writeInt8(file_identifier.charCodeAt(i));\n            }\n        }\n        this.prep(this.minalign, constants_js_1.SIZEOF_INT + size_prefix);\n        this.addOffset(root_table);\n        if (size_prefix) {\n            this.addInt32(this.bb.capacity() - this.space);\n        }\n        this.bb.setPosition(this.space);\n    }\n    /**\n     * Finalize a size prefixed buffer, pointing to the given `root_table`.\n     */\n    finishSizePrefixed(root_table, opt_file_identifier) {\n        this.finish(root_table, opt_file_identifier, true);\n    }\n    /**\n     * This checks a required field has been set in a given table that has\n     * just been constructed.\n     */\n    requiredField(table, field) {\n        const table_start = this.bb.capacity() - table;\n        const vtable_start = table_start - this.bb.readInt32(table_start);\n        const ok = field < this.bb.readInt16(vtable_start) &&\n            this.bb.readInt16(vtable_start + field) != 0;\n        // If this fails, the caller will show what field needs to be set.\n        if (!ok) {\n            throw new TypeError('FlatBuffers: field ' + field + ' must be set');\n        }\n    }\n    /**\n     * Start a new array/vector of objects.  Users usually will not call\n     * this directly. The FlatBuffers compiler will create a start/end\n     * method for vector types in generated code.\n     *\n     * @param elem_size The size of each element in the array\n     * @param num_elems The number of elements in the array\n     * @param alignment The alignment of the array\n     */\n    startVector(elem_size, num_elems, alignment) {\n        this.notNested();\n        this.vector_num_elems = num_elems;\n        this.prep(constants_js_1.SIZEOF_INT, elem_size * num_elems);\n        this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.\n    }\n    /**\n     * Finish off the creation of an array and all its elements. The array must be\n     * created with `startVector`.\n     *\n     * @returns The offset at which the newly created array\n     * starts.\n     */\n    endVector() {\n        this.writeInt32(this.vector_num_elems);\n        return this.offset();\n    }\n    /**\n     * Encode the string `s` in the buffer using UTF-8. If the string passed has\n     * already been seen, we return the offset of the already written string\n     *\n     * @param s The string to encode\n     * @return The offset in the buffer where the encoded string starts\n     */\n    createSharedString(s) {\n        if (!s) {\n            return 0;\n        }\n        if (!this.string_maps) {\n            this.string_maps = new Map();\n        }\n        if (this.string_maps.has(s)) {\n            return this.string_maps.get(s);\n        }\n        const offset = this.createString(s);\n        this.string_maps.set(s, offset);\n        return offset;\n    }\n    /**\n     * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed\n     * instead of a string, it is assumed to contain valid UTF-8 encoded data.\n     *\n     * @param s The string to encode\n     * @return The offset in the buffer where the encoded string starts\n     */\n    createString(s) {\n        if (s === null || s === undefined) {\n            return 0;\n        }\n        let utf8;\n        if (s instanceof Uint8Array) {\n            utf8 = s;\n        }\n        else {\n            utf8 = this.text_encoder.encode(s);\n        }\n        this.addInt8(0);\n        this.startVector(1, utf8.length, 1);\n        this.bb.setPosition(this.space -= utf8.length);\n        this.bb.bytes().set(utf8, this.space);\n        return this.endVector();\n    }\n    /**\n     * Create a byte vector.\n     *\n     * @param v The bytes to add\n     * @returns The offset in the buffer where the byte vector starts\n     */\n    createByteVector(v) {\n        if (v === null || v === undefined) {\n            return 0;\n        }\n        this.startVector(1, v.length, 1);\n        this.bb.setPosition(this.space -= v.length);\n        this.bb.bytes().set(v, this.space);\n        return this.endVector();\n    }\n    /**\n     * A helper function to pack an object\n     *\n     * @returns offset of obj\n     */\n    createObjectOffset(obj) {\n        if (obj === null) {\n            return 0;\n        }\n        if (typeof obj === 'string') {\n            return this.createString(obj);\n        }\n        else {\n            return obj.pack(this);\n        }\n    }\n    /**\n     * A helper function to pack a list of object\n     *\n     * @returns list of offsets of each non null object\n     */\n    createObjectOffsetList(list) {\n        const ret = [];\n        for (let i = 0; i < list.length; ++i) {\n            const val = list[i];\n            if (val !== null) {\n                ret.push(this.createObjectOffset(val));\n            }\n            else {\n                throw new TypeError('FlatBuffers: Argument for createObjectOffsetList cannot contain null.');\n            }\n        }\n        return ret;\n    }\n    createStructOffsetList(list, startFunc) {\n        startFunc(this, list.length);\n        this.createObjectOffsetList(list.slice().reverse());\n        return this.endVector();\n    }\n}\nexports.Builder = Builder;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ByteBuffer = exports.Builder = exports.Encoding = exports.isLittleEndian = exports.float64 = exports.float32 = exports.int32 = exports.SIZE_PREFIX_LENGTH = exports.FILE_IDENTIFIER_LENGTH = exports.SIZEOF_INT = exports.SIZEOF_SHORT = void 0;\nvar constants_js_1 = require(\"./constants.js\");\nObject.defineProperty(exports, \"SIZEOF_SHORT\", { enumerable: true, get: function () { return constants_js_1.SIZEOF_SHORT; } });\nvar constants_js_2 = require(\"./constants.js\");\nObject.defineProperty(exports, \"SIZEOF_INT\", { enumerable: true, get: function () { return constants_js_2.SIZEOF_INT; } });\nvar constants_js_3 = require(\"./constants.js\");\nObject.defineProperty(exports, \"FILE_IDENTIFIER_LENGTH\", { enumerable: true, get: function () { return constants_js_3.FILE_IDENTIFIER_LENGTH; } });\nvar constants_js_4 = require(\"./constants.js\");\nObject.defineProperty(exports, \"SIZE_PREFIX_LENGTH\", { enumerable: true, get: function () { return constants_js_4.SIZE_PREFIX_LENGTH; } });\nvar utils_js_1 = require(\"./utils.js\");\nObject.defineProperty(exports, \"int32\", { enumerable: true, get: function () { return utils_js_1.int32; } });\nObject.defineProperty(exports, \"float32\", { enumerable: true, get: function () { return utils_js_1.float32; } });\nObject.defineProperty(exports, \"float64\", { enumerable: true, get: function () { return utils_js_1.float64; } });\nObject.defineProperty(exports, \"isLittleEndian\", { enumerable: true, get: function () { return utils_js_1.isLittleEndian; } });\nvar encoding_js_1 = require(\"./encoding.js\");\nObject.defineProperty(exports, \"Encoding\", { enumerable: true, get: function () { return encoding_js_1.Encoding; } });\nvar builder_js_1 = require(\"./builder.js\");\nObject.defineProperty(exports, \"Builder\", { enumerable: true, get: function () { return builder_js_1.Builder; } });\nvar byte_buffer_js_1 = require(\"./byte-buffer.js\");\nObject.defineProperty(exports, \"ByteBuffer\", { enumerable: true, get: function () { return byte_buffer_js_1.ByteBuffer; } });\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { ArgType } from '../../onnxruntime/fbs/arg-type.js';\n\nexport class ArgTypeAndIndex {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): ArgTypeAndIndex {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsArgTypeAndIndex(bb: flatbuffers.ByteBuffer, obj?: ArgTypeAndIndex): ArgTypeAndIndex {\n    return (obj || new ArgTypeAndIndex()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsArgTypeAndIndex(bb: flatbuffers.ByteBuffer, obj?: ArgTypeAndIndex): ArgTypeAndIndex {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new ArgTypeAndIndex()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  argType(): ArgType {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readInt8(this.bb_pos + offset) : ArgType.INPUT;\n  }\n\n  index(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  static startArgTypeAndIndex(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addArgType(builder: flatbuffers.Builder, argType: ArgType) {\n    builder.addFieldInt8(0, argType, ArgType.INPUT);\n  }\n\n  static addIndex(builder: flatbuffers.Builder, index: number) {\n    builder.addFieldInt32(1, index, 0);\n  }\n\n  static endArgTypeAndIndex(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createArgTypeAndIndex(builder: flatbuffers.Builder, argType: ArgType, index: number): flatbuffers.Offset {\n    ArgTypeAndIndex.startArgTypeAndIndex(builder);\n    ArgTypeAndIndex.addArgType(builder, argType);\n    ArgTypeAndIndex.addIndex(builder, index);\n    return ArgTypeAndIndex.endArgTypeAndIndex(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nexport enum AttributeType {\n  UNDEFINED = 0,\n  FLOAT = 1,\n  INT = 2,\n  STRING = 3,\n  TENSOR = 4,\n  GRAPH = 5,\n  FLOATS = 6,\n  INTS = 7,\n  STRINGS = 8,\n  TENSORS = 9,\n  GRAPHS = 10,\n  SPARSE_TENSOR = 11,\n  SPARSE_TENSORS = 12,\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nexport enum NodeType {\n  Primitive = 0,\n  Fused = 1,\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Attribute } from '../../onnxruntime/fbs/attribute.js';\nimport { NodeType } from '../../onnxruntime/fbs/node-type.js';\n\nexport class Node {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Node {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsNode(bb: flatbuffers.ByteBuffer, obj?: Node): Node {\n    return (obj || new Node()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsNode(bb: flatbuffers.ByteBuffer, obj?: Node): Node {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Node()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  name(): string | null;\n  name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  name(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  docString(): string | null;\n  docString(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  docString(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  domain(): string | null;\n  domain(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  domain(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  sinceVersion(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;\n  }\n\n  index(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  opType(): string | null;\n  opType(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  opType(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  type(): NodeType {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? this.bb!.readInt32(this.bb_pos + offset) : NodeType.Primitive;\n  }\n\n  executionProviderType(): string | null;\n  executionProviderType(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  executionProviderType(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 18);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  inputs(index: number): string;\n  inputs(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  inputs(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  inputsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  outputs(index: number): string;\n  outputs(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  outputs(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 22);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  outputsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 22);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  attributes(index: number, obj?: Attribute): Attribute | null {\n    const offset = this.bb!.__offset(this.bb_pos, 24);\n    return offset\n      ? (obj || new Attribute()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  attributesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 24);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  inputArgCounts(index: number): number | null {\n    const offset = this.bb!.__offset(this.bb_pos, 26);\n    return offset ? this.bb!.readInt32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n  }\n\n  inputArgCountsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 26);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  inputArgCountsArray(): Int32Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 26);\n    return offset\n      ? new Int32Array(\n          this.bb!.bytes().buffer,\n          this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n          this.bb!.__vector_len(this.bb_pos + offset),\n        )\n      : null;\n  }\n\n  implicitInputs(index: number): string;\n  implicitInputs(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  implicitInputs(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 28);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  implicitInputsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 28);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startNode(builder: flatbuffers.Builder) {\n    builder.startObject(13);\n  }\n\n  static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, nameOffset, 0);\n  }\n\n  static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, docStringOffset, 0);\n  }\n\n  static addDomain(builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, domainOffset, 0);\n  }\n\n  static addSinceVersion(builder: flatbuffers.Builder, sinceVersion: number) {\n    builder.addFieldInt32(3, sinceVersion, 0);\n  }\n\n  static addIndex(builder: flatbuffers.Builder, index: number) {\n    builder.addFieldInt32(4, index, 0);\n  }\n\n  static addOpType(builder: flatbuffers.Builder, opTypeOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(5, opTypeOffset, 0);\n  }\n\n  static addType(builder: flatbuffers.Builder, type: NodeType) {\n    builder.addFieldInt32(6, type, NodeType.Primitive);\n  }\n\n  static addExecutionProviderType(builder: flatbuffers.Builder, executionProviderTypeOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(7, executionProviderTypeOffset, 0);\n  }\n\n  static addInputs(builder: flatbuffers.Builder, inputsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(8, inputsOffset, 0);\n  }\n\n  static createInputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startInputsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addOutputs(builder: flatbuffers.Builder, outputsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(9, outputsOffset, 0);\n  }\n\n  static createOutputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startOutputsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addAttributes(builder: flatbuffers.Builder, attributesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(10, attributesOffset, 0);\n  }\n\n  static createAttributesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startAttributesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addInputArgCounts(builder: flatbuffers.Builder, inputArgCountsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(11, inputArgCountsOffset, 0);\n  }\n\n  static createInputArgCountsVector(builder: flatbuffers.Builder, data: number[] | Int32Array): flatbuffers.Offset;\n  /**\n   * @deprecated This Uint8Array overload will be removed in the future.\n   */\n  static createInputArgCountsVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;\n  static createInputArgCountsVector(\n    builder: flatbuffers.Builder,\n    data: number[] | Int32Array | Uint8Array,\n  ): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt32(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startInputArgCountsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addImplicitInputs(builder: flatbuffers.Builder, implicitInputsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(12, implicitInputsOffset, 0);\n  }\n\n  static createImplicitInputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startImplicitInputsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endNode(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createNode(\n    builder: flatbuffers.Builder,\n    nameOffset: flatbuffers.Offset,\n    docStringOffset: flatbuffers.Offset,\n    domainOffset: flatbuffers.Offset,\n    sinceVersion: number,\n    index: number,\n    opTypeOffset: flatbuffers.Offset,\n    type: NodeType,\n    executionProviderTypeOffset: flatbuffers.Offset,\n    inputsOffset: flatbuffers.Offset,\n    outputsOffset: flatbuffers.Offset,\n    attributesOffset: flatbuffers.Offset,\n    inputArgCountsOffset: flatbuffers.Offset,\n    implicitInputsOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    Node.startNode(builder);\n    Node.addName(builder, nameOffset);\n    Node.addDocString(builder, docStringOffset);\n    Node.addDomain(builder, domainOffset);\n    Node.addSinceVersion(builder, sinceVersion);\n    Node.addIndex(builder, index);\n    Node.addOpType(builder, opTypeOffset);\n    Node.addType(builder, type);\n    Node.addExecutionProviderType(builder, executionProviderTypeOffset);\n    Node.addInputs(builder, inputsOffset);\n    Node.addOutputs(builder, outputsOffset);\n    Node.addAttributes(builder, attributesOffset);\n    Node.addInputArgCounts(builder, inputArgCountsOffset);\n    Node.addImplicitInputs(builder, implicitInputsOffset);\n    return Node.endNode(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nexport class EdgeEnd {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): EdgeEnd {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  nodeIndex(): number {\n    return this.bb!.readUint32(this.bb_pos);\n  }\n\n  srcArgIndex(): number {\n    return this.bb!.readInt32(this.bb_pos + 4);\n  }\n\n  dstArgIndex(): number {\n    return this.bb!.readInt32(this.bb_pos + 8);\n  }\n\n  static sizeOf(): number {\n    return 12;\n  }\n\n  static createEdgeEnd(\n    builder: flatbuffers.Builder,\n    node_index: number,\n    src_arg_index: number,\n    dst_arg_index: number,\n  ): flatbuffers.Offset {\n    builder.prep(4, 12);\n    builder.writeInt32(dst_arg_index);\n    builder.writeInt32(src_arg_index);\n    builder.writeInt32(node_index);\n    return builder.offset();\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { EdgeEnd } from '../../onnxruntime/fbs/edge-end.js';\n\nexport class NodeEdge {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): NodeEdge {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsNodeEdge(bb: flatbuffers.ByteBuffer, obj?: NodeEdge): NodeEdge {\n    return (obj || new NodeEdge()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsNodeEdge(bb: flatbuffers.ByteBuffer, obj?: NodeEdge): NodeEdge {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new NodeEdge()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  nodeIndex(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  inputEdges(index: number, obj?: EdgeEnd): EdgeEnd | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new EdgeEnd()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 12, this.bb!)\n      : null;\n  }\n\n  inputEdgesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  outputEdges(index: number, obj?: EdgeEnd): EdgeEnd | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset\n      ? (obj || new EdgeEnd()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 12, this.bb!)\n      : null;\n  }\n\n  outputEdgesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startNodeEdge(builder: flatbuffers.Builder) {\n    builder.startObject(3);\n  }\n\n  static addNodeIndex(builder: flatbuffers.Builder, nodeIndex: number) {\n    builder.addFieldInt32(0, nodeIndex, 0);\n  }\n\n  static addInputEdges(builder: flatbuffers.Builder, inputEdgesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, inputEdgesOffset, 0);\n  }\n\n  static startInputEdgesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(12, numElems, 4);\n  }\n\n  static addOutputEdges(builder: flatbuffers.Builder, outputEdgesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, outputEdgesOffset, 0);\n  }\n\n  static startOutputEdgesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(12, numElems, 4);\n  }\n\n  static endNodeEdge(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createNodeEdge(\n    builder: flatbuffers.Builder,\n    nodeIndex: number,\n    inputEdgesOffset: flatbuffers.Offset,\n    outputEdgesOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    NodeEdge.startNodeEdge(builder);\n    NodeEdge.addNodeIndex(builder, nodeIndex);\n    NodeEdge.addInputEdges(builder, inputEdgesOffset);\n    NodeEdge.addOutputEdges(builder, outputEdgesOffset);\n    return NodeEdge.endNodeEdge(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\n/**\n * nodes to consider for a runtime optimization\n * see corresponding type in onnxruntime/core/graph/runtime_optimization_record.h\n */\nexport class NodesToOptimizeIndices {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): NodesToOptimizeIndices {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsNodesToOptimizeIndices(\n    bb: flatbuffers.ByteBuffer,\n    obj?: NodesToOptimizeIndices,\n  ): NodesToOptimizeIndices {\n    return (obj || new NodesToOptimizeIndices()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsNodesToOptimizeIndices(\n    bb: flatbuffers.ByteBuffer,\n    obj?: NodesToOptimizeIndices,\n  ): NodesToOptimizeIndices {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new NodesToOptimizeIndices()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  nodeIndices(index: number): number | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readUint32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n  }\n\n  nodeIndicesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  nodeIndicesArray(): Uint32Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? new Uint32Array(\n          this.bb!.bytes().buffer,\n          this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n          this.bb!.__vector_len(this.bb_pos + offset),\n        )\n      : null;\n  }\n\n  numInputs(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  numOutputs(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  hasVariadicInput(): boolean {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;\n  }\n\n  hasVariadicOutput(): boolean {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;\n  }\n\n  numVariadicInputs(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  numVariadicOutputs(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  static startNodesToOptimizeIndices(builder: flatbuffers.Builder) {\n    builder.startObject(7);\n  }\n\n  static addNodeIndices(builder: flatbuffers.Builder, nodeIndicesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, nodeIndicesOffset, 0);\n  }\n\n  static createNodeIndicesVector(builder: flatbuffers.Builder, data: number[] | Uint32Array): flatbuffers.Offset;\n  /**\n   * @deprecated This Uint8Array overload will be removed in the future.\n   */\n  static createNodeIndicesVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;\n  static createNodeIndicesVector(\n    builder: flatbuffers.Builder,\n    data: number[] | Uint32Array | Uint8Array,\n  ): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt32(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startNodeIndicesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addNumInputs(builder: flatbuffers.Builder, numInputs: number) {\n    builder.addFieldInt32(1, numInputs, 0);\n  }\n\n  static addNumOutputs(builder: flatbuffers.Builder, numOutputs: number) {\n    builder.addFieldInt32(2, numOutputs, 0);\n  }\n\n  static addHasVariadicInput(builder: flatbuffers.Builder, hasVariadicInput: boolean) {\n    builder.addFieldInt8(3, +hasVariadicInput, +false);\n  }\n\n  static addHasVariadicOutput(builder: flatbuffers.Builder, hasVariadicOutput: boolean) {\n    builder.addFieldInt8(4, +hasVariadicOutput, +false);\n  }\n\n  static addNumVariadicInputs(builder: flatbuffers.Builder, numVariadicInputs: number) {\n    builder.addFieldInt32(5, numVariadicInputs, 0);\n  }\n\n  static addNumVariadicOutputs(builder: flatbuffers.Builder, numVariadicOutputs: number) {\n    builder.addFieldInt32(6, numVariadicOutputs, 0);\n  }\n\n  static endNodesToOptimizeIndices(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createNodesToOptimizeIndices(\n    builder: flatbuffers.Builder,\n    nodeIndicesOffset: flatbuffers.Offset,\n    numInputs: number,\n    numOutputs: number,\n    hasVariadicInput: boolean,\n    hasVariadicOutput: boolean,\n    numVariadicInputs: number,\n    numVariadicOutputs: number,\n  ): flatbuffers.Offset {\n    NodesToOptimizeIndices.startNodesToOptimizeIndices(builder);\n    NodesToOptimizeIndices.addNodeIndices(builder, nodeIndicesOffset);\n    NodesToOptimizeIndices.addNumInputs(builder, numInputs);\n    NodesToOptimizeIndices.addNumOutputs(builder, numOutputs);\n    NodesToOptimizeIndices.addHasVariadicInput(builder, hasVariadicInput);\n    NodesToOptimizeIndices.addHasVariadicOutput(builder, hasVariadicOutput);\n    NodesToOptimizeIndices.addNumVariadicInputs(builder, numVariadicInputs);\n    NodesToOptimizeIndices.addNumVariadicOutputs(builder, numVariadicOutputs);\n    return NodesToOptimizeIndices.endNodesToOptimizeIndices(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { NodesToOptimizeIndices } from '../../onnxruntime/fbs/nodes-to-optimize-indices.js';\n\n/**\n * a single runtime optimization\n * see corresponding type in onnxruntime/core/graph/runtime_optimization_record.h\n */\nexport class RuntimeOptimizationRecord {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): RuntimeOptimizationRecord {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsRuntimeOptimizationRecord(\n    bb: flatbuffers.ByteBuffer,\n    obj?: RuntimeOptimizationRecord,\n  ): RuntimeOptimizationRecord {\n    return (obj || new RuntimeOptimizationRecord()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsRuntimeOptimizationRecord(\n    bb: flatbuffers.ByteBuffer,\n    obj?: RuntimeOptimizationRecord,\n  ): RuntimeOptimizationRecord {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new RuntimeOptimizationRecord()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  actionId(): string | null;\n  actionId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  actionId(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  nodesToOptimizeIndices(obj?: NodesToOptimizeIndices): NodesToOptimizeIndices | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new NodesToOptimizeIndices()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!)\n      : null;\n  }\n\n  producedOpIds(index: number): string;\n  producedOpIds(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  producedOpIds(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  producedOpIdsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startRuntimeOptimizationRecord(builder: flatbuffers.Builder) {\n    builder.startObject(4);\n  }\n\n  static addActionId(builder: flatbuffers.Builder, actionIdOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, actionIdOffset, 0);\n  }\n\n  static addNodesToOptimizeIndices(builder: flatbuffers.Builder, nodesToOptimizeIndicesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, nodesToOptimizeIndicesOffset, 0);\n  }\n\n  static addProducedOpIds(builder: flatbuffers.Builder, producedOpIdsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(3, producedOpIdsOffset, 0);\n  }\n\n  static createProducedOpIdsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startProducedOpIdsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endRuntimeOptimizationRecord(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { RuntimeOptimizationRecord } from '../../onnxruntime/fbs/runtime-optimization-record.js';\n\nexport class RuntimeOptimizationRecordContainerEntry {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): RuntimeOptimizationRecordContainerEntry {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsRuntimeOptimizationRecordContainerEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: RuntimeOptimizationRecordContainerEntry,\n  ): RuntimeOptimizationRecordContainerEntry {\n    return (obj || new RuntimeOptimizationRecordContainerEntry()).__init(\n      bb.readInt32(bb.position()) + bb.position(),\n      bb,\n    );\n  }\n\n  static getSizePrefixedRootAsRuntimeOptimizationRecordContainerEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: RuntimeOptimizationRecordContainerEntry,\n  ): RuntimeOptimizationRecordContainerEntry {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new RuntimeOptimizationRecordContainerEntry()).__init(\n      bb.readInt32(bb.position()) + bb.position(),\n      bb,\n    );\n  }\n\n  optimizerName(): string | null;\n  optimizerName(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  optimizerName(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  runtimeOptimizationRecords(index: number, obj?: RuntimeOptimizationRecord): RuntimeOptimizationRecord | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new RuntimeOptimizationRecord()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  runtimeOptimizationRecordsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startRuntimeOptimizationRecordContainerEntry(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addOptimizerName(builder: flatbuffers.Builder, optimizerNameOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, optimizerNameOffset, 0);\n  }\n\n  static addRuntimeOptimizationRecords(\n    builder: flatbuffers.Builder,\n    runtimeOptimizationRecordsOffset: flatbuffers.Offset,\n  ) {\n    builder.addFieldOffset(1, runtimeOptimizationRecordsOffset, 0);\n  }\n\n  static createRuntimeOptimizationRecordsVector(\n    builder: flatbuffers.Builder,\n    data: flatbuffers.Offset[],\n  ): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startRuntimeOptimizationRecordsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endRuntimeOptimizationRecordContainerEntry(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    builder.requiredField(offset, 4); // optimizer_name\n    return offset;\n  }\n\n  static createRuntimeOptimizationRecordContainerEntry(\n    builder: flatbuffers.Builder,\n    optimizerNameOffset: flatbuffers.Offset,\n    runtimeOptimizationRecordsOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    RuntimeOptimizationRecordContainerEntry.startRuntimeOptimizationRecordContainerEntry(builder);\n    RuntimeOptimizationRecordContainerEntry.addOptimizerName(builder, optimizerNameOffset);\n    RuntimeOptimizationRecordContainerEntry.addRuntimeOptimizationRecords(builder, runtimeOptimizationRecordsOffset);\n    return RuntimeOptimizationRecordContainerEntry.endRuntimeOptimizationRecordContainerEntry(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { RuntimeOptimizationRecordContainerEntry } from '../../onnxruntime/fbs/runtime-optimization-record-container-entry.js';\n\nexport class RuntimeOptimizations {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): RuntimeOptimizations {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsRuntimeOptimizations(bb: flatbuffers.ByteBuffer, obj?: RuntimeOptimizations): RuntimeOptimizations {\n    return (obj || new RuntimeOptimizations()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsRuntimeOptimizations(\n    bb: flatbuffers.ByteBuffer,\n    obj?: RuntimeOptimizations,\n  ): RuntimeOptimizations {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new RuntimeOptimizations()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  /**\n   * mapping from optimizer name to [RuntimeOptimizationRecord]\n   */\n  records(\n    index: number,\n    obj?: RuntimeOptimizationRecordContainerEntry,\n  ): RuntimeOptimizationRecordContainerEntry | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? (obj || new RuntimeOptimizationRecordContainerEntry()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  recordsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startRuntimeOptimizations(builder: flatbuffers.Builder) {\n    builder.startObject(1);\n  }\n\n  static addRecords(builder: flatbuffers.Builder, recordsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, recordsOffset, 0);\n  }\n\n  static createRecordsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startRecordsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endRuntimeOptimizations(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createRuntimeOptimizations(\n    builder: flatbuffers.Builder,\n    recordsOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    RuntimeOptimizations.startRuntimeOptimizations(builder);\n    RuntimeOptimizations.addRecords(builder, recordsOffset);\n    return RuntimeOptimizations.endRuntimeOptimizations(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nexport enum TensorDataType {\n  UNDEFINED = 0,\n  FLOAT = 1,\n  UINT8 = 2,\n  INT8 = 3,\n  UINT16 = 4,\n  INT16 = 5,\n  INT32 = 6,\n  INT64 = 7,\n  STRING = 8,\n  BOOL = 9,\n  FLOAT16 = 10,\n  DOUBLE = 11,\n  UINT32 = 12,\n  UINT64 = 13,\n  COMPLEX64 = 14,\n  COMPLEX128 = 15,\n  BFLOAT16 = 16,\n  FLOAT8E4M3FN = 17,\n  FLOAT8E4M3FNUZ = 18,\n  FLOAT8E5M2 = 19,\n  FLOAT8E5M2FNUZ = 20,\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { TensorDataType } from '../../onnxruntime/fbs/tensor-data-type.js';\n\nexport class Tensor {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Tensor {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsTensor(bb: flatbuffers.ByteBuffer, obj?: Tensor): Tensor {\n    return (obj || new Tensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsTensor(bb: flatbuffers.ByteBuffer, obj?: Tensor): Tensor {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Tensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  name(): string | null;\n  name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  name(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  docString(): string | null;\n  docString(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  docString(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  dims(index: number): bigint | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);\n  }\n\n  dimsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  dataType(): TensorDataType {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.readInt32(this.bb_pos + offset) : TensorDataType.UNDEFINED;\n  }\n\n  rawData(index: number): number | null {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;\n  }\n\n  rawDataLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  rawDataArray(): Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset\n      ? new Uint8Array(\n          this.bb!.bytes().buffer,\n          this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n          this.bb!.__vector_len(this.bb_pos + offset),\n        )\n      : null;\n  }\n\n  stringData(index: number): string;\n  stringData(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  stringData(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  stringDataLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  externalDataOffset(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('-1');\n  }\n\n  static startTensor(builder: flatbuffers.Builder) {\n    builder.startObject(7);\n  }\n\n  static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, nameOffset, 0);\n  }\n\n  static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, docStringOffset, 0);\n  }\n\n  static addDims(builder: flatbuffers.Builder, dimsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, dimsOffset, 0);\n  }\n\n  static createDimsVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset {\n    builder.startVector(8, data.length, 8);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt64(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startDimsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(8, numElems, 8);\n  }\n\n  static addDataType(builder: flatbuffers.Builder, dataType: TensorDataType) {\n    builder.addFieldInt32(3, dataType, TensorDataType.UNDEFINED);\n  }\n\n  static addRawData(builder: flatbuffers.Builder, rawDataOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(4, rawDataOffset, 0);\n  }\n\n  static createRawDataVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset {\n    builder.startVector(1, data.length, 1);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt8(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startRawDataVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(1, numElems, 1);\n  }\n\n  static addStringData(builder: flatbuffers.Builder, stringDataOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(5, stringDataOffset, 0);\n  }\n\n  static createStringDataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startStringDataVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addExternalDataOffset(builder: flatbuffers.Builder, externalDataOffset: bigint) {\n    builder.addFieldInt64(6, externalDataOffset, BigInt('-1'));\n  }\n\n  static endTensor(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createTensor(\n    builder: flatbuffers.Builder,\n    nameOffset: flatbuffers.Offset,\n    docStringOffset: flatbuffers.Offset,\n    dimsOffset: flatbuffers.Offset,\n    dataType: TensorDataType,\n    rawDataOffset: flatbuffers.Offset,\n    stringDataOffset: flatbuffers.Offset,\n    externalDataOffset: bigint,\n  ): flatbuffers.Offset {\n    Tensor.startTensor(builder);\n    Tensor.addName(builder, nameOffset);\n    Tensor.addDocString(builder, docStringOffset);\n    Tensor.addDims(builder, dimsOffset);\n    Tensor.addDataType(builder, dataType);\n    Tensor.addRawData(builder, rawDataOffset);\n    Tensor.addStringData(builder, stringDataOffset);\n    Tensor.addExternalDataOffset(builder, externalDataOffset);\n    return Tensor.endTensor(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Tensor } from '../../onnxruntime/fbs/tensor.js';\n\nexport class SparseTensor {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): SparseTensor {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsSparseTensor(bb: flatbuffers.ByteBuffer, obj?: SparseTensor): SparseTensor {\n    return (obj || new SparseTensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsSparseTensor(bb: flatbuffers.ByteBuffer, obj?: SparseTensor): SparseTensor {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new SparseTensor()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  values(obj?: Tensor): Tensor | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? (obj || new Tensor()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  indices(obj?: Tensor): Tensor | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? (obj || new Tensor()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  dims(index: number): bigint | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);\n  }\n\n  dimsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startSparseTensor(builder: flatbuffers.Builder) {\n    builder.startObject(3);\n  }\n\n  static addValues(builder: flatbuffers.Builder, valuesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, valuesOffset, 0);\n  }\n\n  static addIndices(builder: flatbuffers.Builder, indicesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, indicesOffset, 0);\n  }\n\n  static addDims(builder: flatbuffers.Builder, dimsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, dimsOffset, 0);\n  }\n\n  static createDimsVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset {\n    builder.startVector(8, data.length, 8);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt64(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startDimsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(8, numElems, 8);\n  }\n\n  static endSparseTensor(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { TensorDataType } from '../../onnxruntime/fbs/tensor-data-type.js';\nimport { TypeInfo } from '../../onnxruntime/fbs/type-info.js';\n\nexport class MapType {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): MapType {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsMapType(bb: flatbuffers.ByteBuffer, obj?: MapType): MapType {\n    return (obj || new MapType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsMapType(bb: flatbuffers.ByteBuffer, obj?: MapType): MapType {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new MapType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  keyType(): TensorDataType {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readInt32(this.bb_pos + offset) : TensorDataType.UNDEFINED;\n  }\n\n  valueType(obj?: TypeInfo): TypeInfo | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? (obj || new TypeInfo()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  static startMapType(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addKeyType(builder: flatbuffers.Builder, keyType: TensorDataType) {\n    builder.addFieldInt32(0, keyType, TensorDataType.UNDEFINED);\n  }\n\n  static addValueType(builder: flatbuffers.Builder, valueTypeOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, valueTypeOffset, 0);\n  }\n\n  static endMapType(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { TypeInfo } from '../../onnxruntime/fbs/type-info.js';\n\nexport class SequenceType {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): SequenceType {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsSequenceType(bb: flatbuffers.ByteBuffer, obj?: SequenceType): SequenceType {\n    return (obj || new SequenceType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsSequenceType(bb: flatbuffers.ByteBuffer, obj?: SequenceType): SequenceType {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new SequenceType()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  elemType(obj?: TypeInfo): TypeInfo | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? (obj || new TypeInfo()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  static startSequenceType(builder: flatbuffers.Builder) {\n    builder.startObject(1);\n  }\n\n  static addElemType(builder: flatbuffers.Builder, elemTypeOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, elemTypeOffset, 0);\n  }\n\n  static endSequenceType(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createSequenceType(builder: flatbuffers.Builder, elemTypeOffset: flatbuffers.Offset): flatbuffers.Offset {\n    SequenceType.startSequenceType(builder);\n    SequenceType.addElemType(builder, elemTypeOffset);\n    return SequenceType.endSequenceType(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nexport enum DimensionValueType {\n  UNKNOWN = 0,\n  VALUE = 1,\n  PARAM = 2,\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { DimensionValueType } from '../../onnxruntime/fbs/dimension-value-type.js';\n\nexport class DimensionValue {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): DimensionValue {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsDimensionValue(bb: flatbuffers.ByteBuffer, obj?: DimensionValue): DimensionValue {\n    return (obj || new DimensionValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsDimensionValue(bb: flatbuffers.ByteBuffer, obj?: DimensionValue): DimensionValue {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new DimensionValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  dimType(): DimensionValueType {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readInt8(this.bb_pos + offset) : DimensionValueType.UNKNOWN;\n  }\n\n  dimValue(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');\n  }\n\n  dimParam(): string | null;\n  dimParam(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  dimParam(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  static startDimensionValue(builder: flatbuffers.Builder) {\n    builder.startObject(3);\n  }\n\n  static addDimType(builder: flatbuffers.Builder, dimType: DimensionValueType) {\n    builder.addFieldInt8(0, dimType, DimensionValueType.UNKNOWN);\n  }\n\n  static addDimValue(builder: flatbuffers.Builder, dimValue: bigint) {\n    builder.addFieldInt64(1, dimValue, BigInt('0'));\n  }\n\n  static addDimParam(builder: flatbuffers.Builder, dimParamOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, dimParamOffset, 0);\n  }\n\n  static endDimensionValue(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createDimensionValue(\n    builder: flatbuffers.Builder,\n    dimType: DimensionValueType,\n    dimValue: bigint,\n    dimParamOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    DimensionValue.startDimensionValue(builder);\n    DimensionValue.addDimType(builder, dimType);\n    DimensionValue.addDimValue(builder, dimValue);\n    DimensionValue.addDimParam(builder, dimParamOffset);\n    return DimensionValue.endDimensionValue(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { DimensionValue } from '../../onnxruntime/fbs/dimension-value.js';\n\nexport class Dimension {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Dimension {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsDimension(bb: flatbuffers.ByteBuffer, obj?: Dimension): Dimension {\n    return (obj || new Dimension()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsDimension(bb: flatbuffers.ByteBuffer, obj?: Dimension): Dimension {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Dimension()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  value(obj?: DimensionValue): DimensionValue | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? (obj || new DimensionValue()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  denotation(): string | null;\n  denotation(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  denotation(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  static startDimension(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, valueOffset, 0);\n  }\n\n  static addDenotation(builder: flatbuffers.Builder, denotationOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, denotationOffset, 0);\n  }\n\n  static endDimension(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createDimension(\n    builder: flatbuffers.Builder,\n    valueOffset: flatbuffers.Offset,\n    denotationOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    Dimension.startDimension(builder);\n    Dimension.addValue(builder, valueOffset);\n    Dimension.addDenotation(builder, denotationOffset);\n    return Dimension.endDimension(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Dimension } from '../../onnxruntime/fbs/dimension.js';\n\nexport class Shape {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Shape {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsShape(bb: flatbuffers.ByteBuffer, obj?: Shape): Shape {\n    return (obj || new Shape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsShape(bb: flatbuffers.ByteBuffer, obj?: Shape): Shape {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Shape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  dim(index: number, obj?: Dimension): Dimension | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? (obj || new Dimension()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  dimLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startShape(builder: flatbuffers.Builder) {\n    builder.startObject(1);\n  }\n\n  static addDim(builder: flatbuffers.Builder, dimOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, dimOffset, 0);\n  }\n\n  static createDimVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startDimVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endShape(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createShape(builder: flatbuffers.Builder, dimOffset: flatbuffers.Offset): flatbuffers.Offset {\n    Shape.startShape(builder);\n    Shape.addDim(builder, dimOffset);\n    return Shape.endShape(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Shape } from '../../onnxruntime/fbs/shape.js';\nimport { TensorDataType } from '../../onnxruntime/fbs/tensor-data-type.js';\n\nexport class TensorTypeAndShape {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): TensorTypeAndShape {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsTensorTypeAndShape(bb: flatbuffers.ByteBuffer, obj?: TensorTypeAndShape): TensorTypeAndShape {\n    return (obj || new TensorTypeAndShape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsTensorTypeAndShape(\n    bb: flatbuffers.ByteBuffer,\n    obj?: TensorTypeAndShape,\n  ): TensorTypeAndShape {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new TensorTypeAndShape()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  elemType(): TensorDataType {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readInt32(this.bb_pos + offset) : TensorDataType.UNDEFINED;\n  }\n\n  shape(obj?: Shape): Shape | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? (obj || new Shape()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  static startTensorTypeAndShape(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addElemType(builder: flatbuffers.Builder, elemType: TensorDataType) {\n    builder.addFieldInt32(0, elemType, TensorDataType.UNDEFINED);\n  }\n\n  static addShape(builder: flatbuffers.Builder, shapeOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, shapeOffset, 0);\n  }\n\n  static endTensorTypeAndShape(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport { MapType } from '../../onnxruntime/fbs/map-type.js';\nimport { SequenceType } from '../../onnxruntime/fbs/sequence-type.js';\nimport { TensorTypeAndShape } from '../../onnxruntime/fbs/tensor-type-and-shape.js';\n\nexport enum TypeInfoValue {\n  NONE = 0,\n  tensor_type = 1,\n  sequence_type = 2,\n  map_type = 3,\n}\n\nexport function unionToTypeInfoValue(\n  type: TypeInfoValue,\n  accessor: (obj: MapType | SequenceType | TensorTypeAndShape) => MapType | SequenceType | TensorTypeAndShape | null,\n): MapType | SequenceType | TensorTypeAndShape | null {\n  switch (TypeInfoValue[type]) {\n    case 'NONE':\n      return null;\n    case 'tensor_type':\n      return accessor(new TensorTypeAndShape())! as TensorTypeAndShape;\n    case 'sequence_type':\n      return accessor(new SequenceType())! as SequenceType;\n    case 'map_type':\n      return accessor(new MapType())! as MapType;\n    default:\n      return null;\n  }\n}\n\nexport function unionListToTypeInfoValue(\n  type: TypeInfoValue,\n  accessor: (\n    index: number,\n    obj: MapType | SequenceType | TensorTypeAndShape,\n  ) => MapType | SequenceType | TensorTypeAndShape | null,\n  index: number,\n): MapType | SequenceType | TensorTypeAndShape | null {\n  switch (TypeInfoValue[type]) {\n    case 'NONE':\n      return null;\n    case 'tensor_type':\n      return accessor(index, new TensorTypeAndShape())! as TensorTypeAndShape;\n    case 'sequence_type':\n      return accessor(index, new SequenceType())! as SequenceType;\n    case 'map_type':\n      return accessor(index, new MapType())! as MapType;\n    default:\n      return null;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { TypeInfoValue } from '../../onnxruntime/fbs/type-info-value.js';\n\nexport class TypeInfo {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): TypeInfo {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsTypeInfo(bb: flatbuffers.ByteBuffer, obj?: TypeInfo): TypeInfo {\n    return (obj || new TypeInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsTypeInfo(bb: flatbuffers.ByteBuffer, obj?: TypeInfo): TypeInfo {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new TypeInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  denotation(): string | null;\n  denotation(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  denotation(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  valueType(): TypeInfoValue {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readUint8(this.bb_pos + offset) : TypeInfoValue.NONE;\n  }\n\n  value(obj: any): any | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__union(obj, this.bb_pos + offset) : null;\n  }\n\n  static startTypeInfo(builder: flatbuffers.Builder) {\n    builder.startObject(3);\n  }\n\n  static addDenotation(builder: flatbuffers.Builder, denotationOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, denotationOffset, 0);\n  }\n\n  static addValueType(builder: flatbuffers.Builder, valueType: TypeInfoValue) {\n    builder.addFieldInt8(1, valueType, TypeInfoValue.NONE);\n  }\n\n  static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, valueOffset, 0);\n  }\n\n  static endTypeInfo(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createTypeInfo(\n    builder: flatbuffers.Builder,\n    denotationOffset: flatbuffers.Offset,\n    valueType: TypeInfoValue,\n    valueOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    TypeInfo.startTypeInfo(builder);\n    TypeInfo.addDenotation(builder, denotationOffset);\n    TypeInfo.addValueType(builder, valueType);\n    TypeInfo.addValue(builder, valueOffset);\n    return TypeInfo.endTypeInfo(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { TypeInfo } from '../../onnxruntime/fbs/type-info.js';\n\nexport class ValueInfo {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): ValueInfo {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsValueInfo(bb: flatbuffers.ByteBuffer, obj?: ValueInfo): ValueInfo {\n    return (obj || new ValueInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsValueInfo(bb: flatbuffers.ByteBuffer, obj?: ValueInfo): ValueInfo {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new ValueInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  name(): string | null;\n  name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  name(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  docString(): string | null;\n  docString(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  docString(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  type(obj?: TypeInfo): TypeInfo | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? (obj || new TypeInfo()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  static startValueInfo(builder: flatbuffers.Builder) {\n    builder.startObject(3);\n  }\n\n  static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, nameOffset, 0);\n  }\n\n  static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, docStringOffset, 0);\n  }\n\n  static addType(builder: flatbuffers.Builder, typeOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, typeOffset, 0);\n  }\n\n  static endValueInfo(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Node } from '../../onnxruntime/fbs/node.js';\nimport { NodeEdge } from '../../onnxruntime/fbs/node-edge.js';\nimport { RuntimeOptimizations } from '../../onnxruntime/fbs/runtime-optimizations.js';\nimport { SparseTensor } from '../../onnxruntime/fbs/sparse-tensor.js';\nimport { Tensor } from '../../onnxruntime/fbs/tensor.js';\nimport { ValueInfo } from '../../onnxruntime/fbs/value-info.js';\n\nexport class Graph {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Graph {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsGraph(bb: flatbuffers.ByteBuffer, obj?: Graph): Graph {\n    return (obj || new Graph()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsGraph(bb: flatbuffers.ByteBuffer, obj?: Graph): Graph {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Graph()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  initializers(index: number, obj?: Tensor): Tensor | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? (obj || new Tensor()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!)\n      : null;\n  }\n\n  initializersLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  nodeArgs(index: number, obj?: ValueInfo): ValueInfo | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new ValueInfo()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  nodeArgsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  nodes(index: number, obj?: Node): Node | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset\n      ? (obj || new Node()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!)\n      : null;\n  }\n\n  nodesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  maxNodeIndex(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  nodeEdges(index: number, obj?: NodeEdge): NodeEdge | null {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset\n      ? (obj || new NodeEdge()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  nodeEdgesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  inputs(index: number): string;\n  inputs(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  inputs(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  inputsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  outputs(index: number): string;\n  outputs(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  outputs(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  outputsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  sparseInitializers(index: number, obj?: SparseTensor): SparseTensor | null {\n    const offset = this.bb!.__offset(this.bb_pos, 18);\n    return offset\n      ? (obj || new SparseTensor()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  sparseInitializersLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 18);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  runtimeOptimizations(obj?: RuntimeOptimizations): RuntimeOptimizations | null {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset\n      ? (obj || new RuntimeOptimizations()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!)\n      : null;\n  }\n\n  static startGraph(builder: flatbuffers.Builder) {\n    builder.startObject(9);\n  }\n\n  static addInitializers(builder: flatbuffers.Builder, initializersOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, initializersOffset, 0);\n  }\n\n  static createInitializersVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startInitializersVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addNodeArgs(builder: flatbuffers.Builder, nodeArgsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, nodeArgsOffset, 0);\n  }\n\n  static createNodeArgsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startNodeArgsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addNodes(builder: flatbuffers.Builder, nodesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, nodesOffset, 0);\n  }\n\n  static createNodesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startNodesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addMaxNodeIndex(builder: flatbuffers.Builder, maxNodeIndex: number) {\n    builder.addFieldInt32(3, maxNodeIndex, 0);\n  }\n\n  static addNodeEdges(builder: flatbuffers.Builder, nodeEdgesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(4, nodeEdgesOffset, 0);\n  }\n\n  static createNodeEdgesVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startNodeEdgesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addInputs(builder: flatbuffers.Builder, inputsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(5, inputsOffset, 0);\n  }\n\n  static createInputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startInputsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addOutputs(builder: flatbuffers.Builder, outputsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(6, outputsOffset, 0);\n  }\n\n  static createOutputsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startOutputsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addSparseInitializers(builder: flatbuffers.Builder, sparseInitializersOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(7, sparseInitializersOffset, 0);\n  }\n\n  static createSparseInitializersVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startSparseInitializersVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addRuntimeOptimizations(builder: flatbuffers.Builder, runtimeOptimizationsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(8, runtimeOptimizationsOffset, 0);\n  }\n\n  static endGraph(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { AttributeType } from '../../onnxruntime/fbs/attribute-type.js';\nimport { Graph } from '../../onnxruntime/fbs/graph.js';\nimport { Tensor } from '../../onnxruntime/fbs/tensor.js';\n\nexport class Attribute {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Attribute {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsAttribute(bb: flatbuffers.ByteBuffer, obj?: Attribute): Attribute {\n    return (obj || new Attribute()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsAttribute(bb: flatbuffers.ByteBuffer, obj?: Attribute): Attribute {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Attribute()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  name(): string | null;\n  name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  name(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  docString(): string | null;\n  docString(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  docString(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  type(): AttributeType {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.readInt32(this.bb_pos + offset) : AttributeType.UNDEFINED;\n  }\n\n  f(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;\n  }\n\n  i(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');\n  }\n\n  s(): string | null;\n  s(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  s(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  t(obj?: Tensor): Tensor | null {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? (obj || new Tensor()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  g(obj?: Graph): Graph | null {\n    const offset = this.bb!.__offset(this.bb_pos, 18);\n    return offset ? (obj || new Graph()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  floats(index: number): number | null {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n  }\n\n  floatsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  floatsArray(): Float32Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset\n      ? new Float32Array(\n          this.bb!.bytes().buffer,\n          this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n          this.bb!.__vector_len(this.bb_pos + offset),\n        )\n      : null;\n  }\n\n  ints(index: number): bigint | null {\n    const offset = this.bb!.__offset(this.bb_pos, 22);\n    return offset ? this.bb!.readInt64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);\n  }\n\n  intsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 22);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  strings(index: number): string;\n  strings(index: number, optionalEncoding: flatbuffers.Encoding): string | Uint8Array;\n  strings(index: number, optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 24);\n    return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;\n  }\n\n  stringsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 24);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  tensors(index: number, obj?: Tensor): Tensor | null {\n    const offset = this.bb!.__offset(this.bb_pos, 26);\n    return offset\n      ? (obj || new Tensor()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!)\n      : null;\n  }\n\n  tensorsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 26);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  graphs(index: number, obj?: Graph): Graph | null {\n    const offset = this.bb!.__offset(this.bb_pos, 28);\n    return offset\n      ? (obj || new Graph()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!)\n      : null;\n  }\n\n  graphsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 28);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startAttribute(builder: flatbuffers.Builder) {\n    builder.startObject(13);\n  }\n\n  static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, nameOffset, 0);\n  }\n\n  static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, docStringOffset, 0);\n  }\n\n  static addType(builder: flatbuffers.Builder, type: AttributeType) {\n    builder.addFieldInt32(2, type, AttributeType.UNDEFINED);\n  }\n\n  static addF(builder: flatbuffers.Builder, f: number) {\n    builder.addFieldFloat32(3, f, 0.0);\n  }\n\n  static addI(builder: flatbuffers.Builder, i: bigint) {\n    builder.addFieldInt64(4, i, BigInt('0'));\n  }\n\n  static addS(builder: flatbuffers.Builder, sOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(5, sOffset, 0);\n  }\n\n  static addT(builder: flatbuffers.Builder, tOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(6, tOffset, 0);\n  }\n\n  static addG(builder: flatbuffers.Builder, gOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(7, gOffset, 0);\n  }\n\n  static addFloats(builder: flatbuffers.Builder, floatsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(8, floatsOffset, 0);\n  }\n\n  static createFloatsVector(builder: flatbuffers.Builder, data: number[] | Float32Array): flatbuffers.Offset;\n  /**\n   * @deprecated This Uint8Array overload will be removed in the future.\n   */\n  static createFloatsVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;\n  static createFloatsVector(\n    builder: flatbuffers.Builder,\n    data: number[] | Float32Array | Uint8Array,\n  ): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addFloat32(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startFloatsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addInts(builder: flatbuffers.Builder, intsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(9, intsOffset, 0);\n  }\n\n  static createIntsVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset {\n    builder.startVector(8, data.length, 8);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt64(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startIntsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(8, numElems, 8);\n  }\n\n  static addStrings(builder: flatbuffers.Builder, stringsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(10, stringsOffset, 0);\n  }\n\n  static createStringsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startStringsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addTensors(builder: flatbuffers.Builder, tensorsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(11, tensorsOffset, 0);\n  }\n\n  static createTensorsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startTensorsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addGraphs(builder: flatbuffers.Builder, graphsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(12, graphsOffset, 0);\n  }\n\n  static createGraphsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startGraphsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endAttribute(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\n/**\n * deprecated: no longer using kernel def hashes\n */\nexport class DeprecatedKernelCreateInfos {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): DeprecatedKernelCreateInfos {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsDeprecatedKernelCreateInfos(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedKernelCreateInfos,\n  ): DeprecatedKernelCreateInfos {\n    return (obj || new DeprecatedKernelCreateInfos()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsDeprecatedKernelCreateInfos(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedKernelCreateInfos,\n  ): DeprecatedKernelCreateInfos {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new DeprecatedKernelCreateInfos()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  nodeIndices(index: number): number | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readUint32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;\n  }\n\n  nodeIndicesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  nodeIndicesArray(): Uint32Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? new Uint32Array(\n          this.bb!.bytes().buffer,\n          this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset),\n          this.bb!.__vector_len(this.bb_pos + offset),\n        )\n      : null;\n  }\n\n  kernelDefHashes(index: number): bigint | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readUint64(this.bb!.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);\n  }\n\n  kernelDefHashesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startDeprecatedKernelCreateInfos(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addNodeIndices(builder: flatbuffers.Builder, nodeIndicesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, nodeIndicesOffset, 0);\n  }\n\n  static createNodeIndicesVector(builder: flatbuffers.Builder, data: number[] | Uint32Array): flatbuffers.Offset;\n  /**\n   * @deprecated This Uint8Array overload will be removed in the future.\n   */\n  static createNodeIndicesVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;\n  static createNodeIndicesVector(\n    builder: flatbuffers.Builder,\n    data: number[] | Uint32Array | Uint8Array,\n  ): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt32(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startNodeIndicesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addKernelDefHashes(builder: flatbuffers.Builder, kernelDefHashesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, kernelDefHashesOffset, 0);\n  }\n\n  static createKernelDefHashesVector(builder: flatbuffers.Builder, data: bigint[]): flatbuffers.Offset {\n    builder.startVector(8, data.length, 8);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addInt64(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startKernelDefHashesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(8, numElems, 8);\n  }\n\n  static endDeprecatedKernelCreateInfos(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createDeprecatedKernelCreateInfos(\n    builder: flatbuffers.Builder,\n    nodeIndicesOffset: flatbuffers.Offset,\n    kernelDefHashesOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    DeprecatedKernelCreateInfos.startDeprecatedKernelCreateInfos(builder);\n    DeprecatedKernelCreateInfos.addNodeIndices(builder, nodeIndicesOffset);\n    DeprecatedKernelCreateInfos.addKernelDefHashes(builder, kernelDefHashesOffset);\n    return DeprecatedKernelCreateInfos.endDeprecatedKernelCreateInfos(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\n/**\n * deprecated: no longer using kernel def hashes\n */\nexport class DeprecatedNodeIndexAndKernelDefHash {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): DeprecatedNodeIndexAndKernelDefHash {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsDeprecatedNodeIndexAndKernelDefHash(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedNodeIndexAndKernelDefHash,\n  ): DeprecatedNodeIndexAndKernelDefHash {\n    return (obj || new DeprecatedNodeIndexAndKernelDefHash()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsDeprecatedNodeIndexAndKernelDefHash(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedNodeIndexAndKernelDefHash,\n  ): DeprecatedNodeIndexAndKernelDefHash {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new DeprecatedNodeIndexAndKernelDefHash()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  nodeIndex(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;\n  }\n\n  kernelDefHash(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');\n  }\n\n  static startDeprecatedNodeIndexAndKernelDefHash(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addNodeIndex(builder: flatbuffers.Builder, nodeIndex: number) {\n    builder.addFieldInt32(0, nodeIndex, 0);\n  }\n\n  static addKernelDefHash(builder: flatbuffers.Builder, kernelDefHash: bigint) {\n    builder.addFieldInt64(1, kernelDefHash, BigInt('0'));\n  }\n\n  static endDeprecatedNodeIndexAndKernelDefHash(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createDeprecatedNodeIndexAndKernelDefHash(\n    builder: flatbuffers.Builder,\n    nodeIndex: number,\n    kernelDefHash: bigint,\n  ): flatbuffers.Offset {\n    DeprecatedNodeIndexAndKernelDefHash.startDeprecatedNodeIndexAndKernelDefHash(builder);\n    DeprecatedNodeIndexAndKernelDefHash.addNodeIndex(builder, nodeIndex);\n    DeprecatedNodeIndexAndKernelDefHash.addKernelDefHash(builder, kernelDefHash);\n    return DeprecatedNodeIndexAndKernelDefHash.endDeprecatedNodeIndexAndKernelDefHash(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { DeprecatedSessionState } from '../../onnxruntime/fbs/deprecated-session-state.js';\n\n/**\n * deprecated: no longer using kernel def hashes\n */\nexport class DeprecatedSubGraphSessionState {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): DeprecatedSubGraphSessionState {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsDeprecatedSubGraphSessionState(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedSubGraphSessionState,\n  ): DeprecatedSubGraphSessionState {\n    return (obj || new DeprecatedSubGraphSessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsDeprecatedSubGraphSessionState(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedSubGraphSessionState,\n  ): DeprecatedSubGraphSessionState {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new DeprecatedSubGraphSessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  graphId(): string | null;\n  graphId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  graphId(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  sessionState(obj?: DeprecatedSessionState): DeprecatedSessionState | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new DeprecatedSessionState()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!)\n      : null;\n  }\n\n  static startDeprecatedSubGraphSessionState(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addGraphId(builder: flatbuffers.Builder, graphIdOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, graphIdOffset, 0);\n  }\n\n  static addSessionState(builder: flatbuffers.Builder, sessionStateOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, sessionStateOffset, 0);\n  }\n\n  static endDeprecatedSubGraphSessionState(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    builder.requiredField(offset, 4); // graph_id\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { DeprecatedKernelCreateInfos } from '../../onnxruntime/fbs/deprecated-kernel-create-infos.js';\nimport { DeprecatedSubGraphSessionState } from '../../onnxruntime/fbs/deprecated-sub-graph-session-state.js';\n\n/**\n * deprecated: no longer using kernel def hashes\n */\nexport class DeprecatedSessionState {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): DeprecatedSessionState {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsDeprecatedSessionState(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedSessionState,\n  ): DeprecatedSessionState {\n    return (obj || new DeprecatedSessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsDeprecatedSessionState(\n    bb: flatbuffers.ByteBuffer,\n    obj?: DeprecatedSessionState,\n  ): DeprecatedSessionState {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new DeprecatedSessionState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  kernels(obj?: DeprecatedKernelCreateInfos): DeprecatedKernelCreateInfos | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? (obj || new DeprecatedKernelCreateInfos()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!)\n      : null;\n  }\n\n  subGraphSessionStates(index: number, obj?: DeprecatedSubGraphSessionState): DeprecatedSubGraphSessionState | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new DeprecatedSubGraphSessionState()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  subGraphSessionStatesLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startDeprecatedSessionState(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addKernels(builder: flatbuffers.Builder, kernelsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, kernelsOffset, 0);\n  }\n\n  static addSubGraphSessionStates(builder: flatbuffers.Builder, subGraphSessionStatesOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, subGraphSessionStatesOffset, 0);\n  }\n\n  static createSubGraphSessionStatesVector(\n    builder: flatbuffers.Builder,\n    data: flatbuffers.Offset[],\n  ): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startSubGraphSessionStatesVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endDeprecatedSessionState(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createDeprecatedSessionState(\n    builder: flatbuffers.Builder,\n    kernelsOffset: flatbuffers.Offset,\n    subGraphSessionStatesOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    DeprecatedSessionState.startDeprecatedSessionState(builder);\n    DeprecatedSessionState.addKernels(builder, kernelsOffset);\n    DeprecatedSessionState.addSubGraphSessionStates(builder, subGraphSessionStatesOffset);\n    return DeprecatedSessionState.endDeprecatedSessionState(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { ArgTypeAndIndex } from '../../onnxruntime/fbs/arg-type-and-index.js';\n\nexport class KernelTypeStrArgsEntry {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): KernelTypeStrArgsEntry {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsKernelTypeStrArgsEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: KernelTypeStrArgsEntry,\n  ): KernelTypeStrArgsEntry {\n    return (obj || new KernelTypeStrArgsEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsKernelTypeStrArgsEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: KernelTypeStrArgsEntry,\n  ): KernelTypeStrArgsEntry {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new KernelTypeStrArgsEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  kernelTypeStr(): string | null;\n  kernelTypeStr(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  kernelTypeStr(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  args(index: number, obj?: ArgTypeAndIndex): ArgTypeAndIndex | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new ArgTypeAndIndex()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  argsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startKernelTypeStrArgsEntry(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addKernelTypeStr(builder: flatbuffers.Builder, kernelTypeStrOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, kernelTypeStrOffset, 0);\n  }\n\n  static addArgs(builder: flatbuffers.Builder, argsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, argsOffset, 0);\n  }\n\n  static createArgsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startArgsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endKernelTypeStrArgsEntry(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    builder.requiredField(offset, 4); // kernel_type_str\n    return offset;\n  }\n\n  static createKernelTypeStrArgsEntry(\n    builder: flatbuffers.Builder,\n    kernelTypeStrOffset: flatbuffers.Offset,\n    argsOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    KernelTypeStrArgsEntry.startKernelTypeStrArgsEntry(builder);\n    KernelTypeStrArgsEntry.addKernelTypeStr(builder, kernelTypeStrOffset);\n    KernelTypeStrArgsEntry.addArgs(builder, argsOffset);\n    return KernelTypeStrArgsEntry.endKernelTypeStrArgsEntry(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { KernelTypeStrArgsEntry } from '../../onnxruntime/fbs/kernel-type-str-args-entry.js';\n\nexport class OpIdKernelTypeStrArgsEntry {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): OpIdKernelTypeStrArgsEntry {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsOpIdKernelTypeStrArgsEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: OpIdKernelTypeStrArgsEntry,\n  ): OpIdKernelTypeStrArgsEntry {\n    return (obj || new OpIdKernelTypeStrArgsEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsOpIdKernelTypeStrArgsEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: OpIdKernelTypeStrArgsEntry,\n  ): OpIdKernelTypeStrArgsEntry {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new OpIdKernelTypeStrArgsEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  opId(): string | null;\n  opId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  opId(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  kernelTypeStrArgs(index: number, obj?: KernelTypeStrArgsEntry): KernelTypeStrArgsEntry | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new KernelTypeStrArgsEntry()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  kernelTypeStrArgsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startOpIdKernelTypeStrArgsEntry(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addOpId(builder: flatbuffers.Builder, opIdOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, opIdOffset, 0);\n  }\n\n  static addKernelTypeStrArgs(builder: flatbuffers.Builder, kernelTypeStrArgsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, kernelTypeStrArgsOffset, 0);\n  }\n\n  static createKernelTypeStrArgsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startKernelTypeStrArgsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endOpIdKernelTypeStrArgsEntry(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    builder.requiredField(offset, 4); // op_id\n    return offset;\n  }\n\n  static createOpIdKernelTypeStrArgsEntry(\n    builder: flatbuffers.Builder,\n    opIdOffset: flatbuffers.Offset,\n    kernelTypeStrArgsOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    OpIdKernelTypeStrArgsEntry.startOpIdKernelTypeStrArgsEntry(builder);\n    OpIdKernelTypeStrArgsEntry.addOpId(builder, opIdOffset);\n    OpIdKernelTypeStrArgsEntry.addKernelTypeStrArgs(builder, kernelTypeStrArgsOffset);\n    return OpIdKernelTypeStrArgsEntry.endOpIdKernelTypeStrArgsEntry(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { OpIdKernelTypeStrArgsEntry } from '../../onnxruntime/fbs/op-id-kernel-type-str-args-entry.js';\n\nexport class KernelTypeStrResolver {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): KernelTypeStrResolver {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsKernelTypeStrResolver(\n    bb: flatbuffers.ByteBuffer,\n    obj?: KernelTypeStrResolver,\n  ): KernelTypeStrResolver {\n    return (obj || new KernelTypeStrResolver()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsKernelTypeStrResolver(\n    bb: flatbuffers.ByteBuffer,\n    obj?: KernelTypeStrResolver,\n  ): KernelTypeStrResolver {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new KernelTypeStrResolver()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  opKernelTypeStrArgs(index: number, obj?: OpIdKernelTypeStrArgsEntry): OpIdKernelTypeStrArgsEntry | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset\n      ? (obj || new OpIdKernelTypeStrArgsEntry()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  opKernelTypeStrArgsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startKernelTypeStrResolver(builder: flatbuffers.Builder) {\n    builder.startObject(1);\n  }\n\n  static addOpKernelTypeStrArgs(builder: flatbuffers.Builder, opKernelTypeStrArgsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, opKernelTypeStrArgsOffset, 0);\n  }\n\n  static createOpKernelTypeStrArgsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startOpKernelTypeStrArgsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endKernelTypeStrResolver(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createKernelTypeStrResolver(\n    builder: flatbuffers.Builder,\n    opKernelTypeStrArgsOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    KernelTypeStrResolver.startKernelTypeStrResolver(builder);\n    KernelTypeStrResolver.addOpKernelTypeStrArgs(builder, opKernelTypeStrArgsOffset);\n    return KernelTypeStrResolver.endKernelTypeStrResolver(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nexport class OperatorSetId {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): OperatorSetId {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsOperatorSetId(bb: flatbuffers.ByteBuffer, obj?: OperatorSetId): OperatorSetId {\n    return (obj || new OperatorSetId()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsOperatorSetId(bb: flatbuffers.ByteBuffer, obj?: OperatorSetId): OperatorSetId {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new OperatorSetId()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  domain(): string | null;\n  domain(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  domain(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  version(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');\n  }\n\n  static startOperatorSetId(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addDomain(builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, domainOffset, 0);\n  }\n\n  static addVersion(builder: flatbuffers.Builder, version: bigint) {\n    builder.addFieldInt64(1, version, BigInt('0'));\n  }\n\n  static endOperatorSetId(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createOperatorSetId(\n    builder: flatbuffers.Builder,\n    domainOffset: flatbuffers.Offset,\n    version: bigint,\n  ): flatbuffers.Offset {\n    OperatorSetId.startOperatorSetId(builder);\n    OperatorSetId.addDomain(builder, domainOffset);\n    OperatorSetId.addVersion(builder, version);\n    return OperatorSetId.endOperatorSetId(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nexport class StringStringEntry {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): StringStringEntry {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsStringStringEntry(bb: flatbuffers.ByteBuffer, obj?: StringStringEntry): StringStringEntry {\n    return (obj || new StringStringEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsStringStringEntry(\n    bb: flatbuffers.ByteBuffer,\n    obj?: StringStringEntry,\n  ): StringStringEntry {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new StringStringEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  key(): string | null;\n  key(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  key(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  value(): string | null;\n  value(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  value(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  static startStringStringEntry(builder: flatbuffers.Builder) {\n    builder.startObject(2);\n  }\n\n  static addKey(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, keyOffset, 0);\n  }\n\n  static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, valueOffset, 0);\n  }\n\n  static endStringStringEntry(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static createStringStringEntry(\n    builder: flatbuffers.Builder,\n    keyOffset: flatbuffers.Offset,\n    valueOffset: flatbuffers.Offset,\n  ): flatbuffers.Offset {\n    StringStringEntry.startStringStringEntry(builder);\n    StringStringEntry.addKey(builder, keyOffset);\n    StringStringEntry.addValue(builder, valueOffset);\n    return StringStringEntry.endStringStringEntry(builder);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Graph } from '../../onnxruntime/fbs/graph.js';\nimport { OperatorSetId } from '../../onnxruntime/fbs/operator-set-id.js';\nimport { StringStringEntry } from '../../onnxruntime/fbs/string-string-entry.js';\n\nexport class Model {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): Model {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsModel(bb: flatbuffers.ByteBuffer, obj?: Model): Model {\n    return (obj || new Model()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsModel(bb: flatbuffers.ByteBuffer, obj?: Model): Model {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new Model()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  irVersion(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');\n  }\n\n  opsetImport(index: number, obj?: OperatorSetId): OperatorSetId | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset\n      ? (obj || new OperatorSetId()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  opsetImportLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  producerName(): string | null;\n  producerName(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  producerName(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 8);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  producerVersion(): string | null;\n  producerVersion(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  producerVersion(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  domain(): string | null;\n  domain(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  domain(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 12);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  modelVersion(): bigint {\n    const offset = this.bb!.__offset(this.bb_pos, 14);\n    return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');\n  }\n\n  docString(): string | null;\n  docString(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  docString(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 16);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  graph(obj?: Graph): Graph | null {\n    const offset = this.bb!.__offset(this.bb_pos, 18);\n    return offset ? (obj || new Graph()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  graphDocString(): string | null;\n  graphDocString(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  graphDocString(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 20);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  metadataProps(index: number, obj?: StringStringEntry): StringStringEntry | null {\n    const offset = this.bb!.__offset(this.bb_pos, 22);\n    return offset\n      ? (obj || new StringStringEntry()).__init(\n          this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4),\n          this.bb!,\n        )\n      : null;\n  }\n\n  metadataPropsLength(): number {\n    const offset = this.bb!.__offset(this.bb_pos, 22);\n    return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;\n  }\n\n  static startModel(builder: flatbuffers.Builder) {\n    builder.startObject(10);\n  }\n\n  static addIrVersion(builder: flatbuffers.Builder, irVersion: bigint) {\n    builder.addFieldInt64(0, irVersion, BigInt('0'));\n  }\n\n  static addOpsetImport(builder: flatbuffers.Builder, opsetImportOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, opsetImportOffset, 0);\n  }\n\n  static createOpsetImportVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startOpsetImportVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static addProducerName(builder: flatbuffers.Builder, producerNameOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(2, producerNameOffset, 0);\n  }\n\n  static addProducerVersion(builder: flatbuffers.Builder, producerVersionOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(3, producerVersionOffset, 0);\n  }\n\n  static addDomain(builder: flatbuffers.Builder, domainOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(4, domainOffset, 0);\n  }\n\n  static addModelVersion(builder: flatbuffers.Builder, modelVersion: bigint) {\n    builder.addFieldInt64(5, modelVersion, BigInt('0'));\n  }\n\n  static addDocString(builder: flatbuffers.Builder, docStringOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(6, docStringOffset, 0);\n  }\n\n  static addGraph(builder: flatbuffers.Builder, graphOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(7, graphOffset, 0);\n  }\n\n  static addGraphDocString(builder: flatbuffers.Builder, graphDocStringOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(8, graphDocStringOffset, 0);\n  }\n\n  static addMetadataProps(builder: flatbuffers.Builder, metadataPropsOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(9, metadataPropsOffset, 0);\n  }\n\n  static createMetadataPropsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset {\n    builder.startVector(4, data.length, 4);\n    for (let i = data.length - 1; i >= 0; i--) {\n      builder.addOffset(data[i]!);\n    }\n    return builder.endVector();\n  }\n\n  static startMetadataPropsVector(builder: flatbuffers.Builder, numElems: number) {\n    builder.startVector(4, numElems, 4);\n  }\n\n  static endModel(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { KernelTypeStrResolver } from '../../onnxruntime/fbs/kernel-type-str-resolver.js';\nimport { Model } from '../../onnxruntime/fbs/model.js';\n\nexport class InferenceSession {\n  bb: flatbuffers.ByteBuffer | null = null;\n  bb_pos = 0;\n  __init(i: number, bb: flatbuffers.ByteBuffer): InferenceSession {\n    this.bb_pos = i;\n    this.bb = bb;\n    return this;\n  }\n\n  static getRootAsInferenceSession(bb: flatbuffers.ByteBuffer, obj?: InferenceSession): InferenceSession {\n    return (obj || new InferenceSession()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static getSizePrefixedRootAsInferenceSession(bb: flatbuffers.ByteBuffer, obj?: InferenceSession): InferenceSession {\n    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n    return (obj || new InferenceSession()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n  }\n\n  static bufferHasIdentifier(bb: flatbuffers.ByteBuffer): boolean {\n    return bb.__has_identifier('ORTM');\n  }\n\n  ortVersion(): string | null;\n  ortVersion(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;\n  ortVersion(optionalEncoding?: any): string | Uint8Array | null {\n    const offset = this.bb!.__offset(this.bb_pos, 4);\n    return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;\n  }\n\n  model(obj?: Model): Model | null {\n    const offset = this.bb!.__offset(this.bb_pos, 6);\n    return offset ? (obj || new Model()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;\n  }\n\n  kernelTypeStrResolver(obj?: KernelTypeStrResolver): KernelTypeStrResolver | null {\n    const offset = this.bb!.__offset(this.bb_pos, 10);\n    return offset\n      ? (obj || new KernelTypeStrResolver()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!)\n      : null;\n  }\n\n  static startInferenceSession(builder: flatbuffers.Builder) {\n    builder.startObject(4);\n  }\n\n  static addOrtVersion(builder: flatbuffers.Builder, ortVersionOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(0, ortVersionOffset, 0);\n  }\n\n  static addModel(builder: flatbuffers.Builder, modelOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(1, modelOffset, 0);\n  }\n\n  static addKernelTypeStrResolver(builder: flatbuffers.Builder, kernelTypeStrResolverOffset: flatbuffers.Offset) {\n    builder.addFieldOffset(3, kernelTypeStrResolverOffset, 0);\n  }\n\n  static endInferenceSession(builder: flatbuffers.Builder): flatbuffers.Offset {\n    const offset = builder.endObject();\n    return offset;\n  }\n\n  static finishInferenceSessionBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset) {\n    builder.finish(offset, 'ORTM');\n  }\n\n  static finishSizePrefixedInferenceSessionBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset) {\n    builder.finish(offset, 'ORTM', true);\n  }\n}\n", "// automatically generated by the FlatBuffers compiler, do not modify\n\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\nexport { ArgType } from './fbs/arg-type.js';\nexport { ArgTypeAndIndex } from './fbs/arg-type-and-index.js';\nexport { Attribute } from './fbs/attribute.js';\nexport { AttributeType } from './fbs/attribute-type.js';\nexport { DeprecatedKernelCreateInfos } from './fbs/deprecated-kernel-create-infos.js';\nexport { DeprecatedNodeIndexAndKernelDefHash } from './fbs/deprecated-node-index-and-kernel-def-hash.js';\nexport { DeprecatedSessionState } from './fbs/deprecated-session-state.js';\nexport { DeprecatedSubGraphSessionState } from './fbs/deprecated-sub-graph-session-state.js';\nexport { Dimension } from './fbs/dimension.js';\nexport { DimensionValue } from './fbs/dimension-value.js';\nexport { DimensionValueType } from './fbs/dimension-value-type.js';\nexport { EdgeEnd } from './fbs/edge-end.js';\nexport { Graph } from './fbs/graph.js';\nexport { InferenceSession } from './fbs/inference-session.js';\nexport { KernelTypeStrArgsEntry } from './fbs/kernel-type-str-args-entry.js';\nexport { KernelTypeStrResolver } from './fbs/kernel-type-str-resolver.js';\nexport { MapType } from './fbs/map-type.js';\nexport { Model } from './fbs/model.js';\nexport { Node } from './fbs/node.js';\nexport { NodeEdge } from './fbs/node-edge.js';\nexport { NodeType } from './fbs/node-type.js';\nexport { NodesToOptimizeIndices } from './fbs/nodes-to-optimize-indices.js';\nexport { OpIdKernelTypeStrArgsEntry } from './fbs/op-id-kernel-type-str-args-entry.js';\nexport { OperatorSetId } from './fbs/operator-set-id.js';\nexport { RuntimeOptimizationRecord } from './fbs/runtime-optimization-record.js';\nexport { RuntimeOptimizationRecordContainerEntry } from './fbs/runtime-optimization-record-container-entry.js';\nexport { RuntimeOptimizations } from './fbs/runtime-optimizations.js';\nexport { SequenceType } from './fbs/sequence-type.js';\nexport { Shape } from './fbs/shape.js';\nexport { SparseTensor } from './fbs/sparse-tensor.js';\nexport { StringStringEntry } from './fbs/string-string-entry.js';\nexport { Tensor } from './fbs/tensor.js';\nexport { TensorDataType } from './fbs/tensor-data-type.js';\nexport { TensorTypeAndShape } from './fbs/tensor-type-and-shape.js';\nexport { TypeInfo } from './fbs/type-info.js';\nexport { TypeInfoValue } from './fbs/type-info-value.js';\nexport { ValueInfo } from './fbs/value-info.js';\n", "export * from './onnxruntime/fbs';\n", "\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n    var params  = new Array(arguments.length - 1),\r\n        offset  = 0,\r\n        index   = 2,\r\n        pending = true;\r\n    while (index < arguments.length)\r\n        params[offset++] = arguments[index++];\r\n    return new Promise(function executor(resolve, reject) {\r\n        params[offset] = function callback(err/*, varargs */) {\r\n            if (pending) {\r\n                pending = false;\r\n                if (err)\r\n                    reject(err);\r\n                else {\r\n                    var params = new Array(arguments.length - 1),\r\n                        offset = 0;\r\n                    while (offset < params.length)\r\n                        params[offset++] = arguments[offset];\r\n                    resolve.apply(null, params);\r\n                }\r\n            }\r\n        };\r\n        try {\r\n            fn.apply(ctx || null, params);\r\n        } catch (err) {\r\n            if (pending) {\r\n                pending = false;\r\n                reject(err);\r\n            }\r\n        }\r\n    });\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n    var p = string.length;\r\n    if (!p)\r\n        return 0;\r\n    var n = 0;\r\n    while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n        ++n;\r\n    return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n    s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n    var parts = null,\r\n        chunk = [];\r\n    var i = 0, // output index\r\n        j = 0, // goto index\r\n        t;     // temporary\r\n    while (start < end) {\r\n        var b = buffer[start++];\r\n        switch (j) {\r\n            case 0:\r\n                chunk[i++] = b64[b >> 2];\r\n                t = (b & 3) << 4;\r\n                j = 1;\r\n                break;\r\n            case 1:\r\n                chunk[i++] = b64[t | b >> 4];\r\n                t = (b & 15) << 2;\r\n                j = 2;\r\n                break;\r\n            case 2:\r\n                chunk[i++] = b64[t | b >> 6];\r\n                chunk[i++] = b64[b & 63];\r\n                j = 0;\r\n                break;\r\n        }\r\n        if (i > 8191) {\r\n            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n            i = 0;\r\n        }\r\n    }\r\n    if (j) {\r\n        chunk[i++] = b64[t];\r\n        chunk[i++] = 61;\r\n        if (j === 1)\r\n            chunk[i++] = 61;\r\n    }\r\n    if (parts) {\r\n        if (i)\r\n            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n        return parts.join(\"\");\r\n    }\r\n    return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n    var start = offset;\r\n    var j = 0, // goto index\r\n        t;     // temporary\r\n    for (var i = 0; i < string.length;) {\r\n        var c = string.charCodeAt(i++);\r\n        if (c === 61 && j > 1)\r\n            break;\r\n        if ((c = s64[c]) === undefined)\r\n            throw Error(invalidEncoding);\r\n        switch (j) {\r\n            case 0:\r\n                t = c;\r\n                j = 1;\r\n                break;\r\n            case 1:\r\n                buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n                t = c;\r\n                j = 2;\r\n                break;\r\n            case 2:\r\n                buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n                t = c;\r\n                j = 3;\r\n                break;\r\n            case 3:\r\n                buffer[offset++] = (t & 3) << 6 | c;\r\n                j = 0;\r\n                break;\r\n        }\r\n    }\r\n    if (j === 1)\r\n        throw Error(invalidEncoding);\r\n    return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n    return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n", "\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n    /**\r\n     * Registered listeners.\r\n     * @type {Object.<string,*>}\r\n     * @private\r\n     */\r\n    this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n    (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n        fn  : fn,\r\n        ctx : ctx || this\r\n    });\r\n    return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n    if (evt === undefined)\r\n        this._listeners = {};\r\n    else {\r\n        if (fn === undefined)\r\n            this._listeners[evt] = [];\r\n        else {\r\n            var listeners = this._listeners[evt];\r\n            for (var i = 0; i < listeners.length;)\r\n                if (listeners[i].fn === fn)\r\n                    listeners.splice(i, 1);\r\n                else\r\n                    ++i;\r\n        }\r\n    }\r\n    return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n    var listeners = this._listeners[evt];\r\n    if (listeners) {\r\n        var args = [],\r\n            i = 1;\r\n        for (; i < arguments.length;)\r\n            args.push(arguments[i++]);\r\n        for (i = 0; i < listeners.length;)\r\n            listeners[i].fn.apply(listeners[i++].ctx, args);\r\n    }\r\n    return this;\r\n};\r\n", "\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n    // float: typed array\r\n    if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n        var f32 = new Float32Array([ -0 ]),\r\n            f8b = new Uint8Array(f32.buffer),\r\n            le  = f8b[3] === 128;\r\n\r\n        function writeFloat_f32_cpy(val, buf, pos) {\r\n            f32[0] = val;\r\n            buf[pos    ] = f8b[0];\r\n            buf[pos + 1] = f8b[1];\r\n            buf[pos + 2] = f8b[2];\r\n            buf[pos + 3] = f8b[3];\r\n        }\r\n\r\n        function writeFloat_f32_rev(val, buf, pos) {\r\n            f32[0] = val;\r\n            buf[pos    ] = f8b[3];\r\n            buf[pos + 1] = f8b[2];\r\n            buf[pos + 2] = f8b[1];\r\n            buf[pos + 3] = f8b[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n        /* istanbul ignore next */\r\n        exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n        function readFloat_f32_cpy(buf, pos) {\r\n            f8b[0] = buf[pos    ];\r\n            f8b[1] = buf[pos + 1];\r\n            f8b[2] = buf[pos + 2];\r\n            f8b[3] = buf[pos + 3];\r\n            return f32[0];\r\n        }\r\n\r\n        function readFloat_f32_rev(buf, pos) {\r\n            f8b[3] = buf[pos    ];\r\n            f8b[2] = buf[pos + 1];\r\n            f8b[1] = buf[pos + 2];\r\n            f8b[0] = buf[pos + 3];\r\n            return f32[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n        /* istanbul ignore next */\r\n        exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n    // float: ieee754\r\n    })(); else (function() {\r\n\r\n        function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n            var sign = val < 0 ? 1 : 0;\r\n            if (sign)\r\n                val = -val;\r\n            if (val === 0)\r\n                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n            else if (isNaN(val))\r\n                writeUint(2143289344, buf, pos);\r\n            else if (val > 3.4028234663852886e+38) // +-Infinity\r\n                writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n            else if (val < 1.1754943508222875e-38) // denormal\r\n                writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n            else {\r\n                var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n                    mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n                writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n            }\r\n        }\r\n\r\n        exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n        exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n        function readFloat_ieee754(readUint, buf, pos) {\r\n            var uint = readUint(buf, pos),\r\n                sign = (uint >> 31) * 2 + 1,\r\n                exponent = uint >>> 23 & 255,\r\n                mantissa = uint & 8388607;\r\n            return exponent === 255\r\n                ? mantissa\r\n                ? NaN\r\n                : sign * Infinity\r\n                : exponent === 0 // denormal\r\n                ? sign * 1.401298464324817e-45 * mantissa\r\n                : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n        }\r\n\r\n        exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n        exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n    })();\r\n\r\n    // double: typed array\r\n    if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n        var f64 = new Float64Array([-0]),\r\n            f8b = new Uint8Array(f64.buffer),\r\n            le  = f8b[7] === 128;\r\n\r\n        function writeDouble_f64_cpy(val, buf, pos) {\r\n            f64[0] = val;\r\n            buf[pos    ] = f8b[0];\r\n            buf[pos + 1] = f8b[1];\r\n            buf[pos + 2] = f8b[2];\r\n            buf[pos + 3] = f8b[3];\r\n            buf[pos + 4] = f8b[4];\r\n            buf[pos + 5] = f8b[5];\r\n            buf[pos + 6] = f8b[6];\r\n            buf[pos + 7] = f8b[7];\r\n        }\r\n\r\n        function writeDouble_f64_rev(val, buf, pos) {\r\n            f64[0] = val;\r\n            buf[pos    ] = f8b[7];\r\n            buf[pos + 1] = f8b[6];\r\n            buf[pos + 2] = f8b[5];\r\n            buf[pos + 3] = f8b[4];\r\n            buf[pos + 4] = f8b[3];\r\n            buf[pos + 5] = f8b[2];\r\n            buf[pos + 6] = f8b[1];\r\n            buf[pos + 7] = f8b[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n        /* istanbul ignore next */\r\n        exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n        function readDouble_f64_cpy(buf, pos) {\r\n            f8b[0] = buf[pos    ];\r\n            f8b[1] = buf[pos + 1];\r\n            f8b[2] = buf[pos + 2];\r\n            f8b[3] = buf[pos + 3];\r\n            f8b[4] = buf[pos + 4];\r\n            f8b[5] = buf[pos + 5];\r\n            f8b[6] = buf[pos + 6];\r\n            f8b[7] = buf[pos + 7];\r\n            return f64[0];\r\n        }\r\n\r\n        function readDouble_f64_rev(buf, pos) {\r\n            f8b[7] = buf[pos    ];\r\n            f8b[6] = buf[pos + 1];\r\n            f8b[5] = buf[pos + 2];\r\n            f8b[4] = buf[pos + 3];\r\n            f8b[3] = buf[pos + 4];\r\n            f8b[2] = buf[pos + 5];\r\n            f8b[1] = buf[pos + 6];\r\n            f8b[0] = buf[pos + 7];\r\n            return f64[0];\r\n        }\r\n\r\n        /* istanbul ignore next */\r\n        exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n        /* istanbul ignore next */\r\n        exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n    // double: ieee754\r\n    })(); else (function() {\r\n\r\n        function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n            var sign = val < 0 ? 1 : 0;\r\n            if (sign)\r\n                val = -val;\r\n            if (val === 0) {\r\n                writeUint(0, buf, pos + off0);\r\n                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n            } else if (isNaN(val)) {\r\n                writeUint(0, buf, pos + off0);\r\n                writeUint(2146959360, buf, pos + off1);\r\n            } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n                writeUint(0, buf, pos + off0);\r\n                writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n            } else {\r\n                var mantissa;\r\n                if (val < 2.2250738585072014e-308) { // denormal\r\n                    mantissa = val / 5e-324;\r\n                    writeUint(mantissa >>> 0, buf, pos + off0);\r\n                    writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n                } else {\r\n                    var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n                    if (exponent === 1024)\r\n                        exponent = 1023;\r\n                    mantissa = val * Math.pow(2, -exponent);\r\n                    writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n                    writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n                }\r\n            }\r\n        }\r\n\r\n        exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n        exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n        function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n            var lo = readUint(buf, pos + off0),\r\n                hi = readUint(buf, pos + off1);\r\n            var sign = (hi >> 31) * 2 + 1,\r\n                exponent = hi >>> 20 & 2047,\r\n                mantissa = 4294967296 * (hi & 1048575) + lo;\r\n            return exponent === 2047\r\n                ? mantissa\r\n                ? NaN\r\n                : sign * Infinity\r\n                : exponent === 0 // denormal\r\n                ? sign * 5e-324 * mantissa\r\n                : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n        }\r\n\r\n        exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n        exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n    })();\r\n\r\n    return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n    buf[pos    ] =  val        & 255;\r\n    buf[pos + 1] =  val >>> 8  & 255;\r\n    buf[pos + 2] =  val >>> 16 & 255;\r\n    buf[pos + 3] =  val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n    buf[pos    ] =  val >>> 24;\r\n    buf[pos + 1] =  val >>> 16 & 255;\r\n    buf[pos + 2] =  val >>> 8  & 255;\r\n    buf[pos + 3] =  val        & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n    return (buf[pos    ]\r\n          | buf[pos + 1] << 8\r\n          | buf[pos + 2] << 16\r\n          | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n    return (buf[pos    ] << 24\r\n          | buf[pos + 1] << 16\r\n          | buf[pos + 2] << 8\r\n          | buf[pos + 3]) >>> 0;\r\n}\r\n", "\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n    try {\r\n        var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n        if (mod && (mod.length || Object.keys(mod).length))\r\n            return mod;\r\n    } catch (e) {} // eslint-disable-line no-empty\r\n    return null;\r\n}\r\n", "\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n    var len = 0,\r\n        c = 0;\r\n    for (var i = 0; i < string.length; ++i) {\r\n        c = string.charCodeAt(i);\r\n        if (c < 128)\r\n            len += 1;\r\n        else if (c < 2048)\r\n            len += 2;\r\n        else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n            ++i;\r\n            len += 4;\r\n        } else\r\n            len += 3;\r\n    }\r\n    return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n    var len = end - start;\r\n    if (len < 1)\r\n        return \"\";\r\n    var parts = null,\r\n        chunk = [],\r\n        i = 0, // char offset\r\n        t;     // temporary\r\n    while (start < end) {\r\n        t = buffer[start++];\r\n        if (t < 128)\r\n            chunk[i++] = t;\r\n        else if (t > 191 && t < 224)\r\n            chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n        else if (t > 239 && t < 365) {\r\n            t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n            chunk[i++] = 0xD800 + (t >> 10);\r\n            chunk[i++] = 0xDC00 + (t & 1023);\r\n        } else\r\n            chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n        if (i > 8191) {\r\n            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n            i = 0;\r\n        }\r\n    }\r\n    if (parts) {\r\n        if (i)\r\n            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n        return parts.join(\"\");\r\n    }\r\n    return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n    var start = offset,\r\n        c1, // character 1\r\n        c2; // character 2\r\n    for (var i = 0; i < string.length; ++i) {\r\n        c1 = string.charCodeAt(i);\r\n        if (c1 < 128) {\r\n            buffer[offset++] = c1;\r\n        } else if (c1 < 2048) {\r\n            buffer[offset++] = c1 >> 6       | 192;\r\n            buffer[offset++] = c1       & 63 | 128;\r\n        } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n            c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n            ++i;\r\n            buffer[offset++] = c1 >> 18      | 240;\r\n            buffer[offset++] = c1 >> 12 & 63 | 128;\r\n            buffer[offset++] = c1 >> 6  & 63 | 128;\r\n            buffer[offset++] = c1       & 63 | 128;\r\n        } else {\r\n            buffer[offset++] = c1 >> 12      | 224;\r\n            buffer[offset++] = c1 >> 6  & 63 | 128;\r\n            buffer[offset++] = c1       & 63 | 128;\r\n        }\r\n    }\r\n    return offset - start;\r\n};\r\n", "\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n    var SIZE   = size || 8192;\r\n    var MAX    = SIZE >>> 1;\r\n    var slab   = null;\r\n    var offset = SIZE;\r\n    return function pool_alloc(size) {\r\n        if (size < 1 || size > MAX)\r\n            return alloc(size);\r\n        if (offset + size > SIZE) {\r\n            slab = alloc(SIZE);\r\n            offset = 0;\r\n        }\r\n        var buf = slice.call(slab, offset, offset += size);\r\n        if (offset & 7) // align to 32 bit\r\n            offset = (offset | 7) + 1;\r\n        return buf;\r\n    };\r\n}\r\n", "\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n    // note that the casts below are theoretically unnecessary as of today, but older statically\n    // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n    /**\n     * Low bits.\n     * @type {number}\n     */\n    this.lo = lo >>> 0;\n\n    /**\n     * High bits.\n     * @type {number}\n     */\n    this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n    if (value === 0)\n        return zero;\n    var sign = value < 0;\n    if (sign)\n        value = -value;\n    var lo = value >>> 0,\n        hi = (value - lo) / 4294967296 >>> 0;\n    if (sign) {\n        hi = ~hi >>> 0;\n        lo = ~lo >>> 0;\n        if (++lo > 4294967295) {\n            lo = 0;\n            if (++hi > 4294967295)\n                hi = 0;\n        }\n    }\n    return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n    if (typeof value === \"number\")\n        return LongBits.fromNumber(value);\n    if (util.isString(value)) {\n        /* istanbul ignore else */\n        if (util.Long)\n            value = util.Long.fromString(value);\n        else\n            return LongBits.fromNumber(parseInt(value, 10));\n    }\n    return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n    if (!unsigned && this.hi >>> 31) {\n        var lo = ~this.lo + 1 >>> 0,\n            hi = ~this.hi     >>> 0;\n        if (!lo)\n            hi = hi + 1 >>> 0;\n        return -(lo + hi * 4294967296);\n    }\n    return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n    return util.Long\n        ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n        /* istanbul ignore next */\n        : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n    if (hash === zeroHash)\n        return zero;\n    return new LongBits(\n        ( charCodeAt.call(hash, 0)\n        | charCodeAt.call(hash, 1) << 8\n        | charCodeAt.call(hash, 2) << 16\n        | charCodeAt.call(hash, 3) << 24) >>> 0\n    ,\n        ( charCodeAt.call(hash, 4)\n        | charCodeAt.call(hash, 5) << 8\n        | charCodeAt.call(hash, 6) << 16\n        | charCodeAt.call(hash, 7) << 24) >>> 0\n    );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n    return String.fromCharCode(\n        this.lo        & 255,\n        this.lo >>> 8  & 255,\n        this.lo >>> 16 & 255,\n        this.lo >>> 24      ,\n        this.hi        & 255,\n        this.hi >>> 8  & 255,\n        this.hi >>> 16 & 255,\n        this.hi >>> 24\n    );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n    var mask =   this.hi >> 31;\n    this.hi  = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n    this.lo  = ( this.lo << 1                   ^ mask) >>> 0;\n    return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n    var mask = -(this.lo & 1);\n    this.lo  = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n    this.hi  = ( this.hi >>> 1                  ^ mask) >>> 0;\n    return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n    var part0 =  this.lo,\n        part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n        part2 =  this.hi >>> 24;\n    return part2 === 0\n         ? part1 === 0\n           ? part0 < 16384\n             ? part0 < 128 ? 1 : 2\n             : part0 < 2097152 ? 3 : 4\n           : part1 < 16384\n             ? part1 < 128 ? 5 : 6\n             : part1 < 2097152 ? 7 : 8\n         : part2 < 128 ? 9 : 10;\n};\n", "\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n                   && global\n                   && global.process\n                   && global.process.versions\n                   && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n           || typeof window !== \"undefined\" && window\n           || typeof self   !== \"undefined\" && self\n           || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n    return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n    return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n    return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n    var value = obj[prop];\n    if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n        return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n    return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor<Buffer>}\n */\nutil.Buffer = (function() {\n    try {\n        var Buffer = util.inquire(\"buffer\").Buffer;\n        // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n        return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n    } catch (e) {\n        /* istanbul ignore next */\n        return null;\n    }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n    /* istanbul ignore next */\n    return typeof sizeOrArray === \"number\"\n        ? util.Buffer\n            ? util._Buffer_allocUnsafe(sizeOrArray)\n            : new util.Array(sizeOrArray)\n        : util.Buffer\n            ? util._Buffer_from(sizeOrArray)\n            : typeof Uint8Array === \"undefined\"\n                ? sizeOrArray\n                : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor<Uint8Array>}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor<Long>}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n         || /* istanbul ignore next */ util.global.Long\n         || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n    return value\n        ? util.LongBits.from(value).toHash()\n        : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n    var bits = util.LongBits.fromHash(hash);\n    if (util.Long)\n        return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n    return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.<string,*>} dst Destination object\n * @param {Object.<string,*>} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.<string,*>} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n    for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n        if (dst[keys[i]] === undefined || !ifNotSet)\n            dst[keys[i]] = src[keys[i]];\n    return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n    return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor<Error>} Custom error constructor\n */\nfunction newError(name) {\n\n    function CustomError(message, properties) {\n\n        if (!(this instanceof CustomError))\n            return new CustomError(message, properties);\n\n        // Error.call(this, message);\n        // ^ just returns a new error instance because the ctor can be called as a function\n\n        Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n        /* istanbul ignore next */\n        if (Error.captureStackTrace) // node\n            Error.captureStackTrace(this, CustomError);\n        else\n            Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n        if (properties)\n            merge(this, properties);\n    }\n\n    CustomError.prototype = Object.create(Error.prototype, {\n        constructor: {\n            value: CustomError,\n            writable: true,\n            enumerable: false,\n            configurable: true,\n        },\n        name: {\n            get: function get() { return name; },\n            set: undefined,\n            enumerable: false,\n            // configurable: false would accurately preserve the behavior of\n            // the original, but I'm guessing that was not intentional.\n            // For an actual error subclass, this property would\n            // be configurable.\n            configurable: true,\n        },\n        toString: {\n            value: function value() { return this.name + \": \" + this.message; },\n            writable: true,\n            enumerable: false,\n            configurable: true,\n        },\n    });\n\n    return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message<T>\n * @constructor\n * @param {string} message Error message\n * @param {Object.<string,*>} [properties] Additional properties\n * @example\n * try {\n *     MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n *     if (e instanceof ProtocolError && e.instance)\n *         console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message<T>}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n    var fieldMap = {};\n    for (var i = 0; i < fieldNames.length; ++i)\n        fieldMap[fieldNames[i]] = 1;\n\n    /**\n     * @returns {string|undefined} Set field name, if any\n     * @this Object\n     * @ignore\n     */\n    return function() { // eslint-disable-line consistent-return\n        for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n            if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n                return keys[i];\n    };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n    /**\n     * @param {string} name Field name\n     * @returns {undefined}\n     * @this Object\n     * @ignore\n     */\n    return function(name) {\n        for (var i = 0; i < fieldNames.length; ++i)\n            if (fieldNames[i] !== name)\n                delete this[fieldNames[i]];\n    };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n    longs: String,\n    enums: String,\n    bytes: String,\n    json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n    var Buffer = util.Buffer;\n    /* istanbul ignore if */\n    if (!Buffer) {\n        util._Buffer_from = util._Buffer_allocUnsafe = null;\n        return;\n    }\n    // because node 4.x buffers are incompatible & immutable\n    // see: https://github.com/dcodeIO/protobuf.js/pull/665\n    util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n        /* istanbul ignore next */\n        function Buffer_from(value, encoding) {\n            return new Buffer(value, encoding);\n        };\n    util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n        /* istanbul ignore next */\n        function Buffer_allocUnsafe(size) {\n            return new Buffer(size);\n        };\n};\n", "\"use strict\";\nmodule.exports = Writer;\n\nvar util      = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits  = util.LongBits,\n    base64    = util.base64,\n    utf8      = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n    /**\n     * Function to call.\n     * @type {function(Uint8Array, number, *)}\n     */\n    this.fn = fn;\n\n    /**\n     * Value byte length.\n     * @type {number}\n     */\n    this.len = len;\n\n    /**\n     * Next operation.\n     * @type {Writer.Op|undefined}\n     */\n    this.next = undefined;\n\n    /**\n     * Value to write.\n     * @type {*}\n     */\n    this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n    /**\n     * Current head.\n     * @type {Writer.Op}\n     */\n    this.head = writer.head;\n\n    /**\n     * Current tail.\n     * @type {Writer.Op}\n     */\n    this.tail = writer.tail;\n\n    /**\n     * Current buffer length.\n     * @type {number}\n     */\n    this.len = writer.len;\n\n    /**\n     * Next state.\n     * @type {State|null}\n     */\n    this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n    /**\n     * Current length.\n     * @type {number}\n     */\n    this.len = 0;\n\n    /**\n     * Operations head.\n     * @type {Object}\n     */\n    this.head = new Op(noop, 0, 0);\n\n    /**\n     * Operations tail\n     * @type {Object}\n     */\n    this.tail = this.head;\n\n    /**\n     * Linked forked states.\n     * @type {Object|null}\n     */\n    this.states = null;\n\n    // When a value is written, the writer calculates its byte length and puts it into a linked\n    // list of operations to perform when finish() is called. This both allows us to allocate\n    // buffers of the exact required size and reduces the amount of work we have to do compared\n    // to first calculating over objects and then encoding over objects. In our case, the encoding\n    // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n    return util.Buffer\n        ? function create_buffer_setup() {\n            return (Writer.create = function create_buffer() {\n                return new BufferWriter();\n            })();\n        }\n        /* istanbul ignore next */\n        : function create_array() {\n            return new Writer();\n        };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n    return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n    Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n    this.tail = this.tail.next = new Op(fn, len, val);\n    this.len += len;\n    return this;\n};\n\nfunction writeByte(val, buf, pos) {\n    buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n    while (val > 127) {\n        buf[pos++] = val & 127 | 128;\n        val >>>= 7;\n    }\n    buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n    this.len = len;\n    this.next = undefined;\n    this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n    // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n    // uint32 is by far the most frequently used operation and benefits significantly from this.\n    this.len += (this.tail = this.tail.next = new VarintOp(\n        (value = value >>> 0)\n                < 128       ? 1\n        : value < 16384     ? 2\n        : value < 2097152   ? 3\n        : value < 268435456 ? 4\n        :                     5,\n    value)).len;\n    return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n    return value < 0\n        ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n        : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n    return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n    while (val.hi) {\n        buf[pos++] = val.lo & 127 | 128;\n        val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n        val.hi >>>= 7;\n    }\n    while (val.lo > 127) {\n        buf[pos++] = val.lo & 127 | 128;\n        val.lo = val.lo >>> 7;\n    }\n    buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n    var bits = LongBits.from(value);\n    return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n    var bits = LongBits.from(value).zzEncode();\n    return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n    return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n    buf[pos    ] =  val         & 255;\n    buf[pos + 1] =  val >>> 8   & 255;\n    buf[pos + 2] =  val >>> 16  & 255;\n    buf[pos + 3] =  val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n    return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n    var bits = LongBits.from(value);\n    return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n    return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n    return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n    ? function writeBytes_set(val, buf, pos) {\n        buf.set(val, pos); // also works for plain array values\n    }\n    /* istanbul ignore next */\n    : function writeBytes_for(val, buf, pos) {\n        for (var i = 0; i < val.length; ++i)\n            buf[pos + i] = val[i];\n    };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n    var len = value.length >>> 0;\n    if (!len)\n        return this._push(writeByte, 1, 0);\n    if (util.isString(value)) {\n        var buf = Writer.alloc(len = base64.length(value));\n        base64.decode(value, buf, 0);\n        value = buf;\n    }\n    return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n    var len = utf8.length(value);\n    return len\n        ? this.uint32(len)._push(utf8.write, len, value)\n        : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n    this.states = new State(this);\n    this.head = this.tail = new Op(noop, 0, 0);\n    this.len = 0;\n    return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n    if (this.states) {\n        this.head   = this.states.head;\n        this.tail   = this.states.tail;\n        this.len    = this.states.len;\n        this.states = this.states.next;\n    } else {\n        this.head = this.tail = new Op(noop, 0, 0);\n        this.len  = 0;\n    }\n    return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n    var head = this.head,\n        tail = this.tail,\n        len  = this.len;\n    this.reset().uint32(len);\n    if (len) {\n        this.tail.next = head.next; // skip noop\n        this.tail = tail;\n        this.len += len;\n    }\n    return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n    var head = this.head.next, // skip noop\n        buf  = this.constructor.alloc(this.len),\n        pos  = 0;\n    while (head) {\n        head.fn(head.val, buf, pos);\n        pos += head.len;\n        head = head.next;\n    }\n    // this.head = this.tail = null;\n    return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n    BufferWriter = BufferWriter_;\n    Writer.create = create();\n    BufferWriter._configure();\n};\n", "\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n    Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n    /**\n     * Allocates a buffer of the specified size.\n     * @function\n     * @param {number} size Buffer size\n     * @returns {Buffer} Buffer\n     */\n    BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n    BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n        ? function writeBytesBuffer_set(val, buf, pos) {\n          buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n          // also works for plain array values\n        }\n        /* istanbul ignore next */\n        : function writeBytesBuffer_copy(val, buf, pos) {\n          if (val.copy) // Buffer values\n            val.copy(buf, pos, 0, val.length);\n          else for (var i = 0; i < val.length;) // plain array values\n            buf[pos++] = val[i++];\n        };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n    if (util.isString(value))\n        value = util._Buffer_from(value, \"base64\");\n    var len = value.length >>> 0;\n    this.uint32(len);\n    if (len)\n        this._push(BufferWriter.writeBytesBuffer, len, value);\n    return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n    if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n        util.utf8.write(val, buf, pos);\n    else if (buf.utf8Write)\n        buf.utf8Write(val, pos);\n    else\n        buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n    var len = util.Buffer.byteLength(value);\n    this.uint32(len);\n    if (len)\n        this._push(writeStringBuffer, len, value);\n    return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n", "\"use strict\";\nmodule.exports = Reader;\n\nvar util      = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits  = util.LongBits,\n    utf8      = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n    return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n    /**\n     * Read buffer.\n     * @type {Uint8Array}\n     */\n    this.buf = buffer;\n\n    /**\n     * Read buffer position.\n     * @type {number}\n     */\n    this.pos = 0;\n\n    /**\n     * Read buffer length.\n     * @type {number}\n     */\n    this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n    ? function create_typed_array(buffer) {\n        if (buffer instanceof Uint8Array || Array.isArray(buffer))\n            return new Reader(buffer);\n        throw Error(\"illegal buffer\");\n    }\n    /* istanbul ignore next */\n    : function create_array(buffer) {\n        if (Array.isArray(buffer))\n            return new Reader(buffer);\n        throw Error(\"illegal buffer\");\n    };\n\nvar create = function create() {\n    return util.Buffer\n        ? function create_buffer_setup(buffer) {\n            return (Reader.create = function create_buffer(buffer) {\n                return util.Buffer.isBuffer(buffer)\n                    ? new BufferReader(buffer)\n                    /* istanbul ignore next */\n                    : create_array(buffer);\n            })(buffer);\n        }\n        /* istanbul ignore next */\n        : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n    var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n    return function read_uint32() {\n        value = (         this.buf[this.pos] & 127       ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) <<  7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] &  15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n        /* istanbul ignore if */\n        if ((this.pos += 5) > this.len) {\n            this.pos = this.len;\n            throw indexOutOfRange(this, 10);\n        }\n        return value;\n    };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n    return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n    var value = this.uint32();\n    return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n    // tends to deopt with local vars for octet etc.\n    var bits = new LongBits(0, 0);\n    var i = 0;\n    if (this.len - this.pos > 4) { // fast route (lo)\n        for (; i < 4; ++i) {\n            // 1st..4th\n            bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n        // 5th\n        bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n        bits.hi = (bits.hi | (this.buf[this.pos] & 127) >>  4) >>> 0;\n        if (this.buf[this.pos++] < 128)\n            return bits;\n        i = 0;\n    } else {\n        for (; i < 3; ++i) {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n            // 1st..3th\n            bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n        // 4th\n        bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n        return bits;\n    }\n    if (this.len - this.pos > 4) { // fast route (hi)\n        for (; i < 5; ++i) {\n            // 6th..10th\n            bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n    } else {\n        for (; i < 5; ++i) {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n            // 6th..10th\n            bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n    }\n    /* istanbul ignore next */\n    throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n    return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n    return (buf[end - 4]\n          | buf[end - 3] << 8\n          | buf[end - 2] << 16\n          | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n    /* istanbul ignore if */\n    if (this.pos + 8 > this.len)\n        throw indexOutOfRange(this, 8);\n\n    return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    var value = util.float.readFloatLE(this.buf, this.pos);\n    this.pos += 4;\n    return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n    /* istanbul ignore if */\n    if (this.pos + 8 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    var value = util.float.readDoubleLE(this.buf, this.pos);\n    this.pos += 8;\n    return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n    var length = this.uint32(),\n        start  = this.pos,\n        end    = this.pos + length;\n\n    /* istanbul ignore if */\n    if (end > this.len)\n        throw indexOutOfRange(this, length);\n\n    this.pos += length;\n    if (Array.isArray(this.buf)) // plain array\n        return this.buf.slice(start, end);\n\n    if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n        var nativeBuffer = util.Buffer;\n        return nativeBuffer\n            ? nativeBuffer.alloc(0)\n            : new this.buf.constructor(0);\n    }\n    return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n    var bytes = this.bytes();\n    return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n    if (typeof length === \"number\") {\n        /* istanbul ignore if */\n        if (this.pos + length > this.len)\n            throw indexOutOfRange(this, length);\n        this.pos += length;\n    } else {\n        do {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n        } while (this.buf[this.pos++] & 128);\n    }\n    return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n    switch (wireType) {\n        case 0:\n            this.skip();\n            break;\n        case 1:\n            this.skip(8);\n            break;\n        case 2:\n            this.skip(this.uint32());\n            break;\n        case 3:\n            while ((wireType = this.uint32() & 7) !== 4) {\n                this.skipType(wireType);\n            }\n            break;\n        case 5:\n            this.skip(4);\n            break;\n\n        /* istanbul ignore next */\n        default:\n            throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n    }\n    return this;\n};\n\nReader._configure = function(BufferReader_) {\n    BufferReader = BufferReader_;\n    Reader.create = create();\n    BufferReader._configure();\n\n    var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n    util.merge(Reader.prototype, {\n\n        int64: function read_int64() {\n            return readLongVarint.call(this)[fn](false);\n        },\n\n        uint64: function read_uint64() {\n            return readLongVarint.call(this)[fn](true);\n        },\n\n        sint64: function read_sint64() {\n            return readLongVarint.call(this).zzDecode()[fn](false);\n        },\n\n        fixed64: function read_fixed64() {\n            return readFixed64.call(this)[fn](true);\n        },\n\n        sfixed64: function read_sfixed64() {\n            return readFixed64.call(this)[fn](false);\n        }\n\n    });\n};\n", "\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n    Reader.call(this, buffer);\n\n    /**\n     * Read buffer.\n     * @name BufferReader#buf\n     * @type {Buffer}\n     */\n}\n\nBufferReader._configure = function () {\n    /* istanbul ignore else */\n    if (util.Buffer)\n        BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n    var len = this.uint32(); // modifies pos\n    return this.buf.utf8Slice\n        ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n        : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n", "\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise<Message<TRes>>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n    if (typeof rpcImpl !== \"function\")\n        throw TypeError(\"rpcImpl must be a function\");\n\n    util.EventEmitter.call(this);\n\n    /**\n     * RPC implementation. Becomes `null` once the service is ended.\n     * @type {RPCImpl|null}\n     */\n    this.rpcImpl = rpcImpl;\n\n    /**\n     * Whether requests are length-delimited.\n     * @type {boolean}\n     */\n    this.requestDelimited = Boolean(requestDelimited);\n\n    /**\n     * Whether responses are length-delimited.\n     * @type {boolean}\n     */\n    this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod<TReq,TRes>} method Reflected or static method\n * @param {Constructor<TReq>} requestCtor Request constructor\n * @param {Constructor<TRes>} responseCtor Response constructor\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n    if (!request)\n        throw TypeError(\"request must be specified\");\n\n    var self = this;\n    if (!callback)\n        return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n    if (!self.rpcImpl) {\n        setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n        return undefined;\n    }\n\n    try {\n        return self.rpcImpl(\n            method,\n            requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n            function rpcCallback(err, response) {\n\n                if (err) {\n                    self.emit(\"error\", err, method);\n                    return callback(err);\n                }\n\n                if (response === null) {\n                    self.end(/* endedByRPC */ true);\n                    return undefined;\n                }\n\n                if (!(response instanceof responseCtor)) {\n                    try {\n                        response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n                    } catch (err) {\n                        self.emit(\"error\", err, method);\n                        return callback(err);\n                    }\n                }\n\n                self.emit(\"data\", response, method);\n                return callback(null, response);\n            }\n        );\n    } catch (err) {\n        self.emit(\"error\", err, method);\n        setTimeout(function() { callback(err); }, 0);\n        return undefined;\n    }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n    if (this.rpcImpl) {\n        if (!endedByRPC) // signal end to rpcImpl\n            this.rpcImpl(null, null, null);\n        this.rpcImpl = null;\n        this.emit(\"end\").off();\n    }\n    return this;\n};\n", "\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod<Message<{}>,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n *     if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n *         throw Error(\"no such method\");\n *     asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n *         callback(err, responseData);\n *     });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n", "\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.<string,Root>}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n", "\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer       = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader       = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util         = require(\"./util/minimal\");\nprotobuf.rpc          = require(\"./rpc\");\nprotobuf.roots        = require(\"./roots\");\nprotobuf.configure    = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n    protobuf.util._configure();\n    protobuf.Writer._configure(protobuf.BufferWriter);\n    protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n", "// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n", "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n'use strict';\n\nvar $protobuf = require('protobufjs/minimal');\n\n// Common aliases\nvar $Reader = $protobuf.Reader,\n  $Writer = $protobuf.Writer,\n  $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots['default'] || ($protobuf.roots['default'] = {});\n\n$root.onnx = (function () {\n  /**\n   * Namespace onnx.\n   * @exports onnx\n   * @namespace\n   */\n  var onnx = {};\n\n  /**\n   * Version enum.\n   * @name onnx.Version\n   * @enum {number}\n   * @property {number} _START_VERSION=0 _START_VERSION value\n   * @property {number} IR_VERSION_2017_10_10=1 IR_VERSION_2017_10_10 value\n   * @property {number} IR_VERSION_2017_10_30=2 IR_VERSION_2017_10_30 value\n   * @property {number} IR_VERSION_2017_11_3=3 IR_VERSION_2017_11_3 value\n   * @property {number} IR_VERSION_2019_1_22=4 IR_VERSION_2019_1_22 value\n   * @property {number} IR_VERSION_2019_3_18=5 IR_VERSION_2019_3_18 value\n   * @property {number} IR_VERSION_2019_9_19=6 IR_VERSION_2019_9_19 value\n   * @property {number} IR_VERSION_2020_5_8=7 IR_VERSION_2020_5_8 value\n   * @property {number} IR_VERSION_2021_7_30=8 IR_VERSION_2021_7_30 value\n   * @property {number} IR_VERSION=9 IR_VERSION value\n   */\n  onnx.Version = (function () {\n    var valuesById = {},\n      values = Object.create(valuesById);\n    values[(valuesById[0] = '_START_VERSION')] = 0;\n    values[(valuesById[1] = 'IR_VERSION_2017_10_10')] = 1;\n    values[(valuesById[2] = 'IR_VERSION_2017_10_30')] = 2;\n    values[(valuesById[3] = 'IR_VERSION_2017_11_3')] = 3;\n    values[(valuesById[4] = 'IR_VERSION_2019_1_22')] = 4;\n    values[(valuesById[5] = 'IR_VERSION_2019_3_18')] = 5;\n    values[(valuesById[6] = 'IR_VERSION_2019_9_19')] = 6;\n    values[(valuesById[7] = 'IR_VERSION_2020_5_8')] = 7;\n    values[(valuesById[8] = 'IR_VERSION_2021_7_30')] = 8;\n    values[(valuesById[9] = 'IR_VERSION')] = 9;\n    return values;\n  })();\n\n  onnx.AttributeProto = (function () {\n    /**\n     * Properties of an AttributeProto.\n     * @memberof onnx\n     * @interface IAttributeProto\n     * @property {string|null} [name] AttributeProto name\n     * @property {string|null} [refAttrName] AttributeProto refAttrName\n     * @property {string|null} [docString] AttributeProto docString\n     * @property {onnx.AttributeProto.AttributeType|null} [type] AttributeProto type\n     * @property {number|null} [f] AttributeProto f\n     * @property {number|Long|null} [i] AttributeProto i\n     * @property {Uint8Array|null} [s] AttributeProto s\n     * @property {onnx.ITensorProto|null} [t] AttributeProto t\n     * @property {onnx.IGraphProto|null} [g] AttributeProto g\n     * @property {onnx.ISparseTensorProto|null} [sparseTensor] AttributeProto sparseTensor\n     * @property {onnx.ITypeProto|null} [tp] AttributeProto tp\n     * @property {Array.<number>|null} [floats] AttributeProto floats\n     * @property {Array.<number|Long>|null} [ints] AttributeProto ints\n     * @property {Array.<Uint8Array>|null} [strings] AttributeProto strings\n     * @property {Array.<onnx.ITensorProto>|null} [tensors] AttributeProto tensors\n     * @property {Array.<onnx.IGraphProto>|null} [graphs] AttributeProto graphs\n     * @property {Array.<onnx.ISparseTensorProto>|null} [sparseTensors] AttributeProto sparseTensors\n     * @property {Array.<onnx.ITypeProto>|null} [typeProtos] AttributeProto typeProtos\n     */\n\n    /**\n     * Constructs a new AttributeProto.\n     * @memberof onnx\n     * @classdesc Represents an AttributeProto.\n     * @implements IAttributeProto\n     * @constructor\n     * @param {onnx.IAttributeProto=} [properties] Properties to set\n     */\n    function AttributeProto(properties) {\n      this.floats = [];\n      this.ints = [];\n      this.strings = [];\n      this.tensors = [];\n      this.graphs = [];\n      this.sparseTensors = [];\n      this.typeProtos = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * AttributeProto name.\n     * @member {string} name\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.name = '';\n\n    /**\n     * AttributeProto refAttrName.\n     * @member {string} refAttrName\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.refAttrName = '';\n\n    /**\n     * AttributeProto docString.\n     * @member {string} docString\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.docString = '';\n\n    /**\n     * AttributeProto type.\n     * @member {onnx.AttributeProto.AttributeType} type\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.type = 0;\n\n    /**\n     * AttributeProto f.\n     * @member {number} f\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.f = 0;\n\n    /**\n     * AttributeProto i.\n     * @member {number|Long} i\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.i = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n\n    /**\n     * AttributeProto s.\n     * @member {Uint8Array} s\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.s = $util.newBuffer([]);\n\n    /**\n     * AttributeProto t.\n     * @member {onnx.ITensorProto|null|undefined} t\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.t = null;\n\n    /**\n     * AttributeProto g.\n     * @member {onnx.IGraphProto|null|undefined} g\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.g = null;\n\n    /**\n     * AttributeProto sparseTensor.\n     * @member {onnx.ISparseTensorProto|null|undefined} sparseTensor\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.sparseTensor = null;\n\n    /**\n     * AttributeProto tp.\n     * @member {onnx.ITypeProto|null|undefined} tp\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.tp = null;\n\n    /**\n     * AttributeProto floats.\n     * @member {Array.<number>} floats\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.floats = $util.emptyArray;\n\n    /**\n     * AttributeProto ints.\n     * @member {Array.<number|Long>} ints\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.ints = $util.emptyArray;\n\n    /**\n     * AttributeProto strings.\n     * @member {Array.<Uint8Array>} strings\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.strings = $util.emptyArray;\n\n    /**\n     * AttributeProto tensors.\n     * @member {Array.<onnx.ITensorProto>} tensors\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.tensors = $util.emptyArray;\n\n    /**\n     * AttributeProto graphs.\n     * @member {Array.<onnx.IGraphProto>} graphs\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.graphs = $util.emptyArray;\n\n    /**\n     * AttributeProto sparseTensors.\n     * @member {Array.<onnx.ISparseTensorProto>} sparseTensors\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.sparseTensors = $util.emptyArray;\n\n    /**\n     * AttributeProto typeProtos.\n     * @member {Array.<onnx.ITypeProto>} typeProtos\n     * @memberof onnx.AttributeProto\n     * @instance\n     */\n    AttributeProto.prototype.typeProtos = $util.emptyArray;\n\n    /**\n     * Creates a new AttributeProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {onnx.IAttributeProto=} [properties] Properties to set\n     * @returns {onnx.AttributeProto} AttributeProto instance\n     */\n    AttributeProto.create = function create(properties) {\n      return new AttributeProto(properties);\n    };\n\n    /**\n     * Encodes the specified AttributeProto message. Does not implicitly {@link onnx.AttributeProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {onnx.IAttributeProto} message AttributeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    AttributeProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.name != null && Object.hasOwnProperty.call(message, 'name'))\n        writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);\n      if (message.f != null && Object.hasOwnProperty.call(message, 'f'))\n        writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.f);\n      if (message.i != null && Object.hasOwnProperty.call(message, 'i'))\n        writer.uint32(/* id 3, wireType 0 =*/ 24).int64(message.i);\n      if (message.s != null && Object.hasOwnProperty.call(message, 's'))\n        writer.uint32(/* id 4, wireType 2 =*/ 34).bytes(message.s);\n      if (message.t != null && Object.hasOwnProperty.call(message, 't'))\n        $root.onnx.TensorProto.encode(message.t, writer.uint32(/* id 5, wireType 2 =*/ 42).fork()).ldelim();\n      if (message.g != null && Object.hasOwnProperty.call(message, 'g'))\n        $root.onnx.GraphProto.encode(message.g, writer.uint32(/* id 6, wireType 2 =*/ 50).fork()).ldelim();\n      if (message.floats != null && message.floats.length) {\n        writer.uint32(/* id 7, wireType 2 =*/ 58).fork();\n        for (var i = 0; i < message.floats.length; ++i) writer.float(message.floats[i]);\n        writer.ldelim();\n      }\n      if (message.ints != null && message.ints.length) {\n        writer.uint32(/* id 8, wireType 2 =*/ 66).fork();\n        for (var i = 0; i < message.ints.length; ++i) writer.int64(message.ints[i]);\n        writer.ldelim();\n      }\n      if (message.strings != null && message.strings.length)\n        for (var i = 0; i < message.strings.length; ++i)\n          writer.uint32(/* id 9, wireType 2 =*/ 74).bytes(message.strings[i]);\n      if (message.tensors != null && message.tensors.length)\n        for (var i = 0; i < message.tensors.length; ++i)\n          $root.onnx.TensorProto.encode(message.tensors[i], writer.uint32(/* id 10, wireType 2 =*/ 82).fork()).ldelim();\n      if (message.graphs != null && message.graphs.length)\n        for (var i = 0; i < message.graphs.length; ++i)\n          $root.onnx.GraphProto.encode(message.graphs[i], writer.uint32(/* id 11, wireType 2 =*/ 90).fork()).ldelim();\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 13, wireType 2 =*/ 106).string(message.docString);\n      if (message.tp != null && Object.hasOwnProperty.call(message, 'tp'))\n        $root.onnx.TypeProto.encode(message.tp, writer.uint32(/* id 14, wireType 2 =*/ 114).fork()).ldelim();\n      if (message.typeProtos != null && message.typeProtos.length)\n        for (var i = 0; i < message.typeProtos.length; ++i)\n          $root.onnx.TypeProto.encode(\n            message.typeProtos[i],\n            writer.uint32(/* id 15, wireType 2 =*/ 122).fork(),\n          ).ldelim();\n      if (message.type != null && Object.hasOwnProperty.call(message, 'type'))\n        writer.uint32(/* id 20, wireType 0 =*/ 160).int32(message.type);\n      if (message.refAttrName != null && Object.hasOwnProperty.call(message, 'refAttrName'))\n        writer.uint32(/* id 21, wireType 2 =*/ 170).string(message.refAttrName);\n      if (message.sparseTensor != null && Object.hasOwnProperty.call(message, 'sparseTensor'))\n        $root.onnx.SparseTensorProto.encode(\n          message.sparseTensor,\n          writer.uint32(/* id 22, wireType 2 =*/ 178).fork(),\n        ).ldelim();\n      if (message.sparseTensors != null && message.sparseTensors.length)\n        for (var i = 0; i < message.sparseTensors.length; ++i)\n          $root.onnx.SparseTensorProto.encode(\n            message.sparseTensors[i],\n            writer.uint32(/* id 23, wireType 2 =*/ 186).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified AttributeProto message, length delimited. Does not implicitly {@link onnx.AttributeProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {onnx.IAttributeProto} message AttributeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    AttributeProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes an AttributeProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.AttributeProto} AttributeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    AttributeProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.AttributeProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.name = reader.string();\n            break;\n          }\n          case 21: {\n            message.refAttrName = reader.string();\n            break;\n          }\n          case 13: {\n            message.docString = reader.string();\n            break;\n          }\n          case 20: {\n            message.type = reader.int32();\n            break;\n          }\n          case 2: {\n            message.f = reader.float();\n            break;\n          }\n          case 3: {\n            message.i = reader.int64();\n            break;\n          }\n          case 4: {\n            message.s = reader.bytes();\n            break;\n          }\n          case 5: {\n            message.t = $root.onnx.TensorProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 6: {\n            message.g = $root.onnx.GraphProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 22: {\n            message.sparseTensor = $root.onnx.SparseTensorProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 14: {\n            message.tp = $root.onnx.TypeProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 7: {\n            if (!(message.floats && message.floats.length)) message.floats = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.floats.push(reader.float());\n            } else message.floats.push(reader.float());\n            break;\n          }\n          case 8: {\n            if (!(message.ints && message.ints.length)) message.ints = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.ints.push(reader.int64());\n            } else message.ints.push(reader.int64());\n            break;\n          }\n          case 9: {\n            if (!(message.strings && message.strings.length)) message.strings = [];\n            message.strings.push(reader.bytes());\n            break;\n          }\n          case 10: {\n            if (!(message.tensors && message.tensors.length)) message.tensors = [];\n            message.tensors.push($root.onnx.TensorProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 11: {\n            if (!(message.graphs && message.graphs.length)) message.graphs = [];\n            message.graphs.push($root.onnx.GraphProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 23: {\n            if (!(message.sparseTensors && message.sparseTensors.length)) message.sparseTensors = [];\n            message.sparseTensors.push($root.onnx.SparseTensorProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 15: {\n            if (!(message.typeProtos && message.typeProtos.length)) message.typeProtos = [];\n            message.typeProtos.push($root.onnx.TypeProto.decode(reader, reader.uint32()));\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes an AttributeProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.AttributeProto} AttributeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    AttributeProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies an AttributeProto message.\n     * @function verify\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    AttributeProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.name != null && message.hasOwnProperty('name'))\n        if (!$util.isString(message.name)) return 'name: string expected';\n      if (message.refAttrName != null && message.hasOwnProperty('refAttrName'))\n        if (!$util.isString(message.refAttrName)) return 'refAttrName: string expected';\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      if (message.type != null && message.hasOwnProperty('type'))\n        switch (message.type) {\n          default:\n            return 'type: enum value expected';\n          case 0:\n          case 1:\n          case 2:\n          case 3:\n          case 4:\n          case 5:\n          case 11:\n          case 13:\n          case 6:\n          case 7:\n          case 8:\n          case 9:\n          case 10:\n          case 12:\n          case 14:\n            break;\n        }\n      if (message.f != null && message.hasOwnProperty('f'))\n        if (typeof message.f !== 'number') return 'f: number expected';\n      if (message.i != null && message.hasOwnProperty('i'))\n        if (\n          !$util.isInteger(message.i) &&\n          !(message.i && $util.isInteger(message.i.low) && $util.isInteger(message.i.high))\n        )\n          return 'i: integer|Long expected';\n      if (message.s != null && message.hasOwnProperty('s'))\n        if (!((message.s && typeof message.s.length === 'number') || $util.isString(message.s)))\n          return 's: buffer expected';\n      if (message.t != null && message.hasOwnProperty('t')) {\n        var error = $root.onnx.TensorProto.verify(message.t);\n        if (error) return 't.' + error;\n      }\n      if (message.g != null && message.hasOwnProperty('g')) {\n        var error = $root.onnx.GraphProto.verify(message.g);\n        if (error) return 'g.' + error;\n      }\n      if (message.sparseTensor != null && message.hasOwnProperty('sparseTensor')) {\n        var error = $root.onnx.SparseTensorProto.verify(message.sparseTensor);\n        if (error) return 'sparseTensor.' + error;\n      }\n      if (message.tp != null && message.hasOwnProperty('tp')) {\n        var error = $root.onnx.TypeProto.verify(message.tp);\n        if (error) return 'tp.' + error;\n      }\n      if (message.floats != null && message.hasOwnProperty('floats')) {\n        if (!Array.isArray(message.floats)) return 'floats: array expected';\n        for (var i = 0; i < message.floats.length; ++i)\n          if (typeof message.floats[i] !== 'number') return 'floats: number[] expected';\n      }\n      if (message.ints != null && message.hasOwnProperty('ints')) {\n        if (!Array.isArray(message.ints)) return 'ints: array expected';\n        for (var i = 0; i < message.ints.length; ++i)\n          if (\n            !$util.isInteger(message.ints[i]) &&\n            !(message.ints[i] && $util.isInteger(message.ints[i].low) && $util.isInteger(message.ints[i].high))\n          )\n            return 'ints: integer|Long[] expected';\n      }\n      if (message.strings != null && message.hasOwnProperty('strings')) {\n        if (!Array.isArray(message.strings)) return 'strings: array expected';\n        for (var i = 0; i < message.strings.length; ++i)\n          if (\n            !(\n              (message.strings[i] && typeof message.strings[i].length === 'number') ||\n              $util.isString(message.strings[i])\n            )\n          )\n            return 'strings: buffer[] expected';\n      }\n      if (message.tensors != null && message.hasOwnProperty('tensors')) {\n        if (!Array.isArray(message.tensors)) return 'tensors: array expected';\n        for (var i = 0; i < message.tensors.length; ++i) {\n          var error = $root.onnx.TensorProto.verify(message.tensors[i]);\n          if (error) return 'tensors.' + error;\n        }\n      }\n      if (message.graphs != null && message.hasOwnProperty('graphs')) {\n        if (!Array.isArray(message.graphs)) return 'graphs: array expected';\n        for (var i = 0; i < message.graphs.length; ++i) {\n          var error = $root.onnx.GraphProto.verify(message.graphs[i]);\n          if (error) return 'graphs.' + error;\n        }\n      }\n      if (message.sparseTensors != null && message.hasOwnProperty('sparseTensors')) {\n        if (!Array.isArray(message.sparseTensors)) return 'sparseTensors: array expected';\n        for (var i = 0; i < message.sparseTensors.length; ++i) {\n          var error = $root.onnx.SparseTensorProto.verify(message.sparseTensors[i]);\n          if (error) return 'sparseTensors.' + error;\n        }\n      }\n      if (message.typeProtos != null && message.hasOwnProperty('typeProtos')) {\n        if (!Array.isArray(message.typeProtos)) return 'typeProtos: array expected';\n        for (var i = 0; i < message.typeProtos.length; ++i) {\n          var error = $root.onnx.TypeProto.verify(message.typeProtos[i]);\n          if (error) return 'typeProtos.' + error;\n        }\n      }\n      return null;\n    };\n\n    /**\n     * Creates an AttributeProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.AttributeProto} AttributeProto\n     */\n    AttributeProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.AttributeProto) return object;\n      var message = new $root.onnx.AttributeProto();\n      if (object.name != null) message.name = String(object.name);\n      if (object.refAttrName != null) message.refAttrName = String(object.refAttrName);\n      if (object.docString != null) message.docString = String(object.docString);\n      switch (object.type) {\n        default:\n          if (typeof object.type === 'number') {\n            message.type = object.type;\n            break;\n          }\n          break;\n        case 'UNDEFINED':\n        case 0:\n          message.type = 0;\n          break;\n        case 'FLOAT':\n        case 1:\n          message.type = 1;\n          break;\n        case 'INT':\n        case 2:\n          message.type = 2;\n          break;\n        case 'STRING':\n        case 3:\n          message.type = 3;\n          break;\n        case 'TENSOR':\n        case 4:\n          message.type = 4;\n          break;\n        case 'GRAPH':\n        case 5:\n          message.type = 5;\n          break;\n        case 'SPARSE_TENSOR':\n        case 11:\n          message.type = 11;\n          break;\n        case 'TYPE_PROTO':\n        case 13:\n          message.type = 13;\n          break;\n        case 'FLOATS':\n        case 6:\n          message.type = 6;\n          break;\n        case 'INTS':\n        case 7:\n          message.type = 7;\n          break;\n        case 'STRINGS':\n        case 8:\n          message.type = 8;\n          break;\n        case 'TENSORS':\n        case 9:\n          message.type = 9;\n          break;\n        case 'GRAPHS':\n        case 10:\n          message.type = 10;\n          break;\n        case 'SPARSE_TENSORS':\n        case 12:\n          message.type = 12;\n          break;\n        case 'TYPE_PROTOS':\n        case 14:\n          message.type = 14;\n          break;\n      }\n      if (object.f != null) message.f = Number(object.f);\n      if (object.i != null)\n        if ($util.Long) (message.i = $util.Long.fromValue(object.i)).unsigned = false;\n        else if (typeof object.i === 'string') message.i = parseInt(object.i, 10);\n        else if (typeof object.i === 'number') message.i = object.i;\n        else if (typeof object.i === 'object')\n          message.i = new $util.LongBits(object.i.low >>> 0, object.i.high >>> 0).toNumber();\n      if (object.s != null)\n        if (typeof object.s === 'string')\n          $util.base64.decode(object.s, (message.s = $util.newBuffer($util.base64.length(object.s))), 0);\n        else if (object.s.length >= 0) message.s = object.s;\n      if (object.t != null) {\n        if (typeof object.t !== 'object') throw TypeError('.onnx.AttributeProto.t: object expected');\n        message.t = $root.onnx.TensorProto.fromObject(object.t);\n      }\n      if (object.g != null) {\n        if (typeof object.g !== 'object') throw TypeError('.onnx.AttributeProto.g: object expected');\n        message.g = $root.onnx.GraphProto.fromObject(object.g);\n      }\n      if (object.sparseTensor != null) {\n        if (typeof object.sparseTensor !== 'object')\n          throw TypeError('.onnx.AttributeProto.sparseTensor: object expected');\n        message.sparseTensor = $root.onnx.SparseTensorProto.fromObject(object.sparseTensor);\n      }\n      if (object.tp != null) {\n        if (typeof object.tp !== 'object') throw TypeError('.onnx.AttributeProto.tp: object expected');\n        message.tp = $root.onnx.TypeProto.fromObject(object.tp);\n      }\n      if (object.floats) {\n        if (!Array.isArray(object.floats)) throw TypeError('.onnx.AttributeProto.floats: array expected');\n        message.floats = [];\n        for (var i = 0; i < object.floats.length; ++i) message.floats[i] = Number(object.floats[i]);\n      }\n      if (object.ints) {\n        if (!Array.isArray(object.ints)) throw TypeError('.onnx.AttributeProto.ints: array expected');\n        message.ints = [];\n        for (var i = 0; i < object.ints.length; ++i)\n          if ($util.Long) (message.ints[i] = $util.Long.fromValue(object.ints[i])).unsigned = false;\n          else if (typeof object.ints[i] === 'string') message.ints[i] = parseInt(object.ints[i], 10);\n          else if (typeof object.ints[i] === 'number') message.ints[i] = object.ints[i];\n          else if (typeof object.ints[i] === 'object')\n            message.ints[i] = new $util.LongBits(object.ints[i].low >>> 0, object.ints[i].high >>> 0).toNumber();\n      }\n      if (object.strings) {\n        if (!Array.isArray(object.strings)) throw TypeError('.onnx.AttributeProto.strings: array expected');\n        message.strings = [];\n        for (var i = 0; i < object.strings.length; ++i)\n          if (typeof object.strings[i] === 'string')\n            $util.base64.decode(\n              object.strings[i],\n              (message.strings[i] = $util.newBuffer($util.base64.length(object.strings[i]))),\n              0,\n            );\n          else if (object.strings[i].length >= 0) message.strings[i] = object.strings[i];\n      }\n      if (object.tensors) {\n        if (!Array.isArray(object.tensors)) throw TypeError('.onnx.AttributeProto.tensors: array expected');\n        message.tensors = [];\n        for (var i = 0; i < object.tensors.length; ++i) {\n          if (typeof object.tensors[i] !== 'object') throw TypeError('.onnx.AttributeProto.tensors: object expected');\n          message.tensors[i] = $root.onnx.TensorProto.fromObject(object.tensors[i]);\n        }\n      }\n      if (object.graphs) {\n        if (!Array.isArray(object.graphs)) throw TypeError('.onnx.AttributeProto.graphs: array expected');\n        message.graphs = [];\n        for (var i = 0; i < object.graphs.length; ++i) {\n          if (typeof object.graphs[i] !== 'object') throw TypeError('.onnx.AttributeProto.graphs: object expected');\n          message.graphs[i] = $root.onnx.GraphProto.fromObject(object.graphs[i]);\n        }\n      }\n      if (object.sparseTensors) {\n        if (!Array.isArray(object.sparseTensors)) throw TypeError('.onnx.AttributeProto.sparseTensors: array expected');\n        message.sparseTensors = [];\n        for (var i = 0; i < object.sparseTensors.length; ++i) {\n          if (typeof object.sparseTensors[i] !== 'object')\n            throw TypeError('.onnx.AttributeProto.sparseTensors: object expected');\n          message.sparseTensors[i] = $root.onnx.SparseTensorProto.fromObject(object.sparseTensors[i]);\n        }\n      }\n      if (object.typeProtos) {\n        if (!Array.isArray(object.typeProtos)) throw TypeError('.onnx.AttributeProto.typeProtos: array expected');\n        message.typeProtos = [];\n        for (var i = 0; i < object.typeProtos.length; ++i) {\n          if (typeof object.typeProtos[i] !== 'object')\n            throw TypeError('.onnx.AttributeProto.typeProtos: object expected');\n          message.typeProtos[i] = $root.onnx.TypeProto.fromObject(object.typeProtos[i]);\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from an AttributeProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {onnx.AttributeProto} message AttributeProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    AttributeProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.floats = [];\n        object.ints = [];\n        object.strings = [];\n        object.tensors = [];\n        object.graphs = [];\n        object.typeProtos = [];\n        object.sparseTensors = [];\n      }\n      if (options.defaults) {\n        object.name = '';\n        object.f = 0;\n        if ($util.Long) {\n          var long = new $util.Long(0, 0, false);\n          object.i = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n        } else object.i = options.longs === String ? '0' : 0;\n        if (options.bytes === String) object.s = '';\n        else {\n          object.s = [];\n          if (options.bytes !== Array) object.s = $util.newBuffer(object.s);\n        }\n        object.t = null;\n        object.g = null;\n        object.docString = '';\n        object.tp = null;\n        object.type = options.enums === String ? 'UNDEFINED' : 0;\n        object.refAttrName = '';\n        object.sparseTensor = null;\n      }\n      if (message.name != null && message.hasOwnProperty('name')) object.name = message.name;\n      if (message.f != null && message.hasOwnProperty('f'))\n        object.f = options.json && !isFinite(message.f) ? String(message.f) : message.f;\n      if (message.i != null && message.hasOwnProperty('i'))\n        if (typeof message.i === 'number') object.i = options.longs === String ? String(message.i) : message.i;\n        else\n          object.i =\n            options.longs === String\n              ? $util.Long.prototype.toString.call(message.i)\n              : options.longs === Number\n                ? new $util.LongBits(message.i.low >>> 0, message.i.high >>> 0).toNumber()\n                : message.i;\n      if (message.s != null && message.hasOwnProperty('s'))\n        object.s =\n          options.bytes === String\n            ? $util.base64.encode(message.s, 0, message.s.length)\n            : options.bytes === Array\n              ? Array.prototype.slice.call(message.s)\n              : message.s;\n      if (message.t != null && message.hasOwnProperty('t'))\n        object.t = $root.onnx.TensorProto.toObject(message.t, options);\n      if (message.g != null && message.hasOwnProperty('g'))\n        object.g = $root.onnx.GraphProto.toObject(message.g, options);\n      if (message.floats && message.floats.length) {\n        object.floats = [];\n        for (var j = 0; j < message.floats.length; ++j)\n          object.floats[j] =\n            options.json && !isFinite(message.floats[j]) ? String(message.floats[j]) : message.floats[j];\n      }\n      if (message.ints && message.ints.length) {\n        object.ints = [];\n        for (var j = 0; j < message.ints.length; ++j)\n          if (typeof message.ints[j] === 'number')\n            object.ints[j] = options.longs === String ? String(message.ints[j]) : message.ints[j];\n          else\n            object.ints[j] =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.ints[j])\n                : options.longs === Number\n                  ? new $util.LongBits(message.ints[j].low >>> 0, message.ints[j].high >>> 0).toNumber()\n                  : message.ints[j];\n      }\n      if (message.strings && message.strings.length) {\n        object.strings = [];\n        for (var j = 0; j < message.strings.length; ++j)\n          object.strings[j] =\n            options.bytes === String\n              ? $util.base64.encode(message.strings[j], 0, message.strings[j].length)\n              : options.bytes === Array\n                ? Array.prototype.slice.call(message.strings[j])\n                : message.strings[j];\n      }\n      if (message.tensors && message.tensors.length) {\n        object.tensors = [];\n        for (var j = 0; j < message.tensors.length; ++j)\n          object.tensors[j] = $root.onnx.TensorProto.toObject(message.tensors[j], options);\n      }\n      if (message.graphs && message.graphs.length) {\n        object.graphs = [];\n        for (var j = 0; j < message.graphs.length; ++j)\n          object.graphs[j] = $root.onnx.GraphProto.toObject(message.graphs[j], options);\n      }\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      if (message.tp != null && message.hasOwnProperty('tp'))\n        object.tp = $root.onnx.TypeProto.toObject(message.tp, options);\n      if (message.typeProtos && message.typeProtos.length) {\n        object.typeProtos = [];\n        for (var j = 0; j < message.typeProtos.length; ++j)\n          object.typeProtos[j] = $root.onnx.TypeProto.toObject(message.typeProtos[j], options);\n      }\n      if (message.type != null && message.hasOwnProperty('type'))\n        object.type =\n          options.enums === String\n            ? $root.onnx.AttributeProto.AttributeType[message.type] === undefined\n              ? message.type\n              : $root.onnx.AttributeProto.AttributeType[message.type]\n            : message.type;\n      if (message.refAttrName != null && message.hasOwnProperty('refAttrName'))\n        object.refAttrName = message.refAttrName;\n      if (message.sparseTensor != null && message.hasOwnProperty('sparseTensor'))\n        object.sparseTensor = $root.onnx.SparseTensorProto.toObject(message.sparseTensor, options);\n      if (message.sparseTensors && message.sparseTensors.length) {\n        object.sparseTensors = [];\n        for (var j = 0; j < message.sparseTensors.length; ++j)\n          object.sparseTensors[j] = $root.onnx.SparseTensorProto.toObject(message.sparseTensors[j], options);\n      }\n      return object;\n    };\n\n    /**\n     * Converts this AttributeProto to JSON.\n     * @function toJSON\n     * @memberof onnx.AttributeProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    AttributeProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for AttributeProto\n     * @function getTypeUrl\n     * @memberof onnx.AttributeProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    AttributeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.AttributeProto';\n    };\n\n    /**\n     * AttributeType enum.\n     * @name onnx.AttributeProto.AttributeType\n     * @enum {number}\n     * @property {number} UNDEFINED=0 UNDEFINED value\n     * @property {number} FLOAT=1 FLOAT value\n     * @property {number} INT=2 INT value\n     * @property {number} STRING=3 STRING value\n     * @property {number} TENSOR=4 TENSOR value\n     * @property {number} GRAPH=5 GRAPH value\n     * @property {number} SPARSE_TENSOR=11 SPARSE_TENSOR value\n     * @property {number} TYPE_PROTO=13 TYPE_PROTO value\n     * @property {number} FLOATS=6 FLOATS value\n     * @property {number} INTS=7 INTS value\n     * @property {number} STRINGS=8 STRINGS value\n     * @property {number} TENSORS=9 TENSORS value\n     * @property {number} GRAPHS=10 GRAPHS value\n     * @property {number} SPARSE_TENSORS=12 SPARSE_TENSORS value\n     * @property {number} TYPE_PROTOS=14 TYPE_PROTOS value\n     */\n    AttributeProto.AttributeType = (function () {\n      var valuesById = {},\n        values = Object.create(valuesById);\n      values[(valuesById[0] = 'UNDEFINED')] = 0;\n      values[(valuesById[1] = 'FLOAT')] = 1;\n      values[(valuesById[2] = 'INT')] = 2;\n      values[(valuesById[3] = 'STRING')] = 3;\n      values[(valuesById[4] = 'TENSOR')] = 4;\n      values[(valuesById[5] = 'GRAPH')] = 5;\n      values[(valuesById[11] = 'SPARSE_TENSOR')] = 11;\n      values[(valuesById[13] = 'TYPE_PROTO')] = 13;\n      values[(valuesById[6] = 'FLOATS')] = 6;\n      values[(valuesById[7] = 'INTS')] = 7;\n      values[(valuesById[8] = 'STRINGS')] = 8;\n      values[(valuesById[9] = 'TENSORS')] = 9;\n      values[(valuesById[10] = 'GRAPHS')] = 10;\n      values[(valuesById[12] = 'SPARSE_TENSORS')] = 12;\n      values[(valuesById[14] = 'TYPE_PROTOS')] = 14;\n      return values;\n    })();\n\n    return AttributeProto;\n  })();\n\n  onnx.ValueInfoProto = (function () {\n    /**\n     * Properties of a ValueInfoProto.\n     * @memberof onnx\n     * @interface IValueInfoProto\n     * @property {string|null} [name] ValueInfoProto name\n     * @property {onnx.ITypeProto|null} [type] ValueInfoProto type\n     * @property {string|null} [docString] ValueInfoProto docString\n     */\n\n    /**\n     * Constructs a new ValueInfoProto.\n     * @memberof onnx\n     * @classdesc Represents a ValueInfoProto.\n     * @implements IValueInfoProto\n     * @constructor\n     * @param {onnx.IValueInfoProto=} [properties] Properties to set\n     */\n    function ValueInfoProto(properties) {\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * ValueInfoProto name.\n     * @member {string} name\n     * @memberof onnx.ValueInfoProto\n     * @instance\n     */\n    ValueInfoProto.prototype.name = '';\n\n    /**\n     * ValueInfoProto type.\n     * @member {onnx.ITypeProto|null|undefined} type\n     * @memberof onnx.ValueInfoProto\n     * @instance\n     */\n    ValueInfoProto.prototype.type = null;\n\n    /**\n     * ValueInfoProto docString.\n     * @member {string} docString\n     * @memberof onnx.ValueInfoProto\n     * @instance\n     */\n    ValueInfoProto.prototype.docString = '';\n\n    /**\n     * Creates a new ValueInfoProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {onnx.IValueInfoProto=} [properties] Properties to set\n     * @returns {onnx.ValueInfoProto} ValueInfoProto instance\n     */\n    ValueInfoProto.create = function create(properties) {\n      return new ValueInfoProto(properties);\n    };\n\n    /**\n     * Encodes the specified ValueInfoProto message. Does not implicitly {@link onnx.ValueInfoProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {onnx.IValueInfoProto} message ValueInfoProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    ValueInfoProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.name != null && Object.hasOwnProperty.call(message, 'name'))\n        writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);\n      if (message.type != null && Object.hasOwnProperty.call(message, 'type'))\n        $root.onnx.TypeProto.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim();\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.docString);\n      return writer;\n    };\n\n    /**\n     * Encodes the specified ValueInfoProto message, length delimited. Does not implicitly {@link onnx.ValueInfoProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {onnx.IValueInfoProto} message ValueInfoProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    ValueInfoProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a ValueInfoProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.ValueInfoProto} ValueInfoProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    ValueInfoProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.ValueInfoProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.name = reader.string();\n            break;\n          }\n          case 2: {\n            message.type = $root.onnx.TypeProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 3: {\n            message.docString = reader.string();\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a ValueInfoProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.ValueInfoProto} ValueInfoProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    ValueInfoProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a ValueInfoProto message.\n     * @function verify\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    ValueInfoProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.name != null && message.hasOwnProperty('name'))\n        if (!$util.isString(message.name)) return 'name: string expected';\n      if (message.type != null && message.hasOwnProperty('type')) {\n        var error = $root.onnx.TypeProto.verify(message.type);\n        if (error) return 'type.' + error;\n      }\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      return null;\n    };\n\n    /**\n     * Creates a ValueInfoProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.ValueInfoProto} ValueInfoProto\n     */\n    ValueInfoProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.ValueInfoProto) return object;\n      var message = new $root.onnx.ValueInfoProto();\n      if (object.name != null) message.name = String(object.name);\n      if (object.type != null) {\n        if (typeof object.type !== 'object') throw TypeError('.onnx.ValueInfoProto.type: object expected');\n        message.type = $root.onnx.TypeProto.fromObject(object.type);\n      }\n      if (object.docString != null) message.docString = String(object.docString);\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a ValueInfoProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {onnx.ValueInfoProto} message ValueInfoProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    ValueInfoProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.defaults) {\n        object.name = '';\n        object.type = null;\n        object.docString = '';\n      }\n      if (message.name != null && message.hasOwnProperty('name')) object.name = message.name;\n      if (message.type != null && message.hasOwnProperty('type'))\n        object.type = $root.onnx.TypeProto.toObject(message.type, options);\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      return object;\n    };\n\n    /**\n     * Converts this ValueInfoProto to JSON.\n     * @function toJSON\n     * @memberof onnx.ValueInfoProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    ValueInfoProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for ValueInfoProto\n     * @function getTypeUrl\n     * @memberof onnx.ValueInfoProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    ValueInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.ValueInfoProto';\n    };\n\n    return ValueInfoProto;\n  })();\n\n  onnx.NodeProto = (function () {\n    /**\n     * Properties of a NodeProto.\n     * @memberof onnx\n     * @interface INodeProto\n     * @property {Array.<string>|null} [input] NodeProto input\n     * @property {Array.<string>|null} [output] NodeProto output\n     * @property {string|null} [name] NodeProto name\n     * @property {string|null} [opType] NodeProto opType\n     * @property {string|null} [domain] NodeProto domain\n     * @property {Array.<onnx.IAttributeProto>|null} [attribute] NodeProto attribute\n     * @property {string|null} [docString] NodeProto docString\n     */\n\n    /**\n     * Constructs a new NodeProto.\n     * @memberof onnx\n     * @classdesc Represents a NodeProto.\n     * @implements INodeProto\n     * @constructor\n     * @param {onnx.INodeProto=} [properties] Properties to set\n     */\n    function NodeProto(properties) {\n      this.input = [];\n      this.output = [];\n      this.attribute = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * NodeProto input.\n     * @member {Array.<string>} input\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.input = $util.emptyArray;\n\n    /**\n     * NodeProto output.\n     * @member {Array.<string>} output\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.output = $util.emptyArray;\n\n    /**\n     * NodeProto name.\n     * @member {string} name\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.name = '';\n\n    /**\n     * NodeProto opType.\n     * @member {string} opType\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.opType = '';\n\n    /**\n     * NodeProto domain.\n     * @member {string} domain\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.domain = '';\n\n    /**\n     * NodeProto attribute.\n     * @member {Array.<onnx.IAttributeProto>} attribute\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.attribute = $util.emptyArray;\n\n    /**\n     * NodeProto docString.\n     * @member {string} docString\n     * @memberof onnx.NodeProto\n     * @instance\n     */\n    NodeProto.prototype.docString = '';\n\n    /**\n     * Creates a new NodeProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {onnx.INodeProto=} [properties] Properties to set\n     * @returns {onnx.NodeProto} NodeProto instance\n     */\n    NodeProto.create = function create(properties) {\n      return new NodeProto(properties);\n    };\n\n    /**\n     * Encodes the specified NodeProto message. Does not implicitly {@link onnx.NodeProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {onnx.INodeProto} message NodeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    NodeProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.input != null && message.input.length)\n        for (var i = 0; i < message.input.length; ++i)\n          writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.input[i]);\n      if (message.output != null && message.output.length)\n        for (var i = 0; i < message.output.length; ++i)\n          writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.output[i]);\n      if (message.name != null && Object.hasOwnProperty.call(message, 'name'))\n        writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.name);\n      if (message.opType != null && Object.hasOwnProperty.call(message, 'opType'))\n        writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.opType);\n      if (message.attribute != null && message.attribute.length)\n        for (var i = 0; i < message.attribute.length; ++i)\n          $root.onnx.AttributeProto.encode(\n            message.attribute[i],\n            writer.uint32(/* id 5, wireType 2 =*/ 42).fork(),\n          ).ldelim();\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.docString);\n      if (message.domain != null && Object.hasOwnProperty.call(message, 'domain'))\n        writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.domain);\n      return writer;\n    };\n\n    /**\n     * Encodes the specified NodeProto message, length delimited. Does not implicitly {@link onnx.NodeProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {onnx.INodeProto} message NodeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    NodeProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a NodeProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.NodeProto} NodeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    NodeProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.NodeProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            if (!(message.input && message.input.length)) message.input = [];\n            message.input.push(reader.string());\n            break;\n          }\n          case 2: {\n            if (!(message.output && message.output.length)) message.output = [];\n            message.output.push(reader.string());\n            break;\n          }\n          case 3: {\n            message.name = reader.string();\n            break;\n          }\n          case 4: {\n            message.opType = reader.string();\n            break;\n          }\n          case 7: {\n            message.domain = reader.string();\n            break;\n          }\n          case 5: {\n            if (!(message.attribute && message.attribute.length)) message.attribute = [];\n            message.attribute.push($root.onnx.AttributeProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 6: {\n            message.docString = reader.string();\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a NodeProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.NodeProto} NodeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    NodeProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a NodeProto message.\n     * @function verify\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    NodeProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.input != null && message.hasOwnProperty('input')) {\n        if (!Array.isArray(message.input)) return 'input: array expected';\n        for (var i = 0; i < message.input.length; ++i)\n          if (!$util.isString(message.input[i])) return 'input: string[] expected';\n      }\n      if (message.output != null && message.hasOwnProperty('output')) {\n        if (!Array.isArray(message.output)) return 'output: array expected';\n        for (var i = 0; i < message.output.length; ++i)\n          if (!$util.isString(message.output[i])) return 'output: string[] expected';\n      }\n      if (message.name != null && message.hasOwnProperty('name'))\n        if (!$util.isString(message.name)) return 'name: string expected';\n      if (message.opType != null && message.hasOwnProperty('opType'))\n        if (!$util.isString(message.opType)) return 'opType: string expected';\n      if (message.domain != null && message.hasOwnProperty('domain'))\n        if (!$util.isString(message.domain)) return 'domain: string expected';\n      if (message.attribute != null && message.hasOwnProperty('attribute')) {\n        if (!Array.isArray(message.attribute)) return 'attribute: array expected';\n        for (var i = 0; i < message.attribute.length; ++i) {\n          var error = $root.onnx.AttributeProto.verify(message.attribute[i]);\n          if (error) return 'attribute.' + error;\n        }\n      }\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      return null;\n    };\n\n    /**\n     * Creates a NodeProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.NodeProto} NodeProto\n     */\n    NodeProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.NodeProto) return object;\n      var message = new $root.onnx.NodeProto();\n      if (object.input) {\n        if (!Array.isArray(object.input)) throw TypeError('.onnx.NodeProto.input: array expected');\n        message.input = [];\n        for (var i = 0; i < object.input.length; ++i) message.input[i] = String(object.input[i]);\n      }\n      if (object.output) {\n        if (!Array.isArray(object.output)) throw TypeError('.onnx.NodeProto.output: array expected');\n        message.output = [];\n        for (var i = 0; i < object.output.length; ++i) message.output[i] = String(object.output[i]);\n      }\n      if (object.name != null) message.name = String(object.name);\n      if (object.opType != null) message.opType = String(object.opType);\n      if (object.domain != null) message.domain = String(object.domain);\n      if (object.attribute) {\n        if (!Array.isArray(object.attribute)) throw TypeError('.onnx.NodeProto.attribute: array expected');\n        message.attribute = [];\n        for (var i = 0; i < object.attribute.length; ++i) {\n          if (typeof object.attribute[i] !== 'object') throw TypeError('.onnx.NodeProto.attribute: object expected');\n          message.attribute[i] = $root.onnx.AttributeProto.fromObject(object.attribute[i]);\n        }\n      }\n      if (object.docString != null) message.docString = String(object.docString);\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a NodeProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {onnx.NodeProto} message NodeProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    NodeProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.input = [];\n        object.output = [];\n        object.attribute = [];\n      }\n      if (options.defaults) {\n        object.name = '';\n        object.opType = '';\n        object.docString = '';\n        object.domain = '';\n      }\n      if (message.input && message.input.length) {\n        object.input = [];\n        for (var j = 0; j < message.input.length; ++j) object.input[j] = message.input[j];\n      }\n      if (message.output && message.output.length) {\n        object.output = [];\n        for (var j = 0; j < message.output.length; ++j) object.output[j] = message.output[j];\n      }\n      if (message.name != null && message.hasOwnProperty('name')) object.name = message.name;\n      if (message.opType != null && message.hasOwnProperty('opType')) object.opType = message.opType;\n      if (message.attribute && message.attribute.length) {\n        object.attribute = [];\n        for (var j = 0; j < message.attribute.length; ++j)\n          object.attribute[j] = $root.onnx.AttributeProto.toObject(message.attribute[j], options);\n      }\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      if (message.domain != null && message.hasOwnProperty('domain')) object.domain = message.domain;\n      return object;\n    };\n\n    /**\n     * Converts this NodeProto to JSON.\n     * @function toJSON\n     * @memberof onnx.NodeProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    NodeProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for NodeProto\n     * @function getTypeUrl\n     * @memberof onnx.NodeProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    NodeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.NodeProto';\n    };\n\n    return NodeProto;\n  })();\n\n  onnx.TrainingInfoProto = (function () {\n    /**\n     * Properties of a TrainingInfoProto.\n     * @memberof onnx\n     * @interface ITrainingInfoProto\n     * @property {onnx.IGraphProto|null} [initialization] TrainingInfoProto initialization\n     * @property {onnx.IGraphProto|null} [algorithm] TrainingInfoProto algorithm\n     * @property {Array.<onnx.IStringStringEntryProto>|null} [initializationBinding] TrainingInfoProto initializationBinding\n     * @property {Array.<onnx.IStringStringEntryProto>|null} [updateBinding] TrainingInfoProto updateBinding\n     */\n\n    /**\n     * Constructs a new TrainingInfoProto.\n     * @memberof onnx\n     * @classdesc Represents a TrainingInfoProto.\n     * @implements ITrainingInfoProto\n     * @constructor\n     * @param {onnx.ITrainingInfoProto=} [properties] Properties to set\n     */\n    function TrainingInfoProto(properties) {\n      this.initializationBinding = [];\n      this.updateBinding = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * TrainingInfoProto initialization.\n     * @member {onnx.IGraphProto|null|undefined} initialization\n     * @memberof onnx.TrainingInfoProto\n     * @instance\n     */\n    TrainingInfoProto.prototype.initialization = null;\n\n    /**\n     * TrainingInfoProto algorithm.\n     * @member {onnx.IGraphProto|null|undefined} algorithm\n     * @memberof onnx.TrainingInfoProto\n     * @instance\n     */\n    TrainingInfoProto.prototype.algorithm = null;\n\n    /**\n     * TrainingInfoProto initializationBinding.\n     * @member {Array.<onnx.IStringStringEntryProto>} initializationBinding\n     * @memberof onnx.TrainingInfoProto\n     * @instance\n     */\n    TrainingInfoProto.prototype.initializationBinding = $util.emptyArray;\n\n    /**\n     * TrainingInfoProto updateBinding.\n     * @member {Array.<onnx.IStringStringEntryProto>} updateBinding\n     * @memberof onnx.TrainingInfoProto\n     * @instance\n     */\n    TrainingInfoProto.prototype.updateBinding = $util.emptyArray;\n\n    /**\n     * Creates a new TrainingInfoProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {onnx.ITrainingInfoProto=} [properties] Properties to set\n     * @returns {onnx.TrainingInfoProto} TrainingInfoProto instance\n     */\n    TrainingInfoProto.create = function create(properties) {\n      return new TrainingInfoProto(properties);\n    };\n\n    /**\n     * Encodes the specified TrainingInfoProto message. Does not implicitly {@link onnx.TrainingInfoProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {onnx.ITrainingInfoProto} message TrainingInfoProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TrainingInfoProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.initialization != null && Object.hasOwnProperty.call(message, 'initialization'))\n        $root.onnx.GraphProto.encode(message.initialization, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();\n      if (message.algorithm != null && Object.hasOwnProperty.call(message, 'algorithm'))\n        $root.onnx.GraphProto.encode(message.algorithm, writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim();\n      if (message.initializationBinding != null && message.initializationBinding.length)\n        for (var i = 0; i < message.initializationBinding.length; ++i)\n          $root.onnx.StringStringEntryProto.encode(\n            message.initializationBinding[i],\n            writer.uint32(/* id 3, wireType 2 =*/ 26).fork(),\n          ).ldelim();\n      if (message.updateBinding != null && message.updateBinding.length)\n        for (var i = 0; i < message.updateBinding.length; ++i)\n          $root.onnx.StringStringEntryProto.encode(\n            message.updateBinding[i],\n            writer.uint32(/* id 4, wireType 2 =*/ 34).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified TrainingInfoProto message, length delimited. Does not implicitly {@link onnx.TrainingInfoProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {onnx.ITrainingInfoProto} message TrainingInfoProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TrainingInfoProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a TrainingInfoProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.TrainingInfoProto} TrainingInfoProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TrainingInfoProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.TrainingInfoProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.initialization = $root.onnx.GraphProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 2: {\n            message.algorithm = $root.onnx.GraphProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 3: {\n            if (!(message.initializationBinding && message.initializationBinding.length))\n              message.initializationBinding = [];\n            message.initializationBinding.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 4: {\n            if (!(message.updateBinding && message.updateBinding.length)) message.updateBinding = [];\n            message.updateBinding.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a TrainingInfoProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.TrainingInfoProto} TrainingInfoProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TrainingInfoProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a TrainingInfoProto message.\n     * @function verify\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    TrainingInfoProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.initialization != null && message.hasOwnProperty('initialization')) {\n        var error = $root.onnx.GraphProto.verify(message.initialization);\n        if (error) return 'initialization.' + error;\n      }\n      if (message.algorithm != null && message.hasOwnProperty('algorithm')) {\n        var error = $root.onnx.GraphProto.verify(message.algorithm);\n        if (error) return 'algorithm.' + error;\n      }\n      if (message.initializationBinding != null && message.hasOwnProperty('initializationBinding')) {\n        if (!Array.isArray(message.initializationBinding)) return 'initializationBinding: array expected';\n        for (var i = 0; i < message.initializationBinding.length; ++i) {\n          var error = $root.onnx.StringStringEntryProto.verify(message.initializationBinding[i]);\n          if (error) return 'initializationBinding.' + error;\n        }\n      }\n      if (message.updateBinding != null && message.hasOwnProperty('updateBinding')) {\n        if (!Array.isArray(message.updateBinding)) return 'updateBinding: array expected';\n        for (var i = 0; i < message.updateBinding.length; ++i) {\n          var error = $root.onnx.StringStringEntryProto.verify(message.updateBinding[i]);\n          if (error) return 'updateBinding.' + error;\n        }\n      }\n      return null;\n    };\n\n    /**\n     * Creates a TrainingInfoProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.TrainingInfoProto} TrainingInfoProto\n     */\n    TrainingInfoProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.TrainingInfoProto) return object;\n      var message = new $root.onnx.TrainingInfoProto();\n      if (object.initialization != null) {\n        if (typeof object.initialization !== 'object')\n          throw TypeError('.onnx.TrainingInfoProto.initialization: object expected');\n        message.initialization = $root.onnx.GraphProto.fromObject(object.initialization);\n      }\n      if (object.algorithm != null) {\n        if (typeof object.algorithm !== 'object') throw TypeError('.onnx.TrainingInfoProto.algorithm: object expected');\n        message.algorithm = $root.onnx.GraphProto.fromObject(object.algorithm);\n      }\n      if (object.initializationBinding) {\n        if (!Array.isArray(object.initializationBinding))\n          throw TypeError('.onnx.TrainingInfoProto.initializationBinding: array expected');\n        message.initializationBinding = [];\n        for (var i = 0; i < object.initializationBinding.length; ++i) {\n          if (typeof object.initializationBinding[i] !== 'object')\n            throw TypeError('.onnx.TrainingInfoProto.initializationBinding: object expected');\n          message.initializationBinding[i] = $root.onnx.StringStringEntryProto.fromObject(\n            object.initializationBinding[i],\n          );\n        }\n      }\n      if (object.updateBinding) {\n        if (!Array.isArray(object.updateBinding))\n          throw TypeError('.onnx.TrainingInfoProto.updateBinding: array expected');\n        message.updateBinding = [];\n        for (var i = 0; i < object.updateBinding.length; ++i) {\n          if (typeof object.updateBinding[i] !== 'object')\n            throw TypeError('.onnx.TrainingInfoProto.updateBinding: object expected');\n          message.updateBinding[i] = $root.onnx.StringStringEntryProto.fromObject(object.updateBinding[i]);\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a TrainingInfoProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {onnx.TrainingInfoProto} message TrainingInfoProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    TrainingInfoProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.initializationBinding = [];\n        object.updateBinding = [];\n      }\n      if (options.defaults) {\n        object.initialization = null;\n        object.algorithm = null;\n      }\n      if (message.initialization != null && message.hasOwnProperty('initialization'))\n        object.initialization = $root.onnx.GraphProto.toObject(message.initialization, options);\n      if (message.algorithm != null && message.hasOwnProperty('algorithm'))\n        object.algorithm = $root.onnx.GraphProto.toObject(message.algorithm, options);\n      if (message.initializationBinding && message.initializationBinding.length) {\n        object.initializationBinding = [];\n        for (var j = 0; j < message.initializationBinding.length; ++j)\n          object.initializationBinding[j] = $root.onnx.StringStringEntryProto.toObject(\n            message.initializationBinding[j],\n            options,\n          );\n      }\n      if (message.updateBinding && message.updateBinding.length) {\n        object.updateBinding = [];\n        for (var j = 0; j < message.updateBinding.length; ++j)\n          object.updateBinding[j] = $root.onnx.StringStringEntryProto.toObject(message.updateBinding[j], options);\n      }\n      return object;\n    };\n\n    /**\n     * Converts this TrainingInfoProto to JSON.\n     * @function toJSON\n     * @memberof onnx.TrainingInfoProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    TrainingInfoProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for TrainingInfoProto\n     * @function getTypeUrl\n     * @memberof onnx.TrainingInfoProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    TrainingInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.TrainingInfoProto';\n    };\n\n    return TrainingInfoProto;\n  })();\n\n  onnx.ModelProto = (function () {\n    /**\n     * Properties of a ModelProto.\n     * @memberof onnx\n     * @interface IModelProto\n     * @property {number|Long|null} [irVersion] ModelProto irVersion\n     * @property {Array.<onnx.IOperatorSetIdProto>|null} [opsetImport] ModelProto opsetImport\n     * @property {string|null} [producerName] ModelProto producerName\n     * @property {string|null} [producerVersion] ModelProto producerVersion\n     * @property {string|null} [domain] ModelProto domain\n     * @property {number|Long|null} [modelVersion] ModelProto modelVersion\n     * @property {string|null} [docString] ModelProto docString\n     * @property {onnx.IGraphProto|null} [graph] ModelProto graph\n     * @property {Array.<onnx.IStringStringEntryProto>|null} [metadataProps] ModelProto metadataProps\n     * @property {Array.<onnx.ITrainingInfoProto>|null} [trainingInfo] ModelProto trainingInfo\n     * @property {Array.<onnx.IFunctionProto>|null} [functions] ModelProto functions\n     */\n\n    /**\n     * Constructs a new ModelProto.\n     * @memberof onnx\n     * @classdesc Represents a ModelProto.\n     * @implements IModelProto\n     * @constructor\n     * @param {onnx.IModelProto=} [properties] Properties to set\n     */\n    function ModelProto(properties) {\n      this.opsetImport = [];\n      this.metadataProps = [];\n      this.trainingInfo = [];\n      this.functions = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * ModelProto irVersion.\n     * @member {number|Long} irVersion\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.irVersion = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n\n    /**\n     * ModelProto opsetImport.\n     * @member {Array.<onnx.IOperatorSetIdProto>} opsetImport\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.opsetImport = $util.emptyArray;\n\n    /**\n     * ModelProto producerName.\n     * @member {string} producerName\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.producerName = '';\n\n    /**\n     * ModelProto producerVersion.\n     * @member {string} producerVersion\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.producerVersion = '';\n\n    /**\n     * ModelProto domain.\n     * @member {string} domain\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.domain = '';\n\n    /**\n     * ModelProto modelVersion.\n     * @member {number|Long} modelVersion\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.modelVersion = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n\n    /**\n     * ModelProto docString.\n     * @member {string} docString\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.docString = '';\n\n    /**\n     * ModelProto graph.\n     * @member {onnx.IGraphProto|null|undefined} graph\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.graph = null;\n\n    /**\n     * ModelProto metadataProps.\n     * @member {Array.<onnx.IStringStringEntryProto>} metadataProps\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.metadataProps = $util.emptyArray;\n\n    /**\n     * ModelProto trainingInfo.\n     * @member {Array.<onnx.ITrainingInfoProto>} trainingInfo\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.trainingInfo = $util.emptyArray;\n\n    /**\n     * ModelProto functions.\n     * @member {Array.<onnx.IFunctionProto>} functions\n     * @memberof onnx.ModelProto\n     * @instance\n     */\n    ModelProto.prototype.functions = $util.emptyArray;\n\n    /**\n     * Creates a new ModelProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {onnx.IModelProto=} [properties] Properties to set\n     * @returns {onnx.ModelProto} ModelProto instance\n     */\n    ModelProto.create = function create(properties) {\n      return new ModelProto(properties);\n    };\n\n    /**\n     * Encodes the specified ModelProto message. Does not implicitly {@link onnx.ModelProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {onnx.IModelProto} message ModelProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    ModelProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.irVersion != null && Object.hasOwnProperty.call(message, 'irVersion'))\n        writer.uint32(/* id 1, wireType 0 =*/ 8).int64(message.irVersion);\n      if (message.producerName != null && Object.hasOwnProperty.call(message, 'producerName'))\n        writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.producerName);\n      if (message.producerVersion != null && Object.hasOwnProperty.call(message, 'producerVersion'))\n        writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.producerVersion);\n      if (message.domain != null && Object.hasOwnProperty.call(message, 'domain'))\n        writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.domain);\n      if (message.modelVersion != null && Object.hasOwnProperty.call(message, 'modelVersion'))\n        writer.uint32(/* id 5, wireType 0 =*/ 40).int64(message.modelVersion);\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.docString);\n      if (message.graph != null && Object.hasOwnProperty.call(message, 'graph'))\n        $root.onnx.GraphProto.encode(message.graph, writer.uint32(/* id 7, wireType 2 =*/ 58).fork()).ldelim();\n      if (message.opsetImport != null && message.opsetImport.length)\n        for (var i = 0; i < message.opsetImport.length; ++i)\n          $root.onnx.OperatorSetIdProto.encode(\n            message.opsetImport[i],\n            writer.uint32(/* id 8, wireType 2 =*/ 66).fork(),\n          ).ldelim();\n      if (message.metadataProps != null && message.metadataProps.length)\n        for (var i = 0; i < message.metadataProps.length; ++i)\n          $root.onnx.StringStringEntryProto.encode(\n            message.metadataProps[i],\n            writer.uint32(/* id 14, wireType 2 =*/ 114).fork(),\n          ).ldelim();\n      if (message.trainingInfo != null && message.trainingInfo.length)\n        for (var i = 0; i < message.trainingInfo.length; ++i)\n          $root.onnx.TrainingInfoProto.encode(\n            message.trainingInfo[i],\n            writer.uint32(/* id 20, wireType 2 =*/ 162).fork(),\n          ).ldelim();\n      if (message.functions != null && message.functions.length)\n        for (var i = 0; i < message.functions.length; ++i)\n          $root.onnx.FunctionProto.encode(\n            message.functions[i],\n            writer.uint32(/* id 25, wireType 2 =*/ 202).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified ModelProto message, length delimited. Does not implicitly {@link onnx.ModelProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {onnx.IModelProto} message ModelProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    ModelProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a ModelProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.ModelProto} ModelProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    ModelProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.ModelProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.irVersion = reader.int64();\n            break;\n          }\n          case 8: {\n            if (!(message.opsetImport && message.opsetImport.length)) message.opsetImport = [];\n            message.opsetImport.push($root.onnx.OperatorSetIdProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 2: {\n            message.producerName = reader.string();\n            break;\n          }\n          case 3: {\n            message.producerVersion = reader.string();\n            break;\n          }\n          case 4: {\n            message.domain = reader.string();\n            break;\n          }\n          case 5: {\n            message.modelVersion = reader.int64();\n            break;\n          }\n          case 6: {\n            message.docString = reader.string();\n            break;\n          }\n          case 7: {\n            message.graph = $root.onnx.GraphProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 14: {\n            if (!(message.metadataProps && message.metadataProps.length)) message.metadataProps = [];\n            message.metadataProps.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 20: {\n            if (!(message.trainingInfo && message.trainingInfo.length)) message.trainingInfo = [];\n            message.trainingInfo.push($root.onnx.TrainingInfoProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 25: {\n            if (!(message.functions && message.functions.length)) message.functions = [];\n            message.functions.push($root.onnx.FunctionProto.decode(reader, reader.uint32()));\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a ModelProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.ModelProto} ModelProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    ModelProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a ModelProto message.\n     * @function verify\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    ModelProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.irVersion != null && message.hasOwnProperty('irVersion'))\n        if (\n          !$util.isInteger(message.irVersion) &&\n          !(message.irVersion && $util.isInteger(message.irVersion.low) && $util.isInteger(message.irVersion.high))\n        )\n          return 'irVersion: integer|Long expected';\n      if (message.opsetImport != null && message.hasOwnProperty('opsetImport')) {\n        if (!Array.isArray(message.opsetImport)) return 'opsetImport: array expected';\n        for (var i = 0; i < message.opsetImport.length; ++i) {\n          var error = $root.onnx.OperatorSetIdProto.verify(message.opsetImport[i]);\n          if (error) return 'opsetImport.' + error;\n        }\n      }\n      if (message.producerName != null && message.hasOwnProperty('producerName'))\n        if (!$util.isString(message.producerName)) return 'producerName: string expected';\n      if (message.producerVersion != null && message.hasOwnProperty('producerVersion'))\n        if (!$util.isString(message.producerVersion)) return 'producerVersion: string expected';\n      if (message.domain != null && message.hasOwnProperty('domain'))\n        if (!$util.isString(message.domain)) return 'domain: string expected';\n      if (message.modelVersion != null && message.hasOwnProperty('modelVersion'))\n        if (\n          !$util.isInteger(message.modelVersion) &&\n          !(\n            message.modelVersion &&\n            $util.isInteger(message.modelVersion.low) &&\n            $util.isInteger(message.modelVersion.high)\n          )\n        )\n          return 'modelVersion: integer|Long expected';\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      if (message.graph != null && message.hasOwnProperty('graph')) {\n        var error = $root.onnx.GraphProto.verify(message.graph);\n        if (error) return 'graph.' + error;\n      }\n      if (message.metadataProps != null && message.hasOwnProperty('metadataProps')) {\n        if (!Array.isArray(message.metadataProps)) return 'metadataProps: array expected';\n        for (var i = 0; i < message.metadataProps.length; ++i) {\n          var error = $root.onnx.StringStringEntryProto.verify(message.metadataProps[i]);\n          if (error) return 'metadataProps.' + error;\n        }\n      }\n      if (message.trainingInfo != null && message.hasOwnProperty('trainingInfo')) {\n        if (!Array.isArray(message.trainingInfo)) return 'trainingInfo: array expected';\n        for (var i = 0; i < message.trainingInfo.length; ++i) {\n          var error = $root.onnx.TrainingInfoProto.verify(message.trainingInfo[i]);\n          if (error) return 'trainingInfo.' + error;\n        }\n      }\n      if (message.functions != null && message.hasOwnProperty('functions')) {\n        if (!Array.isArray(message.functions)) return 'functions: array expected';\n        for (var i = 0; i < message.functions.length; ++i) {\n          var error = $root.onnx.FunctionProto.verify(message.functions[i]);\n          if (error) return 'functions.' + error;\n        }\n      }\n      return null;\n    };\n\n    /**\n     * Creates a ModelProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.ModelProto} ModelProto\n     */\n    ModelProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.ModelProto) return object;\n      var message = new $root.onnx.ModelProto();\n      if (object.irVersion != null)\n        if ($util.Long) (message.irVersion = $util.Long.fromValue(object.irVersion)).unsigned = false;\n        else if (typeof object.irVersion === 'string') message.irVersion = parseInt(object.irVersion, 10);\n        else if (typeof object.irVersion === 'number') message.irVersion = object.irVersion;\n        else if (typeof object.irVersion === 'object')\n          message.irVersion = new $util.LongBits(object.irVersion.low >>> 0, object.irVersion.high >>> 0).toNumber();\n      if (object.opsetImport) {\n        if (!Array.isArray(object.opsetImport)) throw TypeError('.onnx.ModelProto.opsetImport: array expected');\n        message.opsetImport = [];\n        for (var i = 0; i < object.opsetImport.length; ++i) {\n          if (typeof object.opsetImport[i] !== 'object')\n            throw TypeError('.onnx.ModelProto.opsetImport: object expected');\n          message.opsetImport[i] = $root.onnx.OperatorSetIdProto.fromObject(object.opsetImport[i]);\n        }\n      }\n      if (object.producerName != null) message.producerName = String(object.producerName);\n      if (object.producerVersion != null) message.producerVersion = String(object.producerVersion);\n      if (object.domain != null) message.domain = String(object.domain);\n      if (object.modelVersion != null)\n        if ($util.Long) (message.modelVersion = $util.Long.fromValue(object.modelVersion)).unsigned = false;\n        else if (typeof object.modelVersion === 'string') message.modelVersion = parseInt(object.modelVersion, 10);\n        else if (typeof object.modelVersion === 'number') message.modelVersion = object.modelVersion;\n        else if (typeof object.modelVersion === 'object')\n          message.modelVersion = new $util.LongBits(\n            object.modelVersion.low >>> 0,\n            object.modelVersion.high >>> 0,\n          ).toNumber();\n      if (object.docString != null) message.docString = String(object.docString);\n      if (object.graph != null) {\n        if (typeof object.graph !== 'object') throw TypeError('.onnx.ModelProto.graph: object expected');\n        message.graph = $root.onnx.GraphProto.fromObject(object.graph);\n      }\n      if (object.metadataProps) {\n        if (!Array.isArray(object.metadataProps)) throw TypeError('.onnx.ModelProto.metadataProps: array expected');\n        message.metadataProps = [];\n        for (var i = 0; i < object.metadataProps.length; ++i) {\n          if (typeof object.metadataProps[i] !== 'object')\n            throw TypeError('.onnx.ModelProto.metadataProps: object expected');\n          message.metadataProps[i] = $root.onnx.StringStringEntryProto.fromObject(object.metadataProps[i]);\n        }\n      }\n      if (object.trainingInfo) {\n        if (!Array.isArray(object.trainingInfo)) throw TypeError('.onnx.ModelProto.trainingInfo: array expected');\n        message.trainingInfo = [];\n        for (var i = 0; i < object.trainingInfo.length; ++i) {\n          if (typeof object.trainingInfo[i] !== 'object')\n            throw TypeError('.onnx.ModelProto.trainingInfo: object expected');\n          message.trainingInfo[i] = $root.onnx.TrainingInfoProto.fromObject(object.trainingInfo[i]);\n        }\n      }\n      if (object.functions) {\n        if (!Array.isArray(object.functions)) throw TypeError('.onnx.ModelProto.functions: array expected');\n        message.functions = [];\n        for (var i = 0; i < object.functions.length; ++i) {\n          if (typeof object.functions[i] !== 'object') throw TypeError('.onnx.ModelProto.functions: object expected');\n          message.functions[i] = $root.onnx.FunctionProto.fromObject(object.functions[i]);\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a ModelProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {onnx.ModelProto} message ModelProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    ModelProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.opsetImport = [];\n        object.metadataProps = [];\n        object.trainingInfo = [];\n        object.functions = [];\n      }\n      if (options.defaults) {\n        if ($util.Long) {\n          var long = new $util.Long(0, 0, false);\n          object.irVersion =\n            options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n        } else object.irVersion = options.longs === String ? '0' : 0;\n        object.producerName = '';\n        object.producerVersion = '';\n        object.domain = '';\n        if ($util.Long) {\n          var long = new $util.Long(0, 0, false);\n          object.modelVersion =\n            options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n        } else object.modelVersion = options.longs === String ? '0' : 0;\n        object.docString = '';\n        object.graph = null;\n      }\n      if (message.irVersion != null && message.hasOwnProperty('irVersion'))\n        if (typeof message.irVersion === 'number')\n          object.irVersion = options.longs === String ? String(message.irVersion) : message.irVersion;\n        else\n          object.irVersion =\n            options.longs === String\n              ? $util.Long.prototype.toString.call(message.irVersion)\n              : options.longs === Number\n                ? new $util.LongBits(message.irVersion.low >>> 0, message.irVersion.high >>> 0).toNumber()\n                : message.irVersion;\n      if (message.producerName != null && message.hasOwnProperty('producerName'))\n        object.producerName = message.producerName;\n      if (message.producerVersion != null && message.hasOwnProperty('producerVersion'))\n        object.producerVersion = message.producerVersion;\n      if (message.domain != null && message.hasOwnProperty('domain')) object.domain = message.domain;\n      if (message.modelVersion != null && message.hasOwnProperty('modelVersion'))\n        if (typeof message.modelVersion === 'number')\n          object.modelVersion = options.longs === String ? String(message.modelVersion) : message.modelVersion;\n        else\n          object.modelVersion =\n            options.longs === String\n              ? $util.Long.prototype.toString.call(message.modelVersion)\n              : options.longs === Number\n                ? new $util.LongBits(message.modelVersion.low >>> 0, message.modelVersion.high >>> 0).toNumber()\n                : message.modelVersion;\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      if (message.graph != null && message.hasOwnProperty('graph'))\n        object.graph = $root.onnx.GraphProto.toObject(message.graph, options);\n      if (message.opsetImport && message.opsetImport.length) {\n        object.opsetImport = [];\n        for (var j = 0; j < message.opsetImport.length; ++j)\n          object.opsetImport[j] = $root.onnx.OperatorSetIdProto.toObject(message.opsetImport[j], options);\n      }\n      if (message.metadataProps && message.metadataProps.length) {\n        object.metadataProps = [];\n        for (var j = 0; j < message.metadataProps.length; ++j)\n          object.metadataProps[j] = $root.onnx.StringStringEntryProto.toObject(message.metadataProps[j], options);\n      }\n      if (message.trainingInfo && message.trainingInfo.length) {\n        object.trainingInfo = [];\n        for (var j = 0; j < message.trainingInfo.length; ++j)\n          object.trainingInfo[j] = $root.onnx.TrainingInfoProto.toObject(message.trainingInfo[j], options);\n      }\n      if (message.functions && message.functions.length) {\n        object.functions = [];\n        for (var j = 0; j < message.functions.length; ++j)\n          object.functions[j] = $root.onnx.FunctionProto.toObject(message.functions[j], options);\n      }\n      return object;\n    };\n\n    /**\n     * Converts this ModelProto to JSON.\n     * @function toJSON\n     * @memberof onnx.ModelProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    ModelProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for ModelProto\n     * @function getTypeUrl\n     * @memberof onnx.ModelProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    ModelProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.ModelProto';\n    };\n\n    return ModelProto;\n  })();\n\n  onnx.StringStringEntryProto = (function () {\n    /**\n     * Properties of a StringStringEntryProto.\n     * @memberof onnx\n     * @interface IStringStringEntryProto\n     * @property {string|null} [key] StringStringEntryProto key\n     * @property {string|null} [value] StringStringEntryProto value\n     */\n\n    /**\n     * Constructs a new StringStringEntryProto.\n     * @memberof onnx\n     * @classdesc Represents a StringStringEntryProto.\n     * @implements IStringStringEntryProto\n     * @constructor\n     * @param {onnx.IStringStringEntryProto=} [properties] Properties to set\n     */\n    function StringStringEntryProto(properties) {\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * StringStringEntryProto key.\n     * @member {string} key\n     * @memberof onnx.StringStringEntryProto\n     * @instance\n     */\n    StringStringEntryProto.prototype.key = '';\n\n    /**\n     * StringStringEntryProto value.\n     * @member {string} value\n     * @memberof onnx.StringStringEntryProto\n     * @instance\n     */\n    StringStringEntryProto.prototype.value = '';\n\n    /**\n     * Creates a new StringStringEntryProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {onnx.IStringStringEntryProto=} [properties] Properties to set\n     * @returns {onnx.StringStringEntryProto} StringStringEntryProto instance\n     */\n    StringStringEntryProto.create = function create(properties) {\n      return new StringStringEntryProto(properties);\n    };\n\n    /**\n     * Encodes the specified StringStringEntryProto message. Does not implicitly {@link onnx.StringStringEntryProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {onnx.IStringStringEntryProto} message StringStringEntryProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    StringStringEntryProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.key != null && Object.hasOwnProperty.call(message, 'key'))\n        writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.key);\n      if (message.value != null && Object.hasOwnProperty.call(message, 'value'))\n        writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.value);\n      return writer;\n    };\n\n    /**\n     * Encodes the specified StringStringEntryProto message, length delimited. Does not implicitly {@link onnx.StringStringEntryProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {onnx.IStringStringEntryProto} message StringStringEntryProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    StringStringEntryProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a StringStringEntryProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.StringStringEntryProto} StringStringEntryProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    StringStringEntryProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.StringStringEntryProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.key = reader.string();\n            break;\n          }\n          case 2: {\n            message.value = reader.string();\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a StringStringEntryProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.StringStringEntryProto} StringStringEntryProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    StringStringEntryProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a StringStringEntryProto message.\n     * @function verify\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    StringStringEntryProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.key != null && message.hasOwnProperty('key'))\n        if (!$util.isString(message.key)) return 'key: string expected';\n      if (message.value != null && message.hasOwnProperty('value'))\n        if (!$util.isString(message.value)) return 'value: string expected';\n      return null;\n    };\n\n    /**\n     * Creates a StringStringEntryProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.StringStringEntryProto} StringStringEntryProto\n     */\n    StringStringEntryProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.StringStringEntryProto) return object;\n      var message = new $root.onnx.StringStringEntryProto();\n      if (object.key != null) message.key = String(object.key);\n      if (object.value != null) message.value = String(object.value);\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a StringStringEntryProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {onnx.StringStringEntryProto} message StringStringEntryProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    StringStringEntryProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.defaults) {\n        object.key = '';\n        object.value = '';\n      }\n      if (message.key != null && message.hasOwnProperty('key')) object.key = message.key;\n      if (message.value != null && message.hasOwnProperty('value')) object.value = message.value;\n      return object;\n    };\n\n    /**\n     * Converts this StringStringEntryProto to JSON.\n     * @function toJSON\n     * @memberof onnx.StringStringEntryProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    StringStringEntryProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for StringStringEntryProto\n     * @function getTypeUrl\n     * @memberof onnx.StringStringEntryProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    StringStringEntryProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.StringStringEntryProto';\n    };\n\n    return StringStringEntryProto;\n  })();\n\n  onnx.TensorAnnotation = (function () {\n    /**\n     * Properties of a TensorAnnotation.\n     * @memberof onnx\n     * @interface ITensorAnnotation\n     * @property {string|null} [tensorName] TensorAnnotation tensorName\n     * @property {Array.<onnx.IStringStringEntryProto>|null} [quantParameterTensorNames] TensorAnnotation quantParameterTensorNames\n     */\n\n    /**\n     * Constructs a new TensorAnnotation.\n     * @memberof onnx\n     * @classdesc Represents a TensorAnnotation.\n     * @implements ITensorAnnotation\n     * @constructor\n     * @param {onnx.ITensorAnnotation=} [properties] Properties to set\n     */\n    function TensorAnnotation(properties) {\n      this.quantParameterTensorNames = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * TensorAnnotation tensorName.\n     * @member {string} tensorName\n     * @memberof onnx.TensorAnnotation\n     * @instance\n     */\n    TensorAnnotation.prototype.tensorName = '';\n\n    /**\n     * TensorAnnotation quantParameterTensorNames.\n     * @member {Array.<onnx.IStringStringEntryProto>} quantParameterTensorNames\n     * @memberof onnx.TensorAnnotation\n     * @instance\n     */\n    TensorAnnotation.prototype.quantParameterTensorNames = $util.emptyArray;\n\n    /**\n     * Creates a new TensorAnnotation instance using the specified properties.\n     * @function create\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {onnx.ITensorAnnotation=} [properties] Properties to set\n     * @returns {onnx.TensorAnnotation} TensorAnnotation instance\n     */\n    TensorAnnotation.create = function create(properties) {\n      return new TensorAnnotation(properties);\n    };\n\n    /**\n     * Encodes the specified TensorAnnotation message. Does not implicitly {@link onnx.TensorAnnotation.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {onnx.ITensorAnnotation} message TensorAnnotation message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TensorAnnotation.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.tensorName != null && Object.hasOwnProperty.call(message, 'tensorName'))\n        writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.tensorName);\n      if (message.quantParameterTensorNames != null && message.quantParameterTensorNames.length)\n        for (var i = 0; i < message.quantParameterTensorNames.length; ++i)\n          $root.onnx.StringStringEntryProto.encode(\n            message.quantParameterTensorNames[i],\n            writer.uint32(/* id 2, wireType 2 =*/ 18).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified TensorAnnotation message, length delimited. Does not implicitly {@link onnx.TensorAnnotation.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {onnx.ITensorAnnotation} message TensorAnnotation message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TensorAnnotation.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a TensorAnnotation message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.TensorAnnotation} TensorAnnotation\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TensorAnnotation.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.TensorAnnotation();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.tensorName = reader.string();\n            break;\n          }\n          case 2: {\n            if (!(message.quantParameterTensorNames && message.quantParameterTensorNames.length))\n              message.quantParameterTensorNames = [];\n            message.quantParameterTensorNames.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a TensorAnnotation message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.TensorAnnotation} TensorAnnotation\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TensorAnnotation.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a TensorAnnotation message.\n     * @function verify\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    TensorAnnotation.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.tensorName != null && message.hasOwnProperty('tensorName'))\n        if (!$util.isString(message.tensorName)) return 'tensorName: string expected';\n      if (message.quantParameterTensorNames != null && message.hasOwnProperty('quantParameterTensorNames')) {\n        if (!Array.isArray(message.quantParameterTensorNames)) return 'quantParameterTensorNames: array expected';\n        for (var i = 0; i < message.quantParameterTensorNames.length; ++i) {\n          var error = $root.onnx.StringStringEntryProto.verify(message.quantParameterTensorNames[i]);\n          if (error) return 'quantParameterTensorNames.' + error;\n        }\n      }\n      return null;\n    };\n\n    /**\n     * Creates a TensorAnnotation message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.TensorAnnotation} TensorAnnotation\n     */\n    TensorAnnotation.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.TensorAnnotation) return object;\n      var message = new $root.onnx.TensorAnnotation();\n      if (object.tensorName != null) message.tensorName = String(object.tensorName);\n      if (object.quantParameterTensorNames) {\n        if (!Array.isArray(object.quantParameterTensorNames))\n          throw TypeError('.onnx.TensorAnnotation.quantParameterTensorNames: array expected');\n        message.quantParameterTensorNames = [];\n        for (var i = 0; i < object.quantParameterTensorNames.length; ++i) {\n          if (typeof object.quantParameterTensorNames[i] !== 'object')\n            throw TypeError('.onnx.TensorAnnotation.quantParameterTensorNames: object expected');\n          message.quantParameterTensorNames[i] = $root.onnx.StringStringEntryProto.fromObject(\n            object.quantParameterTensorNames[i],\n          );\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a TensorAnnotation message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {onnx.TensorAnnotation} message TensorAnnotation\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    TensorAnnotation.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) object.quantParameterTensorNames = [];\n      if (options.defaults) object.tensorName = '';\n      if (message.tensorName != null && message.hasOwnProperty('tensorName')) object.tensorName = message.tensorName;\n      if (message.quantParameterTensorNames && message.quantParameterTensorNames.length) {\n        object.quantParameterTensorNames = [];\n        for (var j = 0; j < message.quantParameterTensorNames.length; ++j)\n          object.quantParameterTensorNames[j] = $root.onnx.StringStringEntryProto.toObject(\n            message.quantParameterTensorNames[j],\n            options,\n          );\n      }\n      return object;\n    };\n\n    /**\n     * Converts this TensorAnnotation to JSON.\n     * @function toJSON\n     * @memberof onnx.TensorAnnotation\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    TensorAnnotation.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for TensorAnnotation\n     * @function getTypeUrl\n     * @memberof onnx.TensorAnnotation\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    TensorAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.TensorAnnotation';\n    };\n\n    return TensorAnnotation;\n  })();\n\n  onnx.GraphProto = (function () {\n    /**\n     * Properties of a GraphProto.\n     * @memberof onnx\n     * @interface IGraphProto\n     * @property {Array.<onnx.INodeProto>|null} [node] GraphProto node\n     * @property {string|null} [name] GraphProto name\n     * @property {Array.<onnx.ITensorProto>|null} [initializer] GraphProto initializer\n     * @property {Array.<onnx.ISparseTensorProto>|null} [sparseInitializer] GraphProto sparseInitializer\n     * @property {string|null} [docString] GraphProto docString\n     * @property {Array.<onnx.IValueInfoProto>|null} [input] GraphProto input\n     * @property {Array.<onnx.IValueInfoProto>|null} [output] GraphProto output\n     * @property {Array.<onnx.IValueInfoProto>|null} [valueInfo] GraphProto valueInfo\n     * @property {Array.<onnx.ITensorAnnotation>|null} [quantizationAnnotation] GraphProto quantizationAnnotation\n     */\n\n    /**\n     * Constructs a new GraphProto.\n     * @memberof onnx\n     * @classdesc Represents a GraphProto.\n     * @implements IGraphProto\n     * @constructor\n     * @param {onnx.IGraphProto=} [properties] Properties to set\n     */\n    function GraphProto(properties) {\n      this.node = [];\n      this.initializer = [];\n      this.sparseInitializer = [];\n      this.input = [];\n      this.output = [];\n      this.valueInfo = [];\n      this.quantizationAnnotation = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * GraphProto node.\n     * @member {Array.<onnx.INodeProto>} node\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.node = $util.emptyArray;\n\n    /**\n     * GraphProto name.\n     * @member {string} name\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.name = '';\n\n    /**\n     * GraphProto initializer.\n     * @member {Array.<onnx.ITensorProto>} initializer\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.initializer = $util.emptyArray;\n\n    /**\n     * GraphProto sparseInitializer.\n     * @member {Array.<onnx.ISparseTensorProto>} sparseInitializer\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.sparseInitializer = $util.emptyArray;\n\n    /**\n     * GraphProto docString.\n     * @member {string} docString\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.docString = '';\n\n    /**\n     * GraphProto input.\n     * @member {Array.<onnx.IValueInfoProto>} input\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.input = $util.emptyArray;\n\n    /**\n     * GraphProto output.\n     * @member {Array.<onnx.IValueInfoProto>} output\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.output = $util.emptyArray;\n\n    /**\n     * GraphProto valueInfo.\n     * @member {Array.<onnx.IValueInfoProto>} valueInfo\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.valueInfo = $util.emptyArray;\n\n    /**\n     * GraphProto quantizationAnnotation.\n     * @member {Array.<onnx.ITensorAnnotation>} quantizationAnnotation\n     * @memberof onnx.GraphProto\n     * @instance\n     */\n    GraphProto.prototype.quantizationAnnotation = $util.emptyArray;\n\n    /**\n     * Creates a new GraphProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {onnx.IGraphProto=} [properties] Properties to set\n     * @returns {onnx.GraphProto} GraphProto instance\n     */\n    GraphProto.create = function create(properties) {\n      return new GraphProto(properties);\n    };\n\n    /**\n     * Encodes the specified GraphProto message. Does not implicitly {@link onnx.GraphProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {onnx.IGraphProto} message GraphProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    GraphProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.node != null && message.node.length)\n        for (var i = 0; i < message.node.length; ++i)\n          $root.onnx.NodeProto.encode(message.node[i], writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();\n      if (message.name != null && Object.hasOwnProperty.call(message, 'name'))\n        writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.name);\n      if (message.initializer != null && message.initializer.length)\n        for (var i = 0; i < message.initializer.length; ++i)\n          $root.onnx.TensorProto.encode(\n            message.initializer[i],\n            writer.uint32(/* id 5, wireType 2 =*/ 42).fork(),\n          ).ldelim();\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 10, wireType 2 =*/ 82).string(message.docString);\n      if (message.input != null && message.input.length)\n        for (var i = 0; i < message.input.length; ++i)\n          $root.onnx.ValueInfoProto.encode(\n            message.input[i],\n            writer.uint32(/* id 11, wireType 2 =*/ 90).fork(),\n          ).ldelim();\n      if (message.output != null && message.output.length)\n        for (var i = 0; i < message.output.length; ++i)\n          $root.onnx.ValueInfoProto.encode(\n            message.output[i],\n            writer.uint32(/* id 12, wireType 2 =*/ 98).fork(),\n          ).ldelim();\n      if (message.valueInfo != null && message.valueInfo.length)\n        for (var i = 0; i < message.valueInfo.length; ++i)\n          $root.onnx.ValueInfoProto.encode(\n            message.valueInfo[i],\n            writer.uint32(/* id 13, wireType 2 =*/ 106).fork(),\n          ).ldelim();\n      if (message.quantizationAnnotation != null && message.quantizationAnnotation.length)\n        for (var i = 0; i < message.quantizationAnnotation.length; ++i)\n          $root.onnx.TensorAnnotation.encode(\n            message.quantizationAnnotation[i],\n            writer.uint32(/* id 14, wireType 2 =*/ 114).fork(),\n          ).ldelim();\n      if (message.sparseInitializer != null && message.sparseInitializer.length)\n        for (var i = 0; i < message.sparseInitializer.length; ++i)\n          $root.onnx.SparseTensorProto.encode(\n            message.sparseInitializer[i],\n            writer.uint32(/* id 15, wireType 2 =*/ 122).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified GraphProto message, length delimited. Does not implicitly {@link onnx.GraphProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {onnx.IGraphProto} message GraphProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    GraphProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a GraphProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.GraphProto} GraphProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    GraphProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.GraphProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            if (!(message.node && message.node.length)) message.node = [];\n            message.node.push($root.onnx.NodeProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 2: {\n            message.name = reader.string();\n            break;\n          }\n          case 5: {\n            if (!(message.initializer && message.initializer.length)) message.initializer = [];\n            message.initializer.push($root.onnx.TensorProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 15: {\n            if (!(message.sparseInitializer && message.sparseInitializer.length)) message.sparseInitializer = [];\n            message.sparseInitializer.push($root.onnx.SparseTensorProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 10: {\n            message.docString = reader.string();\n            break;\n          }\n          case 11: {\n            if (!(message.input && message.input.length)) message.input = [];\n            message.input.push($root.onnx.ValueInfoProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 12: {\n            if (!(message.output && message.output.length)) message.output = [];\n            message.output.push($root.onnx.ValueInfoProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 13: {\n            if (!(message.valueInfo && message.valueInfo.length)) message.valueInfo = [];\n            message.valueInfo.push($root.onnx.ValueInfoProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 14: {\n            if (!(message.quantizationAnnotation && message.quantizationAnnotation.length))\n              message.quantizationAnnotation = [];\n            message.quantizationAnnotation.push($root.onnx.TensorAnnotation.decode(reader, reader.uint32()));\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a GraphProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.GraphProto} GraphProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    GraphProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a GraphProto message.\n     * @function verify\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    GraphProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.node != null && message.hasOwnProperty('node')) {\n        if (!Array.isArray(message.node)) return 'node: array expected';\n        for (var i = 0; i < message.node.length; ++i) {\n          var error = $root.onnx.NodeProto.verify(message.node[i]);\n          if (error) return 'node.' + error;\n        }\n      }\n      if (message.name != null && message.hasOwnProperty('name'))\n        if (!$util.isString(message.name)) return 'name: string expected';\n      if (message.initializer != null && message.hasOwnProperty('initializer')) {\n        if (!Array.isArray(message.initializer)) return 'initializer: array expected';\n        for (var i = 0; i < message.initializer.length; ++i) {\n          var error = $root.onnx.TensorProto.verify(message.initializer[i]);\n          if (error) return 'initializer.' + error;\n        }\n      }\n      if (message.sparseInitializer != null && message.hasOwnProperty('sparseInitializer')) {\n        if (!Array.isArray(message.sparseInitializer)) return 'sparseInitializer: array expected';\n        for (var i = 0; i < message.sparseInitializer.length; ++i) {\n          var error = $root.onnx.SparseTensorProto.verify(message.sparseInitializer[i]);\n          if (error) return 'sparseInitializer.' + error;\n        }\n      }\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      if (message.input != null && message.hasOwnProperty('input')) {\n        if (!Array.isArray(message.input)) return 'input: array expected';\n        for (var i = 0; i < message.input.length; ++i) {\n          var error = $root.onnx.ValueInfoProto.verify(message.input[i]);\n          if (error) return 'input.' + error;\n        }\n      }\n      if (message.output != null && message.hasOwnProperty('output')) {\n        if (!Array.isArray(message.output)) return 'output: array expected';\n        for (var i = 0; i < message.output.length; ++i) {\n          var error = $root.onnx.ValueInfoProto.verify(message.output[i]);\n          if (error) return 'output.' + error;\n        }\n      }\n      if (message.valueInfo != null && message.hasOwnProperty('valueInfo')) {\n        if (!Array.isArray(message.valueInfo)) return 'valueInfo: array expected';\n        for (var i = 0; i < message.valueInfo.length; ++i) {\n          var error = $root.onnx.ValueInfoProto.verify(message.valueInfo[i]);\n          if (error) return 'valueInfo.' + error;\n        }\n      }\n      if (message.quantizationAnnotation != null && message.hasOwnProperty('quantizationAnnotation')) {\n        if (!Array.isArray(message.quantizationAnnotation)) return 'quantizationAnnotation: array expected';\n        for (var i = 0; i < message.quantizationAnnotation.length; ++i) {\n          var error = $root.onnx.TensorAnnotation.verify(message.quantizationAnnotation[i]);\n          if (error) return 'quantizationAnnotation.' + error;\n        }\n      }\n      return null;\n    };\n\n    /**\n     * Creates a GraphProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.GraphProto} GraphProto\n     */\n    GraphProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.GraphProto) return object;\n      var message = new $root.onnx.GraphProto();\n      if (object.node) {\n        if (!Array.isArray(object.node)) throw TypeError('.onnx.GraphProto.node: array expected');\n        message.node = [];\n        for (var i = 0; i < object.node.length; ++i) {\n          if (typeof object.node[i] !== 'object') throw TypeError('.onnx.GraphProto.node: object expected');\n          message.node[i] = $root.onnx.NodeProto.fromObject(object.node[i]);\n        }\n      }\n      if (object.name != null) message.name = String(object.name);\n      if (object.initializer) {\n        if (!Array.isArray(object.initializer)) throw TypeError('.onnx.GraphProto.initializer: array expected');\n        message.initializer = [];\n        for (var i = 0; i < object.initializer.length; ++i) {\n          if (typeof object.initializer[i] !== 'object')\n            throw TypeError('.onnx.GraphProto.initializer: object expected');\n          message.initializer[i] = $root.onnx.TensorProto.fromObject(object.initializer[i]);\n        }\n      }\n      if (object.sparseInitializer) {\n        if (!Array.isArray(object.sparseInitializer))\n          throw TypeError('.onnx.GraphProto.sparseInitializer: array expected');\n        message.sparseInitializer = [];\n        for (var i = 0; i < object.sparseInitializer.length; ++i) {\n          if (typeof object.sparseInitializer[i] !== 'object')\n            throw TypeError('.onnx.GraphProto.sparseInitializer: object expected');\n          message.sparseInitializer[i] = $root.onnx.SparseTensorProto.fromObject(object.sparseInitializer[i]);\n        }\n      }\n      if (object.docString != null) message.docString = String(object.docString);\n      if (object.input) {\n        if (!Array.isArray(object.input)) throw TypeError('.onnx.GraphProto.input: array expected');\n        message.input = [];\n        for (var i = 0; i < object.input.length; ++i) {\n          if (typeof object.input[i] !== 'object') throw TypeError('.onnx.GraphProto.input: object expected');\n          message.input[i] = $root.onnx.ValueInfoProto.fromObject(object.input[i]);\n        }\n      }\n      if (object.output) {\n        if (!Array.isArray(object.output)) throw TypeError('.onnx.GraphProto.output: array expected');\n        message.output = [];\n        for (var i = 0; i < object.output.length; ++i) {\n          if (typeof object.output[i] !== 'object') throw TypeError('.onnx.GraphProto.output: object expected');\n          message.output[i] = $root.onnx.ValueInfoProto.fromObject(object.output[i]);\n        }\n      }\n      if (object.valueInfo) {\n        if (!Array.isArray(object.valueInfo)) throw TypeError('.onnx.GraphProto.valueInfo: array expected');\n        message.valueInfo = [];\n        for (var i = 0; i < object.valueInfo.length; ++i) {\n          if (typeof object.valueInfo[i] !== 'object') throw TypeError('.onnx.GraphProto.valueInfo: object expected');\n          message.valueInfo[i] = $root.onnx.ValueInfoProto.fromObject(object.valueInfo[i]);\n        }\n      }\n      if (object.quantizationAnnotation) {\n        if (!Array.isArray(object.quantizationAnnotation))\n          throw TypeError('.onnx.GraphProto.quantizationAnnotation: array expected');\n        message.quantizationAnnotation = [];\n        for (var i = 0; i < object.quantizationAnnotation.length; ++i) {\n          if (typeof object.quantizationAnnotation[i] !== 'object')\n            throw TypeError('.onnx.GraphProto.quantizationAnnotation: object expected');\n          message.quantizationAnnotation[i] = $root.onnx.TensorAnnotation.fromObject(object.quantizationAnnotation[i]);\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a GraphProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {onnx.GraphProto} message GraphProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    GraphProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.node = [];\n        object.initializer = [];\n        object.input = [];\n        object.output = [];\n        object.valueInfo = [];\n        object.quantizationAnnotation = [];\n        object.sparseInitializer = [];\n      }\n      if (options.defaults) {\n        object.name = '';\n        object.docString = '';\n      }\n      if (message.node && message.node.length) {\n        object.node = [];\n        for (var j = 0; j < message.node.length; ++j)\n          object.node[j] = $root.onnx.NodeProto.toObject(message.node[j], options);\n      }\n      if (message.name != null && message.hasOwnProperty('name')) object.name = message.name;\n      if (message.initializer && message.initializer.length) {\n        object.initializer = [];\n        for (var j = 0; j < message.initializer.length; ++j)\n          object.initializer[j] = $root.onnx.TensorProto.toObject(message.initializer[j], options);\n      }\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      if (message.input && message.input.length) {\n        object.input = [];\n        for (var j = 0; j < message.input.length; ++j)\n          object.input[j] = $root.onnx.ValueInfoProto.toObject(message.input[j], options);\n      }\n      if (message.output && message.output.length) {\n        object.output = [];\n        for (var j = 0; j < message.output.length; ++j)\n          object.output[j] = $root.onnx.ValueInfoProto.toObject(message.output[j], options);\n      }\n      if (message.valueInfo && message.valueInfo.length) {\n        object.valueInfo = [];\n        for (var j = 0; j < message.valueInfo.length; ++j)\n          object.valueInfo[j] = $root.onnx.ValueInfoProto.toObject(message.valueInfo[j], options);\n      }\n      if (message.quantizationAnnotation && message.quantizationAnnotation.length) {\n        object.quantizationAnnotation = [];\n        for (var j = 0; j < message.quantizationAnnotation.length; ++j)\n          object.quantizationAnnotation[j] = $root.onnx.TensorAnnotation.toObject(\n            message.quantizationAnnotation[j],\n            options,\n          );\n      }\n      if (message.sparseInitializer && message.sparseInitializer.length) {\n        object.sparseInitializer = [];\n        for (var j = 0; j < message.sparseInitializer.length; ++j)\n          object.sparseInitializer[j] = $root.onnx.SparseTensorProto.toObject(message.sparseInitializer[j], options);\n      }\n      return object;\n    };\n\n    /**\n     * Converts this GraphProto to JSON.\n     * @function toJSON\n     * @memberof onnx.GraphProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    GraphProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for GraphProto\n     * @function getTypeUrl\n     * @memberof onnx.GraphProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    GraphProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.GraphProto';\n    };\n\n    return GraphProto;\n  })();\n\n  onnx.TensorProto = (function () {\n    /**\n     * Properties of a TensorProto.\n     * @memberof onnx\n     * @interface ITensorProto\n     * @property {Array.<number|Long>|null} [dims] TensorProto dims\n     * @property {number|null} [dataType] TensorProto dataType\n     * @property {onnx.TensorProto.ISegment|null} [segment] TensorProto segment\n     * @property {Array.<number>|null} [floatData] TensorProto floatData\n     * @property {Array.<number>|null} [int32Data] TensorProto int32Data\n     * @property {Array.<Uint8Array>|null} [stringData] TensorProto stringData\n     * @property {Array.<number|Long>|null} [int64Data] TensorProto int64Data\n     * @property {string|null} [name] TensorProto name\n     * @property {string|null} [docString] TensorProto docString\n     * @property {Uint8Array|null} [rawData] TensorProto rawData\n     * @property {Array.<onnx.IStringStringEntryProto>|null} [externalData] TensorProto externalData\n     * @property {onnx.TensorProto.DataLocation|null} [dataLocation] TensorProto dataLocation\n     * @property {Array.<number>|null} [doubleData] TensorProto doubleData\n     * @property {Array.<number|Long>|null} [uint64Data] TensorProto uint64Data\n     */\n\n    /**\n     * Constructs a new TensorProto.\n     * @memberof onnx\n     * @classdesc Represents a TensorProto.\n     * @implements ITensorProto\n     * @constructor\n     * @param {onnx.ITensorProto=} [properties] Properties to set\n     */\n    function TensorProto(properties) {\n      this.dims = [];\n      this.floatData = [];\n      this.int32Data = [];\n      this.stringData = [];\n      this.int64Data = [];\n      this.externalData = [];\n      this.doubleData = [];\n      this.uint64Data = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * TensorProto dims.\n     * @member {Array.<number|Long>} dims\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.dims = $util.emptyArray;\n\n    /**\n     * TensorProto dataType.\n     * @member {number} dataType\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.dataType = 0;\n\n    /**\n     * TensorProto segment.\n     * @member {onnx.TensorProto.ISegment|null|undefined} segment\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.segment = null;\n\n    /**\n     * TensorProto floatData.\n     * @member {Array.<number>} floatData\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.floatData = $util.emptyArray;\n\n    /**\n     * TensorProto int32Data.\n     * @member {Array.<number>} int32Data\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.int32Data = $util.emptyArray;\n\n    /**\n     * TensorProto stringData.\n     * @member {Array.<Uint8Array>} stringData\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.stringData = $util.emptyArray;\n\n    /**\n     * TensorProto int64Data.\n     * @member {Array.<number|Long>} int64Data\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.int64Data = $util.emptyArray;\n\n    /**\n     * TensorProto name.\n     * @member {string} name\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.name = '';\n\n    /**\n     * TensorProto docString.\n     * @member {string} docString\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.docString = '';\n\n    /**\n     * TensorProto rawData.\n     * @member {Uint8Array} rawData\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.rawData = $util.newBuffer([]);\n\n    /**\n     * TensorProto externalData.\n     * @member {Array.<onnx.IStringStringEntryProto>} externalData\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.externalData = $util.emptyArray;\n\n    /**\n     * TensorProto dataLocation.\n     * @member {onnx.TensorProto.DataLocation} dataLocation\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.dataLocation = 0;\n\n    /**\n     * TensorProto doubleData.\n     * @member {Array.<number>} doubleData\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.doubleData = $util.emptyArray;\n\n    /**\n     * TensorProto uint64Data.\n     * @member {Array.<number|Long>} uint64Data\n     * @memberof onnx.TensorProto\n     * @instance\n     */\n    TensorProto.prototype.uint64Data = $util.emptyArray;\n\n    /**\n     * Creates a new TensorProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {onnx.ITensorProto=} [properties] Properties to set\n     * @returns {onnx.TensorProto} TensorProto instance\n     */\n    TensorProto.create = function create(properties) {\n      return new TensorProto(properties);\n    };\n\n    /**\n     * Encodes the specified TensorProto message. Does not implicitly {@link onnx.TensorProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {onnx.ITensorProto} message TensorProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TensorProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.dims != null && message.dims.length) {\n        writer.uint32(/* id 1, wireType 2 =*/ 10).fork();\n        for (var i = 0; i < message.dims.length; ++i) writer.int64(message.dims[i]);\n        writer.ldelim();\n      }\n      if (message.dataType != null && Object.hasOwnProperty.call(message, 'dataType'))\n        writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.dataType);\n      if (message.segment != null && Object.hasOwnProperty.call(message, 'segment'))\n        $root.onnx.TensorProto.Segment.encode(\n          message.segment,\n          writer.uint32(/* id 3, wireType 2 =*/ 26).fork(),\n        ).ldelim();\n      if (message.floatData != null && message.floatData.length) {\n        writer.uint32(/* id 4, wireType 2 =*/ 34).fork();\n        for (var i = 0; i < message.floatData.length; ++i) writer.float(message.floatData[i]);\n        writer.ldelim();\n      }\n      if (message.int32Data != null && message.int32Data.length) {\n        writer.uint32(/* id 5, wireType 2 =*/ 42).fork();\n        for (var i = 0; i < message.int32Data.length; ++i) writer.int32(message.int32Data[i]);\n        writer.ldelim();\n      }\n      if (message.stringData != null && message.stringData.length)\n        for (var i = 0; i < message.stringData.length; ++i)\n          writer.uint32(/* id 6, wireType 2 =*/ 50).bytes(message.stringData[i]);\n      if (message.int64Data != null && message.int64Data.length) {\n        writer.uint32(/* id 7, wireType 2 =*/ 58).fork();\n        for (var i = 0; i < message.int64Data.length; ++i) writer.int64(message.int64Data[i]);\n        writer.ldelim();\n      }\n      if (message.name != null && Object.hasOwnProperty.call(message, 'name'))\n        writer.uint32(/* id 8, wireType 2 =*/ 66).string(message.name);\n      if (message.rawData != null && Object.hasOwnProperty.call(message, 'rawData'))\n        writer.uint32(/* id 9, wireType 2 =*/ 74).bytes(message.rawData);\n      if (message.doubleData != null && message.doubleData.length) {\n        writer.uint32(/* id 10, wireType 2 =*/ 82).fork();\n        for (var i = 0; i < message.doubleData.length; ++i) writer.double(message.doubleData[i]);\n        writer.ldelim();\n      }\n      if (message.uint64Data != null && message.uint64Data.length) {\n        writer.uint32(/* id 11, wireType 2 =*/ 90).fork();\n        for (var i = 0; i < message.uint64Data.length; ++i) writer.uint64(message.uint64Data[i]);\n        writer.ldelim();\n      }\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 12, wireType 2 =*/ 98).string(message.docString);\n      if (message.externalData != null && message.externalData.length)\n        for (var i = 0; i < message.externalData.length; ++i)\n          $root.onnx.StringStringEntryProto.encode(\n            message.externalData[i],\n            writer.uint32(/* id 13, wireType 2 =*/ 106).fork(),\n          ).ldelim();\n      if (message.dataLocation != null && Object.hasOwnProperty.call(message, 'dataLocation'))\n        writer.uint32(/* id 14, wireType 0 =*/ 112).int32(message.dataLocation);\n      return writer;\n    };\n\n    /**\n     * Encodes the specified TensorProto message, length delimited. Does not implicitly {@link onnx.TensorProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {onnx.ITensorProto} message TensorProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TensorProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a TensorProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.TensorProto} TensorProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TensorProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.TensorProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            if (!(message.dims && message.dims.length)) message.dims = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.dims.push(reader.int64());\n            } else message.dims.push(reader.int64());\n            break;\n          }\n          case 2: {\n            message.dataType = reader.int32();\n            break;\n          }\n          case 3: {\n            message.segment = $root.onnx.TensorProto.Segment.decode(reader, reader.uint32());\n            break;\n          }\n          case 4: {\n            if (!(message.floatData && message.floatData.length)) message.floatData = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.floatData.push(reader.float());\n            } else message.floatData.push(reader.float());\n            break;\n          }\n          case 5: {\n            if (!(message.int32Data && message.int32Data.length)) message.int32Data = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.int32Data.push(reader.int32());\n            } else message.int32Data.push(reader.int32());\n            break;\n          }\n          case 6: {\n            if (!(message.stringData && message.stringData.length)) message.stringData = [];\n            message.stringData.push(reader.bytes());\n            break;\n          }\n          case 7: {\n            if (!(message.int64Data && message.int64Data.length)) message.int64Data = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.int64Data.push(reader.int64());\n            } else message.int64Data.push(reader.int64());\n            break;\n          }\n          case 8: {\n            message.name = reader.string();\n            break;\n          }\n          case 12: {\n            message.docString = reader.string();\n            break;\n          }\n          case 9: {\n            message.rawData = reader.bytes();\n            break;\n          }\n          case 13: {\n            if (!(message.externalData && message.externalData.length)) message.externalData = [];\n            message.externalData.push($root.onnx.StringStringEntryProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 14: {\n            message.dataLocation = reader.int32();\n            break;\n          }\n          case 10: {\n            if (!(message.doubleData && message.doubleData.length)) message.doubleData = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.doubleData.push(reader.double());\n            } else message.doubleData.push(reader.double());\n            break;\n          }\n          case 11: {\n            if (!(message.uint64Data && message.uint64Data.length)) message.uint64Data = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.uint64Data.push(reader.uint64());\n            } else message.uint64Data.push(reader.uint64());\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a TensorProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.TensorProto} TensorProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TensorProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a TensorProto message.\n     * @function verify\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    TensorProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.dims != null && message.hasOwnProperty('dims')) {\n        if (!Array.isArray(message.dims)) return 'dims: array expected';\n        for (var i = 0; i < message.dims.length; ++i)\n          if (\n            !$util.isInteger(message.dims[i]) &&\n            !(message.dims[i] && $util.isInteger(message.dims[i].low) && $util.isInteger(message.dims[i].high))\n          )\n            return 'dims: integer|Long[] expected';\n      }\n      if (message.dataType != null && message.hasOwnProperty('dataType'))\n        if (!$util.isInteger(message.dataType)) return 'dataType: integer expected';\n      if (message.segment != null && message.hasOwnProperty('segment')) {\n        var error = $root.onnx.TensorProto.Segment.verify(message.segment);\n        if (error) return 'segment.' + error;\n      }\n      if (message.floatData != null && message.hasOwnProperty('floatData')) {\n        if (!Array.isArray(message.floatData)) return 'floatData: array expected';\n        for (var i = 0; i < message.floatData.length; ++i)\n          if (typeof message.floatData[i] !== 'number') return 'floatData: number[] expected';\n      }\n      if (message.int32Data != null && message.hasOwnProperty('int32Data')) {\n        if (!Array.isArray(message.int32Data)) return 'int32Data: array expected';\n        for (var i = 0; i < message.int32Data.length; ++i)\n          if (!$util.isInteger(message.int32Data[i])) return 'int32Data: integer[] expected';\n      }\n      if (message.stringData != null && message.hasOwnProperty('stringData')) {\n        if (!Array.isArray(message.stringData)) return 'stringData: array expected';\n        for (var i = 0; i < message.stringData.length; ++i)\n          if (\n            !(\n              (message.stringData[i] && typeof message.stringData[i].length === 'number') ||\n              $util.isString(message.stringData[i])\n            )\n          )\n            return 'stringData: buffer[] expected';\n      }\n      if (message.int64Data != null && message.hasOwnProperty('int64Data')) {\n        if (!Array.isArray(message.int64Data)) return 'int64Data: array expected';\n        for (var i = 0; i < message.int64Data.length; ++i)\n          if (\n            !$util.isInteger(message.int64Data[i]) &&\n            !(\n              message.int64Data[i] &&\n              $util.isInteger(message.int64Data[i].low) &&\n              $util.isInteger(message.int64Data[i].high)\n            )\n          )\n            return 'int64Data: integer|Long[] expected';\n      }\n      if (message.name != null && message.hasOwnProperty('name'))\n        if (!$util.isString(message.name)) return 'name: string expected';\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      if (message.rawData != null && message.hasOwnProperty('rawData'))\n        if (!((message.rawData && typeof message.rawData.length === 'number') || $util.isString(message.rawData)))\n          return 'rawData: buffer expected';\n      if (message.externalData != null && message.hasOwnProperty('externalData')) {\n        if (!Array.isArray(message.externalData)) return 'externalData: array expected';\n        for (var i = 0; i < message.externalData.length; ++i) {\n          var error = $root.onnx.StringStringEntryProto.verify(message.externalData[i]);\n          if (error) return 'externalData.' + error;\n        }\n      }\n      if (message.dataLocation != null && message.hasOwnProperty('dataLocation'))\n        switch (message.dataLocation) {\n          default:\n            return 'dataLocation: enum value expected';\n          case 0:\n          case 1:\n            break;\n        }\n      if (message.doubleData != null && message.hasOwnProperty('doubleData')) {\n        if (!Array.isArray(message.doubleData)) return 'doubleData: array expected';\n        for (var i = 0; i < message.doubleData.length; ++i)\n          if (typeof message.doubleData[i] !== 'number') return 'doubleData: number[] expected';\n      }\n      if (message.uint64Data != null && message.hasOwnProperty('uint64Data')) {\n        if (!Array.isArray(message.uint64Data)) return 'uint64Data: array expected';\n        for (var i = 0; i < message.uint64Data.length; ++i)\n          if (\n            !$util.isInteger(message.uint64Data[i]) &&\n            !(\n              message.uint64Data[i] &&\n              $util.isInteger(message.uint64Data[i].low) &&\n              $util.isInteger(message.uint64Data[i].high)\n            )\n          )\n            return 'uint64Data: integer|Long[] expected';\n      }\n      return null;\n    };\n\n    /**\n     * Creates a TensorProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.TensorProto} TensorProto\n     */\n    TensorProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.TensorProto) return object;\n      var message = new $root.onnx.TensorProto();\n      if (object.dims) {\n        if (!Array.isArray(object.dims)) throw TypeError('.onnx.TensorProto.dims: array expected');\n        message.dims = [];\n        for (var i = 0; i < object.dims.length; ++i)\n          if ($util.Long) (message.dims[i] = $util.Long.fromValue(object.dims[i])).unsigned = false;\n          else if (typeof object.dims[i] === 'string') message.dims[i] = parseInt(object.dims[i], 10);\n          else if (typeof object.dims[i] === 'number') message.dims[i] = object.dims[i];\n          else if (typeof object.dims[i] === 'object')\n            message.dims[i] = new $util.LongBits(object.dims[i].low >>> 0, object.dims[i].high >>> 0).toNumber();\n      }\n      if (object.dataType != null) message.dataType = object.dataType | 0;\n      if (object.segment != null) {\n        if (typeof object.segment !== 'object') throw TypeError('.onnx.TensorProto.segment: object expected');\n        message.segment = $root.onnx.TensorProto.Segment.fromObject(object.segment);\n      }\n      if (object.floatData) {\n        if (!Array.isArray(object.floatData)) throw TypeError('.onnx.TensorProto.floatData: array expected');\n        message.floatData = [];\n        for (var i = 0; i < object.floatData.length; ++i) message.floatData[i] = Number(object.floatData[i]);\n      }\n      if (object.int32Data) {\n        if (!Array.isArray(object.int32Data)) throw TypeError('.onnx.TensorProto.int32Data: array expected');\n        message.int32Data = [];\n        for (var i = 0; i < object.int32Data.length; ++i) message.int32Data[i] = object.int32Data[i] | 0;\n      }\n      if (object.stringData) {\n        if (!Array.isArray(object.stringData)) throw TypeError('.onnx.TensorProto.stringData: array expected');\n        message.stringData = [];\n        for (var i = 0; i < object.stringData.length; ++i)\n          if (typeof object.stringData[i] === 'string')\n            $util.base64.decode(\n              object.stringData[i],\n              (message.stringData[i] = $util.newBuffer($util.base64.length(object.stringData[i]))),\n              0,\n            );\n          else if (object.stringData[i].length >= 0) message.stringData[i] = object.stringData[i];\n      }\n      if (object.int64Data) {\n        if (!Array.isArray(object.int64Data)) throw TypeError('.onnx.TensorProto.int64Data: array expected');\n        message.int64Data = [];\n        for (var i = 0; i < object.int64Data.length; ++i)\n          if ($util.Long) (message.int64Data[i] = $util.Long.fromValue(object.int64Data[i])).unsigned = false;\n          else if (typeof object.int64Data[i] === 'string') message.int64Data[i] = parseInt(object.int64Data[i], 10);\n          else if (typeof object.int64Data[i] === 'number') message.int64Data[i] = object.int64Data[i];\n          else if (typeof object.int64Data[i] === 'object')\n            message.int64Data[i] = new $util.LongBits(\n              object.int64Data[i].low >>> 0,\n              object.int64Data[i].high >>> 0,\n            ).toNumber();\n      }\n      if (object.name != null) message.name = String(object.name);\n      if (object.docString != null) message.docString = String(object.docString);\n      if (object.rawData != null)\n        if (typeof object.rawData === 'string')\n          $util.base64.decode(\n            object.rawData,\n            (message.rawData = $util.newBuffer($util.base64.length(object.rawData))),\n            0,\n          );\n        else if (object.rawData.length >= 0) message.rawData = object.rawData;\n      if (object.externalData) {\n        if (!Array.isArray(object.externalData)) throw TypeError('.onnx.TensorProto.externalData: array expected');\n        message.externalData = [];\n        for (var i = 0; i < object.externalData.length; ++i) {\n          if (typeof object.externalData[i] !== 'object')\n            throw TypeError('.onnx.TensorProto.externalData: object expected');\n          message.externalData[i] = $root.onnx.StringStringEntryProto.fromObject(object.externalData[i]);\n        }\n      }\n      switch (object.dataLocation) {\n        default:\n          if (typeof object.dataLocation === 'number') {\n            message.dataLocation = object.dataLocation;\n            break;\n          }\n          break;\n        case 'DEFAULT':\n        case 0:\n          message.dataLocation = 0;\n          break;\n        case 'EXTERNAL':\n        case 1:\n          message.dataLocation = 1;\n          break;\n      }\n      if (object.doubleData) {\n        if (!Array.isArray(object.doubleData)) throw TypeError('.onnx.TensorProto.doubleData: array expected');\n        message.doubleData = [];\n        for (var i = 0; i < object.doubleData.length; ++i) message.doubleData[i] = Number(object.doubleData[i]);\n      }\n      if (object.uint64Data) {\n        if (!Array.isArray(object.uint64Data)) throw TypeError('.onnx.TensorProto.uint64Data: array expected');\n        message.uint64Data = [];\n        for (var i = 0; i < object.uint64Data.length; ++i)\n          if ($util.Long) (message.uint64Data[i] = $util.Long.fromValue(object.uint64Data[i])).unsigned = true;\n          else if (typeof object.uint64Data[i] === 'string') message.uint64Data[i] = parseInt(object.uint64Data[i], 10);\n          else if (typeof object.uint64Data[i] === 'number') message.uint64Data[i] = object.uint64Data[i];\n          else if (typeof object.uint64Data[i] === 'object')\n            message.uint64Data[i] = new $util.LongBits(\n              object.uint64Data[i].low >>> 0,\n              object.uint64Data[i].high >>> 0,\n            ).toNumber(true);\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a TensorProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {onnx.TensorProto} message TensorProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    TensorProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.dims = [];\n        object.floatData = [];\n        object.int32Data = [];\n        object.stringData = [];\n        object.int64Data = [];\n        object.doubleData = [];\n        object.uint64Data = [];\n        object.externalData = [];\n      }\n      if (options.defaults) {\n        object.dataType = 0;\n        object.segment = null;\n        object.name = '';\n        if (options.bytes === String) object.rawData = '';\n        else {\n          object.rawData = [];\n          if (options.bytes !== Array) object.rawData = $util.newBuffer(object.rawData);\n        }\n        object.docString = '';\n        object.dataLocation = options.enums === String ? 'DEFAULT' : 0;\n      }\n      if (message.dims && message.dims.length) {\n        object.dims = [];\n        for (var j = 0; j < message.dims.length; ++j)\n          if (typeof message.dims[j] === 'number')\n            object.dims[j] = options.longs === String ? String(message.dims[j]) : message.dims[j];\n          else\n            object.dims[j] =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.dims[j])\n                : options.longs === Number\n                  ? new $util.LongBits(message.dims[j].low >>> 0, message.dims[j].high >>> 0).toNumber()\n                  : message.dims[j];\n      }\n      if (message.dataType != null && message.hasOwnProperty('dataType')) object.dataType = message.dataType;\n      if (message.segment != null && message.hasOwnProperty('segment'))\n        object.segment = $root.onnx.TensorProto.Segment.toObject(message.segment, options);\n      if (message.floatData && message.floatData.length) {\n        object.floatData = [];\n        for (var j = 0; j < message.floatData.length; ++j)\n          object.floatData[j] =\n            options.json && !isFinite(message.floatData[j]) ? String(message.floatData[j]) : message.floatData[j];\n      }\n      if (message.int32Data && message.int32Data.length) {\n        object.int32Data = [];\n        for (var j = 0; j < message.int32Data.length; ++j) object.int32Data[j] = message.int32Data[j];\n      }\n      if (message.stringData && message.stringData.length) {\n        object.stringData = [];\n        for (var j = 0; j < message.stringData.length; ++j)\n          object.stringData[j] =\n            options.bytes === String\n              ? $util.base64.encode(message.stringData[j], 0, message.stringData[j].length)\n              : options.bytes === Array\n                ? Array.prototype.slice.call(message.stringData[j])\n                : message.stringData[j];\n      }\n      if (message.int64Data && message.int64Data.length) {\n        object.int64Data = [];\n        for (var j = 0; j < message.int64Data.length; ++j)\n          if (typeof message.int64Data[j] === 'number')\n            object.int64Data[j] = options.longs === String ? String(message.int64Data[j]) : message.int64Data[j];\n          else\n            object.int64Data[j] =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.int64Data[j])\n                : options.longs === Number\n                  ? new $util.LongBits(message.int64Data[j].low >>> 0, message.int64Data[j].high >>> 0).toNumber()\n                  : message.int64Data[j];\n      }\n      if (message.name != null && message.hasOwnProperty('name')) object.name = message.name;\n      if (message.rawData != null && message.hasOwnProperty('rawData'))\n        object.rawData =\n          options.bytes === String\n            ? $util.base64.encode(message.rawData, 0, message.rawData.length)\n            : options.bytes === Array\n              ? Array.prototype.slice.call(message.rawData)\n              : message.rawData;\n      if (message.doubleData && message.doubleData.length) {\n        object.doubleData = [];\n        for (var j = 0; j < message.doubleData.length; ++j)\n          object.doubleData[j] =\n            options.json && !isFinite(message.doubleData[j]) ? String(message.doubleData[j]) : message.doubleData[j];\n      }\n      if (message.uint64Data && message.uint64Data.length) {\n        object.uint64Data = [];\n        for (var j = 0; j < message.uint64Data.length; ++j)\n          if (typeof message.uint64Data[j] === 'number')\n            object.uint64Data[j] = options.longs === String ? String(message.uint64Data[j]) : message.uint64Data[j];\n          else\n            object.uint64Data[j] =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.uint64Data[j])\n                : options.longs === Number\n                  ? new $util.LongBits(message.uint64Data[j].low >>> 0, message.uint64Data[j].high >>> 0).toNumber(true)\n                  : message.uint64Data[j];\n      }\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      if (message.externalData && message.externalData.length) {\n        object.externalData = [];\n        for (var j = 0; j < message.externalData.length; ++j)\n          object.externalData[j] = $root.onnx.StringStringEntryProto.toObject(message.externalData[j], options);\n      }\n      if (message.dataLocation != null && message.hasOwnProperty('dataLocation'))\n        object.dataLocation =\n          options.enums === String\n            ? $root.onnx.TensorProto.DataLocation[message.dataLocation] === undefined\n              ? message.dataLocation\n              : $root.onnx.TensorProto.DataLocation[message.dataLocation]\n            : message.dataLocation;\n      return object;\n    };\n\n    /**\n     * Converts this TensorProto to JSON.\n     * @function toJSON\n     * @memberof onnx.TensorProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    TensorProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for TensorProto\n     * @function getTypeUrl\n     * @memberof onnx.TensorProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    TensorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.TensorProto';\n    };\n\n    /**\n     * DataType enum.\n     * @name onnx.TensorProto.DataType\n     * @enum {number}\n     * @property {number} UNDEFINED=0 UNDEFINED value\n     * @property {number} FLOAT=1 FLOAT value\n     * @property {number} UINT8=2 UINT8 value\n     * @property {number} INT8=3 INT8 value\n     * @property {number} UINT16=4 UINT16 value\n     * @property {number} INT16=5 INT16 value\n     * @property {number} INT32=6 INT32 value\n     * @property {number} INT64=7 INT64 value\n     * @property {number} STRING=8 STRING value\n     * @property {number} BOOL=9 BOOL value\n     * @property {number} FLOAT16=10 FLOAT16 value\n     * @property {number} DOUBLE=11 DOUBLE value\n     * @property {number} UINT32=12 UINT32 value\n     * @property {number} UINT64=13 UINT64 value\n     * @property {number} COMPLEX64=14 COMPLEX64 value\n     * @property {number} COMPLEX128=15 COMPLEX128 value\n     * @property {number} BFLOAT16=16 BFLOAT16 value\n     * @property {number} FLOAT8E4M3FN=17 FLOAT8E4M3FN value\n     * @property {number} FLOAT8E4M3FNUZ=18 FLOAT8E4M3FNUZ value\n     * @property {number} FLOAT8E5M2=19 FLOAT8E5M2 value\n     * @property {number} FLOAT8E5M2FNUZ=20 FLOAT8E5M2FNUZ value\n     */\n    TensorProto.DataType = (function () {\n      var valuesById = {},\n        values = Object.create(valuesById);\n      values[(valuesById[0] = 'UNDEFINED')] = 0;\n      values[(valuesById[1] = 'FLOAT')] = 1;\n      values[(valuesById[2] = 'UINT8')] = 2;\n      values[(valuesById[3] = 'INT8')] = 3;\n      values[(valuesById[4] = 'UINT16')] = 4;\n      values[(valuesById[5] = 'INT16')] = 5;\n      values[(valuesById[6] = 'INT32')] = 6;\n      values[(valuesById[7] = 'INT64')] = 7;\n      values[(valuesById[8] = 'STRING')] = 8;\n      values[(valuesById[9] = 'BOOL')] = 9;\n      values[(valuesById[10] = 'FLOAT16')] = 10;\n      values[(valuesById[11] = 'DOUBLE')] = 11;\n      values[(valuesById[12] = 'UINT32')] = 12;\n      values[(valuesById[13] = 'UINT64')] = 13;\n      values[(valuesById[14] = 'COMPLEX64')] = 14;\n      values[(valuesById[15] = 'COMPLEX128')] = 15;\n      values[(valuesById[16] = 'BFLOAT16')] = 16;\n      values[(valuesById[17] = 'FLOAT8E4M3FN')] = 17;\n      values[(valuesById[18] = 'FLOAT8E4M3FNUZ')] = 18;\n      values[(valuesById[19] = 'FLOAT8E5M2')] = 19;\n      values[(valuesById[20] = 'FLOAT8E5M2FNUZ')] = 20;\n      return values;\n    })();\n\n    TensorProto.Segment = (function () {\n      /**\n       * Properties of a Segment.\n       * @memberof onnx.TensorProto\n       * @interface ISegment\n       * @property {number|Long|null} [begin] Segment begin\n       * @property {number|Long|null} [end] Segment end\n       */\n\n      /**\n       * Constructs a new Segment.\n       * @memberof onnx.TensorProto\n       * @classdesc Represents a Segment.\n       * @implements ISegment\n       * @constructor\n       * @param {onnx.TensorProto.ISegment=} [properties] Properties to set\n       */\n      function Segment(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * Segment begin.\n       * @member {number|Long} begin\n       * @memberof onnx.TensorProto.Segment\n       * @instance\n       */\n      Segment.prototype.begin = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n\n      /**\n       * Segment end.\n       * @member {number|Long} end\n       * @memberof onnx.TensorProto.Segment\n       * @instance\n       */\n      Segment.prototype.end = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n\n      /**\n       * Creates a new Segment instance using the specified properties.\n       * @function create\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {onnx.TensorProto.ISegment=} [properties] Properties to set\n       * @returns {onnx.TensorProto.Segment} Segment instance\n       */\n      Segment.create = function create(properties) {\n        return new Segment(properties);\n      };\n\n      /**\n       * Encodes the specified Segment message. Does not implicitly {@link onnx.TensorProto.Segment.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {onnx.TensorProto.ISegment} message Segment message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Segment.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.begin != null && Object.hasOwnProperty.call(message, 'begin'))\n          writer.uint32(/* id 1, wireType 0 =*/ 8).int64(message.begin);\n        if (message.end != null && Object.hasOwnProperty.call(message, 'end'))\n          writer.uint32(/* id 2, wireType 0 =*/ 16).int64(message.end);\n        return writer;\n      };\n\n      /**\n       * Encodes the specified Segment message, length delimited. Does not implicitly {@link onnx.TensorProto.Segment.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {onnx.TensorProto.ISegment} message Segment message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Segment.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes a Segment message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TensorProto.Segment} Segment\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Segment.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TensorProto.Segment();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.begin = reader.int64();\n              break;\n            }\n            case 2: {\n              message.end = reader.int64();\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes a Segment message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TensorProto.Segment} Segment\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Segment.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies a Segment message.\n       * @function verify\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      Segment.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        if (message.begin != null && message.hasOwnProperty('begin'))\n          if (\n            !$util.isInteger(message.begin) &&\n            !(message.begin && $util.isInteger(message.begin.low) && $util.isInteger(message.begin.high))\n          )\n            return 'begin: integer|Long expected';\n        if (message.end != null && message.hasOwnProperty('end'))\n          if (\n            !$util.isInteger(message.end) &&\n            !(message.end && $util.isInteger(message.end.low) && $util.isInteger(message.end.high))\n          )\n            return 'end: integer|Long expected';\n        return null;\n      };\n\n      /**\n       * Creates a Segment message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TensorProto.Segment} Segment\n       */\n      Segment.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TensorProto.Segment) return object;\n        var message = new $root.onnx.TensorProto.Segment();\n        if (object.begin != null)\n          if ($util.Long) (message.begin = $util.Long.fromValue(object.begin)).unsigned = false;\n          else if (typeof object.begin === 'string') message.begin = parseInt(object.begin, 10);\n          else if (typeof object.begin === 'number') message.begin = object.begin;\n          else if (typeof object.begin === 'object')\n            message.begin = new $util.LongBits(object.begin.low >>> 0, object.begin.high >>> 0).toNumber();\n        if (object.end != null)\n          if ($util.Long) (message.end = $util.Long.fromValue(object.end)).unsigned = false;\n          else if (typeof object.end === 'string') message.end = parseInt(object.end, 10);\n          else if (typeof object.end === 'number') message.end = object.end;\n          else if (typeof object.end === 'object')\n            message.end = new $util.LongBits(object.end.low >>> 0, object.end.high >>> 0).toNumber();\n        return message;\n      };\n\n      /**\n       * Creates a plain object from a Segment message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {onnx.TensorProto.Segment} message Segment\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      Segment.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) {\n          if ($util.Long) {\n            var long = new $util.Long(0, 0, false);\n            object.begin =\n              options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n          } else object.begin = options.longs === String ? '0' : 0;\n          if ($util.Long) {\n            var long = new $util.Long(0, 0, false);\n            object.end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n          } else object.end = options.longs === String ? '0' : 0;\n        }\n        if (message.begin != null && message.hasOwnProperty('begin'))\n          if (typeof message.begin === 'number')\n            object.begin = options.longs === String ? String(message.begin) : message.begin;\n          else\n            object.begin =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.begin)\n                : options.longs === Number\n                  ? new $util.LongBits(message.begin.low >>> 0, message.begin.high >>> 0).toNumber()\n                  : message.begin;\n        if (message.end != null && message.hasOwnProperty('end'))\n          if (typeof message.end === 'number')\n            object.end = options.longs === String ? String(message.end) : message.end;\n          else\n            object.end =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.end)\n                : options.longs === Number\n                  ? new $util.LongBits(message.end.low >>> 0, message.end.high >>> 0).toNumber()\n                  : message.end;\n        return object;\n      };\n\n      /**\n       * Converts this Segment to JSON.\n       * @function toJSON\n       * @memberof onnx.TensorProto.Segment\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      Segment.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for Segment\n       * @function getTypeUrl\n       * @memberof onnx.TensorProto.Segment\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TensorProto.Segment';\n      };\n\n      return Segment;\n    })();\n\n    /**\n     * DataLocation enum.\n     * @name onnx.TensorProto.DataLocation\n     * @enum {number}\n     * @property {number} DEFAULT=0 DEFAULT value\n     * @property {number} EXTERNAL=1 EXTERNAL value\n     */\n    TensorProto.DataLocation = (function () {\n      var valuesById = {},\n        values = Object.create(valuesById);\n      values[(valuesById[0] = 'DEFAULT')] = 0;\n      values[(valuesById[1] = 'EXTERNAL')] = 1;\n      return values;\n    })();\n\n    return TensorProto;\n  })();\n\n  onnx.SparseTensorProto = (function () {\n    /**\n     * Properties of a SparseTensorProto.\n     * @memberof onnx\n     * @interface ISparseTensorProto\n     * @property {onnx.ITensorProto|null} [values] SparseTensorProto values\n     * @property {onnx.ITensorProto|null} [indices] SparseTensorProto indices\n     * @property {Array.<number|Long>|null} [dims] SparseTensorProto dims\n     */\n\n    /**\n     * Constructs a new SparseTensorProto.\n     * @memberof onnx\n     * @classdesc Represents a SparseTensorProto.\n     * @implements ISparseTensorProto\n     * @constructor\n     * @param {onnx.ISparseTensorProto=} [properties] Properties to set\n     */\n    function SparseTensorProto(properties) {\n      this.dims = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * SparseTensorProto values.\n     * @member {onnx.ITensorProto|null|undefined} values\n     * @memberof onnx.SparseTensorProto\n     * @instance\n     */\n    SparseTensorProto.prototype.values = null;\n\n    /**\n     * SparseTensorProto indices.\n     * @member {onnx.ITensorProto|null|undefined} indices\n     * @memberof onnx.SparseTensorProto\n     * @instance\n     */\n    SparseTensorProto.prototype.indices = null;\n\n    /**\n     * SparseTensorProto dims.\n     * @member {Array.<number|Long>} dims\n     * @memberof onnx.SparseTensorProto\n     * @instance\n     */\n    SparseTensorProto.prototype.dims = $util.emptyArray;\n\n    /**\n     * Creates a new SparseTensorProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {onnx.ISparseTensorProto=} [properties] Properties to set\n     * @returns {onnx.SparseTensorProto} SparseTensorProto instance\n     */\n    SparseTensorProto.create = function create(properties) {\n      return new SparseTensorProto(properties);\n    };\n\n    /**\n     * Encodes the specified SparseTensorProto message. Does not implicitly {@link onnx.SparseTensorProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {onnx.ISparseTensorProto} message SparseTensorProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    SparseTensorProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.values != null && Object.hasOwnProperty.call(message, 'values'))\n        $root.onnx.TensorProto.encode(message.values, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();\n      if (message.indices != null && Object.hasOwnProperty.call(message, 'indices'))\n        $root.onnx.TensorProto.encode(message.indices, writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim();\n      if (message.dims != null && message.dims.length) {\n        writer.uint32(/* id 3, wireType 2 =*/ 26).fork();\n        for (var i = 0; i < message.dims.length; ++i) writer.int64(message.dims[i]);\n        writer.ldelim();\n      }\n      return writer;\n    };\n\n    /**\n     * Encodes the specified SparseTensorProto message, length delimited. Does not implicitly {@link onnx.SparseTensorProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {onnx.ISparseTensorProto} message SparseTensorProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    SparseTensorProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a SparseTensorProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.SparseTensorProto} SparseTensorProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    SparseTensorProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.SparseTensorProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.values = $root.onnx.TensorProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 2: {\n            message.indices = $root.onnx.TensorProto.decode(reader, reader.uint32());\n            break;\n          }\n          case 3: {\n            if (!(message.dims && message.dims.length)) message.dims = [];\n            if ((tag & 7) === 2) {\n              var end2 = reader.uint32() + reader.pos;\n              while (reader.pos < end2) message.dims.push(reader.int64());\n            } else message.dims.push(reader.int64());\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a SparseTensorProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.SparseTensorProto} SparseTensorProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    SparseTensorProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a SparseTensorProto message.\n     * @function verify\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    SparseTensorProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.values != null && message.hasOwnProperty('values')) {\n        var error = $root.onnx.TensorProto.verify(message.values);\n        if (error) return 'values.' + error;\n      }\n      if (message.indices != null && message.hasOwnProperty('indices')) {\n        var error = $root.onnx.TensorProto.verify(message.indices);\n        if (error) return 'indices.' + error;\n      }\n      if (message.dims != null && message.hasOwnProperty('dims')) {\n        if (!Array.isArray(message.dims)) return 'dims: array expected';\n        for (var i = 0; i < message.dims.length; ++i)\n          if (\n            !$util.isInteger(message.dims[i]) &&\n            !(message.dims[i] && $util.isInteger(message.dims[i].low) && $util.isInteger(message.dims[i].high))\n          )\n            return 'dims: integer|Long[] expected';\n      }\n      return null;\n    };\n\n    /**\n     * Creates a SparseTensorProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.SparseTensorProto} SparseTensorProto\n     */\n    SparseTensorProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.SparseTensorProto) return object;\n      var message = new $root.onnx.SparseTensorProto();\n      if (object.values != null) {\n        if (typeof object.values !== 'object') throw TypeError('.onnx.SparseTensorProto.values: object expected');\n        message.values = $root.onnx.TensorProto.fromObject(object.values);\n      }\n      if (object.indices != null) {\n        if (typeof object.indices !== 'object') throw TypeError('.onnx.SparseTensorProto.indices: object expected');\n        message.indices = $root.onnx.TensorProto.fromObject(object.indices);\n      }\n      if (object.dims) {\n        if (!Array.isArray(object.dims)) throw TypeError('.onnx.SparseTensorProto.dims: array expected');\n        message.dims = [];\n        for (var i = 0; i < object.dims.length; ++i)\n          if ($util.Long) (message.dims[i] = $util.Long.fromValue(object.dims[i])).unsigned = false;\n          else if (typeof object.dims[i] === 'string') message.dims[i] = parseInt(object.dims[i], 10);\n          else if (typeof object.dims[i] === 'number') message.dims[i] = object.dims[i];\n          else if (typeof object.dims[i] === 'object')\n            message.dims[i] = new $util.LongBits(object.dims[i].low >>> 0, object.dims[i].high >>> 0).toNumber();\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a SparseTensorProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {onnx.SparseTensorProto} message SparseTensorProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    SparseTensorProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) object.dims = [];\n      if (options.defaults) {\n        object.values = null;\n        object.indices = null;\n      }\n      if (message.values != null && message.hasOwnProperty('values'))\n        object.values = $root.onnx.TensorProto.toObject(message.values, options);\n      if (message.indices != null && message.hasOwnProperty('indices'))\n        object.indices = $root.onnx.TensorProto.toObject(message.indices, options);\n      if (message.dims && message.dims.length) {\n        object.dims = [];\n        for (var j = 0; j < message.dims.length; ++j)\n          if (typeof message.dims[j] === 'number')\n            object.dims[j] = options.longs === String ? String(message.dims[j]) : message.dims[j];\n          else\n            object.dims[j] =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.dims[j])\n                : options.longs === Number\n                  ? new $util.LongBits(message.dims[j].low >>> 0, message.dims[j].high >>> 0).toNumber()\n                  : message.dims[j];\n      }\n      return object;\n    };\n\n    /**\n     * Converts this SparseTensorProto to JSON.\n     * @function toJSON\n     * @memberof onnx.SparseTensorProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    SparseTensorProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for SparseTensorProto\n     * @function getTypeUrl\n     * @memberof onnx.SparseTensorProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    SparseTensorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.SparseTensorProto';\n    };\n\n    return SparseTensorProto;\n  })();\n\n  onnx.TensorShapeProto = (function () {\n    /**\n     * Properties of a TensorShapeProto.\n     * @memberof onnx\n     * @interface ITensorShapeProto\n     * @property {Array.<onnx.TensorShapeProto.IDimension>|null} [dim] TensorShapeProto dim\n     */\n\n    /**\n     * Constructs a new TensorShapeProto.\n     * @memberof onnx\n     * @classdesc Represents a TensorShapeProto.\n     * @implements ITensorShapeProto\n     * @constructor\n     * @param {onnx.ITensorShapeProto=} [properties] Properties to set\n     */\n    function TensorShapeProto(properties) {\n      this.dim = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * TensorShapeProto dim.\n     * @member {Array.<onnx.TensorShapeProto.IDimension>} dim\n     * @memberof onnx.TensorShapeProto\n     * @instance\n     */\n    TensorShapeProto.prototype.dim = $util.emptyArray;\n\n    /**\n     * Creates a new TensorShapeProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {onnx.ITensorShapeProto=} [properties] Properties to set\n     * @returns {onnx.TensorShapeProto} TensorShapeProto instance\n     */\n    TensorShapeProto.create = function create(properties) {\n      return new TensorShapeProto(properties);\n    };\n\n    /**\n     * Encodes the specified TensorShapeProto message. Does not implicitly {@link onnx.TensorShapeProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {onnx.ITensorShapeProto} message TensorShapeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TensorShapeProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.dim != null && message.dim.length)\n        for (var i = 0; i < message.dim.length; ++i)\n          $root.onnx.TensorShapeProto.Dimension.encode(\n            message.dim[i],\n            writer.uint32(/* id 1, wireType 2 =*/ 10).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified TensorShapeProto message, length delimited. Does not implicitly {@link onnx.TensorShapeProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {onnx.ITensorShapeProto} message TensorShapeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TensorShapeProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a TensorShapeProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.TensorShapeProto} TensorShapeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TensorShapeProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.TensorShapeProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            if (!(message.dim && message.dim.length)) message.dim = [];\n            message.dim.push($root.onnx.TensorShapeProto.Dimension.decode(reader, reader.uint32()));\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a TensorShapeProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.TensorShapeProto} TensorShapeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TensorShapeProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a TensorShapeProto message.\n     * @function verify\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    TensorShapeProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.dim != null && message.hasOwnProperty('dim')) {\n        if (!Array.isArray(message.dim)) return 'dim: array expected';\n        for (var i = 0; i < message.dim.length; ++i) {\n          var error = $root.onnx.TensorShapeProto.Dimension.verify(message.dim[i]);\n          if (error) return 'dim.' + error;\n        }\n      }\n      return null;\n    };\n\n    /**\n     * Creates a TensorShapeProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.TensorShapeProto} TensorShapeProto\n     */\n    TensorShapeProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.TensorShapeProto) return object;\n      var message = new $root.onnx.TensorShapeProto();\n      if (object.dim) {\n        if (!Array.isArray(object.dim)) throw TypeError('.onnx.TensorShapeProto.dim: array expected');\n        message.dim = [];\n        for (var i = 0; i < object.dim.length; ++i) {\n          if (typeof object.dim[i] !== 'object') throw TypeError('.onnx.TensorShapeProto.dim: object expected');\n          message.dim[i] = $root.onnx.TensorShapeProto.Dimension.fromObject(object.dim[i]);\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a TensorShapeProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {onnx.TensorShapeProto} message TensorShapeProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    TensorShapeProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) object.dim = [];\n      if (message.dim && message.dim.length) {\n        object.dim = [];\n        for (var j = 0; j < message.dim.length; ++j)\n          object.dim[j] = $root.onnx.TensorShapeProto.Dimension.toObject(message.dim[j], options);\n      }\n      return object;\n    };\n\n    /**\n     * Converts this TensorShapeProto to JSON.\n     * @function toJSON\n     * @memberof onnx.TensorShapeProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    TensorShapeProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for TensorShapeProto\n     * @function getTypeUrl\n     * @memberof onnx.TensorShapeProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    TensorShapeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.TensorShapeProto';\n    };\n\n    TensorShapeProto.Dimension = (function () {\n      /**\n       * Properties of a Dimension.\n       * @memberof onnx.TensorShapeProto\n       * @interface IDimension\n       * @property {number|Long|null} [dimValue] Dimension dimValue\n       * @property {string|null} [dimParam] Dimension dimParam\n       * @property {string|null} [denotation] Dimension denotation\n       */\n\n      /**\n       * Constructs a new Dimension.\n       * @memberof onnx.TensorShapeProto\n       * @classdesc Represents a Dimension.\n       * @implements IDimension\n       * @constructor\n       * @param {onnx.TensorShapeProto.IDimension=} [properties] Properties to set\n       */\n      function Dimension(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * Dimension dimValue.\n       * @member {number|Long|null|undefined} dimValue\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @instance\n       */\n      Dimension.prototype.dimValue = null;\n\n      /**\n       * Dimension dimParam.\n       * @member {string|null|undefined} dimParam\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @instance\n       */\n      Dimension.prototype.dimParam = null;\n\n      /**\n       * Dimension denotation.\n       * @member {string} denotation\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @instance\n       */\n      Dimension.prototype.denotation = '';\n\n      // OneOf field names bound to virtual getters and setters\n      var $oneOfFields;\n\n      /**\n       * Dimension value.\n       * @member {\"dimValue\"|\"dimParam\"|undefined} value\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @instance\n       */\n      Object.defineProperty(Dimension.prototype, 'value', {\n        get: $util.oneOfGetter(($oneOfFields = ['dimValue', 'dimParam'])),\n        set: $util.oneOfSetter($oneOfFields),\n      });\n\n      /**\n       * Creates a new Dimension instance using the specified properties.\n       * @function create\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {onnx.TensorShapeProto.IDimension=} [properties] Properties to set\n       * @returns {onnx.TensorShapeProto.Dimension} Dimension instance\n       */\n      Dimension.create = function create(properties) {\n        return new Dimension(properties);\n      };\n\n      /**\n       * Encodes the specified Dimension message. Does not implicitly {@link onnx.TensorShapeProto.Dimension.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {onnx.TensorShapeProto.IDimension} message Dimension message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Dimension.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.dimValue != null && Object.hasOwnProperty.call(message, 'dimValue'))\n          writer.uint32(/* id 1, wireType 0 =*/ 8).int64(message.dimValue);\n        if (message.dimParam != null && Object.hasOwnProperty.call(message, 'dimParam'))\n          writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.dimParam);\n        if (message.denotation != null && Object.hasOwnProperty.call(message, 'denotation'))\n          writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.denotation);\n        return writer;\n      };\n\n      /**\n       * Encodes the specified Dimension message, length delimited. Does not implicitly {@link onnx.TensorShapeProto.Dimension.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {onnx.TensorShapeProto.IDimension} message Dimension message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Dimension.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes a Dimension message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TensorShapeProto.Dimension} Dimension\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Dimension.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TensorShapeProto.Dimension();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.dimValue = reader.int64();\n              break;\n            }\n            case 2: {\n              message.dimParam = reader.string();\n              break;\n            }\n            case 3: {\n              message.denotation = reader.string();\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes a Dimension message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TensorShapeProto.Dimension} Dimension\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Dimension.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies a Dimension message.\n       * @function verify\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      Dimension.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        var properties = {};\n        if (message.dimValue != null && message.hasOwnProperty('dimValue')) {\n          properties.value = 1;\n          if (\n            !$util.isInteger(message.dimValue) &&\n            !(message.dimValue && $util.isInteger(message.dimValue.low) && $util.isInteger(message.dimValue.high))\n          )\n            return 'dimValue: integer|Long expected';\n        }\n        if (message.dimParam != null && message.hasOwnProperty('dimParam')) {\n          if (properties.value === 1) return 'value: multiple values';\n          properties.value = 1;\n          if (!$util.isString(message.dimParam)) return 'dimParam: string expected';\n        }\n        if (message.denotation != null && message.hasOwnProperty('denotation'))\n          if (!$util.isString(message.denotation)) return 'denotation: string expected';\n        return null;\n      };\n\n      /**\n       * Creates a Dimension message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TensorShapeProto.Dimension} Dimension\n       */\n      Dimension.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TensorShapeProto.Dimension) return object;\n        var message = new $root.onnx.TensorShapeProto.Dimension();\n        if (object.dimValue != null)\n          if ($util.Long) (message.dimValue = $util.Long.fromValue(object.dimValue)).unsigned = false;\n          else if (typeof object.dimValue === 'string') message.dimValue = parseInt(object.dimValue, 10);\n          else if (typeof object.dimValue === 'number') message.dimValue = object.dimValue;\n          else if (typeof object.dimValue === 'object')\n            message.dimValue = new $util.LongBits(object.dimValue.low >>> 0, object.dimValue.high >>> 0).toNumber();\n        if (object.dimParam != null) message.dimParam = String(object.dimParam);\n        if (object.denotation != null) message.denotation = String(object.denotation);\n        return message;\n      };\n\n      /**\n       * Creates a plain object from a Dimension message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {onnx.TensorShapeProto.Dimension} message Dimension\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      Dimension.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) object.denotation = '';\n        if (message.dimValue != null && message.hasOwnProperty('dimValue')) {\n          if (typeof message.dimValue === 'number')\n            object.dimValue = options.longs === String ? String(message.dimValue) : message.dimValue;\n          else\n            object.dimValue =\n              options.longs === String\n                ? $util.Long.prototype.toString.call(message.dimValue)\n                : options.longs === Number\n                  ? new $util.LongBits(message.dimValue.low >>> 0, message.dimValue.high >>> 0).toNumber()\n                  : message.dimValue;\n          if (options.oneofs) object.value = 'dimValue';\n        }\n        if (message.dimParam != null && message.hasOwnProperty('dimParam')) {\n          object.dimParam = message.dimParam;\n          if (options.oneofs) object.value = 'dimParam';\n        }\n        if (message.denotation != null && message.hasOwnProperty('denotation')) object.denotation = message.denotation;\n        return object;\n      };\n\n      /**\n       * Converts this Dimension to JSON.\n       * @function toJSON\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      Dimension.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for Dimension\n       * @function getTypeUrl\n       * @memberof onnx.TensorShapeProto.Dimension\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      Dimension.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TensorShapeProto.Dimension';\n      };\n\n      return Dimension;\n    })();\n\n    return TensorShapeProto;\n  })();\n\n  onnx.TypeProto = (function () {\n    /**\n     * Properties of a TypeProto.\n     * @memberof onnx\n     * @interface ITypeProto\n     * @property {onnx.TypeProto.ITensor|null} [tensorType] TypeProto tensorType\n     * @property {onnx.TypeProto.ISequence|null} [sequenceType] TypeProto sequenceType\n     * @property {onnx.TypeProto.IMap|null} [mapType] TypeProto mapType\n     * @property {onnx.TypeProto.IOptional|null} [optionalType] TypeProto optionalType\n     * @property {onnx.TypeProto.ISparseTensor|null} [sparseTensorType] TypeProto sparseTensorType\n     * @property {string|null} [denotation] TypeProto denotation\n     */\n\n    /**\n     * Constructs a new TypeProto.\n     * @memberof onnx\n     * @classdesc Represents a TypeProto.\n     * @implements ITypeProto\n     * @constructor\n     * @param {onnx.ITypeProto=} [properties] Properties to set\n     */\n    function TypeProto(properties) {\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * TypeProto tensorType.\n     * @member {onnx.TypeProto.ITensor|null|undefined} tensorType\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    TypeProto.prototype.tensorType = null;\n\n    /**\n     * TypeProto sequenceType.\n     * @member {onnx.TypeProto.ISequence|null|undefined} sequenceType\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    TypeProto.prototype.sequenceType = null;\n\n    /**\n     * TypeProto mapType.\n     * @member {onnx.TypeProto.IMap|null|undefined} mapType\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    TypeProto.prototype.mapType = null;\n\n    /**\n     * TypeProto optionalType.\n     * @member {onnx.TypeProto.IOptional|null|undefined} optionalType\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    TypeProto.prototype.optionalType = null;\n\n    /**\n     * TypeProto sparseTensorType.\n     * @member {onnx.TypeProto.ISparseTensor|null|undefined} sparseTensorType\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    TypeProto.prototype.sparseTensorType = null;\n\n    /**\n     * TypeProto denotation.\n     * @member {string} denotation\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    TypeProto.prototype.denotation = '';\n\n    // OneOf field names bound to virtual getters and setters\n    var $oneOfFields;\n\n    /**\n     * TypeProto value.\n     * @member {\"tensorType\"|\"sequenceType\"|\"mapType\"|\"optionalType\"|\"sparseTensorType\"|undefined} value\n     * @memberof onnx.TypeProto\n     * @instance\n     */\n    Object.defineProperty(TypeProto.prototype, 'value', {\n      get: $util.oneOfGetter(\n        ($oneOfFields = ['tensorType', 'sequenceType', 'mapType', 'optionalType', 'sparseTensorType']),\n      ),\n      set: $util.oneOfSetter($oneOfFields),\n    });\n\n    /**\n     * Creates a new TypeProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {onnx.ITypeProto=} [properties] Properties to set\n     * @returns {onnx.TypeProto} TypeProto instance\n     */\n    TypeProto.create = function create(properties) {\n      return new TypeProto(properties);\n    };\n\n    /**\n     * Encodes the specified TypeProto message. Does not implicitly {@link onnx.TypeProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {onnx.ITypeProto} message TypeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TypeProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.tensorType != null && Object.hasOwnProperty.call(message, 'tensorType'))\n        $root.onnx.TypeProto.Tensor.encode(\n          message.tensorType,\n          writer.uint32(/* id 1, wireType 2 =*/ 10).fork(),\n        ).ldelim();\n      if (message.sequenceType != null && Object.hasOwnProperty.call(message, 'sequenceType'))\n        $root.onnx.TypeProto.Sequence.encode(\n          message.sequenceType,\n          writer.uint32(/* id 4, wireType 2 =*/ 34).fork(),\n        ).ldelim();\n      if (message.mapType != null && Object.hasOwnProperty.call(message, 'mapType'))\n        $root.onnx.TypeProto.Map.encode(message.mapType, writer.uint32(/* id 5, wireType 2 =*/ 42).fork()).ldelim();\n      if (message.denotation != null && Object.hasOwnProperty.call(message, 'denotation'))\n        writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.denotation);\n      if (message.sparseTensorType != null && Object.hasOwnProperty.call(message, 'sparseTensorType'))\n        $root.onnx.TypeProto.SparseTensor.encode(\n          message.sparseTensorType,\n          writer.uint32(/* id 8, wireType 2 =*/ 66).fork(),\n        ).ldelim();\n      if (message.optionalType != null && Object.hasOwnProperty.call(message, 'optionalType'))\n        $root.onnx.TypeProto.Optional.encode(\n          message.optionalType,\n          writer.uint32(/* id 9, wireType 2 =*/ 74).fork(),\n        ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified TypeProto message, length delimited. Does not implicitly {@link onnx.TypeProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {onnx.ITypeProto} message TypeProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TypeProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a TypeProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.TypeProto} TypeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TypeProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.TypeProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.tensorType = $root.onnx.TypeProto.Tensor.decode(reader, reader.uint32());\n            break;\n          }\n          case 4: {\n            message.sequenceType = $root.onnx.TypeProto.Sequence.decode(reader, reader.uint32());\n            break;\n          }\n          case 5: {\n            message.mapType = $root.onnx.TypeProto.Map.decode(reader, reader.uint32());\n            break;\n          }\n          case 9: {\n            message.optionalType = $root.onnx.TypeProto.Optional.decode(reader, reader.uint32());\n            break;\n          }\n          case 8: {\n            message.sparseTensorType = $root.onnx.TypeProto.SparseTensor.decode(reader, reader.uint32());\n            break;\n          }\n          case 6: {\n            message.denotation = reader.string();\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a TypeProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.TypeProto} TypeProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TypeProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a TypeProto message.\n     * @function verify\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    TypeProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      var properties = {};\n      if (message.tensorType != null && message.hasOwnProperty('tensorType')) {\n        properties.value = 1;\n        {\n          var error = $root.onnx.TypeProto.Tensor.verify(message.tensorType);\n          if (error) return 'tensorType.' + error;\n        }\n      }\n      if (message.sequenceType != null && message.hasOwnProperty('sequenceType')) {\n        if (properties.value === 1) return 'value: multiple values';\n        properties.value = 1;\n        {\n          var error = $root.onnx.TypeProto.Sequence.verify(message.sequenceType);\n          if (error) return 'sequenceType.' + error;\n        }\n      }\n      if (message.mapType != null && message.hasOwnProperty('mapType')) {\n        if (properties.value === 1) return 'value: multiple values';\n        properties.value = 1;\n        {\n          var error = $root.onnx.TypeProto.Map.verify(message.mapType);\n          if (error) return 'mapType.' + error;\n        }\n      }\n      if (message.optionalType != null && message.hasOwnProperty('optionalType')) {\n        if (properties.value === 1) return 'value: multiple values';\n        properties.value = 1;\n        {\n          var error = $root.onnx.TypeProto.Optional.verify(message.optionalType);\n          if (error) return 'optionalType.' + error;\n        }\n      }\n      if (message.sparseTensorType != null && message.hasOwnProperty('sparseTensorType')) {\n        if (properties.value === 1) return 'value: multiple values';\n        properties.value = 1;\n        {\n          var error = $root.onnx.TypeProto.SparseTensor.verify(message.sparseTensorType);\n          if (error) return 'sparseTensorType.' + error;\n        }\n      }\n      if (message.denotation != null && message.hasOwnProperty('denotation'))\n        if (!$util.isString(message.denotation)) return 'denotation: string expected';\n      return null;\n    };\n\n    /**\n     * Creates a TypeProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.TypeProto} TypeProto\n     */\n    TypeProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.TypeProto) return object;\n      var message = new $root.onnx.TypeProto();\n      if (object.tensorType != null) {\n        if (typeof object.tensorType !== 'object') throw TypeError('.onnx.TypeProto.tensorType: object expected');\n        message.tensorType = $root.onnx.TypeProto.Tensor.fromObject(object.tensorType);\n      }\n      if (object.sequenceType != null) {\n        if (typeof object.sequenceType !== 'object') throw TypeError('.onnx.TypeProto.sequenceType: object expected');\n        message.sequenceType = $root.onnx.TypeProto.Sequence.fromObject(object.sequenceType);\n      }\n      if (object.mapType != null) {\n        if (typeof object.mapType !== 'object') throw TypeError('.onnx.TypeProto.mapType: object expected');\n        message.mapType = $root.onnx.TypeProto.Map.fromObject(object.mapType);\n      }\n      if (object.optionalType != null) {\n        if (typeof object.optionalType !== 'object') throw TypeError('.onnx.TypeProto.optionalType: object expected');\n        message.optionalType = $root.onnx.TypeProto.Optional.fromObject(object.optionalType);\n      }\n      if (object.sparseTensorType != null) {\n        if (typeof object.sparseTensorType !== 'object')\n          throw TypeError('.onnx.TypeProto.sparseTensorType: object expected');\n        message.sparseTensorType = $root.onnx.TypeProto.SparseTensor.fromObject(object.sparseTensorType);\n      }\n      if (object.denotation != null) message.denotation = String(object.denotation);\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a TypeProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {onnx.TypeProto} message TypeProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    TypeProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.defaults) object.denotation = '';\n      if (message.tensorType != null && message.hasOwnProperty('tensorType')) {\n        object.tensorType = $root.onnx.TypeProto.Tensor.toObject(message.tensorType, options);\n        if (options.oneofs) object.value = 'tensorType';\n      }\n      if (message.sequenceType != null && message.hasOwnProperty('sequenceType')) {\n        object.sequenceType = $root.onnx.TypeProto.Sequence.toObject(message.sequenceType, options);\n        if (options.oneofs) object.value = 'sequenceType';\n      }\n      if (message.mapType != null && message.hasOwnProperty('mapType')) {\n        object.mapType = $root.onnx.TypeProto.Map.toObject(message.mapType, options);\n        if (options.oneofs) object.value = 'mapType';\n      }\n      if (message.denotation != null && message.hasOwnProperty('denotation')) object.denotation = message.denotation;\n      if (message.sparseTensorType != null && message.hasOwnProperty('sparseTensorType')) {\n        object.sparseTensorType = $root.onnx.TypeProto.SparseTensor.toObject(message.sparseTensorType, options);\n        if (options.oneofs) object.value = 'sparseTensorType';\n      }\n      if (message.optionalType != null && message.hasOwnProperty('optionalType')) {\n        object.optionalType = $root.onnx.TypeProto.Optional.toObject(message.optionalType, options);\n        if (options.oneofs) object.value = 'optionalType';\n      }\n      return object;\n    };\n\n    /**\n     * Converts this TypeProto to JSON.\n     * @function toJSON\n     * @memberof onnx.TypeProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    TypeProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for TypeProto\n     * @function getTypeUrl\n     * @memberof onnx.TypeProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    TypeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.TypeProto';\n    };\n\n    TypeProto.Tensor = (function () {\n      /**\n       * Properties of a Tensor.\n       * @memberof onnx.TypeProto\n       * @interface ITensor\n       * @property {number|null} [elemType] Tensor elemType\n       * @property {onnx.ITensorShapeProto|null} [shape] Tensor shape\n       */\n\n      /**\n       * Constructs a new Tensor.\n       * @memberof onnx.TypeProto\n       * @classdesc Represents a Tensor.\n       * @implements ITensor\n       * @constructor\n       * @param {onnx.TypeProto.ITensor=} [properties] Properties to set\n       */\n      function Tensor(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * Tensor elemType.\n       * @member {number} elemType\n       * @memberof onnx.TypeProto.Tensor\n       * @instance\n       */\n      Tensor.prototype.elemType = 0;\n\n      /**\n       * Tensor shape.\n       * @member {onnx.ITensorShapeProto|null|undefined} shape\n       * @memberof onnx.TypeProto.Tensor\n       * @instance\n       */\n      Tensor.prototype.shape = null;\n\n      /**\n       * Creates a new Tensor instance using the specified properties.\n       * @function create\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {onnx.TypeProto.ITensor=} [properties] Properties to set\n       * @returns {onnx.TypeProto.Tensor} Tensor instance\n       */\n      Tensor.create = function create(properties) {\n        return new Tensor(properties);\n      };\n\n      /**\n       * Encodes the specified Tensor message. Does not implicitly {@link onnx.TypeProto.Tensor.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {onnx.TypeProto.ITensor} message Tensor message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Tensor.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.elemType != null && Object.hasOwnProperty.call(message, 'elemType'))\n          writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.elemType);\n        if (message.shape != null && Object.hasOwnProperty.call(message, 'shape'))\n          $root.onnx.TensorShapeProto.encode(message.shape, writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim();\n        return writer;\n      };\n\n      /**\n       * Encodes the specified Tensor message, length delimited. Does not implicitly {@link onnx.TypeProto.Tensor.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {onnx.TypeProto.ITensor} message Tensor message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Tensor.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes a Tensor message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TypeProto.Tensor} Tensor\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Tensor.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TypeProto.Tensor();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.elemType = reader.int32();\n              break;\n            }\n            case 2: {\n              message.shape = $root.onnx.TensorShapeProto.decode(reader, reader.uint32());\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes a Tensor message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TypeProto.Tensor} Tensor\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Tensor.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies a Tensor message.\n       * @function verify\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      Tensor.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        if (message.elemType != null && message.hasOwnProperty('elemType'))\n          if (!$util.isInteger(message.elemType)) return 'elemType: integer expected';\n        if (message.shape != null && message.hasOwnProperty('shape')) {\n          var error = $root.onnx.TensorShapeProto.verify(message.shape);\n          if (error) return 'shape.' + error;\n        }\n        return null;\n      };\n\n      /**\n       * Creates a Tensor message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TypeProto.Tensor} Tensor\n       */\n      Tensor.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TypeProto.Tensor) return object;\n        var message = new $root.onnx.TypeProto.Tensor();\n        if (object.elemType != null) message.elemType = object.elemType | 0;\n        if (object.shape != null) {\n          if (typeof object.shape !== 'object') throw TypeError('.onnx.TypeProto.Tensor.shape: object expected');\n          message.shape = $root.onnx.TensorShapeProto.fromObject(object.shape);\n        }\n        return message;\n      };\n\n      /**\n       * Creates a plain object from a Tensor message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {onnx.TypeProto.Tensor} message Tensor\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      Tensor.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) {\n          object.elemType = 0;\n          object.shape = null;\n        }\n        if (message.elemType != null && message.hasOwnProperty('elemType')) object.elemType = message.elemType;\n        if (message.shape != null && message.hasOwnProperty('shape'))\n          object.shape = $root.onnx.TensorShapeProto.toObject(message.shape, options);\n        return object;\n      };\n\n      /**\n       * Converts this Tensor to JSON.\n       * @function toJSON\n       * @memberof onnx.TypeProto.Tensor\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      Tensor.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for Tensor\n       * @function getTypeUrl\n       * @memberof onnx.TypeProto.Tensor\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      Tensor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TypeProto.Tensor';\n      };\n\n      return Tensor;\n    })();\n\n    TypeProto.Sequence = (function () {\n      /**\n       * Properties of a Sequence.\n       * @memberof onnx.TypeProto\n       * @interface ISequence\n       * @property {onnx.ITypeProto|null} [elemType] Sequence elemType\n       */\n\n      /**\n       * Constructs a new Sequence.\n       * @memberof onnx.TypeProto\n       * @classdesc Represents a Sequence.\n       * @implements ISequence\n       * @constructor\n       * @param {onnx.TypeProto.ISequence=} [properties] Properties to set\n       */\n      function Sequence(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * Sequence elemType.\n       * @member {onnx.ITypeProto|null|undefined} elemType\n       * @memberof onnx.TypeProto.Sequence\n       * @instance\n       */\n      Sequence.prototype.elemType = null;\n\n      /**\n       * Creates a new Sequence instance using the specified properties.\n       * @function create\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {onnx.TypeProto.ISequence=} [properties] Properties to set\n       * @returns {onnx.TypeProto.Sequence} Sequence instance\n       */\n      Sequence.create = function create(properties) {\n        return new Sequence(properties);\n      };\n\n      /**\n       * Encodes the specified Sequence message. Does not implicitly {@link onnx.TypeProto.Sequence.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {onnx.TypeProto.ISequence} message Sequence message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Sequence.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.elemType != null && Object.hasOwnProperty.call(message, 'elemType'))\n          $root.onnx.TypeProto.encode(message.elemType, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();\n        return writer;\n      };\n\n      /**\n       * Encodes the specified Sequence message, length delimited. Does not implicitly {@link onnx.TypeProto.Sequence.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {onnx.TypeProto.ISequence} message Sequence message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Sequence.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes a Sequence message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TypeProto.Sequence} Sequence\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Sequence.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TypeProto.Sequence();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.elemType = $root.onnx.TypeProto.decode(reader, reader.uint32());\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes a Sequence message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TypeProto.Sequence} Sequence\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Sequence.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies a Sequence message.\n       * @function verify\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      Sequence.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        if (message.elemType != null && message.hasOwnProperty('elemType')) {\n          var error = $root.onnx.TypeProto.verify(message.elemType);\n          if (error) return 'elemType.' + error;\n        }\n        return null;\n      };\n\n      /**\n       * Creates a Sequence message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TypeProto.Sequence} Sequence\n       */\n      Sequence.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TypeProto.Sequence) return object;\n        var message = new $root.onnx.TypeProto.Sequence();\n        if (object.elemType != null) {\n          if (typeof object.elemType !== 'object')\n            throw TypeError('.onnx.TypeProto.Sequence.elemType: object expected');\n          message.elemType = $root.onnx.TypeProto.fromObject(object.elemType);\n        }\n        return message;\n      };\n\n      /**\n       * Creates a plain object from a Sequence message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {onnx.TypeProto.Sequence} message Sequence\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      Sequence.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) object.elemType = null;\n        if (message.elemType != null && message.hasOwnProperty('elemType'))\n          object.elemType = $root.onnx.TypeProto.toObject(message.elemType, options);\n        return object;\n      };\n\n      /**\n       * Converts this Sequence to JSON.\n       * @function toJSON\n       * @memberof onnx.TypeProto.Sequence\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      Sequence.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for Sequence\n       * @function getTypeUrl\n       * @memberof onnx.TypeProto.Sequence\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      Sequence.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TypeProto.Sequence';\n      };\n\n      return Sequence;\n    })();\n\n    TypeProto.Map = (function () {\n      /**\n       * Properties of a Map.\n       * @memberof onnx.TypeProto\n       * @interface IMap\n       * @property {number|null} [keyType] Map keyType\n       * @property {onnx.ITypeProto|null} [valueType] Map valueType\n       */\n\n      /**\n       * Constructs a new Map.\n       * @memberof onnx.TypeProto\n       * @classdesc Represents a Map.\n       * @implements IMap\n       * @constructor\n       * @param {onnx.TypeProto.IMap=} [properties] Properties to set\n       */\n      function Map(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * Map keyType.\n       * @member {number} keyType\n       * @memberof onnx.TypeProto.Map\n       * @instance\n       */\n      Map.prototype.keyType = 0;\n\n      /**\n       * Map valueType.\n       * @member {onnx.ITypeProto|null|undefined} valueType\n       * @memberof onnx.TypeProto.Map\n       * @instance\n       */\n      Map.prototype.valueType = null;\n\n      /**\n       * Creates a new Map instance using the specified properties.\n       * @function create\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {onnx.TypeProto.IMap=} [properties] Properties to set\n       * @returns {onnx.TypeProto.Map} Map instance\n       */\n      Map.create = function create(properties) {\n        return new Map(properties);\n      };\n\n      /**\n       * Encodes the specified Map message. Does not implicitly {@link onnx.TypeProto.Map.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {onnx.TypeProto.IMap} message Map message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Map.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.keyType != null && Object.hasOwnProperty.call(message, 'keyType'))\n          writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.keyType);\n        if (message.valueType != null && Object.hasOwnProperty.call(message, 'valueType'))\n          $root.onnx.TypeProto.encode(message.valueType, writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim();\n        return writer;\n      };\n\n      /**\n       * Encodes the specified Map message, length delimited. Does not implicitly {@link onnx.TypeProto.Map.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {onnx.TypeProto.IMap} message Map message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Map.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes a Map message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TypeProto.Map} Map\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Map.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TypeProto.Map();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.keyType = reader.int32();\n              break;\n            }\n            case 2: {\n              message.valueType = $root.onnx.TypeProto.decode(reader, reader.uint32());\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes a Map message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TypeProto.Map} Map\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Map.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies a Map message.\n       * @function verify\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      Map.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        if (message.keyType != null && message.hasOwnProperty('keyType'))\n          if (!$util.isInteger(message.keyType)) return 'keyType: integer expected';\n        if (message.valueType != null && message.hasOwnProperty('valueType')) {\n          var error = $root.onnx.TypeProto.verify(message.valueType);\n          if (error) return 'valueType.' + error;\n        }\n        return null;\n      };\n\n      /**\n       * Creates a Map message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TypeProto.Map} Map\n       */\n      Map.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TypeProto.Map) return object;\n        var message = new $root.onnx.TypeProto.Map();\n        if (object.keyType != null) message.keyType = object.keyType | 0;\n        if (object.valueType != null) {\n          if (typeof object.valueType !== 'object') throw TypeError('.onnx.TypeProto.Map.valueType: object expected');\n          message.valueType = $root.onnx.TypeProto.fromObject(object.valueType);\n        }\n        return message;\n      };\n\n      /**\n       * Creates a plain object from a Map message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {onnx.TypeProto.Map} message Map\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      Map.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) {\n          object.keyType = 0;\n          object.valueType = null;\n        }\n        if (message.keyType != null && message.hasOwnProperty('keyType')) object.keyType = message.keyType;\n        if (message.valueType != null && message.hasOwnProperty('valueType'))\n          object.valueType = $root.onnx.TypeProto.toObject(message.valueType, options);\n        return object;\n      };\n\n      /**\n       * Converts this Map to JSON.\n       * @function toJSON\n       * @memberof onnx.TypeProto.Map\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      Map.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for Map\n       * @function getTypeUrl\n       * @memberof onnx.TypeProto.Map\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      Map.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TypeProto.Map';\n      };\n\n      return Map;\n    })();\n\n    TypeProto.Optional = (function () {\n      /**\n       * Properties of an Optional.\n       * @memberof onnx.TypeProto\n       * @interface IOptional\n       * @property {onnx.ITypeProto|null} [elemType] Optional elemType\n       */\n\n      /**\n       * Constructs a new Optional.\n       * @memberof onnx.TypeProto\n       * @classdesc Represents an Optional.\n       * @implements IOptional\n       * @constructor\n       * @param {onnx.TypeProto.IOptional=} [properties] Properties to set\n       */\n      function Optional(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * Optional elemType.\n       * @member {onnx.ITypeProto|null|undefined} elemType\n       * @memberof onnx.TypeProto.Optional\n       * @instance\n       */\n      Optional.prototype.elemType = null;\n\n      /**\n       * Creates a new Optional instance using the specified properties.\n       * @function create\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {onnx.TypeProto.IOptional=} [properties] Properties to set\n       * @returns {onnx.TypeProto.Optional} Optional instance\n       */\n      Optional.create = function create(properties) {\n        return new Optional(properties);\n      };\n\n      /**\n       * Encodes the specified Optional message. Does not implicitly {@link onnx.TypeProto.Optional.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {onnx.TypeProto.IOptional} message Optional message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Optional.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.elemType != null && Object.hasOwnProperty.call(message, 'elemType'))\n          $root.onnx.TypeProto.encode(message.elemType, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim();\n        return writer;\n      };\n\n      /**\n       * Encodes the specified Optional message, length delimited. Does not implicitly {@link onnx.TypeProto.Optional.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {onnx.TypeProto.IOptional} message Optional message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      Optional.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes an Optional message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TypeProto.Optional} Optional\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Optional.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TypeProto.Optional();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.elemType = $root.onnx.TypeProto.decode(reader, reader.uint32());\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes an Optional message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TypeProto.Optional} Optional\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      Optional.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies an Optional message.\n       * @function verify\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      Optional.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        if (message.elemType != null && message.hasOwnProperty('elemType')) {\n          var error = $root.onnx.TypeProto.verify(message.elemType);\n          if (error) return 'elemType.' + error;\n        }\n        return null;\n      };\n\n      /**\n       * Creates an Optional message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TypeProto.Optional} Optional\n       */\n      Optional.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TypeProto.Optional) return object;\n        var message = new $root.onnx.TypeProto.Optional();\n        if (object.elemType != null) {\n          if (typeof object.elemType !== 'object')\n            throw TypeError('.onnx.TypeProto.Optional.elemType: object expected');\n          message.elemType = $root.onnx.TypeProto.fromObject(object.elemType);\n        }\n        return message;\n      };\n\n      /**\n       * Creates a plain object from an Optional message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {onnx.TypeProto.Optional} message Optional\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      Optional.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) object.elemType = null;\n        if (message.elemType != null && message.hasOwnProperty('elemType'))\n          object.elemType = $root.onnx.TypeProto.toObject(message.elemType, options);\n        return object;\n      };\n\n      /**\n       * Converts this Optional to JSON.\n       * @function toJSON\n       * @memberof onnx.TypeProto.Optional\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      Optional.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for Optional\n       * @function getTypeUrl\n       * @memberof onnx.TypeProto.Optional\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      Optional.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TypeProto.Optional';\n      };\n\n      return Optional;\n    })();\n\n    TypeProto.SparseTensor = (function () {\n      /**\n       * Properties of a SparseTensor.\n       * @memberof onnx.TypeProto\n       * @interface ISparseTensor\n       * @property {number|null} [elemType] SparseTensor elemType\n       * @property {onnx.ITensorShapeProto|null} [shape] SparseTensor shape\n       */\n\n      /**\n       * Constructs a new SparseTensor.\n       * @memberof onnx.TypeProto\n       * @classdesc Represents a SparseTensor.\n       * @implements ISparseTensor\n       * @constructor\n       * @param {onnx.TypeProto.ISparseTensor=} [properties] Properties to set\n       */\n      function SparseTensor(properties) {\n        if (properties)\n          for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n            if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n      }\n\n      /**\n       * SparseTensor elemType.\n       * @member {number} elemType\n       * @memberof onnx.TypeProto.SparseTensor\n       * @instance\n       */\n      SparseTensor.prototype.elemType = 0;\n\n      /**\n       * SparseTensor shape.\n       * @member {onnx.ITensorShapeProto|null|undefined} shape\n       * @memberof onnx.TypeProto.SparseTensor\n       * @instance\n       */\n      SparseTensor.prototype.shape = null;\n\n      /**\n       * Creates a new SparseTensor instance using the specified properties.\n       * @function create\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {onnx.TypeProto.ISparseTensor=} [properties] Properties to set\n       * @returns {onnx.TypeProto.SparseTensor} SparseTensor instance\n       */\n      SparseTensor.create = function create(properties) {\n        return new SparseTensor(properties);\n      };\n\n      /**\n       * Encodes the specified SparseTensor message. Does not implicitly {@link onnx.TypeProto.SparseTensor.verify|verify} messages.\n       * @function encode\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {onnx.TypeProto.ISparseTensor} message SparseTensor message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      SparseTensor.encode = function encode(message, writer) {\n        if (!writer) writer = $Writer.create();\n        if (message.elemType != null && Object.hasOwnProperty.call(message, 'elemType'))\n          writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.elemType);\n        if (message.shape != null && Object.hasOwnProperty.call(message, 'shape'))\n          $root.onnx.TensorShapeProto.encode(message.shape, writer.uint32(/* id 2, wireType 2 =*/ 18).fork()).ldelim();\n        return writer;\n      };\n\n      /**\n       * Encodes the specified SparseTensor message, length delimited. Does not implicitly {@link onnx.TypeProto.SparseTensor.verify|verify} messages.\n       * @function encodeDelimited\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {onnx.TypeProto.ISparseTensor} message SparseTensor message or plain object to encode\n       * @param {$protobuf.Writer} [writer] Writer to encode to\n       * @returns {$protobuf.Writer} Writer\n       */\n      SparseTensor.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n      };\n\n      /**\n       * Decodes a SparseTensor message from the specified reader or buffer.\n       * @function decode\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @param {number} [length] Message length if known beforehand\n       * @returns {onnx.TypeProto.SparseTensor} SparseTensor\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      SparseTensor.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length,\n          message = new $root.onnx.TypeProto.SparseTensor();\n        while (reader.pos < end) {\n          var tag = reader.uint32();\n          switch (tag >>> 3) {\n            case 1: {\n              message.elemType = reader.int32();\n              break;\n            }\n            case 2: {\n              message.shape = $root.onnx.TensorShapeProto.decode(reader, reader.uint32());\n              break;\n            }\n            default:\n              reader.skipType(tag & 7);\n              break;\n          }\n        }\n        return message;\n      };\n\n      /**\n       * Decodes a SparseTensor message from the specified reader or buffer, length delimited.\n       * @function decodeDelimited\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n       * @returns {onnx.TypeProto.SparseTensor} SparseTensor\n       * @throws {Error} If the payload is not a reader or valid buffer\n       * @throws {$protobuf.util.ProtocolError} If required fields are missing\n       */\n      SparseTensor.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n      };\n\n      /**\n       * Verifies a SparseTensor message.\n       * @function verify\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {Object.<string,*>} message Plain object to verify\n       * @returns {string|null} `null` if valid, otherwise the reason why it is not\n       */\n      SparseTensor.verify = function verify(message) {\n        if (typeof message !== 'object' || message === null) return 'object expected';\n        if (message.elemType != null && message.hasOwnProperty('elemType'))\n          if (!$util.isInteger(message.elemType)) return 'elemType: integer expected';\n        if (message.shape != null && message.hasOwnProperty('shape')) {\n          var error = $root.onnx.TensorShapeProto.verify(message.shape);\n          if (error) return 'shape.' + error;\n        }\n        return null;\n      };\n\n      /**\n       * Creates a SparseTensor message from a plain object. Also converts values to their respective internal types.\n       * @function fromObject\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {Object.<string,*>} object Plain object\n       * @returns {onnx.TypeProto.SparseTensor} SparseTensor\n       */\n      SparseTensor.fromObject = function fromObject(object) {\n        if (object instanceof $root.onnx.TypeProto.SparseTensor) return object;\n        var message = new $root.onnx.TypeProto.SparseTensor();\n        if (object.elemType != null) message.elemType = object.elemType | 0;\n        if (object.shape != null) {\n          if (typeof object.shape !== 'object') throw TypeError('.onnx.TypeProto.SparseTensor.shape: object expected');\n          message.shape = $root.onnx.TensorShapeProto.fromObject(object.shape);\n        }\n        return message;\n      };\n\n      /**\n       * Creates a plain object from a SparseTensor message. Also converts values to other types if specified.\n       * @function toObject\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {onnx.TypeProto.SparseTensor} message SparseTensor\n       * @param {$protobuf.IConversionOptions} [options] Conversion options\n       * @returns {Object.<string,*>} Plain object\n       */\n      SparseTensor.toObject = function toObject(message, options) {\n        if (!options) options = {};\n        var object = {};\n        if (options.defaults) {\n          object.elemType = 0;\n          object.shape = null;\n        }\n        if (message.elemType != null && message.hasOwnProperty('elemType')) object.elemType = message.elemType;\n        if (message.shape != null && message.hasOwnProperty('shape'))\n          object.shape = $root.onnx.TensorShapeProto.toObject(message.shape, options);\n        return object;\n      };\n\n      /**\n       * Converts this SparseTensor to JSON.\n       * @function toJSON\n       * @memberof onnx.TypeProto.SparseTensor\n       * @instance\n       * @returns {Object.<string,*>} JSON object\n       */\n      SparseTensor.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n      };\n\n      /**\n       * Gets the default type url for SparseTensor\n       * @function getTypeUrl\n       * @memberof onnx.TypeProto.SparseTensor\n       * @static\n       * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n       * @returns {string} The default type url\n       */\n      SparseTensor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n          typeUrlPrefix = 'type.googleapis.com';\n        }\n        return typeUrlPrefix + '/onnx.TypeProto.SparseTensor';\n      };\n\n      return SparseTensor;\n    })();\n\n    return TypeProto;\n  })();\n\n  onnx.OperatorSetIdProto = (function () {\n    /**\n     * Properties of an OperatorSetIdProto.\n     * @memberof onnx\n     * @interface IOperatorSetIdProto\n     * @property {string|null} [domain] OperatorSetIdProto domain\n     * @property {number|Long|null} [version] OperatorSetIdProto version\n     */\n\n    /**\n     * Constructs a new OperatorSetIdProto.\n     * @memberof onnx\n     * @classdesc Represents an OperatorSetIdProto.\n     * @implements IOperatorSetIdProto\n     * @constructor\n     * @param {onnx.IOperatorSetIdProto=} [properties] Properties to set\n     */\n    function OperatorSetIdProto(properties) {\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * OperatorSetIdProto domain.\n     * @member {string} domain\n     * @memberof onnx.OperatorSetIdProto\n     * @instance\n     */\n    OperatorSetIdProto.prototype.domain = '';\n\n    /**\n     * OperatorSetIdProto version.\n     * @member {number|Long} version\n     * @memberof onnx.OperatorSetIdProto\n     * @instance\n     */\n    OperatorSetIdProto.prototype.version = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n\n    /**\n     * Creates a new OperatorSetIdProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {onnx.IOperatorSetIdProto=} [properties] Properties to set\n     * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto instance\n     */\n    OperatorSetIdProto.create = function create(properties) {\n      return new OperatorSetIdProto(properties);\n    };\n\n    /**\n     * Encodes the specified OperatorSetIdProto message. Does not implicitly {@link onnx.OperatorSetIdProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {onnx.IOperatorSetIdProto} message OperatorSetIdProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    OperatorSetIdProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.domain != null && Object.hasOwnProperty.call(message, 'domain'))\n        writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.domain);\n      if (message.version != null && Object.hasOwnProperty.call(message, 'version'))\n        writer.uint32(/* id 2, wireType 0 =*/ 16).int64(message.version);\n      return writer;\n    };\n\n    /**\n     * Encodes the specified OperatorSetIdProto message, length delimited. Does not implicitly {@link onnx.OperatorSetIdProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {onnx.IOperatorSetIdProto} message OperatorSetIdProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    OperatorSetIdProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes an OperatorSetIdProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    OperatorSetIdProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.OperatorSetIdProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.domain = reader.string();\n            break;\n          }\n          case 2: {\n            message.version = reader.int64();\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes an OperatorSetIdProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    OperatorSetIdProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies an OperatorSetIdProto message.\n     * @function verify\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    OperatorSetIdProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.domain != null && message.hasOwnProperty('domain'))\n        if (!$util.isString(message.domain)) return 'domain: string expected';\n      if (message.version != null && message.hasOwnProperty('version'))\n        if (\n          !$util.isInteger(message.version) &&\n          !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))\n        )\n          return 'version: integer|Long expected';\n      return null;\n    };\n\n    /**\n     * Creates an OperatorSetIdProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.OperatorSetIdProto} OperatorSetIdProto\n     */\n    OperatorSetIdProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.OperatorSetIdProto) return object;\n      var message = new $root.onnx.OperatorSetIdProto();\n      if (object.domain != null) message.domain = String(object.domain);\n      if (object.version != null)\n        if ($util.Long) (message.version = $util.Long.fromValue(object.version)).unsigned = false;\n        else if (typeof object.version === 'string') message.version = parseInt(object.version, 10);\n        else if (typeof object.version === 'number') message.version = object.version;\n        else if (typeof object.version === 'object')\n          message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber();\n      return message;\n    };\n\n    /**\n     * Creates a plain object from an OperatorSetIdProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {onnx.OperatorSetIdProto} message OperatorSetIdProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    OperatorSetIdProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.defaults) {\n        object.domain = '';\n        if ($util.Long) {\n          var long = new $util.Long(0, 0, false);\n          object.version =\n            options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n        } else object.version = options.longs === String ? '0' : 0;\n      }\n      if (message.domain != null && message.hasOwnProperty('domain')) object.domain = message.domain;\n      if (message.version != null && message.hasOwnProperty('version'))\n        if (typeof message.version === 'number')\n          object.version = options.longs === String ? String(message.version) : message.version;\n        else\n          object.version =\n            options.longs === String\n              ? $util.Long.prototype.toString.call(message.version)\n              : options.longs === Number\n                ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber()\n                : message.version;\n      return object;\n    };\n\n    /**\n     * Converts this OperatorSetIdProto to JSON.\n     * @function toJSON\n     * @memberof onnx.OperatorSetIdProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    OperatorSetIdProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for OperatorSetIdProto\n     * @function getTypeUrl\n     * @memberof onnx.OperatorSetIdProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    OperatorSetIdProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.OperatorSetIdProto';\n    };\n\n    return OperatorSetIdProto;\n  })();\n\n  /**\n   * OperatorStatus enum.\n   * @name onnx.OperatorStatus\n   * @enum {number}\n   * @property {number} EXPERIMENTAL=0 EXPERIMENTAL value\n   * @property {number} STABLE=1 STABLE value\n   */\n  onnx.OperatorStatus = (function () {\n    var valuesById = {},\n      values = Object.create(valuesById);\n    values[(valuesById[0] = 'EXPERIMENTAL')] = 0;\n    values[(valuesById[1] = 'STABLE')] = 1;\n    return values;\n  })();\n\n  onnx.FunctionProto = (function () {\n    /**\n     * Properties of a FunctionProto.\n     * @memberof onnx\n     * @interface IFunctionProto\n     * @property {string|null} [name] FunctionProto name\n     * @property {Array.<string>|null} [input] FunctionProto input\n     * @property {Array.<string>|null} [output] FunctionProto output\n     * @property {Array.<string>|null} [attribute] FunctionProto attribute\n     * @property {Array.<onnx.IAttributeProto>|null} [attributeProto] FunctionProto attributeProto\n     * @property {Array.<onnx.INodeProto>|null} [node] FunctionProto node\n     * @property {string|null} [docString] FunctionProto docString\n     * @property {Array.<onnx.IOperatorSetIdProto>|null} [opsetImport] FunctionProto opsetImport\n     * @property {string|null} [domain] FunctionProto domain\n     */\n\n    /**\n     * Constructs a new FunctionProto.\n     * @memberof onnx\n     * @classdesc Represents a FunctionProto.\n     * @implements IFunctionProto\n     * @constructor\n     * @param {onnx.IFunctionProto=} [properties] Properties to set\n     */\n    function FunctionProto(properties) {\n      this.input = [];\n      this.output = [];\n      this.attribute = [];\n      this.attributeProto = [];\n      this.node = [];\n      this.opsetImport = [];\n      if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n          if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * FunctionProto name.\n     * @member {string} name\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.name = '';\n\n    /**\n     * FunctionProto input.\n     * @member {Array.<string>} input\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.input = $util.emptyArray;\n\n    /**\n     * FunctionProto output.\n     * @member {Array.<string>} output\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.output = $util.emptyArray;\n\n    /**\n     * FunctionProto attribute.\n     * @member {Array.<string>} attribute\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.attribute = $util.emptyArray;\n\n    /**\n     * FunctionProto attributeProto.\n     * @member {Array.<onnx.IAttributeProto>} attributeProto\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.attributeProto = $util.emptyArray;\n\n    /**\n     * FunctionProto node.\n     * @member {Array.<onnx.INodeProto>} node\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.node = $util.emptyArray;\n\n    /**\n     * FunctionProto docString.\n     * @member {string} docString\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.docString = '';\n\n    /**\n     * FunctionProto opsetImport.\n     * @member {Array.<onnx.IOperatorSetIdProto>} opsetImport\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.opsetImport = $util.emptyArray;\n\n    /**\n     * FunctionProto domain.\n     * @member {string} domain\n     * @memberof onnx.FunctionProto\n     * @instance\n     */\n    FunctionProto.prototype.domain = '';\n\n    /**\n     * Creates a new FunctionProto instance using the specified properties.\n     * @function create\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {onnx.IFunctionProto=} [properties] Properties to set\n     * @returns {onnx.FunctionProto} FunctionProto instance\n     */\n    FunctionProto.create = function create(properties) {\n      return new FunctionProto(properties);\n    };\n\n    /**\n     * Encodes the specified FunctionProto message. Does not implicitly {@link onnx.FunctionProto.verify|verify} messages.\n     * @function encode\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {onnx.IFunctionProto} message FunctionProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    FunctionProto.encode = function encode(message, writer) {\n      if (!writer) writer = $Writer.create();\n      if (message.name != null && Object.hasOwnProperty.call(message, 'name'))\n        writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name);\n      if (message.input != null && message.input.length)\n        for (var i = 0; i < message.input.length; ++i)\n          writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.input[i]);\n      if (message.output != null && message.output.length)\n        for (var i = 0; i < message.output.length; ++i)\n          writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.output[i]);\n      if (message.attribute != null && message.attribute.length)\n        for (var i = 0; i < message.attribute.length; ++i)\n          writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.attribute[i]);\n      if (message.node != null && message.node.length)\n        for (var i = 0; i < message.node.length; ++i)\n          $root.onnx.NodeProto.encode(message.node[i], writer.uint32(/* id 7, wireType 2 =*/ 58).fork()).ldelim();\n      if (message.docString != null && Object.hasOwnProperty.call(message, 'docString'))\n        writer.uint32(/* id 8, wireType 2 =*/ 66).string(message.docString);\n      if (message.opsetImport != null && message.opsetImport.length)\n        for (var i = 0; i < message.opsetImport.length; ++i)\n          $root.onnx.OperatorSetIdProto.encode(\n            message.opsetImport[i],\n            writer.uint32(/* id 9, wireType 2 =*/ 74).fork(),\n          ).ldelim();\n      if (message.domain != null && Object.hasOwnProperty.call(message, 'domain'))\n        writer.uint32(/* id 10, wireType 2 =*/ 82).string(message.domain);\n      if (message.attributeProto != null && message.attributeProto.length)\n        for (var i = 0; i < message.attributeProto.length; ++i)\n          $root.onnx.AttributeProto.encode(\n            message.attributeProto[i],\n            writer.uint32(/* id 11, wireType 2 =*/ 90).fork(),\n          ).ldelim();\n      return writer;\n    };\n\n    /**\n     * Encodes the specified FunctionProto message, length delimited. Does not implicitly {@link onnx.FunctionProto.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {onnx.IFunctionProto} message FunctionProto message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    FunctionProto.encodeDelimited = function encodeDelimited(message, writer) {\n      return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a FunctionProto message from the specified reader or buffer.\n     * @function decode\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {onnx.FunctionProto} FunctionProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    FunctionProto.decode = function decode(reader, length) {\n      if (!(reader instanceof $Reader)) reader = $Reader.create(reader);\n      var end = length === undefined ? reader.len : reader.pos + length,\n        message = new $root.onnx.FunctionProto();\n      while (reader.pos < end) {\n        var tag = reader.uint32();\n        switch (tag >>> 3) {\n          case 1: {\n            message.name = reader.string();\n            break;\n          }\n          case 4: {\n            if (!(message.input && message.input.length)) message.input = [];\n            message.input.push(reader.string());\n            break;\n          }\n          case 5: {\n            if (!(message.output && message.output.length)) message.output = [];\n            message.output.push(reader.string());\n            break;\n          }\n          case 6: {\n            if (!(message.attribute && message.attribute.length)) message.attribute = [];\n            message.attribute.push(reader.string());\n            break;\n          }\n          case 11: {\n            if (!(message.attributeProto && message.attributeProto.length)) message.attributeProto = [];\n            message.attributeProto.push($root.onnx.AttributeProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 7: {\n            if (!(message.node && message.node.length)) message.node = [];\n            message.node.push($root.onnx.NodeProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 8: {\n            message.docString = reader.string();\n            break;\n          }\n          case 9: {\n            if (!(message.opsetImport && message.opsetImport.length)) message.opsetImport = [];\n            message.opsetImport.push($root.onnx.OperatorSetIdProto.decode(reader, reader.uint32()));\n            break;\n          }\n          case 10: {\n            message.domain = reader.string();\n            break;\n          }\n          default:\n            reader.skipType(tag & 7);\n            break;\n        }\n      }\n      return message;\n    };\n\n    /**\n     * Decodes a FunctionProto message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {onnx.FunctionProto} FunctionProto\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    FunctionProto.decodeDelimited = function decodeDelimited(reader) {\n      if (!(reader instanceof $Reader)) reader = new $Reader(reader);\n      return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a FunctionProto message.\n     * @function verify\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    FunctionProto.verify = function verify(message) {\n      if (typeof message !== 'object' || message === null) return 'object expected';\n      if (message.name != null && message.hasOwnProperty('name'))\n        if (!$util.isString(message.name)) return 'name: string expected';\n      if (message.input != null && message.hasOwnProperty('input')) {\n        if (!Array.isArray(message.input)) return 'input: array expected';\n        for (var i = 0; i < message.input.length; ++i)\n          if (!$util.isString(message.input[i])) return 'input: string[] expected';\n      }\n      if (message.output != null && message.hasOwnProperty('output')) {\n        if (!Array.isArray(message.output)) return 'output: array expected';\n        for (var i = 0; i < message.output.length; ++i)\n          if (!$util.isString(message.output[i])) return 'output: string[] expected';\n      }\n      if (message.attribute != null && message.hasOwnProperty('attribute')) {\n        if (!Array.isArray(message.attribute)) return 'attribute: array expected';\n        for (var i = 0; i < message.attribute.length; ++i)\n          if (!$util.isString(message.attribute[i])) return 'attribute: string[] expected';\n      }\n      if (message.attributeProto != null && message.hasOwnProperty('attributeProto')) {\n        if (!Array.isArray(message.attributeProto)) return 'attributeProto: array expected';\n        for (var i = 0; i < message.attributeProto.length; ++i) {\n          var error = $root.onnx.AttributeProto.verify(message.attributeProto[i]);\n          if (error) return 'attributeProto.' + error;\n        }\n      }\n      if (message.node != null && message.hasOwnProperty('node')) {\n        if (!Array.isArray(message.node)) return 'node: array expected';\n        for (var i = 0; i < message.node.length; ++i) {\n          var error = $root.onnx.NodeProto.verify(message.node[i]);\n          if (error) return 'node.' + error;\n        }\n      }\n      if (message.docString != null && message.hasOwnProperty('docString'))\n        if (!$util.isString(message.docString)) return 'docString: string expected';\n      if (message.opsetImport != null && message.hasOwnProperty('opsetImport')) {\n        if (!Array.isArray(message.opsetImport)) return 'opsetImport: array expected';\n        for (var i = 0; i < message.opsetImport.length; ++i) {\n          var error = $root.onnx.OperatorSetIdProto.verify(message.opsetImport[i]);\n          if (error) return 'opsetImport.' + error;\n        }\n      }\n      if (message.domain != null && message.hasOwnProperty('domain'))\n        if (!$util.isString(message.domain)) return 'domain: string expected';\n      return null;\n    };\n\n    /**\n     * Creates a FunctionProto message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {onnx.FunctionProto} FunctionProto\n     */\n    FunctionProto.fromObject = function fromObject(object) {\n      if (object instanceof $root.onnx.FunctionProto) return object;\n      var message = new $root.onnx.FunctionProto();\n      if (object.name != null) message.name = String(object.name);\n      if (object.input) {\n        if (!Array.isArray(object.input)) throw TypeError('.onnx.FunctionProto.input: array expected');\n        message.input = [];\n        for (var i = 0; i < object.input.length; ++i) message.input[i] = String(object.input[i]);\n      }\n      if (object.output) {\n        if (!Array.isArray(object.output)) throw TypeError('.onnx.FunctionProto.output: array expected');\n        message.output = [];\n        for (var i = 0; i < object.output.length; ++i) message.output[i] = String(object.output[i]);\n      }\n      if (object.attribute) {\n        if (!Array.isArray(object.attribute)) throw TypeError('.onnx.FunctionProto.attribute: array expected');\n        message.attribute = [];\n        for (var i = 0; i < object.attribute.length; ++i) message.attribute[i] = String(object.attribute[i]);\n      }\n      if (object.attributeProto) {\n        if (!Array.isArray(object.attributeProto))\n          throw TypeError('.onnx.FunctionProto.attributeProto: array expected');\n        message.attributeProto = [];\n        for (var i = 0; i < object.attributeProto.length; ++i) {\n          if (typeof object.attributeProto[i] !== 'object')\n            throw TypeError('.onnx.FunctionProto.attributeProto: object expected');\n          message.attributeProto[i] = $root.onnx.AttributeProto.fromObject(object.attributeProto[i]);\n        }\n      }\n      if (object.node) {\n        if (!Array.isArray(object.node)) throw TypeError('.onnx.FunctionProto.node: array expected');\n        message.node = [];\n        for (var i = 0; i < object.node.length; ++i) {\n          if (typeof object.node[i] !== 'object') throw TypeError('.onnx.FunctionProto.node: object expected');\n          message.node[i] = $root.onnx.NodeProto.fromObject(object.node[i]);\n        }\n      }\n      if (object.docString != null) message.docString = String(object.docString);\n      if (object.opsetImport) {\n        if (!Array.isArray(object.opsetImport)) throw TypeError('.onnx.FunctionProto.opsetImport: array expected');\n        message.opsetImport = [];\n        for (var i = 0; i < object.opsetImport.length; ++i) {\n          if (typeof object.opsetImport[i] !== 'object')\n            throw TypeError('.onnx.FunctionProto.opsetImport: object expected');\n          message.opsetImport[i] = $root.onnx.OperatorSetIdProto.fromObject(object.opsetImport[i]);\n        }\n      }\n      if (object.domain != null) message.domain = String(object.domain);\n      return message;\n    };\n\n    /**\n     * Creates a plain object from a FunctionProto message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {onnx.FunctionProto} message FunctionProto\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    FunctionProto.toObject = function toObject(message, options) {\n      if (!options) options = {};\n      var object = {};\n      if (options.arrays || options.defaults) {\n        object.input = [];\n        object.output = [];\n        object.attribute = [];\n        object.node = [];\n        object.opsetImport = [];\n        object.attributeProto = [];\n      }\n      if (options.defaults) {\n        object.name = '';\n        object.docString = '';\n        object.domain = '';\n      }\n      if (message.name != null && message.hasOwnProperty('name')) object.name = message.name;\n      if (message.input && message.input.length) {\n        object.input = [];\n        for (var j = 0; j < message.input.length; ++j) object.input[j] = message.input[j];\n      }\n      if (message.output && message.output.length) {\n        object.output = [];\n        for (var j = 0; j < message.output.length; ++j) object.output[j] = message.output[j];\n      }\n      if (message.attribute && message.attribute.length) {\n        object.attribute = [];\n        for (var j = 0; j < message.attribute.length; ++j) object.attribute[j] = message.attribute[j];\n      }\n      if (message.node && message.node.length) {\n        object.node = [];\n        for (var j = 0; j < message.node.length; ++j)\n          object.node[j] = $root.onnx.NodeProto.toObject(message.node[j], options);\n      }\n      if (message.docString != null && message.hasOwnProperty('docString')) object.docString = message.docString;\n      if (message.opsetImport && message.opsetImport.length) {\n        object.opsetImport = [];\n        for (var j = 0; j < message.opsetImport.length; ++j)\n          object.opsetImport[j] = $root.onnx.OperatorSetIdProto.toObject(message.opsetImport[j], options);\n      }\n      if (message.domain != null && message.hasOwnProperty('domain')) object.domain = message.domain;\n      if (message.attributeProto && message.attributeProto.length) {\n        object.attributeProto = [];\n        for (var j = 0; j < message.attributeProto.length; ++j)\n          object.attributeProto[j] = $root.onnx.AttributeProto.toObject(message.attributeProto[j], options);\n      }\n      return object;\n    };\n\n    /**\n     * Converts this FunctionProto to JSON.\n     * @function toJSON\n     * @memberof onnx.FunctionProto\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    FunctionProto.prototype.toJSON = function toJSON() {\n      return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for FunctionProto\n     * @function getTypeUrl\n     * @memberof onnx.FunctionProto\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    FunctionProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n      if (typeUrlPrefix === undefined) {\n        typeUrlPrefix = 'type.googleapis.com';\n      }\n      return typeUrlPrefix + '/onnx.FunctionProto';\n    };\n\n    return FunctionProto;\n  })();\n\n  return onnx;\n})();\n\nmodule.exports = $root;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport Long from 'long';\n\nimport { Graph } from './graph';\nimport * as ortFbs from './ort-schema/flatbuffers/ort-generated';\nimport { onnx } from './ort-schema/protobuf/onnx';\nimport { Tensor } from './tensor';\n\n// check the inputs shape before running an OP.\n// return true when the inputs pass the check\n// return false when the inputs do not fit the requirement\n// throw exception when fatal error or not implemented\nexport function checkInputsShape(inputs: Tensor[], ...expectedDimensions: number[]): boolean {\n  if (!inputs || inputs.length !== expectedDimensions.length) {\n    return false;\n  }\n  for (let i = 0; i < inputs.length; i++) {\n    if (!inputs[i].dims || inputs[i].dims.length !== expectedDimensions[i]) {\n      return false;\n    }\n  }\n  return true;\n}\n\n// Evaluates the given expression and asserts error message if condition is unmet.\nexport function assert(expr: boolean, msg: () => string) {\n  if (!expr) {\n    throw new Error(typeof msg === 'string' ? msg : msg());\n  }\n}\n\nexport class ArrayUtil {\n  /**\n   * Verifies if 2 input arrays contain the same elements.\n   * @param n1 Array 1\n   * @param n2 Array 2\n   * @returns Whether these 2 are equal\n   */\n  static arraysEqual(\n    n1:\n      | readonly number[]\n      | Int8Array\n      | Uint8Array\n      | Int16Array\n      | Uint16Array\n      | Int32Array\n      | Uint32Array\n      | Uint8ClampedArray\n      | Float32Array\n      | Float64Array,\n    n2:\n      | readonly number[]\n      | Int8Array\n      | Uint8Array\n      | Int16Array\n      | Uint16Array\n      | Int32Array\n      | Uint32Array\n      | Uint8ClampedArray\n      | Float32Array\n      | Float64Array,\n  ) {\n    if (n1.length !== n2.length) {\n      return false;\n    }\n    for (let i = 0; i < n1.length; i++) {\n      if (n1[i] !== n2[i]) {\n        return false;\n      }\n    }\n    return true;\n  }\n}\n\nexport class MatMulUtil {\n  /**\n   * Fix the input shapes for MatMul operation if they need fixing\n   * @param dimsA The shape of tensor A. Should be an array of positive integers\n   * @param dimsB The shape of tensor B. Should be an array of positive integers\n   * @returns A tuple containing the preprocessed input shapes as required by ONNX specifications\n   */\n  static preprocessInputShapes(\n    dimsA: readonly number[],\n    dimsB: readonly number[],\n  ): [readonly number[], readonly number[]] {\n    // If the first argument is 1-D, it is promoted to a matrix by prepending\n    // a 1 to its dimensions. After matrix multiplication the prepended 1 is\n    // removed.\n    const a = dimsA.length === 1 ? [1, dimsA[0]] : dimsA;\n\n    // If the second argument is 1-D, it is promoted to a matrix by appending\n    // a 1 to its dimensions. After matrix multiplication the appended 1 is\n    // removed.\n    const b = dimsB.length === 1 ? [dimsB[0], 1] : dimsB;\n\n    return [a, b];\n  }\n\n  /**\n   * Fix the output shape computed for MatMul operation if it needs fixing\n   * @param outputShape The computed outputShape. Should be an array (atleast of length 2) of positive integers.\n   * This will be mutated.\n   * @param aRank The rank of tensor A.\n   * @param bRank The rank of tensor B.\n   */\n  static postprocessOutputShape(outputShape: number[], aRank: number, bRank: number) {\n    // Remove prepended dimension if first input is 1d\n    if (aRank === 1) {\n      // outputShape = outputShape.slice(0, outputShape.length - 2).concat(outputShape.slice(outputShape.length - 1));\n      outputShape.splice(outputShape.length - 2, 1);\n    }\n    // Remove appended dimension if second input is 1d\n    if (bRank === 1) {\n      outputShape.pop();\n    }\n  }\n\n  /**\n   * Calculate the expected shape when matrix multiplication\n   * @param a The shape of tensor A. Should be a tuple of 2 positive integers\n   * @param b The shape of tensor B. Should be a tuple of 2 positive integers\n   * @returns The expected shape of the result, or undefined if N/A\n   */\n  static calcMatMulShape(a: [number, number], b: [number, number]): [number, number] | undefined {\n    return a[1] !== b[0] ? undefined : [a[0], b[1]];\n  }\n}\n\nexport class BroadcastUtil {\n  /**\n   * Calculate the expected shape when broadcasting 2 tensors\n   * @param a The shape of tensor A. Should be an array of positive integers\n   * @param b The shape of tensor B. Should be an array of positive integers\n   * @param isMatMul Whether the operation is MatMul\n   * @returns The expected shape of the result, or undefined if N/A\n   */\n  static calcShape(\n    adims: readonly number[],\n    bdims: readonly number[],\n    isMatMul = false,\n  ): readonly number[] | undefined {\n    const arank = adims.length;\n    const brank = bdims.length;\n    if (arank === 0) {\n      return bdims;\n    }\n    if (brank === 0) {\n      return adims;\n    }\n    const crank = Math.max(adims.length, bdims.length);\n    const cdims = new Array<number>(crank);\n\n    // calculate the last 2 dimension if it is MatMul\n    if (isMatMul) {\n      if (arank < 2 || brank < 2) {\n        return undefined;\n      }\n      const cShapeMatMul = MatMulUtil.calcMatMulShape(\n        [adims[arank - 2], adims[arank - 1]],\n        [bdims[brank - 2], bdims[brank - 1]],\n      );\n      if (cShapeMatMul === undefined) {\n        return undefined;\n      }\n      [cdims[crank - 2], cdims[crank - 1]] = cShapeMatMul;\n    }\n\n    for (let i = isMatMul ? 3 : 1; i <= crank; i++) {\n      const aLen = arank - i < 0 ? 1 : adims[arank - i];\n      const bLen = brank - i < 0 ? 1 : bdims[brank - i];\n\n      if (aLen !== bLen && aLen > 1 && bLen > 1) {\n        return undefined;\n      }\n      cdims[crank - i] = Math.max(aLen, bLen);\n    }\n\n    return cdims;\n  }\n\n  /**\n   * Given the indices of a broadcasted tensor, calculate the original indices\n   * @param broadcastedIndices The given indices of the broadcasted tensor.\n   * @param originalShape The original shape of the tensor before broadcas\n   * @returns The calculated indices that maps to the original tensor.\n   */\n  static index(broadcastedIndices: readonly number[], originalShape: readonly number[]): number[] {\n    // NOTE 1: we assume the parameter broadcastedIndices is valid. ie. it should have the same\n    // length as the broadcasted shape, and for each dimension the index should\n    // not be out of range.\n    const originalIndices = new Array(originalShape.length);\n    BroadcastUtil.fillIndex(broadcastedIndices, originalShape, originalIndices);\n    return originalIndices;\n  }\n\n  /**\n   * Given the indices of a broadcasted tensor, calculate the original indices\n   * @param broadcastedIndices The given indices of the broadcasted tensor.\n   * @param originalShape The original shape of the tensor before broadcast\n   * @param originalIndices The mapping of broadcastedIndices to the originalIndices (output parameter - will be\n   *     mutated).\n   */\n  static fillIndex(broadcastedIndices: readonly number[], originalShape: readonly number[], originalIndices: number[]) {\n    // NOTE 1: we assume the parameter broadcastedIndices is valid. ie. it should have the same length as the\n    // broadcasted shape, and for each dimension the index should not be out of range.\n    // NOTE 2: we assume the parameter originalIndices has the same length as the originalShape\n    const dimOffset = broadcastedIndices.length - originalShape.length;\n    for (let i = 0; i < originalShape.length; i++) {\n      originalIndices[i] = broadcastedIndices[dimOffset + i] % originalShape[i];\n    }\n  }\n\n  /**\n   * Perform the broadcasting operation on the specific operator\n   * @param a The input tensor A\n   * @param b The input tensor B\n   * @param op The operator lambda function\n   * @param inplace Whether to write the result back to A.\n   * @returns The result tensor, or undefined if input not broadcastable.\n   */\n  static calc(\n    a: Tensor,\n    b: Tensor,\n    op: (a: string | number, b: string | number) => string | number,\n    inplace: boolean,\n    resultType?: Tensor.DataType,\n  ): Tensor | undefined {\n    const outputShape = BroadcastUtil.calcShape(a.dims, b.dims);\n\n    if (outputShape) {\n      if (inplace && !ShapeUtil.areEqual(outputShape, a.dims)) {\n        // B is not broadcastable to A, failed to calculate inplace.\n        return undefined;\n      }\n\n      const size = ShapeUtil.size(outputShape);\n      const c = inplace ? a : new Tensor(outputShape, resultType || a.type);\n\n      // both inputs are scalars\n      if (outputShape.length === 0) {\n        c.set([], op(a.get([]) as number, b.get([]) as number));\n      }\n\n      // atleast one input is a non-scalar\n      else {\n        const outputIndices = new Array<number>(outputShape.length);\n        const originalIndicesA = new Array(a.dims.length);\n        const originalIndicesB = new Array(b.dims.length);\n        let valA: string | number = 0;\n        let valB: string | number = 0;\n        let isAScalar = false;\n        let isBScalar = false;\n        if (a.dims.length === 0) {\n          valA = a.get([]) as number;\n          isAScalar = true;\n        }\n        if (b.dims.length === 0) {\n          valB = b.get([]) as number;\n          isBScalar = true;\n        }\n        let rest: number;\n        for (let i = 0; i < size; i++) {\n          // traversal indices\n          rest = i;\n          for (let j = outputShape.length - 1; j >= 0; j--) {\n            outputIndices[j] = rest % outputShape[j];\n            rest = Math.floor(rest / outputShape[j]);\n          }\n\n          if (!isAScalar) {\n            // map outputIndices (which is actually broadcasted) to the originalIndices\n            BroadcastUtil.fillIndex(outputIndices, a.dims, originalIndicesA);\n            valA = a.get(originalIndicesA) as number;\n          }\n          if (!isBScalar) {\n            BroadcastUtil.fillIndex(outputIndices, b.dims, originalIndicesB);\n            valB = b.get(originalIndicesB) as number;\n          }\n\n          c.set(outputIndices, op(valA, valB));\n        }\n      }\n\n      return c;\n    }\n\n    return undefined;\n  }\n\n  /**\n   * Determine if a shape is unidirectional broadcastable to another shape\n   * @param shape The input shape\n   * @param finalShape The desired shape after broadcasting\n   */\n  static isValidBroadcast(shape: readonly number[], finalShape: readonly number[]): boolean {\n    // align shape to the right\n    const inputRank = shape.length;\n    const finalRank = finalShape.length;\n    if (inputRank > finalRank) {\n      return false;\n    }\n    for (let i = 1; i <= inputRank; i++) {\n      if (shape[inputRank - i] !== 1 && shape[inputRank - i] !== finalShape[finalRank - i]) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  /**\n   * Determine the broadcasted dims in input shape based on the given output shape.\n   * Note that this function only returns the broadcasted dims.\n   * @param inputShape The input shape\n   * @param outputShape The output shape\n   * @returns The broadcasted dims in input shape.\n   */\n  static getBroadcastDims(inputShape: readonly number[], outputShape: readonly number[]): number[] {\n    const inRank = inputShape.length;\n    const dims: number[] = [];\n    for (let i = 0; i < inRank; i++) {\n      const dim = inRank - 1 - i;\n      const a = inputShape[dim] || 1;\n      const b = outputShape[outputShape.length - 1 - i] || 1;\n      if (b > 1 && a === 1) {\n        dims.unshift(dim);\n      }\n    }\n    return dims;\n  }\n}\n\n// copy array helper\n// mimics memcpy as much as possible\nexport function arrayCopyHelper(\n  target: number[] | Tensor.NumberType,\n  source: number[] | Tensor.NumberType,\n  targetIndex: number,\n  sourceIndex: number,\n  blockSize: number,\n) {\n  if (sourceIndex < 0 || sourceIndex >= source.length) {\n    throw new Error('sourceIndex out of bounds');\n  }\n  if (targetIndex < 0 || targetIndex >= target.length) {\n    throw new Error('targetIndex out of bounds');\n  }\n  if (sourceIndex + blockSize > source.length) {\n    throw new Error('source indices to be copied are outside bounds');\n  }\n  if (targetIndex + blockSize > target.length) {\n    throw new Error('target array is too small to hold result');\n  }\n\n  for (let offset = 0; offset < blockSize; offset++) {\n    target[targetIndex + offset] = source[sourceIndex + offset];\n  }\n}\n\nexport class GemmUtil {\n  // will make sure input shapes are compatible for this op\n  // and return back the shape of the output in the form of a tuple\n  // will throw exception if the input shapes are not compatible\n  static getShapeOfGemmResult(\n    leftShape: readonly number[],\n    transLeft: boolean,\n    rightShape: readonly number[],\n    transRight: boolean,\n    biasShape?: readonly number[],\n  ): readonly number[] {\n    if (leftShape.length !== 2 || rightShape.length !== 2) {\n      throw new Error('shape need to be of size 2');\n    }\n\n    let M: number;\n    let K: number;\n    let N: number;\n\n    if (transLeft) {\n      M = leftShape[1];\n      K = leftShape[0];\n    } else {\n      M = leftShape[0];\n      K = leftShape[1];\n    }\n\n    let kDim = -1;\n\n    if (transRight) {\n      N = rightShape[0];\n      kDim = 1;\n    } else {\n      N = rightShape[1];\n      kDim = 0;\n    }\n\n    if (rightShape[kDim] !== K) {\n      throw new Error('dimension mismatch');\n    }\n\n    if (M <= 0 || N <= 0 || K <= 0) {\n      throw new Error('invalid shape specified');\n    }\n\n    if (biasShape && !BroadcastUtil.isValidBroadcast(biasShape, [M, N])) {\n      throw new Error('gemm: invalid bias shape for broadcast');\n    }\n\n    return [M, N, K];\n  }\n}\n\nexport class ProtoUtil {\n  static tensorDataTypeFromProto(typeProto: onnx.TensorProto.DataType | ortFbs.TensorDataType): Tensor.DataType {\n    switch (typeProto) {\n      case onnx.TensorProto.DataType.INT8:\n        return 'int8';\n      case onnx.TensorProto.DataType.UINT8:\n        return 'uint8';\n      case onnx.TensorProto.DataType.BOOL:\n        return 'bool';\n      case onnx.TensorProto.DataType.INT16:\n        return 'int16';\n      case onnx.TensorProto.DataType.UINT16:\n        return 'uint16';\n      case onnx.TensorProto.DataType.INT32:\n        return 'int32';\n      case onnx.TensorProto.DataType.UINT32:\n        return 'uint32';\n      case onnx.TensorProto.DataType.FLOAT:\n        return 'float32';\n      case onnx.TensorProto.DataType.DOUBLE:\n        return 'float64';\n      case onnx.TensorProto.DataType.STRING:\n        return 'string';\n\n      // For INT64/UINT64, reduce their value to 32-bits.\n      // Should throw exception when overflow\n      case onnx.TensorProto.DataType.INT64:\n        return 'int32';\n      case onnx.TensorProto.DataType.UINT64:\n        return 'uint32';\n\n      default:\n        throw new Error(`unsupported data type: ${onnx.TensorProto.DataType[typeProto]}`);\n    }\n  }\n\n  static tensorDataTypeStringToEnum(type: string): onnx.TensorProto.DataType {\n    switch (type) {\n      case 'int8':\n        return onnx.TensorProto.DataType.INT8;\n      case 'uint8':\n        return onnx.TensorProto.DataType.UINT8;\n      case 'bool':\n        return onnx.TensorProto.DataType.BOOL;\n      case 'int16':\n        return onnx.TensorProto.DataType.INT16;\n      case 'uint16':\n        return onnx.TensorProto.DataType.UINT16;\n      case 'int32':\n        return onnx.TensorProto.DataType.INT32;\n      case 'uint32':\n        return onnx.TensorProto.DataType.UINT32;\n      case 'float32':\n        return onnx.TensorProto.DataType.FLOAT;\n      case 'float64':\n        return onnx.TensorProto.DataType.DOUBLE;\n      case 'string':\n        return onnx.TensorProto.DataType.STRING;\n      case 'int64':\n        return onnx.TensorProto.DataType.INT64;\n      case 'uint64':\n        return onnx.TensorProto.DataType.UINT64;\n\n      default:\n        throw new Error(`unsupported data type: ${type}`);\n    }\n  }\n\n  static tensorDimsFromProto(dims: Array<number | Long>): number[] {\n    // get rid of Long type for dims\n    return dims.map((d) => (Long.isLong(d) ? d.toNumber() : d));\n  }\n\n  static tensorValueTypeFromProto(valueType: onnx.TypeProto.ITensor): Graph.ValueType {\n    return {\n      tensorType: ProtoUtil.tensorDataTypeFromProto(valueType.elemType!),\n      shape: { dims: ProtoUtil.tensorDimsFromProto(valueType.shape!.dim!.map((d) => d.dimValue!)) },\n    };\n  }\n\n  static tensorDimsFromORTFormat(tensor: ortFbs.Tensor) {\n    const dims = [];\n    for (let i = 0; i < tensor.dimsLength(); i++) {\n      dims.push(LongUtil.longToNumber(tensor.dims(i)!));\n    }\n    return dims;\n  }\n\n  static tensorAttributesFromORTFormat(node: ortFbs.Node) {\n    const attributes = [];\n    for (let i = 0; i < node.attributesLength(); i++) {\n      attributes.push(node.attributes(i)!);\n    }\n    return attributes;\n  }\n}\n\nexport class LongUtil {\n  // This function is called to get a number from long type of data for attribute, dim, and ir version,\n  // which values are signed integers.\n  // To make it more generic, add an optional parameter to convert to a unsigned number.\n  static longToNumber(n: Long | bigint | number) {\n    if (Long.isLong(n)) {\n      return n.toNumber();\n    } else if (typeof n === 'bigint') {\n      return Number(n);\n    }\n    return n;\n  }\n  static isLong(n: unknown) {\n    return Long.isLong(n) || typeof n === 'bigint';\n  }\n}\n\nexport class ShapeUtil {\n  static size(dims: readonly number[]): number {\n    return ShapeUtil.getSizeFromDimensionRange(dims, 0, dims.length);\n  }\n\n  // `axis` inclusive\n  static sizeFromDimension(dims: readonly number[], axis: number): number {\n    if (axis < 0 || axis > dims.length) {\n      throw new Error(`invalid dimension of ${axis} for sizeFromDimension as Tensor has ${dims.length} dimensions.`);\n    }\n    return ShapeUtil.getSizeFromDimensionRange(dims, axis, dims.length);\n  }\n\n  // `axis` exclusive\n  static sizeToDimension(dims: readonly number[], axis: number): number {\n    if (axis < 0 || axis > dims.length) {\n      throw new Error(`invalid dimension of ${axis} for sizeToDimension as Tensor has ${dims.length} dimensions.`);\n    }\n    return ShapeUtil.getSizeFromDimensionRange(dims, 0, axis);\n  }\n\n  static getSizeFromDimensionRange(dims: readonly number[], start: number, end: number): number {\n    let size = 1;\n    for (let i = start; i < end; i++) {\n      // safety check as this method is called by multiple other methods requiring size.\n      // size cannot be 0 or negative.\n      if (dims[i] <= 0) {\n        throw new Error(\n          // eslint-disable-next-line max-len\n          'cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.',\n        );\n      }\n      size *= dims[i];\n    }\n    return size;\n  }\n\n  static computeStrides(dims: readonly number[]): readonly number[] {\n    const rank = dims.length;\n    if (rank === 0) {\n      return [];\n    } else if (rank === 1) {\n      return [1];\n    }\n    const strides = new Array(rank);\n    strides[rank - 1] = 1;\n    strides[rank - 2] = dims[rank - 1];\n    for (let i = rank - 3; i >= 0; --i) {\n      strides[i] = strides[i + 1] * dims[i + 1];\n    }\n    return strides;\n  }\n\n  static transpose(dims: readonly number[]): readonly number[] {\n    const copy = dims.slice();\n    return copy.reverse();\n  }\n\n  static indicesToOffset(indices: readonly number[], strides: readonly number[], axis?: number): number {\n    if (axis === undefined) {\n      axis = indices.length;\n    }\n    let offset = 0;\n    for (let i = 0; i < axis; ++i) {\n      offset += strides[i] * indices[i];\n    }\n    return offset;\n  }\n\n  static offsetToIndices(offset: number, strides: readonly number[]): readonly number[] {\n    const rank = strides.length;\n    if (rank === 0) {\n      return [];\n    } else if (rank === 1) {\n      return [offset * strides[0]];\n    }\n    const indices: number[] = new Array(strides.length);\n    for (let i = 0; i < indices.length - 1; ++i) {\n      indices[i] = Math.floor(offset / strides[i]);\n      offset -= indices[i] * strides[i];\n    }\n    indices[indices.length - 1] = offset;\n    return indices;\n  }\n\n  /**\n   * normailze axis of range [-r, r) into [0, r).\n   */\n  static normalizeAxis(axis: number, tensorRank: number): number {\n    if (axis < -tensorRank && axis >= tensorRank) {\n      throw new Error('unsupported axis for this operation.');\n    }\n    return axis < 0 ? axis + tensorRank : axis;\n  }\n\n  static normalizeAxes(axes: readonly number[], tensorRank: number): number[] {\n    return axes.map((x) => this.normalizeAxis(x, tensorRank));\n  }\n\n  // Increment an index into a tensor (in lexicographic\n  // ordering), wrapping around the specified upper_bound.\n  /**\n   * Increment an index into a tensor (in lexicographic ordering), wrapping around the specified upper_bound.\n   * @param index Given index to increment (Will be mutated)\n   * @param dims The dimensions of the tensor for which the given index corresponds to\n   * @param axisToIncrementOn The 1-indexed axis to increment on. If undefined, axisToIncrementOn == rank\n   */\n  static incrementIndex(index: number[], dims: readonly number[], axisToIncrementOn?: number) {\n    if (dims.length === 0 || index.length === 0) {\n      throw new Error('Index incrementing unsupported for scalar Tensor');\n    }\n    if (axisToIncrementOn === undefined) {\n      axisToIncrementOn = dims.length;\n    } else {\n      if (axisToIncrementOn <= 0 || axisToIncrementOn > dims.length) {\n        throw new Error('Incorrect axis to increment on');\n      }\n    }\n\n    for (let k = axisToIncrementOn - 1; k >= 0; --k) {\n      index[k]++;\n      if (index[k] < dims[k]) {\n        break;\n      }\n      index[k] = 0;\n    }\n  }\n\n  /**\n   * Produces a new dimensions array based on the values in the 'originalDimensions' and 'shape' array\n   * Used in Reshape\n   * @param originalDims Original Shape array\n   * @param shapeHints array containing values to compute the new dimensions\n   * For example:\n   * originalDims = [2,2] and shapeHints = [0,-1] will return [2,2]\n   * originalDims = [2,2] and shapeHints = [4] will return [4]\n   * originalDims = [2,2] and shapeHints = [5] will throw an exception\n   * https://github.com/onnx/onnx/blob/main/docs/Operators.md#Reshape\n   */\n\n  static calculateReshapedDims(originalDims: readonly number[], shapeHints: ArrayLike<number>): number[] {\n    // reshape to a Scalar Tensor\n    if (shapeHints.length === 0) {\n      if (originalDims.length === 0 || ShapeUtil.size(originalDims) === 1) {\n        return [];\n      } else {\n        throw new Error('cannot reshape to a scalar Tensor');\n      }\n    }\n\n    const nDims = shapeHints.length;\n    const reshapedDims = new Array<number>(nDims);\n    let unknownDimension = -1;\n    let newTensorSize = 1;\n    for (let i = 0; i < nDims; i++) {\n      if (shapeHints[i] < -1) {\n        throw new Error('a dimension in shape hints cannot be less than -1');\n      }\n      if (shapeHints[i] === -1) {\n        if (unknownDimension !== -1) {\n          throw new Error('at most one dimension in shape hints can be -1');\n        }\n        unknownDimension = i;\n      } else {\n        if (shapeHints[i] === 0) {\n          if (i >= originalDims.length) {\n            throw new Error('the dimension with value zero exceeds the dimension size of the input tensor');\n          }\n          reshapedDims[i] = originalDims[i];\n        } else {\n          reshapedDims[i] = shapeHints[i];\n        }\n        newTensorSize *= reshapedDims[i];\n      }\n    }\n\n    const oldTensorSize = ShapeUtil.size(originalDims);\n    if (unknownDimension !== -1) {\n      if (oldTensorSize % newTensorSize !== 0) {\n        throw new Error(\n          `the input tensor cannot be reshaped to the requested shape. Input shape: [${\n            originalDims\n          }] Output shape: [${shapeHints}]`,\n        );\n      }\n      reshapedDims[unknownDimension] = oldTensorSize / newTensorSize;\n    }\n    // validate sizes from originalDims and reshapedDims match\n    else {\n      if (newTensorSize !== oldTensorSize) {\n        throw new Error(\"reshapedDims and originalDims don't have matching sizes\");\n      }\n    }\n    return reshapedDims;\n  }\n\n  /**\n   * Sorts a given array based on the indices in the Perm array\n   * Used in Transpose\n   * @param a Array to be sorted such as dims or strides\n   * @param perm Perm given; if null a will be reversed\n   */\n  static sortBasedOnPerm(a: readonly number[], perm?: readonly number[]): readonly number[] {\n    if (perm) {\n      return perm.map((v) => a[v]);\n    } else {\n      return a.slice().reverse();\n    }\n  }\n\n  /**\n   * Pads a given shape according to the padding values\n   * @param dims shape of the Tensor to be padded\n   * @param pad pad values\n   */\n  static padShape(dims: readonly number[], pad: readonly number[]): readonly number[] {\n    const rank = dims.length;\n    return dims.map((v, i) => v + pad[i] + pad[i + rank]);\n  }\n\n  /**\n   * Determines if the two shapes are identical\n   * @param shape1\n   * @param shape2\n   */\n  static areEqual(shape1: readonly number[], shape2: readonly number[]): boolean {\n    if (shape1.length !== shape2.length) {\n      return false;\n    }\n    return shape1.every((v, i) => v === shape2[i]);\n  }\n\n  /**\n   * Validates if the given `dims` or `shape` is valid in ONNX.js context and returns data size\n   * @param dims - input `dims` that needs to be checked\n   */\n  static validateDimsAndCalcSize(dims: readonly number[]): number {\n    if (dims.length > 6) {\n      throw new TypeError('Only rank 0 to 6 is supported for tensor shape.');\n    }\n    let size = 1;\n    for (const n of dims) {\n      if (!Number.isInteger(n)) {\n        throw new TypeError(`Invalid shape: ${n} is not an integer`);\n      }\n      if (n < 0 || n > 2147483647) {\n        throw new TypeError(`Invalid shape: length ${n} is not allowed`);\n      }\n      size *= n;\n    }\n    return size;\n  }\n\n  /**\n   * Determines the shape of output tensor y = flatten(x, axis)\n   * @param dims - shape of input tensor\n   * @param axis - flatten axis, in the range [-r, r]\n   */\n  static flattenShape(dims: readonly number[], axis: number): readonly number[] {\n    if (axis < 0) {\n      axis += dims.length;\n    }\n    const total = dims.reduce((x, y) => x * y, 1);\n    const right = dims.slice(axis).reduce((x, y) => x * y, 1);\n    const outputDims = [total / right, right];\n\n    return outputDims;\n  }\n\n  /**\n   * Determines the shape of output tensor y = squeeze(x, axes)\n   * @param dims - shape of input tensor\n   * @param axes - squeeze axes\n   */\n  static squeezeShape(dims: readonly number[], axes: readonly number[]): readonly number[] {\n    const outputDims = new Array<number>();\n\n    // sanity check\n    axes = ShapeUtil.normalizeAxes(axes, dims.length);\n\n    for (let i = 0; i < dims.length; i++) {\n      const inSqueezeList = axes.indexOf(i) >= 0;\n      if (inSqueezeList && dims[i] !== 1) {\n        throw new Error('squeeze an axis of size different than 1');\n      }\n\n      if ((axes.length === 0 && dims[i] > 1) || (axes.length > 0 && !inSqueezeList)) {\n        outputDims.push(dims[i]);\n      }\n    }\n\n    return outputDims;\n  }\n\n  /**\n   * Determines the shape of output tensor y = unsqueeze(x, axes)\n   * @param dims - shape of input tensor\n   * @param axes - unsqueeze axes\n   */\n  static unsqueezeShape(dims: readonly number[], axes: readonly number[]): readonly number[] {\n    const outputDims = new Array<number>(dims.length + axes.length);\n\n    // initialize the array elements to 0\n    outputDims.fill(0);\n\n    // set all axes indices to 1 in outputDims and check for duplicates\n    for (let i = 0; i < axes.length; i++) {\n      const axis = ShapeUtil.normalizeAxis(axes[i], outputDims.length);\n      if (axis >= outputDims.length) {\n        throw new Error(\"'axes' has an out of range axis\");\n      }\n      if (outputDims[axis] !== 0) {\n        throw new Error(\"'axes' has a duplicate axis\");\n      }\n\n      outputDims[axis] = 1;\n    }\n\n    // fill in the zero entries of outputDims with the input tensor's shape\n    let inputDimsIterator = 0;\n    for (let i = 0; i < outputDims.length; i++) {\n      if (outputDims[i] === 0) {\n        outputDims[i] = dims[inputDimsIterator++];\n      }\n    }\n\n    // sanity check assertion. 'inputDimsIterator'\n    // should be equal to the length of 'dims'\n    if (inputDimsIterator !== dims.length) {\n      throw new Error('the unsqueezed dimension could not be established');\n    }\n\n    return outputDims;\n  }\n}\n\n// bunch of helper methods that do a variety of math operations\nexport class MathUtil {\n  // y = (x*x) + y\n  static sqr(\n    target: number[] | Tensor.NumberType,\n    source: number[] | Tensor.NumberType,\n    targetIndex: number,\n    sourceIndex: number,\n    blockSize: number,\n  ) {\n    if (sourceIndex < 0 || sourceIndex >= source.length) {\n      throw new Error('sourceIndex out of bounds');\n    }\n    if (targetIndex < 0 || targetIndex >= target.length) {\n      throw new Error('targetIndex out of bounds');\n    }\n    if (sourceIndex + blockSize > source.length) {\n      throw new Error('source indices to be copied are outside bounds');\n    }\n    if (targetIndex + blockSize > target.length) {\n      throw new Error('target array is too small to hold result');\n    }\n\n    for (let offset = 0; offset < blockSize; offset++) {\n      target[targetIndex + offset] += Math.pow(source[sourceIndex + offset], 2);\n    }\n  }\n\n  // y = ax + y\n  static axpy(\n    target: number[] | Tensor.NumberType,\n    source: number[] | Tensor.NumberType,\n    targetIndex: number,\n    sourceIndex: number,\n    blockSize: number,\n    alpha: number,\n  ) {\n    if (sourceIndex < 0 || sourceIndex >= source.length) {\n      throw new Error('sourceIndex out of bounds');\n    }\n    if (targetIndex < 0 || targetIndex >= target.length) {\n      throw new Error('targetIndex out of bounds');\n    }\n    if (sourceIndex + blockSize > source.length) {\n      throw new Error('source indices to be copied are outside bounds');\n    }\n    if (targetIndex + blockSize > target.length) {\n      throw new Error('target array is too small to hold result');\n    }\n\n    for (let offset = 0; offset < blockSize; offset++) {\n      target[targetIndex + offset] += alpha * source[sourceIndex + offset];\n    }\n  }\n\n  // y = pow(x, b)\n  static powx(\n    target: number[] | Tensor.NumberType,\n    source: number[] | Tensor.NumberType,\n    targetIndex: number,\n    sourceIndex: number,\n    blockSize: number,\n    b: number,\n  ) {\n    if (sourceIndex < 0 || sourceIndex >= source.length) {\n      throw new Error('sourceIndex out of bounds');\n    }\n    if (targetIndex < 0 || targetIndex >= target.length) {\n      throw new Error('targetIndex out of bounds');\n    }\n    if (sourceIndex + blockSize > source.length) {\n      throw new Error('source indices to be copied are outside bounds');\n    }\n    if (targetIndex + blockSize > target.length) {\n      throw new Error('target array is too small to hold result');\n    }\n\n    for (let offset = 0; offset < blockSize; offset++) {\n      target[targetIndex + offset] = Math.pow(source[sourceIndex + offset], b);\n    }\n  }\n\n  // y = x * y\n  static mul(\n    target: number[] | Tensor.NumberType,\n    source: number[] | Tensor.NumberType,\n    targetIndex: number,\n    sourceIndex: number,\n    blockSize: number,\n  ) {\n    if (sourceIndex < 0 || sourceIndex >= source.length) {\n      throw new Error('sourceIndex out of bounds');\n    }\n    if (targetIndex < 0 || targetIndex >= target.length) {\n      throw new Error('targetIndex out of bounds');\n    }\n    if (sourceIndex + blockSize > source.length) {\n      throw new Error('source indices to be copied are outside bounds');\n    }\n    if (targetIndex + blockSize > target.length) {\n      throw new Error('target array is too small to hold result');\n    }\n\n    for (let offset = 0; offset < blockSize; offset++) {\n      target[targetIndex + offset] = source[sourceIndex + offset] * target[targetIndex + offset];\n    }\n  }\n}\n\nexport class SplitUtil {\n  /**\n   * Calculates new Shapes from existing one and the splits given along the axis provides\n   * @param dims Shape of the Tensor to be splitted into two or more Shapes\n   * @param axis The dimension along which the Tensor will be split\n   * @param splits Offsets for the start of each split\n   */\n  static splitShape(\n    dims: readonly number[],\n    axis: number,\n    split: number[],\n    numOutputs?: number,\n  ): [number[][], number[]] {\n    if (split.length === 0) {\n      if (!numOutputs) {\n        throw new Error(\"need to know number of outputs when the 'split' attribute is not specified\");\n      }\n      SplitUtil.determineSplit(dims[axis], numOutputs, split);\n    }\n\n    const shapes: number[][] = [];\n    const offsets = [0];\n    for (let i = 0; i < split.length; ++i) {\n      if (i !== 0) {\n        offsets.push(offsets[i - 1] + split[i - 1]);\n      }\n      const shape = dims.slice();\n      shape[axis] = split[i];\n      shapes.push(shape);\n    }\n    return [shapes, offsets];\n  }\n\n  static determineSplit(numElementsAlongAxis: number, numOutputs: number, split: number[]) {\n    // If 'split' is not specified by the user, we need to partition the number of elements equally among the outputs\n    if (numElementsAlongAxis % numOutputs !== 0) {\n      throw new Error('cannot split tensor to equal sized parts');\n    }\n    for (let i = 0; i < numOutputs; ++i) {\n      split.push(numElementsAlongAxis / numOutputs);\n    }\n  }\n}\n\nexport class ReduceUtil {\n  /**\n   * Perform reduce operations on the specific operator\n   * @param a Input tensor data\n   * @param axes The dimensions along which the Tensor will be reduced\n   * @param keepdims If set to true, the axes which are reduced are left in the\n   *    result as dimensions with size one.\n   * @param op1 The operation to be performed on each element in the tensor\n   * @param op2 The operation to be performed between elements in the tensor\n   */\n  static calcReduce(\n    a: Tensor,\n    axes: number[],\n    keepdims: boolean,\n    op1: (b: number) => number,\n    op2: (a: number, b: number) => number,\n  ): Tensor {\n    const dims = a.dims.slice(0);\n    // if axes is not set, perform reduce on all axes\n    if (axes.length === 0) {\n      dims.forEach((_d, ind) => axes.push(ind));\n    }\n    // get a temporary broadcastable output shape\n    const outputDims = ReduceUtil.calcReduceShape(dims, axes, true);\n\n    // loop through the output and calculate result one by one\n    const size = ShapeUtil.size(outputDims);\n    const y = new Tensor(outputDims, a.type);\n    const strides = ShapeUtil.computeStrides(outputDims);\n    const inputStrides = ShapeUtil.computeStrides(dims);\n    const indicesY = new Array(dims.length);\n    for (let i = 0; i < size; i++) {\n      const indices = ShapeUtil.offsetToIndices(i, strides);\n      // map index\n      BroadcastUtil.fillIndex(indices, dims, indicesY);\n      y.set(\n        indices,\n        ReduceUtil.calcReduceByAxis(\n          a.numberData,\n          axes,\n          dims,\n          0,\n          ShapeUtil.indicesToOffset(indicesY, inputStrides),\n          op1,\n          op2,\n        ),\n      );\n    }\n\n    if (keepdims) {\n      return y;\n    } else {\n      // keepdims == 0, calculate the expected shape\n      return new Tensor(\n        ReduceUtil.calcReduceShape(dims, axes, keepdims),\n        y.type,\n        undefined,\n        undefined,\n        y.data,\n        y.dataId,\n      );\n    }\n  }\n\n  /**\n   * Perform reduce operations on the specific operator on specific axes\n   * @param a Input tensor data\n   * @param axes The dimensions along which the Tensor will be reduced\n   * @param dims The input dimension.\n   * @param curAxisInd Index in axes specifying the current dimension along\n   *      which the tensor will be reduced\n   * @param pos The current index of element to perform operation\n   * @param op1 The operation to be performed on each element in the tensor\n   * @param op2 The operation to be performed between elements in the tensor\n   */\n  static calcReduceByAxis(\n    input: Tensor.NumberType,\n    axes: number[],\n    dims: number[],\n    curAxisInd: number,\n    pos: number,\n    op1: (b: number) => number,\n    op2: (a: number, b: number) => number,\n  ): number {\n    let res = 0;\n    if (curAxisInd >= axes.length) {\n      return op1(input[pos]);\n    }\n    const axis = axes[curAxisInd];\n    const step = axis >= dims.length ? 1 : ShapeUtil.size(dims.slice(axis + 1));\n    for (let i = 0; i < dims[axis]; i++) {\n      res =\n        i === 0\n          ? ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2)\n          : op2(res, ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2));\n      pos += step;\n    }\n    return res;\n  }\n\n  /**\n   * Calculate the expected shape of a reduce operation\n   * @param dims The input tensor dimension\n   * @param axes The dimensions along which the Tensor will be reduced\n   * @param keepdims If set to true, the axes which are reduced are left in the\n   *    result as dimensions with size one.\n   */\n  static calcReduceShape(dims: readonly number[], axes: readonly number[], keepDims: boolean): number[] {\n    const outputDims = dims.slice();\n    for (let i = 0; i < axes.length; i++) {\n      if (keepDims) {\n        outputDims[axes[i]] = 1;\n      } else {\n        outputDims[axes[i]] = 0;\n      }\n    }\n    return outputDims.filter((dim) => dim !== 0);\n  }\n}\n\nexport class PoolConvUtil {\n  /**\n   * Adjust the kernel, strides, pads to correct rank. Set to default value if not present\n   * @param isGlobalOperator If true, perform global pooling.\n   * @param inputDims The input tensor dimension.\n   * @param kernelShape The size of the kernel along each axis.\n   * @param strides Stride along each axis.\n   * @param dilations Dilation along each axis.\n   * @param pads Padding for the beginning and ending along each axis.\n   */\n  static adjustPoolAttributes(\n    isGlobalOperator: boolean,\n    inputDims: readonly number[],\n    kernelShape: number[],\n    strides: number[],\n    dilations: number[],\n    pads: number[],\n  ) {\n    if (!isGlobalOperator && kernelShape.length !== inputDims.length - 2) {\n      throw new Error('length of specified kernel shapes should be 2 less than length of input dimensions');\n    }\n\n    if (isGlobalOperator) {\n      // adjust kernel shape to cover the input dims\n      for (let dim = 0; dim < inputDims.length - 2; dim++) {\n        if (dim >= kernelShape.length) {\n          kernelShape.push(inputDims[dim + 2]);\n        } else {\n          kernelShape[dim] = inputDims[dim + 2];\n        }\n      }\n    }\n\n    // adjust strides length to match kernel shape length\n    for (let dim = 0; dim < kernelShape.length; dim++) {\n      if (dim < strides.length) {\n        if (strides[dim] < 0) {\n          throw new Error('strides should be greater than or equal to 1');\n        }\n      } else {\n        strides.push(1);\n      }\n    }\n\n    // adjust dilation value\n    for (let dim = 0; dim < kernelShape.length; dim++) {\n      if (dim < dilations.length) {\n        if (dilations[dim] < 0) {\n          throw new Error('dilations should be greater than or equal to 1');\n        }\n      } else {\n        dilations.push(1);\n      }\n    }\n\n    // adjust pads length to match 2 * kernel shape length\n    for (let dim = 0; dim < kernelShape.length * 2; dim++) {\n      if (dim < pads.length) {\n        if (pads[dim] < 0) {\n          throw new Error('pad should be greater than or equal to 1');\n        }\n      } else {\n        pads.push(0);\n      }\n    }\n\n    // sanity checks for values in kernel shapes and pads\n    for (let dim = 0; dim < kernelShape.length; dim++) {\n      if (kernelShape[dim] <= 0) {\n        throw new Error('kernel shapes need to be greater than 0');\n      }\n\n      if (pads[dim] >= kernelShape[dim] || pads[dim + kernelShape.length] >= kernelShape[dim]) {\n        throw new Error('pads should be smaller than kernel');\n      }\n    }\n  }\n\n  // adjust pad values based on 'autoPad' attribute\n  static adjustPadsBasedOnAutoPad(\n    inputDims: readonly number[],\n    strides: readonly number[],\n    dilations: readonly number[],\n    kernelShape: readonly number[],\n    pads: number[],\n    autoPad?: string,\n  ) {\n    if (!autoPad) {\n      return;\n    }\n\n    if (pads.length !== 2 * (inputDims.length - 2)) {\n      throw new Error('length of pads should be twice the length of data dimensions');\n    }\n\n    if (strides.length !== inputDims.length - 2) {\n      throw new Error('length of strides should be the length of data dimensions');\n    }\n\n    if (kernelShape.length !== inputDims.length - 2) {\n      throw new Error('length of kernel shapes should be the length of data dimensions');\n    }\n\n    for (let dim = 0; dim < inputDims.length - 2; dim++) {\n      PoolConvUtil.adjustPadAndReturnShape(\n        inputDims[dim + 2],\n        strides[dim],\n        dilations[dim],\n        kernelShape[dim],\n        pads,\n        dim,\n        dim + inputDims.length - 2,\n        autoPad,\n      );\n    }\n  }\n\n  /**\n   * Calculate the output shape for Pool ops based on input attributes. (Should be used only for Pool ops)\n   * @param isGlobalOperator If true, perform global pooling.\n   * @param inputDims The input tensor dimension. (inputs[0].dims)\n   * @param strides Stride along each axis.\n   * @param dilations Dilation along each axis.\n   * @param kernelShape The size of the kernel along each axis.\n   * @param pads Padding for the beginning and ending along each axis.\n   * @param autoPad DEPRECATED attribute supported for legacy models. Specifies how to implicitly calculate pads in each\n   *     dimension. Can take values NOTSET, SAME_UPPER, SAME_LOWER, or VALID.\n   */\n  static computePoolOutputShape(\n    isGlobalOperator: boolean,\n    inputDims: readonly number[],\n    strides: number[],\n    dilations: number[],\n    kernelShape: number[],\n    pads: number[],\n    autoPad?: string,\n  ): number[] {\n    if (inputDims.length <= 0) {\n      throw new Error('input shape must be of size greater than 0');\n    }\n\n    // Add batch size and number of channels of output\n    const outputDims = [inputDims[0], inputDims[1]];\n\n    PoolConvUtil.computeShapeHelper(\n      isGlobalOperator,\n      inputDims,\n      outputDims,\n      strides,\n      dilations,\n      kernelShape,\n      pads,\n      autoPad,\n    );\n    return outputDims;\n  }\n\n  /**\n   * Calculate the output shape for Conv op based on input attributes. (Should be used only for Conv op)\n   * @param inputDims The input tensor dimension. (inputs[0].dims)\n   * @param filterDims The filter tensor dimension. (inputs[1].dims)\n   * @param strides Stride along each axis.\n   * @param kernelShape The size of the kernel along each axis.\n   * @param pads Padding for the beginning and ending along each axis.\n   * @param autoPad DEPRECATED attribute supported for legacy models. Specifies how to implicitly calculate pads in each\n   *     dimension. Can take values NOTSET, SAME_UPPER, SAME_LOWER, or VALID.\n   */\n  static computeConvOutputShape(\n    inputDims: readonly number[],\n    filterDims: readonly number[],\n    strides: number[],\n    dilations: number[],\n    kernelShape: number[],\n    pads: number[],\n    autoPad?: string,\n  ): number[] {\n    if (inputDims.length <= 0 || filterDims.length <= 0) {\n      throw new Error('invalid input tensor dims or invalid filter tensor dims');\n    }\n\n    // Add batch size and number of channels of output\n    const outputDims = [inputDims[0], filterDims[0]];\n\n    PoolConvUtil.computeShapeHelper(false, inputDims, outputDims, strides, dilations, kernelShape, pads, autoPad);\n    return outputDims;\n  }\n\n  // will compute output shapes for data dimensions ONLY (i.e.) no batch size and channels\n  // called by computePoolOutputShape() and computeConvOutputShape()\n  // adjust pads based on 'autoPad' attribute prior to shape computation\n  private static computeShapeHelper(\n    isGlobalOperator: boolean,\n    inputDims: readonly number[],\n    outputDims: number[],\n    strides: readonly number[],\n    dilations: readonly number[],\n    kernelShape: readonly number[],\n    pads: number[],\n    autoPad?: string,\n  ) {\n    if (isGlobalOperator) {\n      for (let dim = 0; dim < inputDims.length - 2; dim++) {\n        outputDims.push(1);\n      }\n    } else {\n      for (let dim = 0; dim < inputDims.length - 2; dim++) {\n        outputDims.push(\n          PoolConvUtil.adjustPadAndReturnShape(\n            inputDims[dim + 2],\n            strides[dim],\n            dilations[dim],\n            kernelShape[dim],\n            pads,\n            dim,\n            dim + inputDims.length - 2,\n            autoPad,\n          ),\n        );\n      }\n    }\n  }\n\n  // helper for computeShapeHelper() and adjustPadsBasedOnAutoPad()\n  // adjusts pad value for given 'autoPad' string and computes output shape along a particular dimension\n  private static adjustPadAndReturnShape(\n    inSize: number,\n    stride: number,\n    dilation: number,\n    kernel: number,\n    pads: number[],\n    padHeadIndex: number,\n    padTailIndex: number,\n    autoPad?: string,\n  ): number {\n    const dkernel = dilation * (kernel - 1) + 1;\n    if (autoPad && autoPad !== 'NOTSET') {\n      switch (autoPad) {\n        case 'VALID':\n          pads[padHeadIndex] = 0;\n          pads[padTailIndex] = 0;\n          return Math.floor((inSize - dkernel) / stride + 1);\n        case 'SAME_LOWER':\n        case 'SAME_UPPER':\n          if (dilation !== 1) {\n            throw new Error('Dilation not supported for SAME_UPPER or SAME_LOWER');\n          } else {\n            const legacyTargetSize = (inSize + stride - 1) / stride;\n            const padNeeded = (legacyTargetSize - 1) * stride + kernel - inSize;\n            pads[padHeadIndex] = autoPad === 'SAME_LOWER' ? Math.floor((padNeeded + 1) / 2) : Math.floor(padNeeded / 2);\n            pads[padTailIndex] = padNeeded - pads[padHeadIndex];\n            return Math.floor((inSize + padNeeded - kernel) / stride + 1);\n          }\n        default:\n          throw new Error('Unsupported AutoPad type');\n      }\n    } else {\n      return Math.floor((inSize + pads[padHeadIndex] + pads[padTailIndex] - dkernel) / stride + 1);\n    }\n  }\n}\n\nexport const MIN_CLIP = -3.4028234663852886e38;\nexport const MAX_CLIP = 3.4028234663852886e38;\n\nexport function decodeUtf8String(buffer: Uint8Array): string {\n  return new TextDecoder().decode(buffer);\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Guid } from 'guid-typescript';\nimport Long from 'long';\n\nimport * as ortFbs from './ort-schema/flatbuffers/ort-generated';\nimport { onnx } from './ort-schema/protobuf/onnx';\nimport { decodeUtf8String, ProtoUtil, ShapeUtil } from './util';\n\nexport declare namespace Tensor {\n  export interface DataTypeMap {\n    bool: Uint8Array;\n    float32: Float32Array;\n    float64: Float64Array;\n    string: string[];\n    int8: Int8Array;\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n    int32: Int32Array;\n    uint32: Uint32Array;\n    int64: BigInt64Array;\n  }\n\n  export type DataType = keyof DataTypeMap;\n\n  export type StringType = Tensor.DataTypeMap['string'];\n  export type BooleanType = Tensor.DataTypeMap['bool'];\n  export type IntegerType =\n    | Tensor.DataTypeMap['int8']\n    | Tensor.DataTypeMap['uint8']\n    | Tensor.DataTypeMap['int16']\n    | Tensor.DataTypeMap['uint16']\n    | Tensor.DataTypeMap['int32']\n    | Tensor.DataTypeMap['uint32'];\n  export type FloatType = Tensor.DataTypeMap['float32'] | Tensor.DataTypeMap['float64'];\n  export type NumberType = BooleanType | IntegerType | FloatType;\n\n  export type Id = Guid;\n}\n\ntype TensorData = Tensor.DataTypeMap[Tensor.DataType];\n\ntype DataProvider = (id: Tensor.Id) => TensorData;\ntype AsyncDataProvider = (id: Tensor.Id) => Promise<TensorData>;\n\nexport class Tensor {\n  /**\n   * get the underlying tensor data\n   */\n  get data(): TensorData {\n    if (this.cache === undefined) {\n      const data = this.dataProvider!(this.dataId);\n      if (data.length !== this.size) {\n        throw new Error('Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.');\n      }\n      this.cache = data;\n    }\n    return this.cache;\n  }\n\n  /**\n   * get the underlying string tensor data. Should only use when type is STRING\n   */\n  get stringData() {\n    if (this.type !== 'string') {\n      throw new TypeError('data type is not string');\n    }\n\n    return this.data as Tensor.StringType;\n  }\n\n  /**\n   * get the underlying integer tensor data. Should only use when type is one of the following: (UINT8, INT8, UINT16,\n   * INT16, INT32, UINT32, BOOL)\n   */\n  get integerData() {\n    switch (this.type) {\n      case 'uint8':\n      case 'int8':\n      case 'uint16':\n      case 'int16':\n      case 'int32':\n      case 'uint32':\n      case 'bool':\n        return this.data as Tensor.IntegerType;\n\n      default:\n        throw new TypeError('data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)');\n    }\n  }\n\n  /**\n   * get the underlying float tensor data. Should only use when type is one of the following: (FLOAT, DOUBLE)\n   */\n  get floatData() {\n    switch (this.type) {\n      case 'float32':\n      case 'float64':\n        return this.data as Tensor.FloatType;\n\n      default:\n        throw new TypeError('data type is not float (float32, float64)');\n    }\n  }\n\n  /**\n   * get the underlying number tensor data. Should only use when type is one of the following: (UINT8, INT8, UINT16,\n   * INT16, INT32, UINT32, BOOL, FLOAT, DOUBLE)\n   */\n  get numberData() {\n    if (this.type !== 'string') {\n      return this.data as Tensor.NumberType;\n    }\n    throw new TypeError('type cannot be non-number (string)');\n  }\n\n  /**\n   * get value of an element at the given indices\n   */\n  get(indices: readonly number[]): Tensor.DataTypeMap[Tensor.DataType][number] {\n    return this.data[ShapeUtil.indicesToOffset(indices, this.strides)];\n  }\n\n  /**\n   * set value of an element at the given indices\n   */\n  set(indices: readonly number[], value: Tensor.DataTypeMap[Tensor.DataType][number]) {\n    this.data[ShapeUtil.indicesToOffset(indices, this.strides)] = value;\n  }\n\n  /**\n   * get the underlying tensor data asynchronously\n   */\n  async getData(): Promise<TensorData> {\n    if (this.cache === undefined) {\n      this.cache = await this.asyncDataProvider!(this.dataId);\n    }\n    return this.cache;\n  }\n\n  /**\n   * get the number of elements in the tensor\n   */\n  public readonly size: number;\n\n  private _strides: readonly number[];\n  /**\n   * get the strides for each dimension\n   */\n  get strides(): readonly number[] {\n    if (!this._strides) {\n      this._strides = ShapeUtil.computeStrides(this.dims);\n    }\n    return this._strides;\n  }\n\n  constructor(\n    /**\n     * get the dimensions of the tensor\n     */\n    public readonly dims: readonly number[],\n    /**\n     * get the type of the tensor\n     */\n    public readonly type: Tensor.DataType,\n    private dataProvider?: DataProvider,\n    private asyncDataProvider?: AsyncDataProvider,\n    private cache?: TensorData,\n    /**\n     * get the data ID that used to map to a tensor data\n     */\n    public readonly dataId: Guid = Guid.create(),\n  ) {\n    this.size = ShapeUtil.validateDimsAndCalcSize(dims);\n    const size = this.size;\n    const empty = dataProvider === undefined && asyncDataProvider === undefined && cache === undefined;\n\n    if (cache !== undefined) {\n      if (cache.length !== size) {\n        throw new RangeError(\"Input dims doesn't match data length.\");\n      }\n    }\n\n    if (type === 'string') {\n      if (cache !== undefined && (!Array.isArray(cache) || !cache.every((i) => typeof i === 'string'))) {\n        throw new TypeError('cache should be a string array');\n      }\n\n      if (empty) {\n        this.cache = new Array<string>(size);\n      }\n    } else {\n      if (cache !== undefined) {\n        const constructor = dataviewConstructor(type);\n        if (!(cache instanceof constructor)) {\n          throw new TypeError(`cache should be type ${constructor.name}`);\n        }\n      }\n\n      if (empty) {\n        const buf = new ArrayBuffer(size * sizeof(type));\n        this.cache = createView(buf, type);\n      }\n    }\n  }\n\n  /**\n   * Construct new Tensor from a ONNX Tensor object\n   * @param tensorProto the ONNX Tensor\n   */\n  static fromProto(tensorProto: onnx.ITensorProto): Tensor {\n    if (!tensorProto) {\n      throw new Error('cannot construct Value from an empty tensor');\n    }\n    const type = ProtoUtil.tensorDataTypeFromProto(tensorProto.dataType!);\n    const dims = ProtoUtil.tensorDimsFromProto(tensorProto.dims!);\n\n    const value = new Tensor(dims, type);\n\n    if (type === 'string') {\n      // When it's STRING type, the value should always be stored in field\n      // 'stringData'\n      tensorProto.stringData!.forEach((str, i) => {\n        value.data[i] = decodeUtf8String(str);\n      });\n    } else if (\n      tensorProto.rawData &&\n      typeof tensorProto.rawData.byteLength === 'number' &&\n      tensorProto.rawData.byteLength > 0\n    ) {\n      // NOT considering segment for now (IMPORTANT)\n\n      // populate value from rawData\n      const dataDest = value.data;\n      const dataSource = new DataView(\n        tensorProto.rawData.buffer,\n        tensorProto.rawData.byteOffset,\n        tensorProto.rawData.byteLength,\n      );\n      const elementSize = sizeofProto(tensorProto.dataType!);\n      const length = tensorProto.rawData.byteLength / elementSize;\n\n      if (tensorProto.rawData.byteLength % elementSize !== 0) {\n        throw new Error('invalid buffer length');\n      }\n      if (dataDest.length !== length) {\n        throw new Error('buffer length mismatch');\n      }\n\n      for (let i = 0; i < length; i++) {\n        const n = readProto(dataSource, tensorProto.dataType!, i * elementSize);\n        dataDest[i] = n;\n      }\n    } else {\n      // populate value from array\n      let array: Array<number | Long>;\n      switch (tensorProto.dataType) {\n        case onnx.TensorProto.DataType.FLOAT:\n          array = tensorProto.floatData!;\n          break;\n        case onnx.TensorProto.DataType.INT32:\n        case onnx.TensorProto.DataType.INT16:\n        case onnx.TensorProto.DataType.UINT16:\n        case onnx.TensorProto.DataType.INT8:\n        case onnx.TensorProto.DataType.UINT8:\n        case onnx.TensorProto.DataType.BOOL:\n          array = tensorProto.int32Data!;\n          break;\n        case onnx.TensorProto.DataType.INT64:\n          array = tensorProto.int64Data!;\n          break;\n        case onnx.TensorProto.DataType.DOUBLE:\n          array = tensorProto.doubleData!;\n          break;\n        case onnx.TensorProto.DataType.UINT32:\n        case onnx.TensorProto.DataType.UINT64:\n          array = tensorProto.uint64Data!;\n          break;\n        default:\n          // should never run here\n          throw new Error('unspecific error');\n      }\n\n      if (array === null || array === undefined) {\n        throw new Error('failed to populate data from a tensorproto value');\n      }\n\n      const data = value.data;\n      if (data.length !== array.length) {\n        throw new Error('array length mismatch');\n      }\n\n      for (let i = 0; i < array.length; i++) {\n        const element = array[i];\n        if (Long.isLong(element)) {\n          data[i] = longToNumber(element, tensorProto.dataType);\n        } else {\n          data[i] = element;\n        }\n      }\n    }\n\n    return value;\n  }\n\n  /**\n   * Construct new Tensor from raw data\n   * @param data the raw data object. Should be a string array for 'string' tensor, and the corresponding typed array\n   * for other types of tensor.\n   * @param dims the dimensions of the tensor\n   * @param type the type of the tensor\n   */\n  static fromData(data: Tensor.DataTypeMap[Tensor.DataType], dims: readonly number[], type: Tensor.DataType) {\n    return new Tensor(dims, type, undefined, undefined, data);\n  }\n\n  static fromOrtTensor(ortTensor: ortFbs.Tensor) {\n    if (!ortTensor) {\n      throw new Error('cannot construct Value from an empty tensor');\n    }\n    const dims = ProtoUtil.tensorDimsFromORTFormat(ortTensor);\n    const type = ProtoUtil.tensorDataTypeFromProto(ortTensor.dataType());\n\n    const value = new Tensor(dims, type);\n\n    if (type === 'string') {\n      // When it's STRING type, the value should always be stored in field\n      // 'stringData'\n      for (let i = 0; i < ortTensor.stringDataLength(); i++) {\n        value.data[i] = ortTensor.stringData(i);\n      }\n    } else if (\n      ortTensor.rawDataArray() &&\n      typeof ortTensor.rawDataLength() === 'number' &&\n      ortTensor.rawDataLength() > 0\n    ) {\n      // NOT considering segment for now (IMPORTANT)\n\n      // populate value from rawData\n      const dataDest = value.data;\n      const dataSource = new DataView(\n        ortTensor.rawDataArray()!.buffer,\n        ortTensor.rawDataArray()!.byteOffset,\n        ortTensor.rawDataLength(),\n      );\n      const elementSize = sizeofProto(ortTensor.dataType());\n      const length = ortTensor.rawDataLength() / elementSize;\n\n      if (ortTensor.rawDataLength() % elementSize !== 0) {\n        throw new Error('invalid buffer length');\n      }\n      if (dataDest.length !== length) {\n        throw new Error('buffer length mismatch');\n      }\n\n      for (let i = 0; i < length; i++) {\n        const n = readProto(dataSource, ortTensor.dataType(), i * elementSize);\n        dataDest[i] = n;\n      }\n    }\n    return value;\n  }\n}\n\nfunction sizeof(type: Tensor.DataType): number {\n  switch (type) {\n    case 'bool':\n    case 'int8':\n    case 'uint8':\n      return 1;\n    case 'int16':\n    case 'uint16':\n      return 2;\n    case 'int32':\n    case 'uint32':\n    case 'float32':\n      return 4;\n    case 'float64':\n      return 8;\n    default:\n      throw new Error(`cannot calculate sizeof() on type ${type}`);\n  }\n}\n\nfunction sizeofProto(type: onnx.TensorProto.DataType | ortFbs.TensorDataType): number {\n  switch (type) {\n    case onnx.TensorProto.DataType.UINT8:\n    case onnx.TensorProto.DataType.INT8:\n    case onnx.TensorProto.DataType.BOOL:\n      return 1;\n    case onnx.TensorProto.DataType.UINT16:\n    case onnx.TensorProto.DataType.INT16:\n      return 2;\n    case onnx.TensorProto.DataType.FLOAT:\n    case onnx.TensorProto.DataType.INT32:\n    case onnx.TensorProto.DataType.UINT32:\n      return 4;\n    case onnx.TensorProto.DataType.INT64:\n    case onnx.TensorProto.DataType.DOUBLE:\n    case onnx.TensorProto.DataType.UINT64:\n      return 8;\n    default:\n      throw new Error(`cannot calculate sizeof() on type ${onnx.TensorProto.DataType[type]}`);\n  }\n}\n\nfunction createView(dataBuffer: ArrayBuffer, type: Tensor.DataType) {\n  return new (dataviewConstructor(type))(dataBuffer);\n}\n\nfunction dataviewConstructor(type: Tensor.DataType) {\n  switch (type) {\n    case 'bool':\n    case 'uint8':\n      return Uint8Array;\n    case 'int8':\n      return Int8Array;\n    case 'int16':\n      return Int16Array;\n    case 'uint16':\n      return Uint16Array;\n    case 'int32':\n      return Int32Array;\n    case 'uint32':\n      return Uint32Array;\n    case 'int64':\n      return BigInt64Array;\n    case 'float32':\n      return Float32Array;\n    case 'float64':\n      return Float64Array;\n    default:\n      // should never run to here\n      throw new Error('unspecified error');\n  }\n}\n\n// convert a long number to a 32-bit integer (cast-down)\nfunction longToNumber(i: Long, type: onnx.TensorProto.DataType | ortFbs.TensorDataType): number {\n  // INT64, UINT32, UINT64\n  if (type === onnx.TensorProto.DataType.INT64 || type === ortFbs.TensorDataType.INT64) {\n    if (i.greaterThanOrEqual(2147483648) || i.lessThan(-2147483648)) {\n      throw new TypeError('int64 is not supported');\n    }\n  } else if (\n    type === onnx.TensorProto.DataType.UINT32 ||\n    type === ortFbs.TensorDataType.UINT32 ||\n    type === onnx.TensorProto.DataType.UINT64 ||\n    type === ortFbs.TensorDataType.UINT64\n  ) {\n    if (i.greaterThanOrEqual(4294967296) || i.lessThan(0)) {\n      throw new TypeError('uint64 is not supported');\n    }\n  } else {\n    throw new TypeError(`not a LONG type: ${onnx.TensorProto.DataType[type]}`);\n  }\n\n  return i.toNumber();\n}\n\n// read one value from TensorProto\nfunction readProto(\n  view: DataView,\n  type: onnx.TensorProto.DataType | ortFbs.TensorDataType,\n  byteOffset: number,\n): number {\n  switch (type) {\n    case onnx.TensorProto.DataType.BOOL:\n    case onnx.TensorProto.DataType.UINT8:\n      return view.getUint8(byteOffset);\n    case onnx.TensorProto.DataType.INT8:\n      return view.getInt8(byteOffset);\n    case onnx.TensorProto.DataType.UINT16:\n      return view.getUint16(byteOffset, true);\n    case onnx.TensorProto.DataType.INT16:\n      return view.getInt16(byteOffset, true);\n    case onnx.TensorProto.DataType.FLOAT:\n      return view.getFloat32(byteOffset, true);\n    case onnx.TensorProto.DataType.INT32:\n      return view.getInt32(byteOffset, true);\n    case onnx.TensorProto.DataType.UINT32:\n      return view.getUint32(byteOffset, true);\n    case onnx.TensorProto.DataType.INT64:\n      return longToNumber(\n        Long.fromBits(view.getUint32(byteOffset, true), view.getUint32(byteOffset + 4, true), false),\n        type,\n      );\n    case onnx.TensorProto.DataType.DOUBLE:\n      return view.getFloat64(byteOffset, true);\n    case onnx.TensorProto.DataType.UINT64:\n      return longToNumber(\n        Long.fromBits(view.getUint32(byteOffset, true), view.getUint32(byteOffset + 4, true), true),\n        type,\n      );\n    default:\n      throw new Error(`cannot read from DataView for type ${onnx.TensorProto.DataType[type]}`);\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * represent a version irrelevant abstraction of for GLSL source code\n */\nexport interface Glsl {\n  readonly version: string;\n  readonly attribute: string;\n  readonly varyingVertex: string;\n  readonly varyingFrag: string;\n  readonly texture2D: string;\n  readonly output: string;\n  readonly outputDeclaration: string;\n}\n\nconst GLSL_ES_2_0: Glsl = {\n  version: '',\n  attribute: 'attribute',\n  varyingVertex: 'varying',\n  varyingFrag: 'varying',\n  texture2D: 'texture2D',\n  output: 'gl_FragColor',\n  outputDeclaration: '',\n};\nconst GLSL_ES_3_0: Glsl = {\n  version: '#version 300 es',\n  attribute: 'in',\n  varyingVertex: 'out',\n  varyingFrag: 'in',\n  texture2D: 'texture',\n  output: 'outputColor',\n  outputDeclaration: 'out vec4 outputColor;',\n};\n\nexport function getGlsl(version: 1 | 2) {\n  return version === 1 ? GLSL_ES_2_0 : GLSL_ES_3_0;\n}\n\nexport function getVertexShaderSource(version: 1 | 2): string {\n  const glsl = getGlsl(version);\n  return `${glsl.version}\n      precision highp float;\n      ${glsl.attribute} vec3 position;\n      ${glsl.attribute} vec2 textureCoord;\n\n      ${glsl.varyingVertex} vec2 TexCoords;\n\n      void main()\n      {\n          gl_Position = vec4(position, 1.0);\n          TexCoords = textureCoord;\n      }`;\n}\n\nexport function getFragShaderPreamble(version: 1 | 2): string {\n  const glsl = getGlsl(version);\n  return `${glsl.version}\n    precision highp float;\n    precision highp int;\n    precision highp sampler2D;\n    ${glsl.varyingFrag} vec2 TexCoords;\n    ${glsl.outputDeclaration}\n    const vec2 halfCR = vec2(0.5, 0.5);\n\n    // Custom vector types to handle higher dimenalities.\n    struct ivec5\n    {\n      int x;\n      int y;\n      int z;\n      int w;\n      int u;\n    };\n\n    struct ivec6\n    {\n      int x;\n      int y;\n      int z;\n      int w;\n      int u;\n      int v;\n    };\n\n    int imod(int x, int y) {\n      return x - y * (x / y);\n    }\n\n    `;\n}\n\nexport function getDefaultFragShaderMain(version: 1 | 2, outputShapeLength: number): string {\n  const glsl = getGlsl(version);\n  return `\n  void main() {\n    int indices[${outputShapeLength}];\n    toVec(TexCoords, indices);\n    vec4 result = vec4(process(indices));\n    ${glsl.output} = result;\n  }\n  `;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../tensor';\n\n/**\n * Layout info is used for mapping n-dimensional array to 2D textures\n * The layout is created by the TextureLayoutStrategy based on\n * the Tensor's dimensions and strides\n */\nexport interface TextureLayout {\n  width: number;\n  height: number;\n  /**\n   * specify the number of value that encoded in a single pixel\n   */\n  channels: 1 | 2 | 3 | 4;\n  /**\n   * whether in packed mode or not\n   */\n  isPacked?: boolean;\n  /**\n   * the normalized shape\n   */\n  shape: readonly number[];\n  /**\n   * the stride of each dimensions, calculated according to shape\n   */\n  strides: readonly number[];\n  /**\n   * the original shape(dims) of the corresponding tensor\n   */\n  unpackedShape: readonly number[];\n\n  reversedWH?: boolean;\n}\nexport interface TextureData extends TextureLayout {\n  tensor: Tensor;\n  texture: WebGLTexture;\n}\n\nexport enum TextureType {\n  unpacked, // <-- normal unpacked texture\n  unpackedReversed, // <-- unpacked texture used in old ONNX.js implementation (deprecated)\n  packed, // <-- normal packed texture\n  downloadUint8AsFloat, // <-- ONLY used in texture downloading for iOS devices\n  packedLastDimension, // <-- ONLY used in old ONNX.js Conv implementation for input W (deprecated)\n}\n\nexport interface TensorInfo {\n  id?: Tensor.Id;\n  dims: readonly number[];\n  type: Tensor.DataType;\n  textureType: TextureType;\n}\n\nexport interface ProgramVariable {\n  type: 'float' | 'int';\n  name: string;\n  arrayLength?: number;\n  data: number | number[];\n}\n\n/**\n * A set of metadata of a shader program.\n */\nexport interface ProgramMetadata {\n  /**\n   * the name of the program. used for debugging and profiling\n   */\n  name: string;\n  /**\n   * texture types for each input\n   */\n  inputTypes: TextureType[];\n  /**\n   * names of each input\n   */\n  inputNames: string[];\n  /**\n   * an optional string as a cache hint in the artifact cache\n   */\n  cacheHint?: string;\n}\n\n/**\n * A ProgramInfoLoader allows\n */\nexport interface ProgramInfoLoader extends ProgramMetadata {\n  /**\n   * a function to get the program info\n   */\n  get(): ProgramInfo;\n}\n\n/**\n * A set of data that represent a shader program\n */\nexport interface ProgramInfo extends ProgramMetadata {\n  /**\n   * information of uniform variables\n   */\n  variables?: ProgramVariable[];\n  /**\n   * tensor info for output\n   */\n  output: TensorInfo;\n  /**\n   * the shader's processing source code\n   */\n  shaderSource: string;\n  /**\n   * whether the shader source contains a customized main function implementation\n   */\n  hasMain?: boolean;\n}\n\nexport interface VariableInfo {\n  type: 'float' | 'int';\n  name: string;\n  arrayLength?: number;\n}\n\nexport interface ProgramVariable {\n  type: 'float' | 'int';\n  name: string;\n  arrayLength?: number;\n  data: number | number[];\n}\n\n/**\n * Information of uniforms that shader uses\n */\nexport interface UniformInfo {\n  type: 'sampler2D' | VariableInfo['type'];\n  name: string;\n  arrayLength?: number;\n}\n\nexport interface UniformLocation extends UniformInfo {\n  location: WebGLUniformLocation;\n}\n\n/**\n * Artifact is the result of compilation\n * It does not contain input of output data\n * However anything that could be run as a \"program\"\n */\nexport interface Artifact {\n  programInfo: ProgramInfo;\n  program: WebGLProgram;\n  uniformLocations: UniformLocation[];\n  attribLocations: { position: number; textureCoord: number };\n}\nexport declare namespace Artifact {\n  type UniformLocations = Artifact['uniformLocations'];\n  type AttribLocations = Artifact['attribLocations'];\n}\n\nexport interface UniformData {\n  [name: string]: number | number[];\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { assert } from '../../util';\n/**\n * Given a non RGBA shape calculate the R version\n * It is assumed that the dimensions are multiples of given channels\n * NOTE: it is always the last dim that gets packed.\n * @param unpackedShape original shape to create a packed version from\n */\nexport function getPackedShape(unpackedShape: readonly number[]): readonly number[] {\n  const len = unpackedShape.length;\n  return unpackedShape.slice(0, len - 1).concat(unpackedShape[len - 1] / 4);\n}\n\nexport async function repeatedTry(\n  checkFn: () => boolean,\n  delayFn = (_counter: number) => 0,\n  maxCounter?: number,\n): Promise<void> {\n  return new Promise<void>((resolve, reject) => {\n    let tryCount = 0;\n\n    const tryFn = () => {\n      if (checkFn()) {\n        resolve();\n        return;\n      }\n\n      tryCount++;\n\n      const nextBackoff = delayFn(tryCount);\n\n      if (maxCounter != null && tryCount >= maxCounter) {\n        reject();\n        return;\n      }\n      setTimeout(tryFn, nextBackoff);\n    };\n\n    tryFn();\n  });\n}\n\n/**\n * Generates the function name from an input sampler name.\n * @param samplerName Name of the sampler.\n */\nexport function generateShaderFuncNameFromInputSamplerName(samplerName: string): string {\n  assert(typeof samplerName !== 'undefined' && samplerName.length !== 0, () => 'empty string found for sampler name');\n  return 'get' + samplerName.charAt(0).toUpperCase() + samplerName.slice(1);\n}\n\n/**\n * Generates the function name from an input sampler name at output coordinates.\n * @param samplerName Name of the sampler.\n */\nexport function generateShaderFuncNameFromInputSamplerNameAtOutCoords(samplerName: string): string {\n  assert(typeof samplerName !== 'undefined' && samplerName.length !== 0, () => 'empty string found for sampler name');\n  return 'get' + samplerName.charAt(0).toUpperCase() + samplerName.slice(1) + 'AtOutCoords';\n}\n\n/** Returns a new input shape (a copy) that has a squeezed logical shape. */\nexport function squeezeInputShape(inputShape: readonly number[], squeezedShape: number[]): number[] {\n  // Deep copy.\n  let newInputShape: number[] = JSON.parse(JSON.stringify(inputShape));\n  newInputShape = squeezedShape;\n  return newInputShape;\n}\n\n/** Returns a list of squeezed parameters for shader functions */\nexport function getSqueezedParams(params: string[], keptDims: number[]): string {\n  return keptDims.map((d) => params[d]).join(', ');\n}\n\n/** Returns the data type for different ranks. */\nexport function getCoordsDataType(rank: number): string {\n  if (rank <= 1) {\n    return 'int';\n  } else if (rank === 2) {\n    return 'ivec2';\n  } else if (rank === 3) {\n    return 'ivec3';\n  } else if (rank === 4) {\n    return 'ivec4';\n  } else if (rank === 5) {\n    return 'ivec5';\n  } else if (rank === 6) {\n    return 'ivec6';\n  } else {\n    throw Error(`GPU for rank ${rank} is not yet supported`);\n  }\n}\n\nexport function getGlChannels(rank = 6): string[] {\n  return ['x', 'y', 'z', 'w', 'u', 'v'].slice(0, rank);\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getGlChannels } from '../utils';\n\nexport function getVecChannels(name: string, rank: number): string[] {\n  return getGlChannels(rank).map((d) => `${name}.${d}`);\n}\n\nexport function getChannels(name: string, rank: number): string[] {\n  if (rank === 1) {\n    return [name];\n  }\n  return getVecChannels(name, rank);\n}\n\nexport function unpackFromChannel(): string {\n  return `\n    float getChannel(vec4 frag, int dim) {\n      int modCoord = imod(dim, 2);\n      return modCoord == 0 ? frag.r : frag.g;\n    }\n\n    float getChannel(vec4 frag, vec2 innerDims) {\n      vec2 modCoord = mod(innerDims, 2.);\n      return modCoord.x == 0. ?\n        (modCoord.y == 0. ? frag.r : frag.g) :\n        (modCoord.y == 0. ? frag.b : frag.a);\n    }\n  `;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, TextureType } from '../types';\nimport { getCoordsDataType } from '../utils';\n\nimport { getChannels } from './packing-utils';\n\nconst packProgramMetadata = {\n  name: 'pack',\n  inputNames: ['A'],\n  inputTypes: [TextureType.unpackedReversed],\n};\n\nconst createPackProgramInfo = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfo => {\n  const glsl = getGlsl(handler.session.backend.glContext.version);\n  const inputShape = input.dims;\n\n  const inputRank = inputShape.length;\n  // createTextureLayoutFromShape won't change output rank. Need to verify by running tests\n  const outputRank = input.dims.length;\n\n  const coordsDataType = getCoordsDataType(outputRank);\n  const channels = getChannels('rc', outputRank);\n  const setup = getSetup(outputRank, channels, inputShape[inputShape.length - 2], inputShape[inputShape.length - 1]);\n\n  let reversedInputWH;\n  if (inputRank === 0) {\n    reversedInputWH = [1, 1];\n  } else if (inputRank === 1) {\n    reversedInputWH = [inputShape[0], 1];\n  } else {\n    reversedInputWH = [inputShape[outputRank - 1], inputShape[outputRank - 2]];\n  }\n  const outOfBoundsCondition = getOutOfBoundsCondition(outputRank, reversedInputWH, channels);\n  const output = getOutput(inputShape, channels);\n\n  const shaderSource = `\n        void main() {\n          ${coordsDataType} rc = getOutputCoords();\n\n          if(${outOfBoundsCondition}) {\n            ${glsl.output} = vec4(0);\n          } else {\n            ${setup}\n\n            ${glsl.output} = vec4(${output});\n          }\n        }\n      `;\n  return {\n    ...packProgramMetadata,\n    hasMain: true,\n    output: { dims: input.dims, type: input.type, textureType: TextureType.packed },\n    shaderSource,\n  };\n};\n\nexport const createPackProgramInfoLoader = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfoLoader => ({\n  ...packProgramMetadata,\n  get: () => createPackProgramInfo(handler, input),\n});\n\n/**\n * check output coordinate location and return false if it is outside input's width/height boundary\n */\nfunction getOutOfBoundsCondition(rank: number, shape: readonly number[], dims: string[]): string {\n  if (rank === 0) {\n    return 'false';\n  }\n  if (rank === 1) {\n    return `rc > ${shape[0]}`;\n  }\n\n  let cond = '';\n  for (let i = rank - 2; i < rank; i++) {\n    cond += `${dims[i]} >= ${shape[i - rank + 2]}`;\n    if (i < rank - 1) {\n      cond += '||';\n    }\n  }\n\n  return cond;\n}\n\n/**\n * code snippet to sample input texture with output coordinates\n */\nfunction getOutput(shape: readonly number[], dims: string[]): string {\n  const rank = shape.length;\n\n  if (rank === 0) {\n    return 'getA(), 0, 0, 0';\n  }\n\n  if (rank === 1) {\n    return `getA(rc),\n            rc + 1 >= ${shape[0]} ? 0. : getA(rc + 1),\n            0, 0`;\n  }\n\n  const coord00 = 'r, c';\n  const coord01 = 'r, cp1';\n  const coord10 = 'rp1, c';\n  const coord11 = 'rp1, cp1';\n  let D = '';\n  if (rank > 2) {\n    for (let i = 0; i < rank - 2; ++i) {\n      D = D + `${dims[i]},`;\n    }\n  }\n  return `getA(${D}${coord00}),\n          rEdge ? 0. : getA(${D}${coord10}),\n          cEdge ? 0. : getA(${D}${coord01}),\n          rEdge || cEdge ? 0. : getA(${D}${coord11})`;\n}\n\n/**\n * code snippet to setup 4 coordinates and edge conditions\n */\nfunction getSetup(rank: number, dims: string[], rows: number, cols: number): string {\n  if (rank === 0 || rank === 1) {\n    return '';\n  }\n  // rank >= 2 for width+height pack.\n  else {\n    const setup = `\n    int r = ${dims[rank - 2]};\n    int c = ${dims[rank - 1]};\n    int rp1 = ${dims[rank - 2]} + 1;\n    int cp1 = ${dims[rank - 1]} + 1;\n    bool rEdge = rp1 >= ${cols};\n    bool cEdge = cp1 >= ${rows};\n    `;\n    return setup;\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { unpackFromChannel } from './packing-utils';\n\nconst createPackedReshape3DProgramMetadata = (outputShape3D: readonly number[]) => ({\n  name: 'Reshape (packed)',\n  inputTypes: [TextureType.packed],\n  inputNames: ['A'],\n  cacheHint: `${outputShape3D}`,\n});\n\nconst createPackedReshape3DProgramInfo = (\n  handler: WebGLInferenceHandler,\n  input3D: Tensor,\n  metadata: ProgramMetadata,\n  outputShape3D: readonly number[],\n): ProgramInfo => {\n  const inputShape3D = input3D.dims as [number, number, number];\n  const squeezedOutputShape = outputShape3D as [number, number, number];\n\n  let mainLoop = '';\n  for (let i = 0; i < 4; i++) {\n    let outputCoords = '';\n    switch (i) {\n      case 0:\n        outputCoords = 'outputCoords = rc;';\n        break;\n      case 1:\n        outputCoords = 'outputCoords = ivec3(rc.x, rc.y+1, rc.z);';\n        break;\n      case 2:\n        outputCoords = 'outputCoords = ivec3(rc.x, rc.y, rc.z+1);';\n        break;\n      case 3:\n        outputCoords = 'outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);';\n        break;\n      default:\n        throw new Error();\n    }\n\n    mainLoop += `\n        ${outputCoords}\n        ${i > 0 ? 'if(outputCoords.y < rows && outputCoords.z < cols){' : ''}\n          int flattenedIndex = getFlattenedIndex(outputCoords);\n\n          ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n          vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n          result[${i}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n        ${i > 0 ? '}' : ''}\n      `;\n  }\n  const glsl = getGlsl(handler.session.backend.glContext.version);\n\n  const shaderSource = `\n      ${getReshapedInputCoords(inputShape3D)}\n      ${getFlattenedIndexFrom3D(squeezedOutputShape)}\n      ${unpackFromChannel()}\n\n      void main() {\n        ivec3 rc = getOutputCoords();\n\n        vec4 result = vec4(0.0);\n\n        ivec3 outputCoords;\n        int rows = ${squeezedOutputShape[2]};\n        int cols = ${squeezedOutputShape[1]};\n\n        ${mainLoop}\n        ${glsl.output} = result;\n      }\n    `;\n\n  return {\n    ...metadata,\n    output: { dims: squeezedOutputShape, type: input3D.type, textureType: TextureType.packed },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nexport const createPackedReshape3DProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  input3D: Tensor,\n  outputShape3D: readonly number[],\n): ProgramInfoLoader => {\n  const metadata = createPackedReshape3DProgramMetadata(outputShape3D);\n  return { ...metadata, get: () => createPackedReshape3DProgramInfo(handler, input3D, metadata, outputShape3D) };\n};\n\nexport function processDims3D(shape: ArrayLike<number>): [number, number, number] {\n  if (shape.length === 0) {\n    return [1, 1, 1];\n  }\n  // TODO: squeeze other shapes to 2D case\n  let batch = 1;\n  for (let i = 0; i < shape.length - 2; ++i) {\n    batch *= shape[i];\n  }\n  return [batch, shape.length > 1 ? shape[shape.length - 2] : 1, shape[shape.length - 1]];\n}\n\n// For packed reshape, we need to re-arrange texel data for output shape.\n// Our pack is designed to pack a 2x2 tile in last h and w dimension, so\n// for the reshaped new tensor, we just need to re-arrange the last h and\n// w dimension. For any shape that is not in 3D, i.e. [batch, W, H], we\n// first convert it to 3D by collapsing other dimension to batch dim, then\n// process with the last two dimensions.\n// Note: we only need the shape tensor to calculate output shape, so the\n// content in shape tensor is never uploaded to GPU. It is always kept in CPU.\n// TODO: optimize the algorithm -- in some cases, if the last two dims are\n// the same between input shape and output shape, the packed reshape can be\n// treated as no-op.\nexport function isReshapeCheap(dims: readonly number[], reshapedDims: readonly number[]) {\n  let isCheapReshape = false;\n  if (dims.length === 0 || reshapedDims.length === 0) {\n    // scalar\n    isCheapReshape = true;\n  } else if (dims.length < 2 || reshapedDims.length < 2) {\n    // 1D\n    isCheapReshape = dims[dims.length - 1] === reshapedDims[reshapedDims.length - 1];\n  } else {\n    // 2D +\n    isCheapReshape =\n      dims[dims.length - 1] === reshapedDims[reshapedDims.length - 1] &&\n      dims[dims.length - 2] === reshapedDims[reshapedDims.length - 2];\n  }\n\n  return isCheapReshape;\n}\n\nfunction getReshapedInputCoords(shape: [number, number, number]): string {\n  const strides = ShapeUtil.computeStrides(shape);\n  const coords = ['b', 'r', 'c'];\n  const index = 'index';\n  const coordsFromIndexSnippet = strides\n    .map((stride, i) => {\n      const line1 = `int ${coords[i]} = ${index} / ${stride}`;\n      const line2 =\n        i === strides.length - 1\n          ? `int ${coords[i + 1]} = ${index} - ${coords[i]} * ${stride}`\n          : `index -= ${coords[i]} * ${stride}`;\n      return `${line1}; ${line2};`;\n    })\n    .join('');\n\n  return `\n    ivec3 inputCoordsFromReshapedOutCoords(int index) {\n      ${coordsFromIndexSnippet}\n      return ivec3(b, r, c);\n    }\n  `;\n}\n\nfunction getFlattenedIndexFrom3D(shape: [number, number, number]): string {\n  const strides = ShapeUtil.computeStrides(shape);\n\n  return `\n  int getFlattenedIndex(ivec3 coords) {\n    // reverse y, z order\n    return coords.x * ${strides[0]} + coords.z * ${strides[1]} + coords.y;\n  }\n`;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { TextureData, TextureType } from '../types';\n\nexport const encodeAsUint8 = (inferenceHandler: WebGLInferenceHandler, input: TextureData): TextureData => {\n  const outputShape = input.shape;\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  /**\n   * https://github.com/tensorflow/tfjs-core/blob/master/src/kernels/webgl/encode_float_gpu.ts\n   */\n  const shaderSource = `\n    const float FLOAT_MAX = 1.70141184e38;\n    const float FLOAT_MIN = 1.17549435e-38;\n\n    bool isNaN(float val) {\n      return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n    }\n\n    highp vec4 encodeAsUint8(highp float v) {\n      if (isNaN(v)) {\n        return vec4(255, 255, 255, 255);\n      }\n\n      highp float av = abs(v);\n\n      if(av < FLOAT_MIN) {\n        return vec4(0.0, 0.0, 0.0, 0.0);\n      } else if(v > FLOAT_MAX) {\n        return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n      } else if(v < -FLOAT_MAX) {\n        return vec4(0.0, 0.0,  128.0, 255.0) / 255.0;\n      }\n\n      highp vec4 c = vec4(0,0,0,0);\n\n      highp float e = floor(log2(av));\n      highp float m = exp2(fract(log2(av))) - 1.0;\n\n      c[2] = floor(128.0 * m);\n      m -= c[2] / 128.0;\n      c[1] = floor(32768.0 * m);\n      m -= c[1] / 32768.0;\n      c[0] = floor(8388608.0 * m);\n\n      highp float ebias = e + 127.0;\n      c[3] = floor(ebias / 2.0);\n      ebias -= c[3] * 2.0;\n      c[2] += floor(ebias) * 128.0;\n\n      c[3] += 128.0 * step(0.0, -v);\n\n      return c / 255.0;\n    }\n\n    void main() {\n      float value = ${glsl.texture2D}(X,TexCoords).r;\n      ${glsl.output} = encodeAsUint8(value);\n    }`;\n  const programInfo = {\n    name: 'Uint8Encode',\n    inputTypes: [TextureType.unpacked],\n    inputNames: ['X'],\n    output: { dims: outputShape, type: input.tensor.type, textureType: TextureType.downloadUint8AsFloat },\n    shaderSource,\n    hasMain: true,\n  };\n  return inferenceHandler.executeProgram(programInfo, [input.tensor]);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, TextureType } from '../types';\nimport { getCoordsDataType } from '../utils';\n\nimport { getChannels, unpackFromChannel } from './packing-utils';\n\nconst unpackProgramMetadata = {\n  name: 'unpack',\n  inputNames: ['A'],\n  inputTypes: [TextureType.packed],\n};\n\nexport const createUnpackProgramInfo = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfo => {\n  const rank = input.dims.length;\n\n  const channels = getChannels('rc', rank);\n  const innerDims = channels.slice(-2);\n  const coordsDataType = getCoordsDataType(rank);\n  const unpackChannel = unpackFromChannel();\n  const isScalar = input.dims.length === 0;\n  const sourceCoords = isScalar ? '' : getSourceCoords(rank, channels);\n  const coords = rank <= 1 ? 'rc' : `vec2(${innerDims.join(',')})`;\n  const glsl = getGlsl(handler.session.backend.glContext.version);\n  const shaderSource = `\n    ${unpackChannel}\n    void main() {\n      ${coordsDataType} rc = getOutputCoords();\n\n       // Sample the texture with the coords to get the rgba channel value.\n       vec4 packedInput = getA(${sourceCoords});\n\n       ${glsl.output} = vec4(getChannel(packedInput, ${coords}), 0, 0, 0);\n     }\n   `;\n\n  return {\n    ...unpackProgramMetadata,\n    hasMain: true,\n    output: { dims: input.dims, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nexport const createUnpackProgramInfoLoader = (handler: WebGLInferenceHandler, input: Tensor): ProgramInfoLoader => ({\n  ...unpackProgramMetadata,\n  get: () => createUnpackProgramInfo(handler, input),\n});\n\nfunction getSourceCoords(rank: number, dims: string[]): string {\n  if (rank === 1) {\n    return 'rc';\n  }\n\n  let coords = '';\n  for (let i = 0; i < rank; i++) {\n    coords += dims[i];\n    if (i < rank - 1) {\n      coords += ',';\n    }\n  }\n  return coords;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Logger } from '../../instrument';\n\nexport declare namespace Encoder {\n  export interface DataTypeMap {\n    float: Float32Array;\n    byte: Uint8Array;\n    int: Uint32Array;\n  }\n  export type DataType = keyof DataTypeMap;\n  type DataArrayType = DataTypeMap[DataType];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const enum EncoderUsage {\n  Default = 0,\n  UploadOnly,\n  Download4BytesAsFloat32,\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * Abstraction for mapping data types to texture texlets\n * Encoding means how a Float32 is mapped to 1 or 4 channels for each texlet\n * Decoding means how a texlet's channels are mapped to a resulting Float32\n */\nexport interface DataEncoder {\n  internalFormat: number;\n  format: number;\n  textureType: number;\n  channelSize: number;\n  encode(src: Encoder.DataArrayType, textureSize: number): Encoder.DataArrayType;\n  allocate(size: number): Encoder.DataArrayType;\n  decode(buffer: Encoder.DataArrayType, dataSize: number): Encoder.DataArrayType;\n}\n/**\n * WebGL2 data encoder\n * Uses R32F as the format for texlet\n */\nexport class RedFloat32DataEncoder implements DataEncoder {\n  internalFormat: number;\n  format: number;\n  textureType: number;\n  channelSize: number;\n  constructor(gl: WebGL2RenderingContext, channels = 1) {\n    if (channels === 1) {\n      this.internalFormat = gl.R32F;\n      this.format = gl.RED;\n      this.textureType = gl.FLOAT;\n      this.channelSize = channels;\n    } else if (channels === 4) {\n      this.internalFormat = gl.RGBA32F;\n      this.format = gl.RGBA;\n      this.textureType = gl.FLOAT;\n      this.channelSize = channels;\n    } else {\n      throw new Error(`Invalid number of channels: ${channels}`);\n    }\n  }\n  encode(src: Encoder.DataArrayType, textureSize: number): Encoder.DataArrayType {\n    let result: Float32Array;\n    let source: Float32Array;\n    if (src.constructor !== Float32Array) {\n      Logger.warning('Encoder', 'data was not of type Float32; creating new Float32Array');\n      source = new Float32Array(src);\n    }\n    if (textureSize * this.channelSize > src.length) {\n      Logger.warning('Encoder', 'Source data too small. Allocating larger array');\n      source = src as Float32Array;\n      result = this.allocate(textureSize * this.channelSize) as Float32Array;\n      source.forEach((v, i) => (result[i] = v));\n    } else {\n      source = src as Float32Array;\n      result = source;\n    }\n    return result;\n  }\n  allocate(size: number): Encoder.DataArrayType {\n    return new Float32Array(size * 4);\n  }\n  decode(buffer: Encoder.DataArrayType, dataSize: number): Float32Array {\n    if (this.channelSize === 1) {\n      const filteredData = (buffer as Float32Array).filter((_value, index) => index % 4 === 0).subarray(0, dataSize);\n      return filteredData;\n    }\n    return buffer.subarray(0, dataSize) as Float32Array;\n  }\n}\n/**\n * Data encoder for WebGL 1 with support for floating point texture\n */\nexport class RGBAFloatDataEncoder implements DataEncoder {\n  internalFormat: number;\n  format: number;\n  textureType: number;\n  channelSize: number;\n  constructor(gl: WebGLRenderingContext, channels = 1, textureType?: number) {\n    if (channels !== 1 && channels !== 4) {\n      throw new Error(`Invalid number of channels: ${channels}`);\n    }\n    this.internalFormat = gl.RGBA;\n    this.format = gl.RGBA;\n    this.channelSize = channels;\n    this.textureType = textureType || gl.FLOAT;\n  }\n  encode(src: Float32Array, textureSize: number): Encoder.DataArrayType {\n    let dest = src;\n    if (this.channelSize === 1) {\n      Logger.verbose('Encoder', 'Exploding into a larger array');\n      dest = this.allocate(textureSize) as Float32Array;\n      src.forEach((v, i) => (dest[i * 4] = v));\n    }\n    return dest;\n  }\n  allocate(size: number): Encoder.DataArrayType {\n    return new Float32Array(size * 4);\n  }\n  decode(buffer: Encoder.DataArrayType, dataSize: number): Float32Array {\n    if (this.channelSize === 1) {\n      const filteredData = (buffer as Float32Array).filter((_value, index) => index % 4 === 0).subarray(0, dataSize);\n      return filteredData;\n    }\n    return buffer.subarray(0, dataSize) as Float32Array;\n  }\n}\n\nexport class Uint8DataEncoder implements DataEncoder {\n  internalFormat: number;\n  format: number;\n  textureType: number;\n  channelSize = 4;\n  constructor(gl: WebGLRenderingContext, channels = 1) {\n    if (channels === 1) {\n      this.internalFormat = gl.ALPHA;\n      this.format = gl.ALPHA; // not tested\n      this.textureType = gl.UNSIGNED_BYTE;\n      this.channelSize = channels;\n    } else if (channels === 4) {\n      this.internalFormat = gl.RGBA;\n      this.format = gl.RGBA;\n      this.textureType = gl.UNSIGNED_BYTE;\n      this.channelSize = channels;\n    } else {\n      throw new Error(`Invalid number of channels: ${channels}`);\n    }\n  }\n  encode(src: Uint8Array, _textureSize: number): Encoder.DataArrayType {\n    return new Uint8Array(src.buffer, src.byteOffset, src.byteLength);\n  }\n  allocate(size: number): Encoder.DataArrayType {\n    return new Uint8Array(size * this.channelSize);\n  }\n  decode(buffer: Encoder.DataArrayType, dataSize: number): Uint8Array {\n    if (buffer instanceof Uint8Array) {\n      return buffer.subarray(0, dataSize);\n    }\n    throw new Error(`Invalid array type: ${buffer.constructor}`);\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { ShapeUtil } from '../../util';\n\nimport { TextureLayoutStrategy, WidthHeightPrefs } from './texture-layout-strategy';\nimport { TextureLayout, TextureType } from './types';\n\nexport const createTextureLayoutFromTextureType = (\n  textureLayoutStrategy: TextureLayoutStrategy,\n  shape: readonly number[],\n  textureType: TextureType,\n): TextureLayout => {\n  const channel = textureType === TextureType.unpacked || textureType === TextureType.unpackedReversed ? 1 : 4;\n  const isPacked = textureType === TextureType.packed;\n  const reverseWH = textureType === TextureType.unpackedReversed || textureType === TextureType.packed;\n  const breakAxis = textureType === TextureType.packedLastDimension ? shape.length - 1 : undefined;\n  const unpackedShape =\n    textureType === TextureType.packedLastDimension\n      ? shape.map((d, i) => (i === shape.length - 1 ? d * 4 : d))\n      : undefined;\n  return createTextureLayoutFromShape(textureLayoutStrategy, shape, channel, unpackedShape, {\n    isPacked,\n    reverseWH,\n    breakAxis,\n  });\n};\n\nexport const calculateTextureWidthAndHeight = (\n  textureLayoutStrategy: TextureLayoutStrategy,\n  shape: readonly number[],\n  textureType: TextureType,\n): [number, number] => {\n  const layout = createTextureLayoutFromTextureType(textureLayoutStrategy, shape, textureType);\n  return [layout.width, layout.height];\n};\n\n/**\n * Create a TextureLayout object from shape.\n */\nexport const createTextureLayoutFromShape = (\n  textureLayoutStrategy: TextureLayoutStrategy,\n  shape: readonly number[],\n  channels: 1 | 4 = 1,\n  unpackedShape?: readonly number[],\n  prefs?: WidthHeightPrefs,\n): TextureLayout => {\n  const isPacked = !!(prefs && prefs.isPacked);\n  const [width, height] = textureLayoutStrategy.computeTextureWH(isPacked ? unpackedShape || shape : shape, prefs);\n  const rank = shape.length;\n  let inferredDims = shape.slice(0);\n  if (rank === 0) {\n    inferredDims = [1];\n  }\n  if (channels === 1) {\n    // unpackedShape will take `shape` and not `inferredDims` so as to create a scalar Tensor if need be\n    unpackedShape = shape;\n  } else if (isPacked) {\n    if (channels !== 4) {\n      throw new Error('a packed texture must be 4-channel');\n    }\n    unpackedShape = shape;\n    if (rank > 0) {\n      inferredDims[rank - 1] = Math.ceil(inferredDims[rank - 1] / 2);\n    }\n    if (rank > 1) {\n      inferredDims[rank - 2] = Math.ceil(inferredDims[rank - 2] / 2);\n    }\n  } else if (!unpackedShape) {\n    throw new Error('Unpacked shape is needed when using channels > 1');\n  }\n  return {\n    width,\n    height,\n    channels,\n    isPacked,\n    shape: inferredDims,\n    strides: ShapeUtil.computeStrides(inferredDims),\n    unpackedShape,\n    reversedWH: prefs && prefs.reverseWH,\n  };\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { InferenceHandler } from '../../backend';\nimport { Logger } from '../../instrument';\nimport { Tensor } from '../../tensor';\nimport { ShapeUtil } from '../../util';\n\nimport { createPackProgramInfoLoader } from './ops/pack';\nimport { createPackedReshape3DProgramInfoLoader, isReshapeCheap, processDims3D } from './ops/reshape-packed';\nimport { encodeAsUint8 } from './ops/uint8-encode';\nimport { createUnpackProgramInfoLoader } from './ops/unpack';\nimport { WebGLSessionHandler } from './session-handler';\nimport { EncoderUsage } from './texture-data-encoder';\nimport {\n  calculateTextureWidthAndHeight,\n  createTextureLayoutFromShape,\n  createTextureLayoutFromTextureType,\n} from './texture-layout';\nimport { Artifact, ProgramInfo, ProgramInfoLoader, TextureData, TextureLayout, TextureType } from './types';\n\nconst getProgramInfoUniqueKey = (\n  programInfo: ProgramInfo | ProgramInfoLoader,\n  inputTextureDatas: TextureData[],\n): string => {\n  const inputs = inputTextureDatas\n    .map((texture) => `${texture.unpackedShape.join(',')};${texture.width}x${texture.height}`)\n    .join('_');\n  let key = programInfo.name;\n  if (programInfo.cacheHint) {\n    key += '[' + programInfo.cacheHint + ']';\n  }\n  key += ':' + inputs;\n  return key;\n};\n\nexport class WebGLInferenceHandler implements InferenceHandler {\n  private packedTextureDataCache: Map<Tensor.Id, TextureData>;\n  private unpackedTextureDataCache: Map<Tensor.Id, TextureData>;\n  constructor(public session: WebGLSessionHandler) {\n    this.packedTextureDataCache = new Map();\n    this.unpackedTextureDataCache = new Map();\n  }\n\n  /**\n   * @returns [width, height]\n   */\n  calculateTextureWidthAndHeight(shape: readonly number[], textureType: TextureType): [number, number] {\n    return calculateTextureWidthAndHeight(this.session.layoutStrategy, shape, textureType);\n  }\n\n  executeProgram(program: ProgramInfo | ProgramInfoLoader, inputs: readonly Tensor[]): TextureData {\n    if (inputs.length < program.inputNames.length) {\n      throw new Error(`Input size mustn't be less than ${program.inputNames.length}.`);\n    }\n    if (program.inputNames.length !== program.inputTypes.length) {\n      throw new Error('input names size does not match input types');\n    }\n\n    // create texture info for input\n    const inputTextureDatas: TextureData[] = [];\n    for (let i = 0; i < program.inputNames.length; ++i) {\n      inputTextureDatas[i] = this.getOrCreateTextureData(inputs[i], program.inputTypes[i]);\n    }\n\n    const key = getProgramInfoUniqueKey(program, inputTextureDatas);\n    let artifact = this.session.programManager.getArtifact(key);\n    const programInfo = artifact\n      ? artifact.programInfo\n      : typeof (program as ProgramInfoLoader).get === 'function'\n        ? (program as ProgramInfoLoader).get()\n        : (program as ProgramInfo);\n\n    // create texture info for output\n    const outputTextureLayout = createTextureLayoutFromTextureType(\n      this.session.layoutStrategy,\n      programInfo.output.dims,\n      programInfo.output.textureType,\n    );\n    const outputTextureData = this.createTextureData(outputTextureLayout, programInfo.output.type);\n\n    if (!artifact) {\n      artifact = this.session.programManager.build(programInfo, inputTextureDatas, outputTextureData);\n      this.session.programManager.setArtifact(key, artifact);\n    }\n\n    this.runProgram(artifact, inputTextureDatas, outputTextureData);\n    return outputTextureData;\n  }\n\n  run(program: ProgramInfoLoader, inputs: readonly Tensor[]): Tensor {\n    const outputTextureData = this.executeProgram(program, inputs);\n    return outputTextureData.tensor;\n  }\n\n  private runProgram(artifact: Artifact, inputs: TextureData[], output: TextureData): void {\n    // input should match\n    for (let i = 0; i < inputs.length; ++i) {\n      if (!!inputs[i].isPacked !== (artifact.programInfo.inputTypes[i] === TextureType.packed)) {\n        throw new Error(`input[${i}] property packed inconsistent`);\n      }\n    }\n\n    // output should match\n    if (!!output.isPacked !== (artifact.programInfo.output.textureType === TextureType.packed)) {\n      throw new Error('output property packed inconsistent');\n    }\n\n    this.session.programManager.run(artifact, inputs, output);\n  }\n\n  /**\n   * Create a TextureData object from a tensor.\n   * Usage = EncoderUsage.UploadOnly.\n   * If a related texture data is found in cache, returns it;\n   * Otherwise:\n   *   Creates a new texture layout if not provided;\n   *   Creates WebGLTexture with the layout;\n   *   Upload tensor data to the texture;\n   *   Creates a texture data object associated with the given tensor.\n   * @param tensor the tensor with data to upload\n   */\n  private getOrCreateTextureData(tensor: Tensor, textureType: TextureType) {\n    let td = this.getTextureData(tensor.dataId, textureType === TextureType.packed);\n\n    if (!td) {\n      // check if we have texture data in different type\n      td = this.getTextureData(tensor.dataId, textureType !== TextureType.packed);\n      if (td) {\n        if (textureType === TextureType.packed) {\n          return this.pack(td);\n        } else {\n          return this.unpack(td);\n        }\n      }\n    }\n\n    if (!td) {\n      const layout = createTextureLayoutFromTextureType(this.session.layoutStrategy, tensor.dims, textureType);\n\n      if (textureType === TextureType.packedLastDimension) {\n        const group = 1;\n        const channels = 4;\n        const shape = tensor.dims;\n        if (shape.length === 4) {\n          // pre-processing for kernel data of Conv.\n          //\n          // TODO: currently this is a hacking to overwrite Conv's weight. The correct way to do this should be:\n          // 1. implement texture based const-folding\n          // 2. create a WebGL program \"preprocessConvWeight\" to do the same work as below\n          // 3. run the program before dotProduct.\n          //\n          const adjustedKernelShape = [shape[0], Math.ceil((shape[1] * shape[2] * shape[3]) / channels)];\n          const adjustedLayout = createTextureLayoutFromTextureType(\n            this.session.layoutStrategy,\n            adjustedKernelShape,\n            textureType,\n          );\n          let buffer = tensor.numberData;\n          if ((shape[1] * shape[2] * shape[3]) % channels !== 0) {\n            const numFeatureMaps = shape[0];\n            const oldRowSize = shape[1] * shape[2] * shape[3];\n            const newRowSize = Math.ceil((oldRowSize * group) / channels) * channels;\n            const newSize = numFeatureMaps * newRowSize;\n            buffer = new Float32Array(newSize);\n            for (let f = 0; f < numFeatureMaps; ++f) {\n              const oldOffset = f * oldRowSize;\n              const newOffset = f * newRowSize + (f % group) * oldRowSize;\n              buffer.set(tensor.numberData.subarray(oldOffset, oldOffset + oldRowSize), newOffset);\n            }\n          }\n          return this.createTextureData(adjustedLayout, tensor.type, buffer, tensor, EncoderUsage.UploadOnly);\n        }\n      }\n\n      if (textureType === TextureType.packed) {\n        const unpackedTextureLayout = createTextureLayoutFromShape(this.session.layoutStrategy, tensor.dims, 1, [], {\n          reverseWH: true,\n        });\n        const unpackedTextureData = this.createTextureData(\n          unpackedTextureLayout,\n          tensor.type,\n          tensor.numberData,\n          tensor,\n          EncoderUsage.UploadOnly,\n        );\n        td = this.pack(unpackedTextureData);\n      } else {\n        td = this.createTextureData(layout, tensor.type, tensor.numberData, tensor, EncoderUsage.UploadOnly);\n      }\n    }\n    return td;\n  }\n\n  /**\n   * Create a TextureData object using the given data and bind to the given tensor.\n   * Usage = EncoderUsage.UploadOnly.\n   * NOTE: this function is a hack for Conv implementation. should remove this function, after rewriting Conv\n   * implementation by Graph.Transformer\n   * @param dataType the tensor data type\n   * @param data the actual data to upload\n   * @param tensor the tensor to bind. tensor's data is ignored.\n   */\n  createTextureDataFromLayoutBindTensor(\n    layout: TextureLayout,\n    dataType: Tensor.DataType,\n    data: Tensor.NumberType,\n    tensor: Tensor,\n  ): TextureData {\n    return this.createTextureData(layout, dataType, data, tensor, EncoderUsage.UploadOnly);\n  }\n\n  private createTextureData(\n    layout: TextureLayout,\n    dataType: Tensor.DataType,\n    data?: Tensor.NumberType,\n    tensor?: Tensor,\n    usage?: EncoderUsage,\n  ): TextureData {\n    Logger.verbose('InferenceHandler', `Creating TextureData: layout:[${JSON.stringify(layout)}]`);\n    const texture = this.session.textureManager.createTextureFromLayout(dataType, layout, data, usage);\n    return this.createTextureDataFromTexture(layout, dataType, texture, tensor);\n  }\n\n  reshapeUnpacked(input: Tensor, reshapedDims: readonly number[]): Tensor {\n    const inputTD = this.getOrCreateTextureData(input, TextureType.unpacked);\n    const newTextureLayout: TextureLayout = {\n      channels: inputTD.channels,\n      height: inputTD.height,\n      width: inputTD.width,\n      // handle reshaping into scalar Tensors\n      shape: reshapedDims.length !== 0 ? reshapedDims : [1],\n      strides: ShapeUtil.computeStrides(reshapedDims),\n      unpackedShape: reshapedDims,\n    };\n    const newTextureData = this.createTextureDataFromTexture(newTextureLayout, input.type, inputTD.texture);\n    return newTextureData.tensor;\n  }\n\n  reshapePacked(input: Tensor, reshapedDims: readonly number[]): Tensor {\n    const inputTD = this.getOrCreateTextureData(input, TextureType.packed);\n\n    // check if the reshape is 'cheap'\n    if (isReshapeCheap(input.dims, reshapedDims)) {\n      const newTextureLayout: TextureLayout = {\n        channels: inputTD.channels,\n        height: inputTD.height,\n        width: inputTD.width,\n        // handle reshaping into scalar Tensors\n        shape: reshapedDims.length !== 0 ? reshapedDims : [1],\n        strides: ShapeUtil.computeStrides(reshapedDims),\n        unpackedShape: reshapedDims,\n        isPacked: true,\n      };\n      const newTextureData = this.createTextureDataFromTexture(newTextureLayout, input.type, inputTD.texture);\n      return newTextureData.tensor;\n    }\n\n    const squeezedInputShape = processDims3D(input.dims);\n    const squeezedOutputShape = processDims3D(reshapedDims);\n\n    const squeezedInputTensor = this.reshapePacked(input, squeezedInputShape);\n    const squeezedOutputTensor = this.run(\n      createPackedReshape3DProgramInfoLoader(this, squeezedInputTensor, squeezedOutputShape),\n      [squeezedInputTensor],\n    );\n    const outputTensor = this.reshapePacked(squeezedOutputTensor, reshapedDims);\n    return outputTensor;\n  }\n\n  cast(input: Tensor, type: Tensor.DataType): Tensor {\n    const inputTD = this.getOrCreateTextureData(input, TextureType.unpacked);\n    const newTextureData = this.createTextureDataFromTexture(inputTD as TextureLayout, type, inputTD.texture);\n    return newTextureData.tensor;\n  }\n\n  private createTextureDataFromTexture(\n    layout: TextureLayout,\n    dataType: Tensor.DataType,\n    texture: WebGLTexture,\n    tensor?: Tensor,\n    tensorId?: Tensor.Id,\n  ) {\n    const textureData: TextureData = {\n      ...layout,\n      tensor:\n        tensor ||\n        new Tensor(\n          layout.unpackedShape,\n          dataType,\n          (_id: Tensor.Id) => this.readTexture(textureData),\n          async (_id: Tensor.Id) => this.readTextureAsync(textureData),\n          undefined,\n          tensorId,\n        ),\n      texture,\n    };\n    this.setTextureData(textureData.tensor.dataId, textureData, layout.isPacked);\n    return textureData;\n  }\n\n  private getTextureData(tensorId: Tensor.Id, isPacked = false): TextureData | undefined {\n    return this.session.isInitializer(tensorId)\n      ? this.session.getTextureData(tensorId, isPacked)\n      : isPacked\n        ? this.packedTextureDataCache.get(tensorId)\n        : this.unpackedTextureDataCache.get(tensorId);\n  }\n  setTextureData(tensorId: Tensor.Id, td: TextureData, isPacked = false): void {\n    if (this.session.isInitializer(tensorId)) {\n      this.session.setTextureData(tensorId, td, isPacked);\n    } else {\n      (isPacked ? this.packedTextureDataCache : this.unpackedTextureDataCache).set(tensorId, td);\n    }\n  }\n  isTextureLayoutCached(tensor: Tensor, isPacked = false): boolean {\n    return !!this.getTextureData(tensor.dataId, isPacked);\n  }\n\n  dispose(): void {\n    this.session.textureManager.clearActiveTextures();\n    this.packedTextureDataCache.forEach((td) => this.session.textureManager.releaseTexture(td));\n    this.packedTextureDataCache = new Map();\n    this.unpackedTextureDataCache.forEach((td) => this.session.textureManager.releaseTexture(td));\n    this.unpackedTextureDataCache = new Map();\n  }\n\n  readTexture(textureData: TextureData): Tensor.NumberType {\n    if (textureData.isPacked) {\n      return this.readTexture(this.unpack(textureData));\n    }\n    if (!this.session.backend.glContext.isFloat32DownloadSupported) {\n      return this.session.textureManager.readUint8TextureAsFloat(encodeAsUint8(this, textureData));\n    }\n    return this.session.textureManager.readTexture(textureData, textureData.tensor.type, textureData.channels);\n  }\n\n  async readTextureAsync(textureData: TextureData): Promise<Tensor.NumberType> {\n    if (textureData.isPacked) {\n      return this.readTextureAsync(this.unpack(textureData));\n    }\n    if (!this.session.backend.glContext.isFloat32DownloadSupported) {\n      return this.session.textureManager.readUint8TextureAsFloat(encodeAsUint8(this, textureData));\n    }\n    return this.session.textureManager.readTextureAsync(textureData, textureData.tensor.type, textureData.channels);\n  }\n\n  pack(input: TextureData): TextureData {\n    const outputTextureData = this.executeProgram(createPackProgramInfoLoader(this, input.tensor), [input.tensor]);\n    return outputTextureData;\n  }\n\n  unpack(input: TextureData): TextureData {\n    const outputTextureData = this.executeProgram(createUnpackProgramInfoLoader(this, input.tensor), [input.tensor]);\n    return outputTextureData;\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nclass AttributeWithCacheKeyImpl {\n  constructor(attribute: Record<string, unknown>) {\n    Object.assign(this, attribute);\n  }\n\n  private key: string;\n  public get cacheKey(): string {\n    if (!this.key) {\n      this.key = Object.getOwnPropertyNames(this)\n        .sort()\n        .map((name) => `${(this as Record<string, unknown>)[name]}`)\n        .join(';');\n    }\n    return this.key;\n  }\n}\n\nexport interface AttributeWithCacheKey {\n  readonly cacheKey: string;\n}\n\nexport const createAttributeWithCacheKey = <T extends Record<string, unknown>>(\n  attribute: T,\n): T & AttributeWithCacheKey => new AttributeWithCacheKeyImpl(attribute) as unknown as T & AttributeWithCacheKey;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nexport interface BatchNormalizationAttributes extends AttributeWithCacheKey {\n  epsilon: number;\n  momentum: number;\n  spatial: number;\n}\n\nconst batchNormalizationProgramMetadata = {\n  name: 'BatchNormalization',\n  inputNames: ['A', 'Scale', 'B', 'Mean', 'Variance'],\n  inputTypes: [\n    TextureType.unpacked,\n    TextureType.unpacked,\n    TextureType.unpacked,\n    TextureType.unpacked,\n    TextureType.unpacked,\n  ],\n};\n\nexport const batchNormalization: OperatorImplementation<BatchNormalizationAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: BatchNormalizationAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const output = inferenceHandler.run(\n    {\n      ...batchNormalizationProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createBatchNormalizationProgramInfo(inferenceHandler, inputs, attributes),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseBatchNormalizationAttributes: OperatorInitialization<BatchNormalizationAttributes> = (\n  node: Graph.Node,\n): BatchNormalizationAttributes => {\n  const epsilon = node.attributes.getFloat('epsilon', 1e-5);\n  const momentum = node.attributes.getFloat('momentum', 0.9);\n  const spatial = node.attributes.getInt('spatial', 1);\n  return createAttributeWithCacheKey({ epsilon, momentum, spatial });\n};\n\nconst createBatchNormalizationProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: BatchNormalizationAttributes,\n): ProgramInfo => {\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const rank = inputs[0].dims.length;\n  const [scaleWidth, scaleHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    inputs[1].dims,\n    TextureType.unpacked,\n  );\n  const shaderSource = `\n  float process(int[${rank}] indices) {\n    vec2 position = offsetToCoords(indices[1], ${scaleWidth}, ${scaleHeight});\n    float scale = getColorAsFloat(${glsl.texture2D}(Scale, position));\n    float mean = getColorAsFloat(${glsl.texture2D}(Mean, position));\n    float variance = getColorAsFloat(${glsl.texture2D}(Variance, position));\n    float b = getColorAsFloat(${glsl.texture2D}(B, position));\n\n    return scale * ( (_A(indices) - mean) / sqrt(variance + float(${attributes.epsilon})) ) + b;\n  }`;\n  return {\n    ...batchNormalizationProgramMetadata,\n    output: { dims: inputs[0].dims, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 5) {\n    throw new Error('BatchNormalization requires 5 inputs.');\n  }\n\n  const X = inputs[0];\n  const scale = inputs[1];\n  const B = inputs[2];\n  const mean = inputs[3];\n  const var_ = inputs[4];\n\n  // input should atleast have three dimensions - N,C,dim1,...,dimn\n  // other inputs can have only one dimensions\n  if (\n    X.dims.length < 3 ||\n    scale.dims.length !== 1 ||\n    B.dims.length !== 1 ||\n    mean.dims.length !== 1 ||\n    var_.dims.length !== 1\n  ) {\n    throw new Error('invalid input shape.');\n  }\n  if (\n    scale.dims[0] !== X.dims[1] ||\n    B.dims[0] !== X.dims[1] ||\n    mean.dims[0] !== X.dims[1] ||\n    var_.dims[0] !== X.dims[1]\n  ) {\n    throw new Error('invalid input shape.');\n  }\n  if (\n    (X.type !== 'float32' && X.type !== 'float64') ||\n    (scale.type !== 'float32' && scale.type !== 'float64') ||\n    (B.type !== 'float32' && B.type !== 'float64') ||\n    (mean.type !== 'float32' && mean.type !== 'float64') ||\n    (var_.type !== 'float32' && var_.type !== 'float64')\n  ) {\n    throw new Error('invalid input tensor types.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { ProgramInfo, TextureLayout } from './types';\nimport { WebGLContext } from './webgl-context';\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum FunctionType {\n  ValueBased,\n  Positional,\n}\nexport interface GlslFunction<T extends FunctionType> {\n  body: string;\n  name: string;\n  type: T;\n}\nexport type GlslValueFunction = GlslFunction<FunctionType.ValueBased>;\nexport interface GlslPositionalFunction extends GlslFunction<FunctionType.Positional> {\n  inputShape: readonly number[];\n  outputShape: readonly number[];\n}\n\nexport class GlslContext {\n  constructor(\n    public glContext: WebGLContext,\n    public programInfo: ProgramInfo,\n    public inputTextureLayouts: TextureLayout[],\n    public outputTextureLayout: TextureLayout,\n  ) {}\n}\nexport abstract class GlslLib {\n  constructor(public context: GlslContext) {}\n  abstract getFunctions(): { [name: string]: GlslLibRoutine };\n  abstract getCustomTypes(): { [name: string]: string };\n}\n\n// abstraction to represent a GLSL library routine and it's dependencies\nexport class GlslLibRoutine {\n  constructor(\n    public routineBody: string,\n    public dependencies?: string[],\n  ) {}\n}\n\n// abstraction to represent a GLSL library routine and it's dependencies AS GRAPH Nodes\n// this level of abstraction is used to topologically sort routines before fragment shade inclusion\nexport class GlslLibRoutineNode {\n  dependencies: GlslLibRoutineNode[];\n  routineBody: string;\n  constructor(\n    public name: string,\n    routineBody?: string,\n    dependencies?: GlslLibRoutineNode[],\n  ) {\n    if (dependencies) {\n      this.dependencies = dependencies;\n    } else {\n      this.dependencies = [];\n    }\n\n    if (routineBody) {\n      this.routineBody = routineBody;\n    }\n  }\n  addDependency(node: GlslLibRoutineNode) {\n    if (node) {\n      this.dependencies.push(node);\n    }\n  }\n}\n\n// topologically sort GLSL library routines (graph nodes abstraction) before shader script inclusion\nexport class TopologicalSortGlslRoutines {\n  static returnOrderedNodes(nodes: GlslLibRoutineNode[]): GlslLibRoutineNode[] {\n    if (!nodes || nodes.length === 0) {\n      return [];\n    }\n\n    if (nodes.length === 1) {\n      return nodes;\n    }\n\n    const cycleCheck = new Set<string>();\n    const alreadyTraversed = new Set<string>();\n    const result = new Array<GlslLibRoutineNode>();\n\n    this.createOrderedNodes(nodes, cycleCheck, alreadyTraversed, result);\n    return result;\n  }\n\n  private static createOrderedNodes(\n    graphNodes: GlslLibRoutineNode[],\n    cycleCheck: Set<string>,\n    alreadyTraversed: Set<string>,\n    result: GlslLibRoutineNode[],\n  ) {\n    for (let i = 0; i < graphNodes.length; ++i) {\n      this.dfsTraverse(graphNodes[i], cycleCheck, alreadyTraversed, result);\n    }\n  }\n\n  private static dfsTraverse(\n    root: GlslLibRoutineNode,\n    cycleCheck: Set<string>,\n    alreadyTraversed: Set<string>,\n    result: GlslLibRoutineNode[],\n  ) {\n    // if this root has already been traversed return\n    if (!root || alreadyTraversed.has(root.name)) {\n      return;\n    }\n\n    // cyclic dependency has been detected\n    if (cycleCheck.has(root.name)) {\n      throw new Error(\"Cyclic dependency detected. Can't topologically sort routines needed for shader.\");\n    }\n\n    // hold this node to detect cycles if any\n    cycleCheck.add(root.name);\n\n    // traverse children in a dfs fashion\n    const dependencies = root.dependencies;\n    if (dependencies && dependencies.length > 0) {\n      for (let i = 0; i < dependencies.length; ++i) {\n        this.dfsTraverse(dependencies[i], cycleCheck, alreadyTraversed, result);\n      }\n    }\n\n    // add to result holder\n    result.push(root);\n\n    // mark this node as traversed so that we don't traverse from this again\n    alreadyTraversed.add(root.name);\n\n    // release the hold\n    cycleCheck.delete(root.name);\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { BroadcastUtil, ShapeUtil } from '../../../util';\nimport { FunctionType, GlslValueFunction } from '../glsl-definitions';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, TextureType } from '../types';\n\nexport function glslAdd(): GlslValueFunction {\n  const name = 'add_';\n  const body = `\n  float ${name}(float a, float b) {\n    return a + b;\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return v1 + v2;\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslDiv(): GlslValueFunction {\n  const name = 'div_';\n  const body = `\n  float ${name}(float a, float b) {\n    return a / b;\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return v1 / v2;\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslMul(): GlslValueFunction {\n  const name = 'mul_';\n  const body = `\n  float ${name}(float a, float b) {\n    return a * b;\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return v1 * v2;\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslSub(): GlslValueFunction {\n  const name = 'sub_';\n  const body = `\n  float ${name}(float a, float b) {\n    return a - b;\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return v1 - v2;\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslEqual(): GlslValueFunction {\n  const name = 'equal_';\n  const body = `\n  float ${name}(float a, float b) {\n    return float(a == b);\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return vec4(equal(v1, v2));\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslGreater(): GlslValueFunction {\n  const name = 'greater_';\n  const body = `\n  float ${name}(float a, float b) {\n    return float(a > b);\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return vec4( v1.r > v2.r ,\n      v1.g > v2.g,\n      v1.b > v2.b,\n      v1.a > v2.a );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslLess(): GlslValueFunction {\n  const name = 'less_';\n  const body = `\n  float ${name}(float a, float b) {\n    return float(a < b);\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return vec4( v1.r < v2.r ,\n                v1.g < v2.g,\n                v1.b < v2.b,\n                v1.a < v2.a );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslAnd(): GlslValueFunction {\n  const name = 'and_';\n  const body = `\n  float ${name}(float a, float b) {\n    return float( bool(a) && bool(b) );\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    bvec4 b1 = bvec4(v1);\n    bvec4 b2 = bvec4(v2);\n    return vec4( b1.r && b2.r ,\n                b1.g && b2.g,\n                b1.b && b2.b,\n                b1.a && b2.a );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslOr(): GlslValueFunction {\n  const name = 'or_';\n  const body = `\n  float ${name}(float a, float b) {\n    return float( bool(a) || bool(b) );\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    bvec4 b1 = bvec4(v1);\n    bvec4 b2 = bvec4(v2);\n    return vec4( b1.r || b2.r ,\n                b1.g || b2.g,\n                b1.b || b2.b,\n                b1.a || b2.a );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslXor(): GlslValueFunction {\n  const name = 'xor_';\n  const body = `\n  float ${name}(float a, float b) {\n    return float( bool(a) ^^ bool(b) );\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    bvec4 b1 = bvec4(v1);\n    bvec4 b2 = bvec4(v2);\n    return vec4( b1.r ^^ b2.r ,\n                b1.g ^^ b2.g,\n                b1.b ^^ b2.b,\n                b1.a ^^ b2.a );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslPow(): GlslValueFunction {\n  return glslBuiltinBinary('pow');\n}\nexport function glslPRelu(): GlslValueFunction {\n  const name = 'prelu_';\n  const body = `\n  float ${name}(float a, float b) {\n    return a < 0.0 ? a * b: a;\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return vec4(\n      v1.r < 0.0 ? v1.r * v2.r: v1.r,\n      v1.g < 0.0 ? v1.g * v2.g: v1.g,\n      v1.b < 0.0 ? v1.b * v2.b: v1.b,\n      v1.a < 0.0 ? v1.a * v2.a: v1.a\n      );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\n\nfunction glslBuiltinBinary(fname: string): GlslValueFunction {\n  const name = `${fname}_`;\n  const body = `\n  float ${name}(float a, float b) {\n    return ${fname}(a, b);\n  }\n  vec4 ${name}(vec4 v1, vec4 v2) {\n    return ${fname}(v1, v2);\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\n\nconst createBinaryProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  glslFunc: GlslValueFunction,\n  outputTensorType: Tensor.DataType = inputs[0].type,\n  cacheKey?: string,\n): ProgramInfoLoader => {\n  const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n  return {\n    name: glslFunc.name,\n    inputNames: ['A', 'B'],\n    inputTypes: [textureType, textureType],\n    cacheHint: cacheKey,\n    get: () => createBinaryProgramInfo(handler, inputs, glslFunc, outputTensorType),\n  };\n};\n\nconst createBinaryProgramInfo = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  glslFunc: GlslValueFunction,\n  outputTensorType: Tensor.DataType = inputs[0].type,\n): ProgramInfo => {\n  const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n  const isBroadcast = !ShapeUtil.areEqual(inputs[0].dims, inputs[1].dims);\n  let outputShape = inputs[0].dims;\n\n  const usePackedTexture = handler.session.pack;\n\n  if (isBroadcast) {\n    const calculatedShape = BroadcastUtil.calcShape(inputs[0].dims, inputs[1].dims, false);\n    if (!calculatedShape) {\n      throw new Error(\"Can't perform binary op on the given tensors\");\n    }\n    outputShape = calculatedShape;\n    const outputRank = outputShape.length;\n    const aRank = inputs[0].dims.length !== 0 ? inputs[0].dims.length : 1;\n    const bRank = inputs[1].dims.length !== 0 ? inputs[1].dims.length : 1;\n    const aBcast = inputs[0].dims.length !== 0 ? 'bcastIndices_A(indices, aindices);' : 'aindices[0] = 0;';\n    const bBcast = inputs[1].dims.length !== 0 ? 'bcastIndices_B(indices, bindices);' : 'bindices[0] = 0;';\n\n    const glsl = getGlsl(handler.session.backend.glContext.version);\n    const shaderSource = usePackedTexture\n      ? `\n      ${glslFunc.body}\n      void main() {\n        vec4 a = getAAtOutCoords();\n        vec4 b = getBAtOutCoords();\n        vec4 result = ${glslFunc.name}(a, b);\n        ${glsl.output} = result;\n      }`\n      : `\n      ${glslFunc.body}\n      float process(int indices[${outputRank}]) {\n        int aindices[${aRank}];\n        int bindices[${bRank}];\n        ${aBcast}\n        ${bBcast}\n        return ${glslFunc.name}(_A(aindices), _B(bindices));\n      }`;\n\n    return {\n      name: glslFunc.name,\n      inputNames: ['A', 'B'],\n      inputTypes: [textureType, textureType],\n      output: { dims: outputShape, type: outputTensorType, textureType },\n      shaderSource,\n      hasMain: usePackedTexture,\n    };\n  }\n  const glsl = getGlsl(handler.session.backend.glContext.version);\n  const shaderSource = `\n    ${glslFunc.body}\n    void main() {\n      vec4 v1 = ${glsl.texture2D}(A, TexCoords);\n      vec4 v2 = ${glsl.texture2D}(B, TexCoords);\n      vec4 result = ${glslFunc.name}(v1, v2);\n      ${glsl.output} = result;\n    }\n    `;\n\n  return {\n    name: glslFunc.name,\n    inputNames: ['A', 'B'],\n    inputTypes: [textureType, textureType],\n    output: { dims: inputs[0].dims, type: outputTensorType, textureType },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nexport const add = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslAdd()), inputs),\n];\n\nexport const and = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslAnd(), 'bool'), inputs),\n];\n\nexport const div = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslDiv()), inputs),\n];\n\nexport const equal = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslEqual(), 'bool'), inputs),\n];\n\nexport const greater = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslGreater(), 'bool'), inputs),\n];\n\nexport const less = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslLess(), 'bool'), inputs),\n];\n\nexport const mul = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslMul()), inputs),\n];\n\nexport const or = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslOr(), 'bool'), inputs),\n];\n\nexport const pow = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslPow()), inputs),\n];\n\nexport const pRelu = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslPRelu()), inputs),\n];\n\nexport const sub = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslSub()), inputs),\n];\n\nexport const xor = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createBinaryProgramInfoLoader(handler, inputs, glslXor(), 'bool'), inputs),\n];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ProtoUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nexport const cast: OperatorImplementation<Tensor.DataType> = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  to: Tensor.DataType,\n): Tensor[] => {\n  validateInputs(inputs);\n  return [handler.cast(inputs[0], to)];\n};\n\nexport const parseCastAttributes: OperatorInitialization<Tensor.DataType> = (node: Graph.Node): Tensor.DataType =>\n  ProtoUtil.tensorDataTypeFromProto(node.attributes.getInt('to'));\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Cast requires 1 input.');\n  }\n\n  if (inputs[0].type === 'string') {\n    throw new Error('Invalid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\nimport { getCoordsDataType, getGlChannels } from '../utils';\n\nimport { ConcatAttributes } from './concat';\nimport { getChannels, unpackFromChannel } from './packing-utils';\n\nconst createPackedConcatProgramMetadata = (inputCount: number, cacheHint: string) => ({\n  name: 'Concat (packed)',\n  inputNames: Array.from({ length: inputCount }, (_v, i) => `X${i}`),\n  inputTypes: Array(inputCount).fill(TextureType.packed),\n  cacheHint,\n});\n\nconst createPackedConcatProgramInfo = (\n  handler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  axis: number,\n): ProgramInfo => {\n  const inputShape = inputs[0].dims.slice();\n  if (axis >= inputShape.length || axis < -1 * inputShape.length) {\n    throw new Error(\"axis specified for concat doesn't match input dimensionality\");\n  }\n  if (axis < 0) {\n    axis = inputShape.length + axis;\n  }\n  // ensure all of the non-concatenated axes match each other\n  // calculate the shape of the output tensor while we do that\n  const outputShape = inputShape.slice(0);\n  for (let i = 1; i < inputs.length; i++) {\n    const dataNShape = inputs[i].dims.slice();\n    for (let axisIndex = 0; axisIndex < inputShape.length; axisIndex++) {\n      // add to the placeholder for computing output shape\n      if (axisIndex === axis) {\n        outputShape[axis] += dataNShape[axisIndex];\n      }\n      // ensure all non-cancatenated axes match each other\n      else if (inputShape[axisIndex] !== dataNShape[axisIndex]) {\n        throw new Error('non concat dimensions must match');\n      }\n    }\n  }\n\n  const rank = outputShape.length;\n  const coords = getChannels('coords', rank);\n  const dtype = getCoordsDataType(rank);\n  const unpackChannel = unpackFromChannel();\n\n  const shapes = inputs.map((i) => i.dims);\n  const channels = getGlChannels(rank);\n  const offsets: number[] = new Array(shapes.length - 1);\n\n  offsets[0] = shapes[0][axis];\n  for (let i = 1; i < offsets.length; i++) {\n    offsets[i] = offsets[i - 1] + shapes[i][axis];\n  }\n\n  const channel = channels[axis];\n  const lastChannels = channels.slice(-2);\n  const allChannels = channels.join();\n\n  let getValueSnippet = `if (${channel} < ${offsets[0]}) {\n        return getChannel(\n            getX0(${allChannels}), vec2(${lastChannels.join()}));\n        }`;\n  for (let i = 1; i < offsets.length; i++) {\n    const shift = offsets[i - 1];\n    getValueSnippet += `\n            if (${channel} < ${offsets[i]}  && ${channel} >= ${offsets[i - 1]}) {\n              return getChannel(\n                getX${i}(${getShiftedChannelsSnippet(channels, channel, shift)}),\n                vec2(${getShiftedChannelsSnippet(lastChannels, channel, shift)}));\n            }`;\n  }\n  const lastIndex = offsets.length;\n  const shift = offsets[offsets.length - 1];\n  getValueSnippet += `\n            return getChannel(\n              getX${lastIndex}(${getShiftedChannelsSnippet(channels, channel, shift)}),\n              vec2(${getShiftedChannelsSnippet(lastChannels, channel, shift)}));`;\n\n  const glsl = getGlsl(handler.session.backend.glContext.version);\n\n  const shaderSource = `\n          ${unpackChannel}\n          float getValue(${channels.map((x) => 'int ' + x)}) {\n            ${getValueSnippet}\n          }\n\n          void main() {\n            ${dtype} coords = getOutputCoords();\n            int lastDim = coords.${channels[rank - 1]};\n            coords.${channels[rank - 1]} = coords.${channels[rank - 2]};\n            coords.${channels[rank - 2]} = lastDim;\n\n            vec4 result = vec4(getValue(${coords}), 0., 0., 0.);\n\n            ${coords[rank - 1]} = ${coords[rank - 1]} + 1;\n            if (${coords[rank - 1]} < ${outputShape[rank - 1]}) {\n              result.g = getValue(${coords});\n            }\n\n            ${coords[rank - 2]} = ${coords[rank - 2]} + 1;\n            if (${coords[rank - 2]} < ${outputShape[rank - 2]}) {\n              result.a = getValue(${coords});\n            }\n\n            ${coords[rank - 1]} = ${coords[rank - 1]} - 1;\n            if (${coords[rank - 2]} < ${outputShape[rank - 2]} &&\n                ${coords[rank - 1]} < ${outputShape[rank - 1]}) {\n              result.b = getValue(${coords});\n            }\n            ${glsl.output} = result;\n          }\n        `;\n\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.packed },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nexport const createPackedConcatProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ConcatAttributes,\n): ProgramInfoLoader => {\n  const metadata = createPackedConcatProgramMetadata(inputs.length, attributes.cacheKey);\n  return { ...metadata, get: () => createPackedConcatProgramInfo(handler, metadata, inputs, attributes.axis) };\n};\n\nconst getShiftedChannelsSnippet = (channels: string[], channel: string, shift: number): string => {\n  const channelIdx = channels.indexOf(channel);\n  const res = channels.map((c, idx) => {\n    if (idx === channelIdx) {\n      return `${c} - ${shift}`;\n    } else {\n      return c;\n    }\n  });\n  return res.join();\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { createPackedConcatProgramInfoLoader } from './concat-packed';\n\nexport interface ConcatAttributes extends AttributeWithCacheKey {\n  readonly axis: number;\n}\n\nexport const concat: OperatorImplementation<ConcatAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ConcatAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  if (inferenceHandler.session.pack && inputs[0].dims.length > 1) {\n    const output = inferenceHandler.run(\n      createPackedConcatProgramInfoLoader(inferenceHandler, inputs, attributes),\n      inputs,\n    );\n    return [output];\n  } else {\n    const output = inferenceHandler.run(\n      createUnpackedConcatProgramInfoLoader(inferenceHandler, inputs, attributes),\n      inputs,\n    );\n    return [output];\n  }\n};\n\nconst createUnpackedConcatProgramMetadata = (inputCount: number, cacheHint: string) => ({\n  name: 'Concat',\n  inputNames: Array.from({ length: inputCount }, (_v, i) => `X${i}`),\n  inputTypes: Array(inputCount).fill(TextureType.unpacked),\n  cacheHint,\n});\n\nconst createUnpackedConcatProgramInfo = (\n  _handler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  axis: number,\n): ProgramInfo => {\n  const inputShape = inputs[0].dims.slice();\n  if (axis >= inputShape.length || axis < -1 * inputShape.length) {\n    throw new Error(\"axis specified for concat doesn't match input dimensionality\");\n  }\n  if (axis < 0) {\n    axis = inputShape.length + axis;\n  }\n  // ensure all of the non-concatenated axes match each other\n  // calculate the shape of the output tensor while we do that\n  const outputShape = inputShape.slice(0);\n  for (let i = 1; i < inputs.length; i++) {\n    const dataNShape = inputs[i].dims.slice();\n    for (let axisIndex = 0; axisIndex < inputShape.length; axisIndex++) {\n      // add to the placeholder for computing output shape\n      if (axisIndex === axis) {\n        outputShape[axis] += dataNShape[axisIndex];\n      }\n      // ensure all non-cancatenated axes match each other\n      else if (inputShape[axisIndex] !== dataNShape[axisIndex]) {\n        throw new Error('non concat dimensions must match');\n      }\n    }\n  }\n\n  const rank = outputShape.length;\n\n  const sizeInConcatAxis = new Array<number>(inputs.length);\n  let previousSum = 0;\n  for (let i = 0; i < sizeInConcatAxis.length; ++i) {\n    previousSum += inputs[i].dims[axis];\n    sizeInConcatAxis[i] = previousSum;\n  }\n\n  let getTextureIndexWhereDataResidesMethod = '';\n  // in most cases linear search is sufficient, as in most scenarios, only 2 tensors are concatenated\n  if (inputs.length < 5) {\n    getTextureIndexWhereDataResidesMethod = getTextureIndexWhereDataResidesLinearSearch(sizeInConcatAxis);\n  } else {\n    getTextureIndexWhereDataResidesMethod = getTextureIndexWhereDataResidesBinarySearch(sizeInConcatAxis);\n  }\n\n  const fetchDataFromCorrectTextureMethod = getFetchDataFromCorrectTextureMethod(inputs.length, rank);\n  const getSizeInConcatAxisValueFromIndexMethod = getGetSizeInConcatAxisValueFromIndexMethod(sizeInConcatAxis);\n  const shaderSource = `\n        ${fetchDataFromCorrectTextureMethod}\n        ${getSizeInConcatAxisValueFromIndexMethod}\n        ${getTextureIndexWhereDataResidesMethod}\n        float process(int indices[${rank}]) {\n          int textureIndex = getTextureWhereDataResides (indices[${axis}]);\n\n          if(textureIndex != 0) {\n            indices[${axis}] = indices[${axis}] - int(getSizeInConcatAxisValueFromIndex(textureIndex-int(1)));\n          }\n\n          return fetchDataFromCorrectTexture(textureIndex, indices);\n        }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst createUnpackedConcatProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ConcatAttributes,\n): ProgramInfoLoader => {\n  const metadata = createUnpackedConcatProgramMetadata(inputs.length, attributes.cacheKey);\n  return { ...metadata, get: () => createUnpackedConcatProgramInfo(handler, metadata, inputs, attributes.axis) };\n};\n\nconst getTextureIndexWhereDataResidesLinearSearch = (sizeInConcatAxis: number[]): string => {\n  const searchAxis = sizeInConcatAxis.map(\n    (size, i) => `if(index<${size}) {return ${i};}\n`,\n  );\n  return `int getTextureWhereDataResides(int index) {\n      ${searchAxis.join('')}\n    }`;\n};\n\n// TODO: Implement BinarySearch in GLSL\nconst getTextureIndexWhereDataResidesBinarySearch = (sizeInConcatAxis: number[]): string =>\n  getTextureIndexWhereDataResidesLinearSearch(sizeInConcatAxis);\n\nconst getFetchDataFromCorrectTextureMethod = (numberOfTensors: number, tensorRank: number) => {\n  const codeLines: string[] = [`float fetchDataFromCorrectTexture(int textureIndex, int indices[${tensorRank}]) {`];\n  for (let i = 0; i < numberOfTensors; ++i) {\n    if (i === 0) {\n      codeLines.push('\\t' + `if (textureIndex == ${i}) { return _X${i}(indices); }`);\n    } else if (i === numberOfTensors - 1) {\n      codeLines.push('\\t' + `else { return _X${i}(indices); }`);\n    } else {\n      codeLines.push('\\t' + `else if (textureIndex == ${i}) { return _X${i}(indices); }`);\n    }\n  }\n  codeLines.push('\\t' + '}');\n  return codeLines.join('\\n');\n};\n\nconst getGetSizeInConcatAxisValueFromIndexMethod = (sizeInConcatAxis: number[]): string => {\n  const codeLines: string[] = ['int getSizeInConcatAxisValueFromIndex(int index) {'];\n  for (let i = 0; i < sizeInConcatAxis.length; ++i) {\n    if (i === 0) {\n      codeLines.push('\\t' + `if (index == ${i}) { return ${sizeInConcatAxis[i]}; }`);\n    } else if (i === sizeInConcatAxis.length - 1) {\n      codeLines.push('\\t' + `else { return ${sizeInConcatAxis[i]}; }`);\n    } else {\n      codeLines.push('\\t' + `else if (index == ${i}) { return ${sizeInConcatAxis[i]}; }`);\n    }\n  }\n  codeLines.push('\\t' + '}');\n\n  return codeLines.join('\\n');\n};\n\nexport const parseConcatAttributes: OperatorInitialization<ConcatAttributes> = (node: Graph.Node): ConcatAttributes =>\n  createAttributeWithCacheKey({ axis: node.attributes.getInt('axis') });\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length < 1) {\n    throw new Error('too few inputs');\n  }\n\n  const inputType = inputs[0].type;\n  const inputDimensionality = inputs[0].dims.length;\n\n  // TODO: Support string concat\n  if (inputType === 'string') {\n    throw new Error('string tensor is not supported yet');\n  }\n\n  for (const input of inputs) {\n    // make sure types of all inputs match\n    if (input.type !== inputType) {\n      throw new Error('input tensors should be one type');\n    }\n\n    // make sure the dimensionality of all inputs are the same\n    if (input.dims.length !== inputDimensionality) {\n      throw new Error('input tensors should have the same shape');\n    }\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { Tensor } from '../../../tensor';\nimport { MAX_CLIP, MIN_CLIP } from '../../../util';\nimport { FunctionType, GlslValueFunction } from '../glsl-definitions';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nexport function glslAbs(): GlslValueFunction {\n  return glslBuiltinUnary('abs');\n}\nexport function glslAcos(): GlslValueFunction {\n  return glslBuiltinUnary('acos');\n}\nexport function glslAsin(): GlslValueFunction {\n  return glslBuiltinUnary('asin');\n}\nexport function glslAtan(): GlslValueFunction {\n  return glslBuiltinUnary('atan');\n}\nexport function glslCeil(): GlslValueFunction {\n  return glslBuiltinUnary('ceil');\n}\nexport function glslCos(): GlslValueFunction {\n  return glslBuiltinUnary('cos');\n}\nexport function glslElu(alpha: number): GlslValueFunction {\n  const name = 'elu';\n  const body = `\n  const float alpha = float(${alpha});\n\n  float ${name}_(float a) {\n    return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n  }\n  vec4 ${name}_(vec4 v) {\n    return vec4(${name}_(v.x), ${name}_(v.y), ${name}_(v.z), ${name}_(v.w));\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslExp(): GlslValueFunction {\n  return glslBuiltinUnary('exp');\n}\nexport function glslFloor(): GlslValueFunction {\n  return glslBuiltinUnary('floor');\n}\nexport function glslClip(min: number, max: number): GlslValueFunction {\n  const name = 'clip';\n  const body = `\n  const float min = float(${min});\n  const float max = float(${max});\n\n  float ${name}_(float a) {\n    return clamp(a, min, max);\n  }\n  vec4 ${name}_(vec4 v) {\n    return clamp(v, min, max);\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslIdentity(): GlslValueFunction {\n  const name = 'indentity';\n  const body = `\n  float ${name}_(float a) {\n    return a;\n  }\n  vec4 ${name}_(vec4 v) {\n    return v;\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslLeakyRelu(alpha: number): GlslValueFunction {\n  const name = 'leakyRelu';\n  const body = `\n  const float alpha = float(${alpha});\n\n  float ${name}_(float a) {\n    return a < 0.0 ? a * alpha : a;\n  }\n  vec4 ${name}_(vec4 v) {\n    return vec4(${name}_(v.x), ${name}_(v.y), ${name}_(v.z), ${name}_(v.w));\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslLog(): GlslValueFunction {\n  return glslBuiltinUnary('log');\n}\nexport function glslNeg(): GlslValueFunction {\n  const name = 'neg';\n  const body = `\n  float ${name}_(float a) {\n    return -a;\n  }\n  vec4 ${name}_(vec4 v) {\n    return -v;\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslNot(): GlslValueFunction {\n  const name = 'not';\n  const body = `\n  float ${name}_(float a) {\n    return float( ! bool(a) );\n  }\n  bool ${name}_(bool a) {\n    return !a;\n  }\n  vec4 ${name}_(vec4 v) {\n    return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n  }\n  bvec4 ${name}_(bvec4 v) {\n    return bvec4(!v.x, !v.y, !v.z, !v.w);\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslSin(): GlslValueFunction {\n  return glslBuiltinUnary('sin');\n}\nexport function glslRelu(): GlslValueFunction {\n  const name = 'relu';\n  const body = `\n  float ${name}_(float a) {\n    return max( a, 0.0 );\n  }\n  vec4 ${name}_(vec4 v) {\n    return max( v, 0.0 );\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslSigmoid(): GlslValueFunction {\n  const name = 'sigmoid';\n  const body = `\n  float ${name}_(float a) {\n    return 1.0 / (1.0 + exp(-a));\n  }\n  vec4 ${name}_(vec4 v) {\n    return 1.0 / (1.0 + exp(-v));\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nexport function glslSqrt(): GlslValueFunction {\n  return glslBuiltinUnary('sqrt');\n}\nexport function glslTan(): GlslValueFunction {\n  return glslBuiltinUnary('tan');\n}\nexport function glslTanh(): GlslValueFunction {\n  const name = 'tanh';\n  const body = `\n  float ${name}_(float a) {\n    a = clamp(a, -10., 10.);\n    a = exp(2.*a);\n    return (a - 1.) / (a + 1.);\n  }\n  vec4 ${name}_(vec4 v) {\n    v = clamp(v, -10., 10.);\n    v = exp(2.*v);\n    return (v - 1.) / (v + 1.);\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\nfunction glslBuiltinUnary(name: string): GlslValueFunction {\n  const body = `\n  float ${name}_(float a) {\n    return ${name}(a);\n  }\n  vec4 ${name}_(vec4 v) {\n    return ${name}(v);\n  }\n  `;\n  return { body, name, type: FunctionType.ValueBased };\n}\n\n/////\n/////\n/////\n\nconst createElementwiseProgramInfo = (\n  handler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  input: Tensor,\n  glslFunc: GlslValueFunction,\n): ProgramInfo => {\n  const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n  const glsl = getGlsl(handler.session.backend.glContext.version);\n  return {\n    ...metadata,\n    output: { dims: input.dims, type: input.type, textureType },\n    shaderSource: `\n     ${glslFunc.body}\n     void main() {\n       vec4 v = ${glsl.texture2D}(A, TexCoords);\n       v = ${glslFunc.name}_(v);\n       ${glsl.output} = v;\n     }\n     `,\n    hasMain: true,\n  };\n};\n\nconst createElementwiseProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  input: Tensor,\n  glslFunc: GlslValueFunction,\n  cacheKey?: string,\n): ProgramInfoLoader => {\n  const textureType = handler.session.pack ? TextureType.packed : TextureType.unpacked;\n  const metadata = { name: glslFunc.name, inputTypes: [textureType], inputNames: ['A'], cacheHint: cacheKey };\n  return { ...metadata, get: () => createElementwiseProgramInfo(handler, metadata, input, glslFunc) };\n};\n\nexport const abs = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAbs()), inputs),\n];\n\nexport const acos = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAcos()), inputs),\n];\n\nexport const asin = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAsin()), inputs),\n];\n\nexport const atan = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslAtan()), inputs),\n];\n\nexport interface ClipAttributes extends AttributeWithCacheKey {\n  readonly min: number;\n  readonly max: number;\n}\n\nexport const clip = (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: ClipAttributes): Tensor[] => [\n  handler.run(\n    createElementwiseProgramInfoLoader(\n      handler,\n      inputs[0],\n      glslClip(attributes.min, attributes.max),\n      attributes.cacheKey,\n    ),\n    inputs,\n  ),\n];\n\nexport const parseClipAttributes = (node: Graph.Node): ClipAttributes =>\n  createAttributeWithCacheKey({\n    min: node.attributes.getFloat('min', MIN_CLIP),\n    max: node.attributes.getFloat('max', MAX_CLIP),\n  });\n\nexport const clipV11 = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  const attributes = generateClipAttributesFromInputs(handler, inputs);\n  return clip(handler, [inputs[0]], attributes);\n};\n\nconst generateClipAttributesFromInputs = (handler: WebGLInferenceHandler, inputs: Tensor[]): ClipAttributes => {\n  if (\n    inputs.length >= 3 &&\n    (!handler.session.isInitializer(inputs[1].dataId) || !handler.session.isInitializer(inputs[2].dataId))\n  ) {\n    throw new Error('dynamic clip attributes are not allowed');\n  }\n\n  const min = inputs.length >= 3 ? inputs[1].numberData[0] : MIN_CLIP;\n  const max = inputs.length >= 3 ? inputs[2].numberData[0] : MAX_CLIP;\n  return createAttributeWithCacheKey({ min, max });\n};\n\nexport const ceil = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslCeil()), inputs),\n];\n\nexport const cos = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslCos()), inputs),\n];\n\nexport interface EluAttributes extends AttributeWithCacheKey {\n  readonly alpha: number;\n}\n\nexport const elu = (handler: WebGLInferenceHandler, inputs: Tensor[], attributes: EluAttributes): Tensor[] => [\n  handler.run(\n    createElementwiseProgramInfoLoader(handler, inputs[0], glslElu(attributes.alpha), attributes.cacheKey),\n    inputs,\n  ),\n];\n\nexport const parseEluAttributes = (node: Graph.Node): EluAttributes =>\n  createAttributeWithCacheKey({ alpha: node.attributes.getFloat('alpha', 1.0) });\n\nexport const exp = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslExp()), inputs),\n];\n\nexport const floor = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslFloor()), inputs),\n];\n\nexport const identity = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslIdentity()), inputs),\n];\n\nexport interface LeakyReluAttributes extends AttributeWithCacheKey {\n  readonly alpha: number;\n}\n\nexport const leakyRelu = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: LeakyReluAttributes,\n): Tensor[] => [\n  handler.run(\n    createElementwiseProgramInfoLoader(handler, inputs[0], glslLeakyRelu(attributes.alpha), attributes.cacheKey),\n    inputs,\n  ),\n];\n\nexport const parseLeakyReluAttributes = (node: Graph.Node): LeakyReluAttributes =>\n  createAttributeWithCacheKey({ alpha: node.attributes.getFloat('alpha', 0.01) });\n\nexport const log = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslLog()), inputs),\n];\n\nexport const neg = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslNeg()), inputs),\n];\n\nexport const not = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslNot()), inputs),\n];\n\nexport const relu = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslRelu()), inputs),\n];\n\nexport const sigmoid = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslSigmoid()), inputs),\n];\n\nexport const sin = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslSin()), inputs),\n];\n\nexport const sqrt = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslSqrt()), inputs),\n];\n\nexport const tan = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslTan()), inputs),\n];\n\nexport const tanh = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => [\n  handler.run(createElementwiseProgramInfoLoader(handler, inputs[0], glslTanh()), inputs),\n];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Attribute } from '../../../attribute';\nimport { MAX_CLIP, MIN_CLIP } from '../../../util';\nimport { GlslValueFunction } from '../glsl-definitions';\n\nimport { glslClip, glslRelu, glslSigmoid } from './unary-op';\n\nexport interface InternalActivationAttributes {\n  readonly activation: string;\n  readonly clipMin?: number;\n  readonly clipMax?: number;\n  readonly activationCacheKey: string;\n}\n\nexport function getActivationSnippet(attributes: InternalActivationAttributes) {\n  let func: GlslValueFunction;\n  switch (attributes.activation) {\n    case 'Relu':\n      func = glslRelu();\n      break;\n    case 'Sigmoid':\n      func = glslSigmoid();\n      break;\n    case 'Clip':\n      func = glslClip(attributes.clipMin!, attributes.clipMax!);\n      break;\n    // TODO: adding other activations that can be fused.\n    default:\n      return { activationFunction: '', applyActivation: '' };\n  }\n\n  const activationName = func.name;\n  const activationFunction = func.body;\n  const applyActivation = `value = ${activationName}_(value);`;\n  return { activationFunction, applyActivation };\n}\n\nexport const parseInternalActivationAttributes = (attributes: Attribute): InternalActivationAttributes => {\n  const activation = attributes.getString('activation', '');\n\n  if (activation === 'Clip') {\n    const [clipMin, clipMax] = attributes.getFloats('activation_params', [MIN_CLIP, MAX_CLIP]);\n    return { activation, clipMax, clipMin, activationCacheKey: `${activation}:${clipMin},${clipMax}` };\n  }\n  return { activation, activationCacheKey: activation };\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Logger } from '../../../instrument';\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { calculateOutputShape, ConvAttributes } from './conv';\nimport { getActivationSnippet } from './fuse-utils';\n\nconst createUnpackedGroupedConvProgramMetadata = (hasBias: boolean, cacheHint: string): ProgramMetadata => ({\n  name: 'GroupedConv',\n  inputNames: hasBias ? ['X', 'W', 'Bias'] : ['X', 'W'],\n  inputTypes: hasBias\n    ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked]\n    : [TextureType.unpacked, TextureType.unpacked],\n  cacheHint,\n});\n\nconst createUnpackedGroupedConvProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  metadata: ProgramMetadata,\n  attributes: ConvAttributes,\n): ProgramInfo => {\n  const hasBias = inputs.length > 2;\n  const processBias = hasBias ? 'value += getBias(output_channel);' : '';\n  const xShape = inputs[0].dims.slice();\n  const wShape = inputs[1].dims.slice();\n  const outputChannelsPerGroup = wShape[0] / attributes.group;\n  Logger.verbose(\n    'GroupedConv',\n    `autpPad:${attributes.autoPad}, dilations:${attributes.dilations}, group:${attributes.group}, kernelShape:${\n      attributes.kernelShape\n    }, pads:${attributes.pads}, strides:${attributes.strides}`,\n  );\n  const outputShape = calculateOutputShape(xShape, wShape, attributes.dilations, attributes.pads, attributes.strides);\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const { activationFunction, applyActivation } = getActivationSnippet(attributes);\n\n  const shaderSource = `\n  const ivec2 strides = ivec2(${attributes.strides[0]}, ${attributes.strides[1]});\n  const ivec2 pads = ivec2(${attributes.pads[0]}, ${attributes.pads[1]});\n  ${activationFunction}\n  void main() {\n    ivec4 coords = getOutputCoords();\n    int batch = coords.x;\n    int output_channel = coords.y;\n    ivec2 xRCCorner = coords.zw * strides - pads;\n    int group_id = output_channel / ${outputChannelsPerGroup};\n\n    float value = 0.0;\n    for (int wInChannel = 0; wInChannel < ${wShape[1]}; wInChannel++) {\n      int input_channel = group_id * ${wShape[1]} + wInChannel;\n      for (int wHeight = 0; wHeight < ${wShape[2]}; wHeight++) {\n        int xHeight = xRCCorner.x + wHeight * ${attributes.dilations[0]};\n\n        if (xHeight < 0 || xHeight >= ${xShape[2]}) {\n          continue;\n        }\n\n        for (int wWidth = 0; wWidth < ${wShape[3]}; wWidth++) {\n          int xWidth = xRCCorner.y + wWidth * ${attributes.dilations[1]};\n          if (xWidth < 0 || xWidth >= ${xShape[3]}) {\n            continue;\n          }\n\n          float xVal = getX(batch, input_channel, xWidth, xHeight);\n          float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n          value += xVal*wVal;\n        }\n      }\n    }\n    ${processBias}\n    ${applyActivation}\n    ${glsl.output} = vec4(value, .0, .0, .0);\n  }\n`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nexport const createUnpackedGroupedConvProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvAttributes,\n): ProgramInfoLoader => {\n  const metadata = createUnpackedGroupedConvProgramMetadata(inputs.length > 2, attributes.cacheKey);\n  return {\n    ...metadata,\n    get: () => createUnpackedGroupedConvProgramInfo(inferenceHandler, inputs, metadata, attributes),\n  };\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { ConvAttributes } from './conv';\nimport { unpackFromChannel } from './packing-utils';\n\nconst createPackedIm2ColProgramMetadata = (cacheHint: string) => ({\n  name: 'Im2Col (packed)',\n  inputNames: ['A'],\n  inputTypes: [TextureType.packed],\n  cacheHint,\n});\n\nconst createPackedIm2ColProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  x: Tensor,\n  w: Tensor,\n  outputShape: readonly number[],\n  attributes: ConvAttributes,\n): ProgramInfo => {\n  const xshape = x.dims;\n  const wshape = w.dims;\n  const rowDim = 2;\n  const colDim = 3;\n  const rank = outputShape.length;\n  const im2colShape = [wshape[1] * wshape[2] * wshape[3], outputShape[2] * outputShape[3]];\n  const kernelSize = wshape[2] * wshape[3];\n  const unpackChannel = unpackFromChannel();\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  let unrolled = '';\n\n  for (let row = 0; row <= 1; row++) {\n    for (let col = 0; col <= 1; col++) {\n      unrolled += `\n            blockIndex = rc.x + ${col};\n            pos = rc.y + ${row};\n\n            if(blockIndex < ${im2colShape[1]} && pos < ${im2colShape[0]}) {\n              offsetY = int(blockIndex / (${outputShape[rank - 1]})) * ${attributes.strides[0]} -\n                ${attributes.pads[0]};\n              d0 = offsetY + ${attributes.dilations[0]} * (imod(pos, ${kernelSize}) / ${wshape[2]});\n\n              if(d0 < ${xshape[rowDim]} && d0 >= 0) {\n                offsetX = imod(blockIndex, ${outputShape[rank - 1]}) * ${attributes.strides[1]} -\n                  ${attributes.pads[1]};\n                d1 = offsetX + ${attributes.dilations[1]} * imod(imod(pos, ${kernelSize}), ${wshape[2]});\n\n                if(d1 < ${xshape[colDim]} && d1 >= 0) {\n\n                  ch = int(float(pos)/ ${kernelSize}.);\n                    innerDims = vec2(d0, d1);\n                    result[${row * 2 + col}] = getChannel(\n                      getA(0, ch, int(innerDims.x),\n                      int(innerDims.y)), innerDims);\n                }\n              }\n            }\n\n          `;\n    }\n  }\n\n  const shaderSource = `\n      ${unpackChannel}\n\n      void main() {\n        ivec2 rc = getOutputCoords();\n          vec4 result = vec4(0.0);\n          int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n          vec2 innerDims;\n          ${unrolled}\n          ${glsl.output} = result;\n      }\n            `;\n  return {\n    ...metadata,\n    output: { dims: im2colShape, type: x.type, textureType: TextureType.packed },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nexport const createPackedIm2ColProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  x: Tensor,\n  w: Tensor,\n  outputShape: readonly number[],\n  attributes: ConvAttributes,\n): ProgramInfoLoader => {\n  const metadata = createPackedIm2ColProgramMetadata(attributes.cacheKey);\n  return {\n    ...metadata,\n    get: () => createPackedIm2ColProgramInfo(inferenceHandler, metadata, x, w, outputShape, attributes),\n  };\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { BroadcastUtil, ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\nimport { getCoordsDataType, getGlChannels } from '../utils';\n\nimport { getActivationSnippet, InternalActivationAttributes, parseInternalActivationAttributes } from './fuse-utils';\nimport { createPackedMatmulProgramInfoLoader } from './matmul-pack';\n\nexport const matMul: OperatorImplementation<InternalActivationAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: InternalActivationAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  if (inferenceHandler.session.pack) {\n    return [inferenceHandler.run(createPackedMatmulProgramInfoLoader(inferenceHandler, inputs, attributes), inputs)];\n  } else {\n    return [inferenceHandler.run(createMatmulProgramInfoLoader(inputs, attributes), inputs)];\n  }\n};\n\nexport const parseMatMulAttributes: OperatorInitialization<InternalActivationAttributes> = (\n  node: Graph.Node,\n): InternalActivationAttributes => parseInternalActivationAttributes(node.attributes);\n\nconst createMatmulProgramMetadata = (hasBias: boolean, cacheHint: string) => ({\n  name: 'MatMul',\n  inputNames: hasBias ? ['A', 'B', 'Bias'] : ['A', 'B'],\n  inputTypes: hasBias\n    ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked]\n    : [TextureType.unpacked, TextureType.unpacked],\n  cacheHint,\n});\n\nfunction createMatmulProgramInfo(\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  activationAttributes: InternalActivationAttributes,\n): ProgramInfo {\n  const aShape = inputs[0].dims;\n  const bShape = inputs[1].dims;\n  const outputShape = BroadcastUtil.calcShape(aShape, bShape, true);\n  if (!outputShape) {\n    throw new Error(\"Can't use matmul on the given tensors\");\n  }\n  const coordsDataType = getCoordsDataType(outputShape.length);\n  const allGlChannels = getGlChannels();\n  const { activationFunction, applyActivation } = getActivationSnippet(activationAttributes);\n\n  const hasBias = inputs.length > 2;\n  const processBias = hasBias ? 'value += getBiasForMatmul();' : '';\n  const getBiasForMatmulSnippet = hasBias\n    ? `${getBiasForMatmul(coordsDataType, allGlChannels, inputs[2].dims, outputShape, false)}`\n    : '';\n\n  const rank = outputShape.length;\n  const arank = aShape.length;\n  const brank = bShape.length;\n  const sharedDim = aShape[aShape.length - 1];\n  const shaderSource = `\n    ${activationFunction}\n    ${getBiasForMatmulSnippet}\n    float process(int indices[${rank}]) {\n        int a[${arank}];\n        int b[${brank}];\n        bcastMatmulIndices_A(indices, a);\n        bcastMatmulIndices_B(indices, b);\n\n        float value;\n        for (int k=0; k<${sharedDim}; ++k) {\n            a[${arank - 1}] = k;\n            b[${brank - 2}] = k;\n            value += _A(a) * _B(b);\n        }\n        ${processBias}\n        ${applyActivation}\n        return value;\n    }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n}\n\nexport function createMatmulProgramInfoLoader(\n  inputs: Tensor[],\n  activationAttributes: InternalActivationAttributes,\n): ProgramInfoLoader {\n  const metadata = createMatmulProgramMetadata(inputs.length > 2, activationAttributes.activationCacheKey);\n  return { ...metadata, get: () => createMatmulProgramInfo(metadata, inputs, activationAttributes) };\n}\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 2) {\n    throw new Error('MatMul requires 2 inputs.');\n  }\n\n  if (inputs[0].dims[inputs[0].dims.length - 1] !== inputs[1].dims[inputs[1].dims.length - 2]) {\n    throw new Error('shared dimension does not match.');\n  }\n\n  if (\n    (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') ||\n    (inputs[1].type !== 'float32' && inputs[1].type !== 'float64')\n  ) {\n    throw new Error('inputs should be float type');\n  }\n\n  if (inputs[0].type !== inputs[1].type) {\n    throw new Error('inputs types should match');\n  }\n};\n\nexport function getBiasForMatmul(\n  coordsDataType: string,\n  allGlChannels: readonly string[],\n  inShape: readonly number[],\n  outShape: readonly number[],\n  isPacked: boolean,\n): string {\n  let unpackedCoordsSnippet = '';\n  const inRank = inShape.length;\n  const outRank = outShape.length;\n  const rankDiff = outRank - inRank;\n  if (outRank < 2 && inRank > 0) {\n    unpackedCoordsSnippet = 'coords';\n  } else {\n    unpackedCoordsSnippet = inShape.map((_s, i) => `coords.${allGlChannels[i + rankDiff]}`).join(', ');\n  }\n  const broadcastDims = BroadcastUtil.getBroadcastDims(inShape, outShape);\n  const coordsSnippet = broadcastDims.map((d) => `coords.${allGlChannels[d + rankDiff]} = 0;`).join('\\n');\n  const inSize = ShapeUtil.size(inShape);\n  const isInputScalar = inSize === 1;\n  let output = 'vec4(outputValue.xx, outputValue.yy)';\n  if (isInputScalar) {\n    output = 'vec4(outputValue.x)';\n  }\n  const getBiasForMatmulSource = isPacked\n    ? `\nvec4 getBiasForMatmul() {\n  ${coordsDataType} coords = getOutputCoords();\n  ${coordsSnippet}\n  vec4 outputValue = getBias(${unpackedCoordsSnippet});\n  return ${output};\n}`\n    : `\nfloat getBiasForMatmul() {\n  ${coordsDataType} coords = getOutputCoords();\n  ${coordsSnippet}\n  return getBias(coords.x);\n}`;\n\n  return getBiasForMatmulSource;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { BroadcastUtil, ShapeUtil } from '../../../util';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\nimport { getCoordsDataType, getGlChannels } from '../utils';\n\nimport { getActivationSnippet, InternalActivationAttributes } from './fuse-utils';\nimport { getBiasForMatmul } from './matmul';\n\nconst createPackedMatmulProgramMetadata = (hasBias: boolean, cacheHint: string) => ({\n  name: 'MatMul (packed)',\n  inputNames: hasBias ? ['A', 'B', 'Bias'] : ['A', 'B'],\n  inputTypes: hasBias\n    ? [TextureType.packed, TextureType.packed, TextureType.packed]\n    : [TextureType.packed, TextureType.packed],\n  cacheHint,\n});\n\nconst createPackedMatmulProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  activationAttributes: InternalActivationAttributes,\n): ProgramInfo => {\n  const hasBias = inputs.length > 2;\n  const processBias = hasBias ? 'value += getBiasForMatmul();' : '';\n  const aShape = inputs[0].dims;\n  const bShape = inputs[1].dims;\n  const outputShape = BroadcastUtil.calcShape(aShape, bShape, true);\n  const isBroadcast = !ShapeUtil.areEqual(inputs[0].dims, inputs[1].dims);\n\n  if (!outputShape) {\n    throw new Error(\"Can't use matmul on the given tensors\");\n  }\n  const sharedDim = aShape[aShape.length - 1];\n  const sharedDimIndex = Math.ceil(sharedDim / 2);\n  const aRank = aShape.length;\n  const bRank = bShape.length;\n\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const coordsDataType = getCoordsDataType(outputShape.length);\n  const outRank = outputShape.length;\n  const allGlChannels = getGlChannels();\n  const { activationFunction, applyActivation } = getActivationSnippet(activationAttributes);\n\n  const getBiasForMatmulSnippet = hasBias\n    ? `${getBiasForMatmul(coordsDataType, allGlChannels, inputs[2].dims, outputShape, true)}`\n    : '';\n\n  const getBcastedSamplerForMatmulSnippet = isBroadcast\n    ? `${getBcastSamplerForMatmul(coordsDataType, allGlChannels, inputs, outputShape)}`\n    : '';\n\n  const getSamplerAInLoopSnippet = isBroadcast ? 'getAAtOutCoordsMatmul(i)' : `getA(${getA(allGlChannels, aRank)})`;\n  const getSamplerBInLoopSnippet = isBroadcast ? 'getBAtOutCoordsMatmul(i)' : `getB(${getB(allGlChannels, bRank)})`;\n  const getOutputCoordsSnippet = isBroadcast\n    ? ''\n    : `${coordsDataType} rc =\n          getOutputCoords(); int lastDim = rc.${allGlChannels[outRank - 1]}; rc.${allGlChannels[outRank - 1]} =\n          rc.${allGlChannels[outRank - 2]}; rc.${allGlChannels[outRank - 2]} = lastDim;\n      `;\n  const shaderSource = `\n            ${getBcastedSamplerForMatmulSnippet}\n            ${getBiasForMatmulSnippet}\n            ${activationFunction}\n            void main() {\n              ${getOutputCoordsSnippet}\n\n              vec4 value = vec4(0);\n              for (int i = 0; i < ${sharedDimIndex}; i++) {\n                vec4 a = ${getSamplerAInLoopSnippet};\n                vec4 b = ${getSamplerBInLoopSnippet};\n\n                value += (a.rrbb * b.rgrg);\n                value += (a.ggaa * b.baba);\n              }\n              ${processBias}\n              ${applyActivation}\n              ${glsl.output} = value;\n            }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.packed },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nexport const createPackedMatmulProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  activationAttributes: InternalActivationAttributes,\n): ProgramInfoLoader => {\n  const metadata = createPackedMatmulProgramMetadata(inputs.length > 2, activationAttributes.activationCacheKey);\n  return {\n    ...metadata,\n    get: () => createPackedMatmulProgramInfo(inferenceHandler, metadata, inputs, activationAttributes),\n  };\n};\n\nfunction getBcastSamplerForMatmul(\n  coordsDataType: string,\n  allGlChannels: readonly string[],\n  inputs: Tensor[],\n  outShape: readonly number[],\n): string {\n  let unpackedACoordsSnippet = [];\n  let unpackedBCoordsSnippet = [];\n\n  const inAShape = inputs[0].dims;\n  const inBShape = inputs[1].dims;\n\n  const inARank = inAShape.length;\n  const inBRank = inBShape.length;\n\n  const outRank = outShape.length;\n  const rankADiff = outRank - inARank;\n  const rankBDiff = outRank - inBRank;\n\n  unpackedACoordsSnippet = inAShape.map((_s, i) => `coords.${allGlChannels[i + rankADiff]}`);\n  unpackedACoordsSnippet[inARank - 1] = 'i*2';\n  unpackedACoordsSnippet.join(', ');\n  unpackedBCoordsSnippet = inBShape.map((_s, i) => `coords.${allGlChannels[i + rankBDiff]}`);\n  unpackedBCoordsSnippet[inBRank - 2] = 'i*2';\n  unpackedBCoordsSnippet.join(', ');\n\n  const broadcastADims = BroadcastUtil.getBroadcastDims(inAShape, outShape);\n  const broadcastBDims = BroadcastUtil.getBroadcastDims(inBShape, outShape);\n\n  const coordsASnippet = broadcastADims.map((d) => `coords.${allGlChannels[d + rankADiff]} = 0;`).join('\\n');\n  const coordsBSnippet = broadcastBDims.map((d) => `coords.${allGlChannels[d + rankBDiff]} = 0;`).join('\\n');\n  const swapDimSnippet = `int lastDim = coords.${allGlChannels[outRank - 1]};\n  coords.${allGlChannels[outRank - 1]} = coords.${allGlChannels[outRank - 2]};\n  coords.${allGlChannels[outRank - 2]} = lastDim;`;\n\n  const getBcastSamplerMatmulSource = `\nvec4 getAAtOutCoordsMatmul(int i) {\n  ${coordsDataType} coords = getOutputCoords();\n  ${swapDimSnippet}\n  ${coordsASnippet}\n  vec4 outputValue = getA(${unpackedACoordsSnippet});\n  return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n  ${coordsDataType} coords = getOutputCoords();\n  ${swapDimSnippet}\n  ${coordsBSnippet}\n  vec4 outputValue = getB(${unpackedBCoordsSnippet});\n  return outputValue;\n}`;\n\n  return getBcastSamplerMatmulSource;\n}\n\nfunction getA(allGlChannels: string[], rank: number): string {\n  let res = '';\n  for (let i = 0; i < rank - 2; i++) {\n    res += `rc.${allGlChannels[i]}, `;\n  }\n  res += `rc.${allGlChannels[rank - 2]}, ` + 'i*2';\n  return res;\n}\n\nfunction getB(allGlChannels: string[], rank: number): string {\n  let res = '';\n  for (let i = 0; i < rank - 2; i++) {\n    res += `rc.${allGlChannels[i]}, `;\n  }\n  res += 'i*2, ' + `rc.${allGlChannels[rank - 1]}`;\n  return res;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nimport { calculateOutputShape, ConvAttributes } from './conv';\nimport { createPackedIm2ColProgramInfoLoader } from './im2col-pack';\nimport { createPackedMatmulProgramInfoLoader } from './matmul-pack';\n\nexport const conv2DPackedPointwise = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvAttributes,\n): Tensor => {\n  const xshape = inputs[0].dims;\n  const kshape = inputs[1].dims;\n  const outputShape = calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n  const reshapedX = inferenceHandler.reshapePacked(inputs[0], [xshape[1], xshape[2] * xshape[3]]);\n  const reshapedK = inferenceHandler.reshapePacked(inputs[1], [kshape[0], kshape[1]]);\n\n  const matmulInputs = inputs.length > 2 ? [reshapedK, reshapedX, inputs[2]] : [reshapedK, reshapedX];\n  const matmulOutput = inferenceHandler.run(\n    createPackedMatmulProgramInfoLoader(inferenceHandler, matmulInputs, attributes),\n    matmulInputs,\n  );\n  return inferenceHandler.reshapePacked(matmulOutput, outputShape);\n};\n\nexport const conv2DPacked = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvAttributes,\n): Tensor => {\n  const xshape = inputs[0].dims;\n  const kshape = inputs[1].dims;\n  const outputShape = calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n\n  // run im2col\n  const im2colOutput = inferenceHandler.run(\n    createPackedIm2ColProgramInfoLoader(inferenceHandler, inputs[0], inputs[1], outputShape, attributes),\n    [inputs[0]],\n  );\n\n  // reshape kernel\n  const kernelReshaped = inferenceHandler.reshapePacked(inputs[1], [kshape[0], kshape[1] * kshape[2] * kshape[3]]);\n\n  // run matmul\n  const matmulInputs = inputs.length === 3 ? [kernelReshaped, im2colOutput, inputs[2]] : [kernelReshaped, im2colOutput];\n  const matmulOutput = inferenceHandler.run(\n    createPackedMatmulProgramInfoLoader(inferenceHandler, matmulInputs, attributes),\n    matmulInputs,\n  );\n\n  // reshape output\n  const outputReshaped = inferenceHandler.reshapePacked(matmulOutput, outputShape);\n  return outputReshaped;\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { ConvAttributes } from './conv';\n\nconst createIm2ColProgramMetadata = (cacheHint: string) => ({\n  name: 'Im2Col',\n  inputNames: ['X'],\n  inputTypes: [TextureType.unpacked],\n  cacheHint,\n});\n\nconst createIm2ColProgramInfo = (\n  _inferenceHandler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  x: Tensor,\n  w: Tensor,\n  outputShape: readonly number[],\n  attributes: ConvAttributes,\n): ProgramInfo => {\n  const xshape = x.dims;\n  const wshape = w.dims;\n\n  const rank = outputShape.length;\n  const im2colDims = calculateIm2ColDims(xshape, wshape, outputShape, 4);\n\n  const shaderSource = `\n        const int XC = ${xshape[1]};\n        const int XH = ${xshape[2]};\n        const int XW = ${xshape[3]};\n        const int KH = ${attributes.kernelShape[0]};\n        const int KW = ${attributes.kernelShape[1]};\n        const int dilationH = ${attributes.dilations[0]};\n        const int dilationW = ${attributes.dilations[1]};\n        const int strideH = ${attributes.strides[0]};\n        const int strideW = ${attributes.strides[1]};\n        const int padH = ${attributes.pads[0]};\n        const int padW = ${attributes.pads[1]};\n        const int KHKW = KH*KW;\n        const int XCKHKW = XC * KHKW;\n        const int outputChannels = 4;\n        vec4 process(int indices[${rank}]) {\n          int b  = indices[0]; // batch size\n          int oh = indices[1] * strideH - padH; //output height\n          int ow = indices[2] * strideW - padW; //output width\n          int p = indices[3] * outputChannels; //patch\n          vec4 value = vec4(0.0);\n          for(int i=0; i < outputChannels; ++i) {\n            if(p < XCKHKW) {\n              int patchC = p / KHKW;\n              int patchH = (p - patchC*KHKW) / KW;\n              int patchW = (p - patchC*KHKW) - patchH * KW;\n              int xh2 = oh + patchH * dilationH;\n              int xw2 = ow + patchW * dilationW;\n              int x[${xshape.length}];\n              x[0] = b;\n              x[1] = patchC;\n              x[2] = xh2;\n              x[3] = xw2;\n              if(xh2 >= 0 &&\n                  xh2 < XH &&\n                  xw2 >= 0 &&\n                  xw2 < XW) {\n                value[i] = _X(x);\n              }\n            }\n            ++p;\n          }\n          return value;\n        }\n        `;\n  return {\n    ...metadata,\n    output: { dims: im2colDims, type: x.type, textureType: TextureType.packedLastDimension },\n    shaderSource,\n  };\n};\n\nexport const createIm2ColProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  x: Tensor,\n  w: Tensor,\n  outputShape: readonly number[],\n  attributes: ConvAttributes,\n): ProgramInfoLoader => {\n  const metadata = createIm2ColProgramMetadata(attributes.cacheKey);\n  return {\n    ...metadata,\n    get: () => createIm2ColProgramInfo(inferenceHandler, metadata, x, w, outputShape, attributes),\n  };\n};\n\nexport const calculateIm2ColDims = (\n  inputShape: readonly number[],\n  kernelShape: readonly number[],\n  outputShape: readonly number[],\n  channels = 4,\n): number[] => [\n  outputShape[0],\n  outputShape[2],\n  outputShape[3],\n  Math.ceil((inputShape[1] * kernelShape[2] * kernelShape[3]) / channels),\n];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { getActivationSnippet, InternalActivationAttributes } from './fuse-utils';\nimport { calculateIm2ColDims } from './im2col';\n\nconst createDotProductProgramMetadata = (hasBias: boolean, attributes: InternalActivationAttributes) => ({\n  name: 'ConvDotProduct',\n  inputNames: hasBias ? ['Im2Col', 'K', 'B'] : ['Im2Col', 'K'],\n  inputTypes: hasBias\n    ? [TextureType.unpacked, TextureType.packedLastDimension, TextureType.unpacked]\n    : [TextureType.unpacked, TextureType.packedLastDimension],\n  cacheKey: attributes.activationCacheKey,\n});\n\nconst createDotProductProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  inputs: readonly Tensor[],\n  outputShape: number[],\n  attributes: InternalActivationAttributes,\n): ProgramInfo => {\n  const xshape = inputs[0].dims;\n  const kshape = inputs[1].dims;\n  const adjustedKernelShape = [kshape[0], Math.ceil((xshape[1] * kshape[2] * kshape[3]) / 4)];\n  const im2colShape = calculateIm2ColDims(xshape, kshape, outputShape);\n  const [kWidth, kHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    adjustedKernelShape,\n    TextureType.packedLastDimension,\n  );\n\n  const im2colStrides = ShapeUtil.computeStrides(im2colShape);\n  const [im2colWidth, im2colHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    im2colShape,\n    TextureType.packedLastDimension,\n  );\n  const rank = outputShape.length;\n\n  const initValue = inputs.length < 3 ? '0.0' : '_B(b)';\n  const sharedDim = Math.ceil((xshape[1] * kshape[2] * kshape[3]) / 4);\n  const { activationFunction, applyActivation } = getActivationSnippet(attributes);\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const shaderSource = `\n${activationFunction}\nfloat process(int indices[${rank}]) {\n  int b[1];\n  b[0] = indices[1];\n  int im2col[4];\n  im2col[0] = indices[0];\n  im2col[1] = indices[2];\n  im2col[2] = indices[3];\n  int im2colOffset = im2col[0] * ${im2colStrides[0]} + im2col[1] * ${im2colStrides[1]} + im2col[2] * ${\n    im2colStrides[2]\n  };\n  int kernelOffset = indices[1] * ${adjustedKernelShape[1]};\n  float value = ${initValue};\n  for (int i = 0; i < ${sharedDim}; ++i) {\n    vec2 im2colCoords = offsetToCoords(im2colOffset, ${im2colWidth}, ${im2colHeight});\n    vec2 kernelCoords = offsetToCoords(kernelOffset, ${kWidth}, ${kHeight});\n    value += dot(${glsl.texture2D}(Im2Col, im2colCoords), ${glsl.texture2D}(K, kernelCoords));\n    ++im2colOffset;\n    ++kernelOffset;\n  }\n  ${applyActivation}\n  return value;\n}`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nexport const createDotProductProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  outputShape: number[],\n  attributes: InternalActivationAttributes,\n): ProgramInfoLoader => {\n  const metadata = createDotProductProgramMetadata(inputs.length > 2, attributes);\n  return {\n    ...metadata,\n    get: () => createDotProductProgramInfo(inferenceHandler, metadata, inputs, outputShape, attributes),\n  };\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { InferenceHandler } from '../../../backend';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { PoolConvUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nimport { createUnpackedGroupedConvProgramInfoLoader } from './conv-grouped';\nimport { conv2DPacked } from './conv-pack';\nimport { createDotProductProgramInfoLoader } from './dot-product';\nimport { InternalActivationAttributes, parseInternalActivationAttributes } from './fuse-utils';\nimport { createIm2ColProgramInfoLoader } from './im2col';\nimport { createMatmulProgramInfoLoader } from './matmul';\n\nexport const calculateOutputShape = (\n  inputShape: readonly number[],\n  kernelShape: readonly number[],\n  dilations: readonly number[],\n  adjustPads: readonly number[],\n  strides: readonly number[],\n): number[] => {\n  const batchSize = inputShape[0];\n  const inputSpatialShape = inputShape.slice(2);\n  const spatialRank = inputSpatialShape.length;\n  const outChannels = kernelShape[0];\n  const kernelSpatialShape = kernelShape.slice(2);\n  const dilatedKernelShape = kernelSpatialShape.map((v, i) => v + (v - 1) * (dilations[i] - 1));\n  const inputSpatialShapeWithPad = inputSpatialShape.map((v, i) => v + adjustPads[i] + adjustPads[i + spatialRank]);\n  const outputSpatialShape = inputSpatialShapeWithPad.map((v, i) =>\n    Math.floor((v - dilatedKernelShape[i] + strides[i]) / strides[i]),\n  );\n  const outputShape = [batchSize, outChannels].concat(...outputSpatialShape);\n  return outputShape;\n};\n\nexport interface ConvAttributes extends InternalActivationAttributes, AttributeWithCacheKey {\n  readonly autoPad: string;\n  readonly dilations: readonly number[];\n  readonly group: number;\n  readonly kernelShape: readonly number[];\n  readonly pads: readonly number[];\n  readonly strides: readonly number[];\n}\n\nexport const conv: OperatorImplementation<ConvAttributes> = (\n  inferenceHandler: InferenceHandler,\n  inputs: Tensor[],\n  attributes: ConvAttributes,\n): Tensor[] => {\n  validateInputs(inputs, attributes); // currently will fail if not conv2D\n  return conv2d(inferenceHandler, inputs, attributes);\n};\n\nconst conv2d: OperatorImplementation<ConvAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ConvAttributes,\n): Tensor[] => {\n  const adjustedAttributes = getAdjustedConvAttributes(attributes, inputs);\n  const packMode = inferenceHandler.session.pack;\n  const isPointwise = adjustedAttributes.kernelShape[0] === 1 && adjustedAttributes.kernelShape[1] === 1;\n  if (adjustedAttributes.group > 1) {\n    const result = inferenceHandler.run(\n      createUnpackedGroupedConvProgramInfoLoader(inferenceHandler, inputs, adjustedAttributes),\n      inputs,\n    );\n    return [result];\n  } else if (isPointwise && packMode) {\n    return [conv2DUnpackedPointwise(inferenceHandler, inputs, adjustedAttributes)];\n  } else if (packMode && inputs[0].dims.length === 4 && inputs[0].dims[0] === 1 && !isPointwise) {\n    return [conv2DPacked(inferenceHandler, inputs, adjustedAttributes)];\n  } else {\n    return [conv2DUnpacked(inferenceHandler, inputs, adjustedAttributes)];\n  }\n};\n\nconst conv2DUnpackedPointwise = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvAttributes,\n): Tensor => {\n  const xshape = inputs[0].dims;\n  const kshape = inputs[1].dims;\n  const outputShape = calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n  const reshapedX = inferenceHandler.reshapeUnpacked(inputs[0], [xshape[1], xshape[2] * xshape[3]]);\n  const reshapedK = inferenceHandler.reshapeUnpacked(inputs[1], [kshape[0], kshape[1]]);\n\n  const matmulInputs = inputs.length > 2 ? [reshapedK, reshapedX, inputs[2]] : [reshapedK, reshapedX];\n  const matmulOutput = inferenceHandler.run(createMatmulProgramInfoLoader(matmulInputs, attributes), matmulInputs);\n  return inferenceHandler.reshapeUnpacked(matmulOutput, outputShape);\n};\n\nconst conv2DUnpacked = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvAttributes,\n): Tensor => {\n  const xshape = inputs[0].dims;\n  const kshape = inputs[1].dims;\n  const outputShape = calculateOutputShape(xshape, kshape, attributes.dilations, attributes.pads, attributes.strides);\n  const xIm2Col = inferenceHandler.run(\n    createIm2ColProgramInfoLoader(inferenceHandler, inputs[0], inputs[1], outputShape, attributes),\n    [inputs[0]],\n  );\n\n  const dotProductInputs = inputs.length === 3 ? [xIm2Col, inputs[1], inputs[2]] : [xIm2Col, inputs[1]];\n  const output = inferenceHandler.run(\n    createDotProductProgramInfoLoader(inferenceHandler, inputs, outputShape, attributes),\n    dotProductInputs,\n  );\n  return output;\n};\n\nconst getAdjustedConvAttributes = <T extends ConvAttributes>(attributes: T, inputs: Tensor[]): T => {\n  const kernelShape = attributes.kernelShape.slice();\n  // if kernelShape is not specified in the attributes of this op, infer it from the weight tensor dims\n  if (attributes.kernelShape.length === 0) {\n    for (let i = 2; i < inputs[1].dims.length; ++i) {\n      kernelShape.push(inputs[1].dims[i]);\n    }\n  }\n  const pads = attributes.pads.slice();\n  PoolConvUtil.adjustPadsBasedOnAutoPad(\n    inputs[0].dims,\n    attributes.strides,\n    attributes.dilations,\n    kernelShape,\n    pads,\n    attributes.autoPad,\n  );\n\n  // always return a new object so does not modify the original attributes\n  const newAttributes: T = Object.assign({}, attributes);\n  Object.assign(newAttributes, { kernelShape, pads, cacheKey: attributes.cacheKey });\n  return newAttributes;\n};\n\nexport const parseConvAttributes: OperatorInitialization<ConvAttributes> = (node: Graph.Node): ConvAttributes => {\n  const attributes = node.attributes;\n  const activationAttributes = parseInternalActivationAttributes(attributes);\n  // TODO : Make this generic enough to compute default attributes for multi-dimensional conv\n  const autoPad = attributes.getString('auto_pad', 'NOTSET');\n  const dilations = attributes.getInts('dilations', [1, 1]);\n  const group = attributes.getInt('group', 1);\n  const kernelShape = attributes.getInts('kernel_shape', []);\n  const pads = attributes.getInts('pads', [0, 0, 0, 0]);\n  const strides = attributes.getInts('strides', [1, 1]);\n\n  return createAttributeWithCacheKey({\n    autoPad,\n    dilations,\n    group,\n    kernelShape,\n    pads,\n    strides,\n    ...activationAttributes,\n  });\n};\n\nconst validateInputs = (inputs: Tensor[], attributes: ConvAttributes): void => {\n  // Refer to the below link for all input checks\n  // https://github.com/onnx/onnx/blob/main/docs/Operators.md#Conv\n  if (!inputs || (inputs.length !== 2 && inputs.length !== 3)) {\n    throw new Error('Conv requires 2 or 3 inputs');\n  }\n\n  // TODO : Need to add support for multi-dimensional conv\n  if (inputs[0].dims.length !== 4 || inputs[1].dims.length !== 4) {\n    throw new Error('currently only support 2-dimensional conv');\n  }\n\n  // FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\n  const dataChannel = inputs[0].dims[1];\n  const filterInChannel = inputs[1].dims[1] * attributes.group;\n  if (dataChannel !== filterInChannel) {\n    throw new Error('FILTER_IN_CHANNEL should be equal to DATA_CHANNEL');\n  }\n\n  // if bias is provided it should be 1D and the number of elements should be equal to the number of feature maps\n  if (inputs.length === 3 && (inputs[2].dims.length !== 1 || inputs[1].dims[0] !== inputs[2].dims[0])) {\n    throw new Error('invalid bias');\n  }\n\n  const spatialRank = inputs[0].dims.length - 2;\n  // wrong dilations dimension\n  if (attributes.dilations.length !== spatialRank) {\n    throw new Error(`dilations should be ${spatialRank}D`);\n  }\n\n  // Wrong strides dimension\n  if (attributes.strides.length !== spatialRank) {\n    throw new Error(`strides should be ${spatialRank}D`);\n  }\n\n  // Wrong pads dimension\n  if (attributes.pads.length !== spatialRank * 2) {\n    throw new Error(`pads should be ${spatialRank * 2}D`);\n  }\n\n  // if kernelShape is specified, it's data length must be 2 less than dims length of the weights tensor\n  // (the first 2 dims are batch_size and channels)\n  if (attributes.kernelShape.length !== 0 && attributes.kernelShape.length !== inputs[1].dims.length - 2) {\n    throw new Error('invalid kernel shape');\n  }\n\n  // TODO : Need to add support for float64\n  if (inputs[0].type !== 'float32' || inputs[1].type !== 'float32') {\n    throw new Error('Conv input(X,W) should be float tensor');\n  }\n\n  if (inputs.length === 3 && inputs[2].type !== 'float32') {\n    throw new Error('Conv input(bias) should be float tensor');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { InferenceHandler } from '../../../backend';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nimport { ConvAttributes } from './conv';\nimport { getActivationSnippet, parseInternalActivationAttributes } from './fuse-utils';\n\nconst computeTotalPad = (\n  inDim: number,\n  stride: number,\n  adj: number,\n  kernel: number,\n  dilation: number,\n  outSize: number,\n) => (inDim - 1) * stride + adj + (kernel - 1) * dilation + 1 - outSize;\n\nconst distributePadding = (totalPad: number, autoPad: string, pads: number[], head: number, tail: number) => {\n  const smallPad = Math.floor(totalPad / 2);\n  if (autoPad === 'SAME_UPPER') {\n    pads[head] = smallPad;\n    pads[tail] = totalPad - smallPad;\n  } else if (autoPad === 'SAME_LOWER') {\n    pads[head] = totalPad - smallPad;\n    pads[tail] = smallPad;\n  }\n};\n\nconst calculateOutputShapeAndPads = (\n  inputShape: readonly number[],\n  kernelShape: readonly number[],\n  dilations: readonly number[],\n  autoPad: string,\n  pads: number[],\n  strides: readonly number[],\n  outputPadding: readonly number[],\n  outputShape: number[],\n) => {\n  const spatialRank = inputShape.length - 2;\n  const updateShape = outputShape.length === 0;\n  for (let i = 0; i < spatialRank; ++i) {\n    const outSize = updateShape ? inputShape[i + 2] * strides[i] : outputShape[i];\n    const totalPad = computeTotalPad(inputShape[i + 2], strides[i], pads[i], kernelShape[i], dilations[i], outSize);\n    distributePadding(totalPad, autoPad, pads, i, i + spatialRank);\n    if (updateShape) {\n      outputShape.push(\n        strides[i] * (inputShape[i + 2] - 1) +\n          outputPadding[i] +\n          (kernelShape[i] - 1) * dilations[i] +\n          1 -\n          pads[i] -\n          pads[i + spatialRank],\n      );\n    }\n  }\n};\n\nexport interface ConvTransposeAttributes extends ConvAttributes {\n  readonly outputPadding: readonly number[];\n  readonly outputShape: readonly number[];\n}\n\nexport const convTranspose: OperatorImplementation<ConvTransposeAttributes> = (\n  inferenceHandler: InferenceHandler,\n  inputs: Tensor[],\n  attributes: ConvTransposeAttributes,\n): Tensor[] => {\n  validateInputs(inputs, attributes); // currently will fail if not convTranspose2D\n  return convTranspose2d(inferenceHandler, inputs, attributes);\n};\n\nconst convTranspose2d: OperatorImplementation<ConvTransposeAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ConvTransposeAttributes,\n): Tensor[] => {\n  const adjustedAttributes = getAdjustedConvTransposeAttributes(attributes, inputs);\n  return [convTranspose2DUnpacked(inferenceHandler, inputs, adjustedAttributes)];\n};\n\nconst createConvTransposeProgramMetadata = (hasBias: boolean, cacheHint: string) => ({\n  name: 'ConvTranspose',\n  inputNames: hasBias ? ['X', 'W', 'B'] : ['X', 'W'],\n  inputTypes: hasBias\n    ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked]\n    : [TextureType.unpacked, TextureType.unpacked],\n  cacheHint,\n});\n\nconst createUnpackedConvTransposeProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  metadata: ProgramMetadata,\n  attributes: ConvTransposeAttributes,\n): ProgramInfo => {\n  const hasBias = inputs.length > 2;\n  const valueInit = hasBias ? 'getB(output_channel)' : '0.0';\n  const xShape = inputs[0].dims;\n  const wShape = inputs[1].dims;\n  const outputChannelsPerGroup = wShape[1];\n  const inputChannelsPerGroup = wShape[0] / attributes.group;\n  const outputShape = [inputs[0].dims[0], inputs[1].dims[1] * attributes.group, ...attributes.outputShape];\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const { activationFunction, applyActivation } = getActivationSnippet(attributes);\n\n  const shaderSource = `\n  const ivec2 strides = ivec2(${attributes.strides[0]}, ${attributes.strides[1]});\n  const ivec2 pads = ivec2(${attributes.pads[0]}, ${attributes.pads[1]});\n  ${activationFunction}\n  void main() {\n    ivec4 coords = getOutputCoords();\n    int batch = coords.x;\n    int output_channel = coords.y;\n\n    ivec2 loc = coords.zw + pads;\n\n    int group_id = output_channel / ${outputChannelsPerGroup};\n    int wOutChannel = output_channel - group_id * ${outputChannelsPerGroup};\n\n    float value = ${valueInit};\n    for (int inChannelOffset = 0; inChannelOffset < ${inputChannelsPerGroup}; inChannelOffset++) {\n      int input_channel = group_id * ${inputChannelsPerGroup} + inChannelOffset;\n      for (int wWOff = 0; wWOff < ${wShape[2]}; wWOff++) {\n        for (int wHOff = 0; wHOff < ${wShape[3]}; wHOff++) {\n          ivec2 wOff = ivec2(wWOff * ${attributes.dilations[0]}, wHOff * ${attributes.dilations[1]});\n          ivec2 wLoc = loc - wOff;\n          ivec2 wLocIn = wLoc / strides;\n          if (\n            wLocIn * strides == wLoc &&\n            wLocIn.x >= 0 && wLocIn.x < ${xShape[2]} &&\n            wLocIn.y >= 0 && wLocIn.y < ${xShape[3]}\n          ) {\n            float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n            float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n            value += xVal * wVal;\n          }\n        }\n      }\n    }\n    ${applyActivation}\n    ${glsl.output} = vec4(value, .0, .0, .0);\n  }\n`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n    hasMain: true,\n  };\n};\n\nconst createUnpackedConvTransposeProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvTransposeAttributes,\n): ProgramInfoLoader => {\n  const metadata = createConvTransposeProgramMetadata(inputs.length > 2, attributes.cacheKey);\n  return {\n    ...metadata,\n    get: () => createUnpackedConvTransposeProgramInfo(inferenceHandler, inputs, metadata, attributes),\n  };\n};\n\nconst convTranspose2DUnpacked = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: readonly Tensor[],\n  attributes: ConvTransposeAttributes,\n): Tensor => {\n  const result = inferenceHandler.run(\n    createUnpackedConvTransposeProgramInfoLoader(inferenceHandler, inputs, attributes),\n    inputs,\n  );\n  return result;\n};\n\nconst getAdjustedConvTransposeAttributes = <T extends ConvTransposeAttributes>(attributes: T, inputs: Tensor[]): T => {\n  const kernelShape = attributes.kernelShape.slice();\n  // if kernelShape is not specified in the attributes of this op, infer it from the weight tensor dims\n  if (attributes.kernelShape.length === 0) {\n    for (let i = 2; i < inputs[1].dims.length; ++i) {\n      kernelShape.push(inputs[1].dims[i]);\n    }\n  }\n\n  const pads = attributes.pads.slice();\n  const outputShape = attributes.outputShape.slice();\n  const inputShape = inputs[0].dims;\n  // If outputShape is not specified in the attributes of this op, infer it from the parameters\n  // Similarly, automatically infer pads if not specified\n  calculateOutputShapeAndPads(\n    inputShape,\n    kernelShape,\n    attributes.dilations,\n    attributes.autoPad,\n    pads,\n    attributes.strides,\n    attributes.outputPadding,\n    outputShape,\n  );\n\n  // always return a new object so does not modify the original attributes\n  const newAttributes: T = Object.assign({}, attributes);\n  Object.assign(newAttributes, { kernelShape, pads, outputShape, cacheKey: attributes.cacheKey });\n  return newAttributes;\n};\n\nexport const parseConvTransposeAttributes: OperatorInitialization<ConvTransposeAttributes> = (\n  node: Graph.Node,\n): ConvTransposeAttributes => {\n  const attributes = node.attributes;\n  const activationAttributes = parseInternalActivationAttributes(attributes);\n  // TODO : Make this generic enough to compute default attributes for multi-dimensional conv\n  const autoPad = attributes.getString('auto_pad', 'NOTSET');\n  const dilations = attributes.getInts('dilations', [1, 1]);\n  const group = attributes.getInt('group', 1);\n  const kernelShape = attributes.getInts('kernel_shape', []);\n  const outputPadding = attributes.getInts('output_padding', [0, 0]);\n  const outputShape = attributes.getInts('output_shape', []);\n  const pads = attributes.getInts('pads', [0, 0, 0, 0]);\n  const strides = attributes.getInts('strides', [1, 1]);\n\n  return createAttributeWithCacheKey({\n    autoPad,\n    dilations,\n    group,\n    kernelShape,\n    outputPadding,\n    outputShape,\n    pads,\n    strides,\n    ...activationAttributes,\n  });\n};\n\nconst validateInputs = (inputs: Tensor[], attributes: ConvTransposeAttributes): void => {\n  // Refer to the below link for all input checks\n  // https://github.com/onnx/onnx/blob/main/docs/Operators.md#Conv\n  if (!inputs || (inputs.length !== 2 && inputs.length !== 3)) {\n    throw new Error('Conv requires 2 or 3 inputs');\n  }\n\n  // TODO : Need to add support for multi-dimensional conv\n  if (inputs[0].dims.length !== 4 || inputs[1].dims.length !== 4) {\n    throw new Error('currently only support 2-dimensional conv');\n  }\n\n  // FILTER_IN_CHANNEL should be equal to DATA_CHANNEL\n  const dataChannel = inputs[0].dims[1];\n  const filterInChannel = inputs[1].dims[0];\n  if (dataChannel !== filterInChannel) {\n    throw new Error('FILTER_IN_CHANNEL should be equal to DATA_CHANNEL');\n  }\n\n  const featureMaps = inputs[1].dims[1] * attributes.group;\n\n  // if bias is provided it should be 1D and the number of elements should be equal to the number of feature maps\n  if (inputs.length === 3 && (inputs[2].dims.length !== 1 || inputs[2].dims[0] !== featureMaps)) {\n    throw new Error('invalid bias');\n  }\n\n  const spatialRank = inputs[0].dims.length - 2;\n  // wrong dilations dimension\n  if (attributes.dilations.length !== spatialRank) {\n    throw new Error(`dilations should be ${spatialRank}D`);\n  }\n\n  // Wrong strides dimension\n  if (attributes.strides.length !== spatialRank) {\n    throw new Error(`strides should be ${spatialRank}D`);\n  }\n\n  // Wrong pads dimension\n  if (attributes.pads.length !== spatialRank * 2) {\n    throw new Error(`pads should be ${spatialRank * 2}D`);\n  }\n\n  // Wrong output padding dimension\n  if (attributes.outputPadding.length !== spatialRank) {\n    throw new Error(`output_padding should be ${spatialRank}D`);\n  }\n\n  // if kernelShape is specified, it's data length must be 2 less than dims length of the weights tensor\n  // (the first 2 dims are batch_size and channels)\n  if (attributes.kernelShape.length !== 0 && attributes.kernelShape.length !== inputs[1].dims.length - 2) {\n    throw new Error('invalid kernel shape');\n  }\n\n  // as with kernelShape, must have same number of spatial dims as input\n  if (attributes.outputShape.length !== 0 && attributes.outputShape.length !== inputs[0].dims.length - 2) {\n    throw new Error('invalid output shape');\n  }\n\n  // TODO : Need to add support for float64\n  if (inputs[0].type !== 'float32' || inputs[1].type !== 'float32') {\n    throw new Error('ConvTranspose input(X,W) should be float tensor');\n  }\n\n  if (inputs.length === 3 && inputs[2].type !== 'float32') {\n    throw new Error('ConvTranspose input(bias) should be float tensor');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nexport interface TransposeAttributes extends AttributeWithCacheKey {\n  readonly perm: number[];\n}\n\nconst transposeProgramMetadata = {\n  name: 'Transpose',\n  inputNames: ['A'],\n  inputTypes: [TextureType.unpacked],\n};\n\nexport const transpose: OperatorImplementation<TransposeAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: TransposeAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const output = inferenceHandler.run(\n    {\n      ...transposeProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createTransposeProgramInfo(inferenceHandler, inputs[0], attributes.perm),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseTransposeAttributes: OperatorInitialization<TransposeAttributes> = (\n  node: Graph.Node,\n): TransposeAttributes => createAttributeWithCacheKey({ perm: node.attributes.getInts('perm', []) });\n\nconst createTransposeProgramInfo = (\n  _inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  perm: number[],\n): ProgramInfo => {\n  const inputShape = input.dims;\n  perm = getAdjustedPerm(inputShape, perm);\n  const unpackedOutputShape = getOutputShape(inputShape, perm);\n  const rank = inputShape.length;\n  // A dims=[${inputs[0].dims.toString()}]\n  // out Dims=[${unpackedOutputShape.toString()}]\n  // based on perm=[${perm.toString()}]\n  const shaderSource = `\n      ${getPermFunctionBody('perm', perm, rank)}\n      float process(int indices[${rank}]) {\n        int a[${rank}];\n        perm(a, indices);\n        return _A(a);\n      }`;\n  return {\n    ...transposeProgramMetadata,\n    output: { dims: unpackedOutputShape, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst getAdjustedPerm = (inputShape: readonly number[], perm: number[]): number[] => {\n  if (perm && perm.length !== inputShape.length) {\n    perm = [...inputShape.keys()].reverse();\n  }\n  return perm;\n};\n\nconst getOutputShape = (inputShape: readonly number[], perm: number[]): readonly number[] => {\n  perm = getAdjustedPerm(inputShape, perm);\n  return ShapeUtil.sortBasedOnPerm(inputShape, perm);\n};\n\nconst getPermFunctionBody = (name: string, perm: number[], rank: number): string => {\n  const reverseFunc = [];\n  reverseFunc.push(`void ${name}(out int a[${rank}], int src[${rank}]) {`);\n  for (let i = 0; i < rank; ++i) {\n    reverseFunc.push(`\\ta[${perm[i]}]=src[${i}];`);\n  }\n  reverseFunc.push('\\t}');\n  return reverseFunc.join('\\n');\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Transpose requires 1 input.');\n  }\n\n  if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n    throw new Error('input should be float tensor');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nimport { transpose, TransposeAttributes } from './transpose';\n\nexport interface DepthToSpaceAttributes {\n  mode: 'DCR' | 'CRD';\n  blocksize: number;\n}\n\nexport const depthToSpace: OperatorImplementation<DepthToSpaceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: DepthToSpaceAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const blocksize = attributes.blocksize;\n  const blocksizeSqr = blocksize * blocksize;\n  const transposePerm = attributes.mode === 'DCR' ? [0, 3, 4, 1, 5, 2] : [0, 1, 4, 2, 5, 3];\n  const firstReshapeShape =\n    attributes.mode === 'DCR'\n      ? [\n          inputs[0].dims[0],\n          blocksize,\n          blocksize,\n          inputs[0].dims[1] / blocksizeSqr,\n          inputs[0].dims[2],\n          inputs[0].dims[3],\n        ]\n      : [\n          inputs[0].dims[0],\n          inputs[0].dims[1] / blocksizeSqr,\n          blocksize,\n          blocksize,\n          inputs[0].dims[2],\n          inputs[0].dims[3],\n        ];\n\n  // const transpose = new WebGLTranspose();\n  // const attributes = new Attribute(undefined);\n  // attributes.set('perm', 'ints', transposePerm);\n  // transpose.initialize(attributes);\n\n  // First reshape\n  const firstReshapedTensor = inferenceHandler.reshapeUnpacked(inputs[0], firstReshapeShape);\n\n  // transpose\n  const transposeAttributes: TransposeAttributes = { perm: transposePerm, cacheKey: `${transposePerm}` };\n  const [transposeOutput] = transpose(inferenceHandler, [firstReshapedTensor], transposeAttributes);\n\n  // Second reshape\n  const secondReshapeShape = [\n    inputs[0].dims[0],\n    inputs[0].dims[1] / blocksizeSqr,\n    inputs[0].dims[2] * blocksize,\n    inputs[0].dims[3] * blocksize,\n  ];\n  const result = inferenceHandler.reshapeUnpacked(transposeOutput, secondReshapeShape);\n  return [result];\n};\n\nexport const parseDepthToSpaceAttributes: OperatorInitialization<DepthToSpaceAttributes> = (\n  node: Graph.Node,\n): DepthToSpaceAttributes => {\n  // processing node attributes\n  const blocksize = node.attributes.getInt('blocksize');\n  if (blocksize < 1) {\n    throw new Error(`blocksize must be >= 1, but got : ${blocksize} for DepthToSpace`);\n  }\n  const mode = node.attributes.getString('mode', 'DCR');\n  if (mode !== 'DCR' && mode !== 'CRD') {\n    throw new Error(`unrecognized mode: ${mode} for DepthToSpace`);\n  }\n  return { mode, blocksize };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (inputs.length !== 1) {\n    throw new Error(`DepthToSpace expect 1 inputs, but got ${inputs.length}`);\n  }\n\n  // Input has to be a 4-D tensor\n  // TODO: Support string depth-to-space.\n  if (inputs[0].type === 'string' || inputs[0].dims.length !== 4) {\n    throw new TypeError('DepthToSpace input should be a 4-D numeric tensor');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nexport const flatten: OperatorImplementation<number> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  axis: number,\n): Tensor[] => {\n  validateInputs(inputs, axis);\n\n  const outputDims = ShapeUtil.flattenShape(inputs[0].dims, axis);\n  return [inferenceHandler.reshapeUnpacked(inputs[0], outputDims)];\n};\n\nexport const parseFlattenAttributes: OperatorInitialization<number> = (node: Graph.Node): number =>\n  node.attributes.getInt('axis', 1); // default axis is 1\n\nconst validateInputs = (inputs: Tensor[], axis: number): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Flatten requires 1 input.');\n  }\n\n  const r = inputs[0].dims.length;\n  if (r === 0) {\n    throw new Error('scalar tensor is not supported.');\n  }\n\n  if (axis < -r || axis > r) {\n    throw new Error('Invalid axis');\n  }\n\n  // TODO: Support string type\n  if (inputs[0].type === 'string') {\n    throw new Error('string tensor is not supported.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { InferenceHandler } from './backend';\nimport { Graph } from './graph';\nimport { Tensor } from './tensor';\n\nexport type OperatorImplementation<T> = (inferenceHandler: InferenceHandler, inputs: Tensor[], context: T) => Tensor[];\nexport type OperatorInitialization<T> = (node: Graph.Node, graph: Graph) => T;\n\nexport interface Operator {\n  readonly impl: OperatorImplementation<unknown>;\n  readonly context: Graph.Node | unknown;\n}\n\nexport const NUMBER_TYPES: readonly Tensor.DataType[] = [\n  'float32',\n  'float64',\n  'int32',\n  'int16',\n  'int8',\n  'uint16',\n  'uint32',\n  'uint8',\n];\nexport const INT_TYPES: readonly Tensor.DataType[] = ['int32', 'int16', 'int8', 'uint16', 'uint32', 'uint8'];\nexport const FLOAT_TYPES: readonly Tensor.DataType[] = ['float32', 'float64'];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { NUMBER_TYPES, OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\ninterface GatherAttributes extends AttributeWithCacheKey {\n  readonly axis: number;\n}\n\nexport const gather: OperatorImplementation<GatherAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: GatherAttributes,\n): Tensor[] => {\n  validateInputs(inputs, attributes.axis);\n  const output = inferenceHandler.run(createGatherProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n  return [output];\n};\n\nexport const parseGatherAttributes: OperatorInitialization<GatherAttributes> = (node: Graph.Node): GatherAttributes =>\n  createAttributeWithCacheKey({ axis: node.attributes.getInt('axis', 0) });\n\nconst gatherProgramMetadata = {\n  name: 'Gather',\n  inputNames: ['A', 'B'],\n  inputTypes: [TextureType.unpacked, TextureType.unpacked],\n};\n\nconst createGatherProgramInfo = (\n  _handler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  axis: number,\n): ProgramInfo => {\n  const inputShape = inputs[0].dims.slice();\n  const indexDataShape = inputs[1].dims.slice();\n  const outputShape = new Array(inputShape.length + indexDataShape.length - 1);\n\n  axis = ShapeUtil.normalizeAxis(axis, inputShape.length);\n  const indexCopyOps: string[] = [];\n  for (let i = 0; i < outputShape.length; i++) {\n    // outputShape is divided into three parts: A, B, C\n    // |0        axis|  axis + indexDataShape.length |          end|\n    // |     A       |             B                 |      C      |\n    //\n    // inputIdx: [A, inputs[1][B], C]\n    if (i < axis) {\n      // A\n      outputShape[i] = inputShape[i];\n      indexCopyOps.push(`inputIdx[${i}] = outputIdx[${i}];`);\n    } else {\n      if (i < axis + indexDataShape.length) {\n        // B\n        outputShape[i] = indexDataShape[i - axis];\n        indexCopyOps.push(`indexDataIdx[${i - axis}] = outputIdx[${i}];`);\n      } else {\n        // C\n        outputShape[i] = inputShape[i - indexDataShape.length + 1]; // skip 1 for axis\n        indexCopyOps.push(`inputIdx[${i - indexDataShape.length + 1}] = outputIdx[${i}];`);\n      }\n    }\n  }\n\n  const orank = outputShape.length || 1;\n  const irank = inputShape.length;\n  const iDrank = indexDataShape.length || 1;\n  const shaderSource = `\n      float process(int outputIdx[${orank}]) {\n        int inputIdx[${irank}];\n        int indexDataIdx[${iDrank}];\n        indexDataIdx[0] = 0;\n        ${indexCopyOps.join('\\n        ')}\n        int idx = int(_B(indexDataIdx));\n        inputIdx[${axis}] = idx < 0 ? idx + ${inputShape[axis]} : idx;\n        return _A(inputIdx);\n      }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst createGatherProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: GatherAttributes,\n): ProgramInfoLoader => {\n  const metadata = { ...gatherProgramMetadata, cacheHint: attributes.cacheKey };\n  return { ...metadata, get: () => createGatherProgramInfo(handler, metadata, inputs, attributes.axis) };\n};\n\nconst validateInputs = (inputs: Tensor[], axis: number): void => {\n  if (!inputs || inputs.length !== 2) {\n    throw new Error('Gather requires 2 inputs.');\n  }\n  const tensorRank = inputs[0].dims.length;\n  if (tensorRank < 1) {\n    throw new Error('Invalid input shape.');\n  }\n  if (axis < -tensorRank || axis > tensorRank - 1) {\n    throw new Error('Invalid axis.');\n  }\n  if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n    throw new Error('Invaid input type.');\n  }\n  if (inputs[1].type !== 'int32' && inputs[1].type !== 'int16') {\n    throw new Error('Invaid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { GemmUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nexport interface GemmAttributes extends AttributeWithCacheKey {\n  transA: boolean;\n  transB: boolean;\n  alpha: number;\n  beta: number;\n  isOptionalC: boolean; // in opset 11, C becomes optional\n}\n\nexport const gemm: OperatorImplementation<GemmAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: GemmAttributes,\n): Tensor[] => {\n  validateInputs(inputs, attributes);\n  const output = inferenceHandler.run(createGemmProgramInfoLoader(inputs, attributes), inputs);\n  return [output];\n};\n\nconst parseGemmAttributes = (node: Graph.Node, isOptionalC: boolean): GemmAttributes => {\n  const transA = node.attributes.getInt('transA', 0) !== 0;\n  const transB = node.attributes.getInt('transB', 0) !== 0;\n  const alpha = node.attributes.getFloat('alpha', 1.0);\n  const beta = node.attributes.getFloat('beta', 1.0);\n  return createAttributeWithCacheKey({ transA, transB, alpha, beta, isOptionalC });\n};\n\nexport const parseGemmAttributesV7: OperatorInitialization<GemmAttributes> = (node: Graph.Node): GemmAttributes =>\n  parseGemmAttributes(node, false);\n\nexport const parseGemmAttributesV11: OperatorInitialization<GemmAttributes> = (node: Graph.Node): GemmAttributes =>\n  parseGemmAttributes(node, true);\n\nconst createGemmProgramInfoLoader = (inputs: Tensor[], attributes: GemmAttributes): ProgramInfoLoader => {\n  const metadata = {\n    name: 'Gemm',\n    inputNames: inputs.length === 3 ? ['A', 'B', 'C'] : ['A', 'B'],\n    inputTypes:\n      inputs.length === 3\n        ? [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked]\n        : [TextureType.unpacked, TextureType.unpacked],\n    key: attributes.cacheKey,\n  };\n\n  return { ...metadata, get: () => createGemmProgramInfo(metadata, inputs, attributes) };\n};\n\nconst createGemmProgramInfo = (\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  attributes: GemmAttributes,\n): ProgramInfo => {\n  const aShape = inputs[0].dims.slice();\n  const bShape = inputs[1].dims.slice();\n  const [M, N] = GemmUtil.getShapeOfGemmResult(\n    aShape,\n    attributes.transA,\n    bShape,\n    attributes.transB,\n    inputs.length === 3 ? inputs[2].dims : undefined,\n  );\n  const outputShape = [M, N];\n  if (!outputShape) {\n    throw new Error(\"Can't use gemm on the given tensors\");\n  }\n  let sharedDim = aShape[aShape.length - 1];\n  let line = '';\n  if (attributes.transA) {\n    sharedDim = aShape[0];\n  }\n  if (attributes.transA && attributes.transB) {\n    line = 'value += _A_T(a) * _B_T(b);';\n  } else if (attributes.transA && !attributes.transB) {\n    line = 'value += _A_T(a) * _B(b);';\n  } else if (!attributes.transA && attributes.transB) {\n    line = 'value += _A(a) * _B_T(b);';\n  } else if (!attributes.transA && !attributes.transB) {\n    line = 'value += _A(a) * _B(b);';\n  }\n  const rank = outputShape.length;\n  const declareC = inputs.length === 3 ? `int c[${inputs[2].dims.length}];` : '';\n  const broadcastC = inputs.length === 3 ? 'bcastIndices_C(indices, c);' : '';\n  const calculateC = inputs.length === 3 ? 'value += beta * _C(c);' : '';\n  const shaderSource = `\n      float process(int indices[${rank}]) {\n          int a[${rank}];\n          int b[${rank}];\n          ${declareC}\n\n          copyVec(indices, a);\n          copyVec(indices, b);\n          ${broadcastC}\n\n          float value = 0.0;\n          for (int k=0; k<${sharedDim}; ++k) {\n              a[${rank - 1}] = k;\n              b[${rank - 2}] = k;\n              ${line}\n          }\n\n          value = value * alpha;\n          ${calculateC}\n          return value;\n      }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    variables: [\n      { name: 'alpha', type: 'float', data: attributes.alpha },\n      { name: 'beta', type: 'float', data: attributes.beta },\n    ],\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[], attributes: GemmAttributes): void => {\n  if (!inputs) {\n    throw new Error('Input is missing');\n  }\n  if (attributes.isOptionalC && (inputs.length < 2 || inputs.length > 3)) {\n    throw new Error('Invaid input shape.');\n  }\n  if (!attributes.isOptionalC && inputs.length !== 3) {\n    throw new Error('Gemm requires 3 inputs');\n  }\n\n  // 'C' can be of dimensionality 1 or 2 only\n  if (inputs.length === 3 && inputs[2].dims.length !== 1 && inputs[2].dims.length !== 2) {\n    throw new Error('Invalid input shape of C');\n  }\n\n  if (\n    (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') ||\n    (inputs[1].type !== 'float32' && inputs[1].type !== 'float64') ||\n    (inputs.length === 3 && inputs[2].type !== 'float32' && inputs[2].type !== 'float64')\n  ) {\n    throw new Error('Invalid input type.');\n  }\n\n  if (inputs[0].type !== inputs[1].type || (inputs.length === 3 && inputs[0].type !== inputs[2].type)) {\n    throw new Error('Input types are mismatched');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nexport interface ImageScalerAttributes extends AttributeWithCacheKey {\n  scale: number;\n  bias: number[];\n}\n\nexport const imageScaler: OperatorImplementation<ImageScalerAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ImageScalerAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const output = inferenceHandler.run(createImageScalerProgramInfoLoader(inferenceHandler, inputs, attributes), inputs);\n  return [output];\n};\n\nexport const parseImageScalerAttributes: OperatorInitialization<ImageScalerAttributes> = (\n  node: Graph.Node,\n): ImageScalerAttributes => {\n  const scale = node.attributes.getFloat('scale');\n  const bias = node.attributes.getFloats('bias');\n  return createAttributeWithCacheKey({ scale, bias });\n};\n\nconst imageScalerProgramMetadata = {\n  name: 'ImageScaler',\n  inputNames: ['X'],\n  inputTypes: [TextureType.unpacked],\n};\n\nconst createImageScalerProgramInfo = (\n  _handler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  inputs: Tensor[],\n  attributes: ImageScalerAttributes,\n): ProgramInfo => {\n  const outputShape = inputs[0].dims.slice();\n  const rank = outputShape.length;\n  const getBiasMethod = createGetBiasMethod(attributes.bias.length);\n  const shaderSource = `\n      ${getBiasMethod}\n      float process(int indices[${rank}]) {\n        return _X(indices) * scale + getBias(bias, indices[1]);\n      }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    variables: [\n      { name: 'bias', type: 'float', arrayLength: attributes.bias.length, data: attributes.bias },\n      { name: 'scale', type: 'float', data: attributes.scale },\n    ],\n    shaderSource,\n  };\n};\n\nconst createImageScalerProgramInfoLoader = (\n  handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ImageScalerAttributes,\n): ProgramInfoLoader => {\n  const metadata = { ...imageScalerProgramMetadata, cacheHint: attributes.cacheKey };\n  return { ...metadata, get: () => createImageScalerProgramInfo(handler, metadata, inputs, attributes) };\n};\n\nconst createGetBiasMethod = (numChannels: number): string => {\n  const codeLines: string[] = [`float getBias(float bias[${numChannels}], int channel) {`];\n  for (let i = 0; i < numChannels; ++i) {\n    if (i === 0) {\n      codeLines.push('\\t' + `if (channel == ${i}) { return bias[${i}]; }`);\n    } else if (i === numChannels - 1) {\n      codeLines.push('\\t' + `else { return bias[${i}]; }`);\n    } else {\n      codeLines.push('\\t' + `else if (channel == ${i}) { return bias[${i}]; }`);\n    }\n  }\n  codeLines.push('\\t' + '}');\n  return codeLines.join('\\n');\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('ImageScaler requires 1 input.');\n  }\n  if (inputs[0].dims.length !== 4) {\n    throw new Error('Invalid input shape.');\n  }\n  if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n    throw new Error('Invalid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, ProgramMetadata, TextureType } from '../types';\n\nexport const instanceNormalization: OperatorImplementation<number> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  epsilon: number,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  const meanAndVariance = inferenceHandler.run(createMeanAndVarianceProgramInfoLoader(inputs[0]), inputs);\n  const output = inferenceHandler.run(\n    createComputeOutputProgramInfoLoader(inferenceHandler, inputs[0], epsilon, meanAndVariance.dims),\n    [inputs[0], meanAndVariance, inputs[1], inputs[2]],\n  );\n  return [output];\n};\n\nexport const parseInstanceNormalizationAttributes: OperatorInitialization<number> = (node: Graph.Node): number =>\n  node.attributes.getFloat('epsilon', 1e-5);\n\nconst meanAndVarianceProgramMetadata = {\n  name: 'InstanceNormalization_MeanAndVariance',\n  inputNames: ['X'],\n  inputTypes: [TextureType.unpacked],\n};\n\nconst createMeanAndVarianceProgramInfo = (metadata: ProgramMetadata, input: Tensor): ProgramInfo => {\n  const xDims = input.dims.slice();\n  const channel = xDims[1];\n  const channelSize = xDims[2] * xDims[3];\n  const outputShape = [xDims[0], channel];\n\n  const shaderSource = `\n      vec4 process(int[2] indices) {\n        vec4 v = vec4(0.0);\n        int a[4];\n        a[0] = indices[0];\n        a[1] = indices[1];\n        float temp = 0.0;\n        for(int a2=0; a2<${xDims[2]}; a2++) {\n          a[2] = a2;\n          for(int a3=0; a3<${xDims[3]}; a3++) {\n            a[3] = a3;\n            float x = _X(a);\n            temp += x;\n          }\n        }\n        float mean = temp / float(${channelSize});\n        temp = 0.0;\n        for(int a2=0; a2<${xDims[2]}; a2++) {\n          a[2] = a2;\n          for(int a3=0; a3<${xDims[3]}; a3++) {\n            a[3] = a3;\n            float x = _X(a);\n            temp += (x - mean) * (x - mean);\n          }\n        }\n        v.r = mean;\n        v.g = temp / float(${channelSize});\n\n        return v;\n      }`;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: input.type, textureType: TextureType.packedLastDimension },\n    shaderSource,\n  };\n};\n\nconst createMeanAndVarianceProgramInfoLoader = (input: Tensor): ProgramInfoLoader => ({\n  ...meanAndVarianceProgramMetadata,\n  get: () => createMeanAndVarianceProgramInfo(meanAndVarianceProgramMetadata, input),\n});\n\nconst computeOutputProgramMetadata = {\n  name: 'InstanceNormalization_ComputeOutput',\n  inputNames: ['X', 'MeanAndVariance', 'Scale', 'B'],\n  inputTypes: [TextureType.unpacked, TextureType.packedLastDimension, TextureType.unpacked, TextureType.unpacked],\n};\n\nconst createComputeOutputProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  metadata: ProgramMetadata,\n  input: Tensor,\n  epsilon: number,\n  meanAndVarianceShape: readonly number[],\n): ProgramInfo => {\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const [textureWidth, textureHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    meanAndVarianceShape,\n    TextureType.packedLastDimension,\n  );\n  const [meanAndVarianceWidth, meanAndVarianceHeight] = [textureWidth / 4, textureHeight];\n  const shaderSource = `\n      vec4 get_MeanAndVariance(int[2] mv) {\n        int offset = indicesToOffset_MeanAndVariance(mv);\n        vec2 coords = offsetToCoords(offset, ${meanAndVarianceWidth}, ${meanAndVarianceHeight});\n        return ${glsl.texture2D}(MeanAndVariance, coords);\n      }\n\n      float process(int[4] indices) {\n        int mv[2];\n        mv[0] = indices[0];\n        mv[1] = indices[1];\n        vec4 mean_and_variance = get_MeanAndVariance(mv);\n        float mean = mean_and_variance.r;\n        float variance = mean_and_variance.g;\n\n        int sb[1];\n        sb[0] = indices[1];\n        float scale = _Scale(sb);\n        float b = _B(sb);\n\n        return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n      }`;\n  return {\n    ...metadata,\n    output: { dims: input.dims, type: input.type, textureType: TextureType.unpacked },\n    variables: [{ name: 'epsilon', type: 'float', data: epsilon }],\n    shaderSource,\n  };\n};\n\nconst createComputeOutputProgramInfoLoader = (\n  inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  epsilon: number,\n  meanAndVarianceShape: readonly number[],\n): ProgramInfoLoader => {\n  const metadata = { ...computeOutputProgramMetadata, cacheHint: `${epsilon}` };\n  return {\n    ...metadata,\n    get: () => createComputeOutputProgramInfo(inferenceHandler, metadata, input, epsilon, meanAndVarianceShape),\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 3) {\n    throw new Error('InstanceNormalization requires 3 inputs.');\n  }\n\n  const X = inputs[0];\n  const scale = inputs[1];\n  const B = inputs[2];\n\n  // input should at least have three dimensions - N,C,dim1,...,dimn\n  // other inputs can have only one dimensions\n  if (X.dims.length < 3 || scale.dims.length !== 1 || B.dims.length !== 1) {\n    throw new Error('Invalid input shape.');\n  }\n  if (scale.dims[0] !== X.dims[1] || B.dims[0] !== X.dims[1]) {\n    throw new Error('Input shapes are mismatched.');\n  }\n  if (\n    (X.type !== 'float32' && X.type !== 'float64') ||\n    (scale.type !== 'float32' && scale.type !== 'float64') ||\n    (B.type !== 'float32' && B.type !== 'float64')\n  ) {\n    throw new Error('Invalid input type.');\n  }\n  if (inputs[0].dims.length !== 4) {\n    throw new Error('Only support 4-D input shape.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramInfoLoader, TextureType } from '../types';\n\nexport interface LrnAttributes extends AttributeWithCacheKey {\n  alpha: number;\n  beta: number;\n  bias: number;\n  size: number;\n}\n\nexport const lrn: OperatorImplementation<LrnAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: LrnAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  // if (inferenceHandler.session.pack) {\n  //   return [inferenceHandler.run(createPackedLrnProgramInfoLoader(inferenceHandler, inputs, attributes),\n  //   inputs)];\n  // } else {\n  return [inferenceHandler.run(createLrnProgramInfoLoader(inputs, attributes), inputs)];\n  //}\n};\n\nexport const parseLrnAttributes: OperatorInitialization<LrnAttributes> = (node: Graph.Node): LrnAttributes => {\n  const alpha = node.attributes.getFloat('alpha', 0.0001);\n  const beta = node.attributes.getFloat('beta', 0.75);\n  const bias = node.attributes.getFloat('bias', 1.0);\n  const size = node.attributes.getInt('size');\n\n  return createAttributeWithCacheKey({ alpha, beta, bias, size });\n};\n\nconst lrnProgramMetadata = {\n  name: 'LRN',\n  inputNames: ['X'],\n  inputTypes: [TextureType.unpacked],\n};\n\nfunction createLrnProgramInfo(inputs: Tensor[], attributes: LrnAttributes): ProgramInfo {\n  const C = inputs[0].dims[1];\n  const rank = inputs[0].dims.length;\n  const from = -Math.floor((attributes.size - 1) / 2);\n  const to = Math.ceil((attributes.size - 1) / 2);\n  const alpha = `float(${attributes.alpha}) / float(${attributes.size})`;\n  const bias = `float(${attributes.bias})`;\n  const beta = `float(${attributes.beta})`;\n\n  const shaderSource = `\n    float process(int indices[${rank}]) {\n        int c = indices[1];\n        float x = _X(indices);\n        float square_sum = 0.0;\n\n        for (int i = ${from}; i <= ${to}; i++) {\n          int idx = c + i;\n          if (c >= 0 && c < ${C}) {\n            indices[1] = idx;\n            float j = _X(indices);\n            square_sum += j * j;\n          }\n        }\n        return x / pow(${bias} + ${alpha} * square_sum, ${beta});\n    }`;\n  return {\n    ...lrnProgramMetadata,\n    cacheHint: attributes.cacheKey,\n    output: { dims: inputs[0].dims, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n}\n\nexport function createLrnProgramInfoLoader(inputs: Tensor[], attributes: LrnAttributes): ProgramInfoLoader {\n  return { ...lrnProgramMetadata, cacheHint: attributes.cacheKey, get: () => createLrnProgramInfo(inputs, attributes) };\n}\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('LRN requires 1 input.');\n  }\n  if (inputs[0].dims.length !== 4) {\n    throw new Error('currently only support LRN for input with \"NCHW\" format');\n  }\n  if (inputs[0].type !== 'float32') {\n    throw new Error('input should be float type');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { getGlsl, Glsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nexport interface PadAttributes extends AttributeWithCacheKey {\n  readonly mode: string;\n  readonly pads: number[];\n  readonly value: number;\n}\n\nconst padProgramMetadata = {\n  name: 'Pad',\n  inputNames: ['A'],\n  inputTypes: [TextureType.unpacked],\n};\n\nexport const padV2: OperatorImplementation<PadAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: PadAttributes,\n): Tensor[] => {\n  validateInputsV2(inputs);\n  const output = inferenceHandler.run(\n    {\n      ...padProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createPadProgramInfo(inferenceHandler, inputs[0], attributes),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parsePadAttributesV2: OperatorInitialization<PadAttributes> = (node: Graph.Node): PadAttributes => {\n  const mode = node.attributes.getString('mode', 'constant');\n  const value = node.attributes.getFloat('value', 0.0);\n  const pads = node.attributes.getInts('pads');\n  return createAttributeWithCacheKey({ mode, value, pads });\n};\n\nexport const padV11: OperatorImplementation<string> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  mode: string,\n): Tensor[] => {\n  validateInputsV11(inputs);\n  const attrubutes = generatePadAttributesFromInputs(inferenceHandler, inputs, mode);\n  return padV2(inferenceHandler, [inputs[0]], attrubutes);\n};\n\nexport const parsePadAttributesV11: OperatorInitialization<string> = (node: Graph.Node): string =>\n  node.attributes.getString('mode', 'constant');\n\nconst generatePadAttributesFromInputs = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  mode: string,\n): PadAttributes => {\n  if (\n    !inferenceHandler.session.isInitializer(inputs[1].dataId) ||\n    (inputs.length >= 3 && !inferenceHandler.session.isInitializer(inputs[2].dataId))\n  ) {\n    throw new Error('dynamic pad attributes are not allowed');\n  }\n\n  const pads = Array.from(inputs[1].integerData);\n  const value = inputs.length >= 3 ? inputs[2].floatData[0] : 0.0;\n\n  return createAttributeWithCacheKey({ mode, pads, value });\n};\n\nconst createPadProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  attributes: PadAttributes,\n): ProgramInfo => {\n  const outputShape = ShapeUtil.padShape(input.dims.slice(), attributes.pads);\n  const rank = outputShape.length;\n  const padFunction = getPadFunction(inferenceHandler, input, attributes);\n  const shaderSource = `\n      ${padFunction}\n      float process(int[${rank}] indices) {\n          return padA(indices);\n      }`;\n  return {\n    name: 'Pad',\n    inputNames: ['A'],\n    inputTypes: [TextureType.unpacked],\n    output: { dims: outputShape, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputsV2 = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Pad requires 1 input');\n  }\n  if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n    throw new Error('Invalid input type.');\n  }\n};\n\nconst validateInputsV11 = (inputs: Tensor[]): void => {\n  if (!inputs || (inputs.length !== 2 && inputs.length !== 3)) {\n    throw new Error('Pad requires 2 or 3 inputs');\n  }\n  if (inputs[1].type !== 'int32') {\n    throw new Error('Invalid input type.');\n  }\n  if (inputs.length >= 3 && inputs[2].type === 'string') {\n    throw new Error('Invalid input type.');\n  }\n};\n\nconst getPadFunction = (inferenceHandler: WebGLInferenceHandler, input: Tensor, attributes: PadAttributes): string => {\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const [width, height] = inferenceHandler.calculateTextureWidthAndHeight(input.dims, TextureType.unpacked);\n  const strides = ShapeUtil.computeStrides(input.dims);\n\n  switch (attributes.mode) {\n    case 'constant':\n      return getPadConstant(glsl, input.dims, strides, width, height, attributes.pads, attributes.value);\n    case 'reflect':\n      return getPadReflect(glsl, input.dims, strides, width, height, attributes.pads);\n    case 'edge':\n      return getPadEdge(glsl, input.dims, strides, width, height, attributes.pads);\n    default:\n      throw new Error('Invalid mode');\n  }\n};\n\nconst getPadConstant = (\n  glsl: Glsl,\n  shape: readonly number[],\n  strides: readonly number[],\n  width: number,\n  height: number,\n  pads: number[],\n  value: number,\n): string => {\n  const rank = shape.length;\n  let block = '';\n  for (let i = rank - 1; i >= 0; --i) {\n    block += `\n        k = m[${i}] - ${pads[i]};\n        if (k < 0)  return constant;\n        if (k >= ${shape[i]}) return constant;\n        offset += k * ${strides[i]};\n        `;\n  }\n  return `\n      float padA(int m[${rank}]) {\n        const float constant = float(${value});\n        int offset = 0;\n        int k = 0;\n        ${block}\n        vec2 coords = offsetToCoords(offset, ${width}, ${height});\n        float value = getColorAsFloat(${glsl.texture2D}(A, coords));\n        return value;\n      }\n      `;\n};\n\nconst getPadReflect = (\n  glsl: Glsl,\n  shape: readonly number[],\n  strides: readonly number[],\n  width: number,\n  height: number,\n  pads: number[],\n): string => {\n  const rank = shape.length;\n\n  let block = '';\n  for (let i = rank - 1; i >= 0; --i) {\n    block += `\n        k = m[${i}] - ${pads[i]};\n        if (k < 0) { k = -k; }\n        {\n          const int _2n_1 = ${2 * (shape[i] - 1)};\n          k = int( mod( float(k), float(_2n_1) ) ) ;\n          if(k >= ${shape[i]}) { k = _2n_1 - k; }\n        }\n        offset += k * ${strides[i]};\n        `;\n  }\n  return `\n      float padA(int m[${rank}]) {\n        int offset = 0;\n        int k = 0;\n        ${block}\n        vec2 coords = offsetToCoords(offset, ${width}, ${height});\n        float value = getColorAsFloat(${glsl.texture2D}(A, coords));\n        return value;\n      }\n      `;\n};\n\nconst getPadEdge = (\n  glsl: Glsl,\n  shape: readonly number[],\n  strides: readonly number[],\n  width: number,\n  height: number,\n  pads: number[],\n): string => {\n  const rank = shape.length;\n\n  let block = '';\n  for (let i = rank - 1; i >= 0; --i) {\n    block += `\n        k = m[${i}] - ${pads[i]};\n        if (k < 0)  k = 0;\n        if (k >= ${shape[i]}) k = ${shape[i] - 1};\n        offset += k * ${strides[i]};\n      `;\n  }\n  return `\n      float padA(int m[${rank}]) {\n        int offset = 0;\n        int k = 0;\n        ${block}\n        vec2 coords = offsetToCoords(offset, ${width}, ${height});\n        float value = getColorAsFloat(${glsl.texture2D}(A, coords));\n        return value;\n      }\n      `;\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { PoolConvUtil, ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramMetadata, TextureType } from '../types';\n\nexport interface AveragePoolAttributes extends AttributeWithCacheKey {\n  readonly autoPad: string;\n  readonly ceilMode: number;\n  readonly countIncludePad: boolean;\n  readonly kernelShape: readonly number[];\n  readonly strides: readonly number[];\n  readonly pads: readonly number[];\n}\n\nexport const averagePool: OperatorImplementation<AveragePoolAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: AveragePoolAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const metadata = {\n    name: 'AveragePool',\n    inputNames: ['X'],\n    inputTypes: [TextureType.unpacked],\n    cacheHint: attributes.cacheKey,\n  };\n  const output = inferenceHandler.run(\n    { ...metadata, get: () => createAveragePoolProgramInfo(inputs, metadata, false, attributes) },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseAveragePoolAttributes: OperatorInitialization<AveragePoolAttributes> = (\n  node: Graph.Node,\n): AveragePoolAttributes => {\n  const autoPad = node.attributes.getString('auto_pad', 'NOTSET');\n  const ceilMode = node.attributes.getInt('ceil_mode', 0);\n  const countIncludePad = node.attributes.getInt('count_include_pad', 0) === 0 ? false : true;\n  const kernelShape = node.attributes.getInts('kernel_shape');\n  const strides = node.attributes.getInts('strides', []);\n  const pads = node.attributes.getInts('pads', []);\n\n  // TODO: support attribute 'ceil_mode'\n  if (ceilMode !== 0) {\n    throw new Error('using ceil() in shape computation is not yet supported for AveragePool');\n  }\n\n  return createAttributeWithCacheKey({ autoPad, ceilMode, countIncludePad, kernelShape, strides, pads });\n};\n\nconst createAveragePoolProgramInfo = (\n  inputs: Tensor[],\n  metadata: ProgramMetadata,\n  isGlobalOperator: boolean,\n  attributes: AveragePoolAttributes,\n): ProgramInfo => {\n  const [adjustedAttributes, outputShape] = getAdjustedPoolAttributesAndOutputShape(\n    inputs,\n    attributes,\n    isGlobalOperator,\n  );\n  const kernelSize = ShapeUtil.size(adjustedAttributes.kernelShape);\n  const op1 = 'value += _X(x);';\n  let op2 = '';\n  if (adjustedAttributes.countIncludePad) {\n    op2 += `value /= float(${kernelSize});`;\n  } else {\n    op2 += `value /= float(${kernelSize} - pad);`;\n  }\n  const poolingCode = generatePoolingCode(inputs[0].dims, adjustedAttributes, op1, op2, '0.0');\n  const shaderSource = `\n        ${poolingCode}\n      `;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nexport const globalAveragePool: OperatorImplementation<AveragePoolAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: AveragePoolAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const metadata = {\n    name: 'GlobalAveragePool',\n    inputNames: ['X'],\n    inputTypes: [TextureType.unpacked],\n    cacheHint: `${attributes.countIncludePad}`,\n  };\n  const output = inferenceHandler.run(\n    { ...metadata, get: () => createAveragePoolProgramInfo(inputs, metadata, true, attributes) },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseGlobalAveragePoolAttributes: OperatorInitialization<AveragePoolAttributes> = (\n  node: Graph.Node,\n): AveragePoolAttributes => {\n  const countIncludePad = node.attributes.getInt('count_include_pad', 0) === 0 ? false : true;\n  return createAttributeWithCacheKey({\n    autoPad: '',\n    ceilMode: 0,\n    countIncludePad,\n    kernelShape: [],\n    strides: [],\n    pads: [],\n  });\n};\n\nexport interface MaxPoolAttributes extends AveragePoolAttributes {\n  readonly storageOrder: number;\n  readonly dilations: number[];\n}\n\nexport const maxPool: OperatorImplementation<MaxPoolAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: MaxPoolAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const metadata = {\n    name: 'MaxPool',\n    inputNames: ['X'],\n    inputTypes: [TextureType.unpacked],\n    cacheHint: attributes.cacheKey,\n  };\n  const output = inferenceHandler.run(\n    { ...metadata, get: () => createMaxPoolProgramInfo(inputs, metadata, false, attributes) },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseMaxPoolAttributes: OperatorInitialization<MaxPoolAttributes> = (\n  node: Graph.Node,\n): MaxPoolAttributes => {\n  const autoPad = node.attributes.getString('auto_pad', 'NOTSET');\n  const ceilMode = node.attributes.getInt('ceil_mode', 0);\n  const kernelShape = node.attributes.getInts('kernel_shape');\n  const strides = node.attributes.getInts('strides', []);\n  const pads = node.attributes.getInts('pads', []);\n  const storageOrder = node.attributes.getInt('storage_order', 0);\n  const dilations = node.attributes.getInts('dilations', []);\n\n  // TODO: support attribute 'ceil_mode' and 'storage_order'\n  if (storageOrder !== 0) {\n    throw new Error('column major storage order is not yet supported for MaxPool');\n  }\n  if (ceilMode !== 0) {\n    throw new Error('using ceil() in shape computation is not yet supported for MaxPool');\n  }\n\n  return createAttributeWithCacheKey({\n    autoPad,\n    ceilMode,\n    countIncludePad: false,\n    kernelShape,\n    strides,\n    pads,\n    storageOrder,\n    dilations,\n  });\n};\n\nconst createMaxPoolProgramInfo = (\n  inputs: Tensor[],\n  metadata: ProgramMetadata,\n  isGlobalOperator: boolean,\n  attributes: MaxPoolAttributes,\n): ProgramInfo => {\n  const [adjustedAttributes, outputShape] = getAdjustedPoolAttributesAndOutputShape(\n    inputs,\n    attributes,\n    isGlobalOperator,\n  );\n  const op1 = `\n      value = max(_X(x), value);\n    `;\n  const op2 = '';\n  const poolingCode = generatePoolingCode(inputs[0].dims, adjustedAttributes, op1, op2, '-1e5');\n  const shaderSource = `\n      ${poolingCode}\n    `;\n  return {\n    ...metadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst getAdjustedPoolAttributesAndOutputShape = (\n  inputs: Tensor[],\n  attributes: AveragePoolAttributes | MaxPoolAttributes,\n  isGlobalOperator: boolean,\n): [AveragePoolAttributes | MaxPoolAttributes, number[]] => {\n  const inputShape = inputs[0].dims.slice();\n  const hasDilations = Object.hasOwnProperty.call(attributes, 'dilations');\n  const kernelShape = attributes.kernelShape.slice();\n  const strides = attributes.strides.slice();\n  const dilations: number[] = hasDilations ? (attributes as MaxPoolAttributes).dilations.slice() : [];\n  const pads = attributes.pads.slice();\n  PoolConvUtil.adjustPoolAttributes(isGlobalOperator, inputShape, kernelShape, strides, dilations, pads);\n\n  const outputShape = PoolConvUtil.computePoolOutputShape(\n    isGlobalOperator,\n    inputShape,\n    strides,\n    dilations,\n    kernelShape,\n    pads,\n    attributes.autoPad,\n  );\n\n  const newAttributes = Object.assign({}, attributes);\n  if (hasDilations) {\n    Object.assign(newAttributes, { kernelShape, strides, pads, dilations, cacheKey: attributes.cacheKey });\n  } else {\n    Object.assign(newAttributes, { kernelShape, strides, pads, cacheKey: attributes.cacheKey });\n  }\n  return [newAttributes, outputShape];\n};\n\nconst globalMaxPoolAttributes = {\n  autoPad: '',\n  ceilMode: 0,\n  countIncludePad: false,\n  kernelShape: [],\n  strides: [],\n  pads: [],\n  storageOrder: 0,\n  dilations: [],\n  cacheKey: '',\n};\n\nconst globalMaxPoolMetadata = {\n  name: 'GlobalMaxPool',\n  inputNames: ['X'],\n  inputTypes: [TextureType.unpacked],\n};\n\nexport const globalMaxPool = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputs(inputs);\n  const output = inferenceHandler.run(\n    {\n      ...globalMaxPoolMetadata,\n      get: () => createMaxPoolProgramInfo(inputs, globalMaxPoolMetadata, true, globalMaxPoolAttributes),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Pool ops requires 1 input.');\n  }\n  if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n    throw new Error('Invalid input type.');\n  }\n};\n\nconst generatePoolingCode = (\n  inputDims: readonly number[],\n  attributes: AveragePoolAttributes,\n  op1: string,\n  op2: string,\n  start: string,\n): string => {\n  const rank = inputDims.length;\n  if (attributes.kernelShape.length <= 2) {\n    const kw = attributes.kernelShape[attributes.kernelShape.length - 1];\n    const sw = attributes.strides[attributes.strides.length - 1];\n    const pwStart = attributes.pads[attributes.pads.length / 2 - 1];\n    const pwEnd = attributes.pads[attributes.pads.length - 1];\n    const dimW = inputDims[rank - 1];\n    let codeW = '';\n    let codeH = '';\n    let codeHEnd = '';\n    if (pwStart + pwEnd !== 0) {\n      codeW = `\n          for (int i = 0; i < ${kw}; i++) {\n            x[${rank} - 1] = indices[${rank} - 1] * ${sw} - ${pwStart} + i;\n            if (x[${rank} - 1] < 0 || x[${rank} - 1] >= ${dimW}) {\n              pad++;\n              continue;\n            }\n            ${op1}\n          }`;\n    } else {\n      codeW = `\n          for (int i = 0; i < ${kw}; i++) {\n            x[${rank} - 1] = indices[${rank} - 1] * ${sw} - ${pwStart} + i;\n            ${op1}\n          }`;\n    }\n\n    if (attributes.kernelShape.length === 2) {\n      const kh = attributes.kernelShape[attributes.kernelShape.length - 2];\n      const sh = attributes.strides[attributes.strides.length - 2];\n      const phStart = attributes.pads[attributes.pads.length / 2 - 2];\n      const phEnd = attributes.pads[attributes.pads.length - 2];\n      const dimH = inputDims[rank - 2];\n      if (phStart + phEnd !== 0) {\n        codeH = `\n            for (int j = 0; j < ${kh}; j++) {\n              x[${rank} - 2] = indices[${rank} - 2] * ${sh} - ${phStart} + j;\n              if (x[${rank} - 2] < 0 || x[${rank} - 2] >= ${dimH}) {\n                pad+= ${kw};\n                continue;\n              }\n          `;\n      } else {\n        codeH = `\n            for (int j = 0; j < ${kh}; j++) {\n              x[${rank} - 2] = indices[${rank} - 2] * ${sh} - ${phStart} + j;\n            `;\n      }\n      codeHEnd = `\n          }\n        `;\n    }\n\n    const poolingCode = `\n        float process(int indices[${rank}]) {\n          int x[${rank}];\n          copyVec(indices, x);\n\n          float value = ${start};\n          int pad = 0;\n          ${codeH}\n          ${codeW}\n          ${codeHEnd}\n          ${op2}\n          return value;\n        }\n      `;\n    return poolingCode;\n  } else {\n    const kernelSize = ShapeUtil.size(attributes.kernelShape);\n    const kernelStrides = ShapeUtil.computeStrides(attributes.kernelShape);\n    const stridesRank = kernelStrides.length;\n    const padsRank = attributes.pads.length;\n    const offsetToIndicesFunction = offsetToIndices(stridesRank);\n    const copyInputDims = copyArray(inputDims, 'inputDims');\n    const copyPads = copyArray(attributes.pads, 'pads');\n    const copyKernelStrides = copyArray(kernelStrides, 'kernelStrides');\n    const copyStrides = copyArray(attributes.strides, 'strides');\n    const hasPads = attributes.pads.reduce((sum, cur) => sum + cur);\n    let padCode = '';\n    if (hasPads) {\n      padCode = `\n            if (x[j] >= inputDims[j] || x[j] < 0) {\n              pad++;\n              isPad = true;\n              break;\n            }\n          }\n          if (!isPad) {\n            ${op1}\n          }`;\n    } else {\n      padCode = `\n          }\n          ${op1}\n        `;\n    }\n    const poolingCode = `\n        ${offsetToIndicesFunction}\n        float process(int indices[${rank}]) {\n          int x[${rank}];\n          copyVec(indices, x);\n          int offset[${stridesRank}];\n          int pads[${padsRank}];\n          int inputDims[${rank}];\n          int kernelStrides[${stridesRank}];\n          int strides[${stridesRank}];\n          ${copyPads}\n          ${copyInputDims}\n          ${copyStrides}\n          ${copyKernelStrides}\n\n          float value = ${start};\n          int pad = 0;\n          bool isPad = false;\n          for (int i = 0; i < ${kernelSize}; i++) {\n            offsetToIndices(i, kernelStrides, offset);\n            isPad = false;\n            for (int j = ${rank} - ${stridesRank}; j < ${rank}; j++) {\n              x[j] = indices[j] * strides[j - ${rank} + ${stridesRank}]\n                + offset[j - ${rank} + ${stridesRank}] - pads[j - 2];\n              ${padCode}\n          }\n          ${op2}\n\n          return value;\n        }\n      `;\n    return poolingCode;\n  }\n};\n\nconst copyArray = (array: readonly number[], arrayName: string): string => {\n  let block = '';\n  for (let i = 0; i < array.length; i++) {\n    block += `\n      ${arrayName}[${i}] = ${array[i]};\n    `;\n  }\n  return block;\n};\n\nconst offsetToIndices = (rank: number): string => `\n  void offsetToIndices(int offset, int[${rank}] strides, out int[${rank}] indices) {\n    if (${rank} == 0) {\n      return;\n    }\n    for (int i = 0; i < ${rank} - 1; ++i) {\n      indices[i] = offset / strides[i];\n      offset -= indices[i] * strides[i];\n    }\n    indices[${rank} - 1] = offset;\n  }`;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { NUMBER_TYPES, OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramMetadata, TextureType } from '../types';\n\nexport interface ReduceAttributes extends AttributeWithCacheKey {\n  readonly axes: number[];\n  readonly keepDims: boolean;\n}\n\n// return [init ops, reduce ops, final ops]\ntype ReduceOp = (inputs: Tensor[], axes: number[]) => string[];\n\nconst reduce = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n  name: string,\n  reduceOp: ReduceOp,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  const reduceProgramMetadata = {\n    name,\n    inputNames: ['A'],\n    inputTypes: [TextureType.unpacked],\n  };\n\n  const output = inferenceHandler.run(\n    {\n      ...reduceProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createReduceProgramInfo(inferenceHandler, inputs, attributes, name, reduceOp, reduceProgramMetadata),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseReduceAttributes: OperatorInitialization<ReduceAttributes> = (node: Graph.Node): ReduceAttributes => {\n  const axes = node.attributes.getInts('axes', []);\n  const keepDims = node.attributes.getInt('keepdims', 1) === 1;\n  return createAttributeWithCacheKey({ axes, keepDims });\n};\n\nconst createReduceProgramInfo = (\n  _handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n  _name: string,\n  reduceOp: ReduceOp,\n  reduceProgramMetadata: ProgramMetadata,\n): ProgramInfo => {\n  const outputShape: number[] = [];\n  const iRank = inputs[0].dims.length || 1;\n\n  const idxCopy = []; // copy output indexes to input indexes\n\n  const axes = ShapeUtil.normalizeAxes(attributes.axes, inputs[0].dims.length);\n  const ops = reduceOp(inputs, axes);\n  let reduceOps = ops[1];\n\n  for (let k = 0; k < inputs[0].dims.length; k++) {\n    // if this axis is reduced\n    if (axes.indexOf(k) >= 0 || axes.length === 0) {\n      if (attributes.keepDims) {\n        outputShape.push(1);\n      } // else { remove the axis from outputShape; }\n\n      // loop over the d-th axis\n      reduceOps = `\n          for(int j${k} = 0; j${k} < ${inputs[0].dims[k]}; j${k}++) {\n            inputIdx[${k}] = j${k};\n            ${reduceOps}\n          }`;\n    } else {\n      idxCopy.push(`inputIdx[${k}] = outputIdx[${outputShape.length}];`);\n\n      outputShape.push(inputs[0].dims[k]);\n    }\n  }\n\n  const oRank = outputShape.length || 1;\n\n  const shaderSource = `\n      float process(int outputIdx[${oRank}]) {\n        float value;                 // final result\n        int inputIdx[${iRank}];      // addressing input data\n        ${idxCopy.join('\\n')}\n        ${ops[0]}       // init ops for reduce max/min\n        ${reduceOps}\n        ${ops[2]}       // final computation for reduce mean\n        return value;\n      }`;\n\n  return {\n    ...reduceProgramMetadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  // TODO: support Reduce* operators with 2 inputs.\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Reduce op requires 1 input.');\n  }\n\n  if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n    throw new Error('Invalid input type.');\n  }\n};\n\nexport const reduceSum: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (): string[] => ['value = 0.0;', 'value += _A(inputIdx);', ''];\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceSum', reduceOp);\n};\n\nexport const reduceMean: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (inputs: Tensor[], axes: number[]): string[] => {\n    let size = 1.0;\n    for (let k = 0; k < inputs[0].dims.length; k++) {\n      if (axes.indexOf(k) >= 0 || axes.length === 0) {\n        size *= inputs[0].dims[k];\n      }\n    }\n\n    return ['value = 0.0;', 'value += _A(inputIdx);', `value /= ${size}.;`]; // ensure real number with `.`\n  };\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceMean', reduceOp);\n};\n\nexport const reduceMax: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (inputs: Tensor[], axes: number[]): string[] => {\n    const idxZero = [];\n    for (let k = 0; k < inputs[0].dims.length; k++) {\n      if (axes.indexOf(k) >= 0 || axes.length === 0) {\n        idxZero.push(`inputIdx[${k}] = 0;`); // first element\n      }\n    }\n\n    return [`${idxZero.join('\\n')}\\nvalue = _A(inputIdx);`, 'value = max(value, _A(inputIdx));', ''];\n  };\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceMax', reduceOp);\n};\n\nexport const reduceMin: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (inputs: Tensor[], axes: number[]): string[] => {\n    const idxZero = [];\n    for (let k = 0; k < inputs[0].dims.length; k++) {\n      if (axes.indexOf(k) >= 0 || axes.length === 0) {\n        idxZero.push(`inputIdx[${k}] = 0;`); // first element\n      }\n    }\n\n    return [`${idxZero.join('\\n')}\\nvalue = _A(inputIdx);`, 'value = min(value, _A(inputIdx));', ''];\n  };\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceMin', reduceOp);\n};\n\nexport const reduceProd: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (): string[] => ['value = 1.0;', 'value *= _A(inputIdx);', ''];\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceProd', reduceOp);\n};\n\nexport const reduceLogSum: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (): string[] => ['value = 0.0;', 'value += _A(inputIdx);', 'value = log(value);'];\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceLogSum', reduceOp);\n};\n\nexport const reduceLogSumSquare: OperatorImplementation<ReduceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: ReduceAttributes,\n): Tensor[] => {\n  const reduceOp: ReduceOp = (): string[] => ['float t; value = 0.0;', 't = _A(inputIdx); value += t * t;', ''];\n  return reduce(inferenceHandler, inputs, attributes, 'ReduceLogSumSquare', reduceOp);\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nexport const reshape = (handler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  const reshapedDims = ShapeUtil.calculateReshapedDims(inputs[0].dims, inputs[1].integerData);\n  if (handler.session.pack) {\n    return [handler.reshapePacked(inputs[0], reshapedDims)];\n  } else {\n    return [handler.reshapeUnpacked(inputs[0], reshapedDims)];\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nexport interface UpsampleAttributes extends AttributeWithCacheKey {\n  readonly opset: number;\n  readonly isResize: boolean;\n  readonly mode: string;\n  readonly scales: number[];\n  readonly extrapolationValue: number;\n  readonly coordinateTransformMode: string;\n  readonly useExtrapolation: boolean;\n  readonly needRoiInput: boolean;\n  readonly nearestMode: string;\n  readonly cubicCoefficientA: number;\n  readonly excludeOutside: boolean;\n  readonly useNearest2xOptimization: boolean;\n  readonly roiInputIdx: number;\n  readonly scalesInputIdx: number;\n  readonly sizesInputIdx: number;\n}\n\nconst upsampleProgramMetadata = {\n  name: 'Upsample',\n  inputNames: ['X'],\n  inputTypes: [TextureType.unpacked],\n};\n\nexport const upsample: OperatorImplementation<UpsampleAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: UpsampleAttributes,\n): Tensor[] => {\n  validateInputs(inputs, attributes);\n  const output = inferenceHandler.run(\n    {\n      ...upsampleProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createUpsampleProgramInfo(inferenceHandler, inputs, attributes),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseUpsampleAttributesV7: OperatorInitialization<UpsampleAttributes> = (\n  node: Graph.Node,\n): UpsampleAttributes => parseUpsampleAttributes(node, 7);\n\nexport const parseUpsampleAttributesV9: OperatorInitialization<UpsampleAttributes> = (\n  node: Graph.Node,\n): UpsampleAttributes => parseUpsampleAttributes(node, 9);\n\nexport const parseUpsampleAttributes = (node: Graph.Node, opset: number): UpsampleAttributes => {\n  const isResize = opset >= 10;\n\n  // processing node attributes\n  const mode = node.attributes.getString('mode', 'nearest');\n  if (mode !== 'nearest' && mode !== 'linear' && (opset < 11 || mode !== 'cubic')) {\n    throw new Error(`unrecognized mode: ${mode}`);\n  }\n\n  let scales: number[] = [];\n  if (opset < 9) {\n    scales = node.attributes.getFloats('scales');\n    scalesValidation(scales, mode, isResize);\n  }\n\n  const extrapolationValue = node.attributes.getFloat('extrapolation_value', 0.0);\n\n  const coordinateTransformMode =\n    opset > 10 ? node.attributes.getString('coordinate_transformation_mode', 'half_pixel') : 'asymmetric';\n  if (\n    [\n      'asymmetric',\n      'pytorch_half_pixel',\n      'tf_half_pixel_for_nn',\n      'align_corners',\n      'tf_crop_and_resize',\n      'half_pixel',\n    ].indexOf(coordinateTransformMode) === -1\n  ) {\n    throw new Error(`coordinate_transform_mode '${coordinateTransformMode}' is not supported`);\n  }\n  const needRoiInput = coordinateTransformMode === 'tf_crop_and_resize';\n  const useExtrapolation = needRoiInput;\n\n  const nearestMode =\n    mode === 'nearest' && opset >= 11 ? node.attributes.getString('nearest_mode', 'round_prefer_floor') : '';\n  if (['round_prefer_floor', 'round_prefer_ceil', 'floor', 'ceil', ''].indexOf(nearestMode) === -1) {\n    throw new Error(`nearest_mode '${nearestMode}' is not supported`);\n  }\n\n  const cubicCoefficientA = node.attributes.getFloat('cubic_coeff_a', -0.75);\n  const excludeOutside = node.attributes.getInt('exclude_outside', 0) !== 0;\n  if (excludeOutside && mode !== 'cubic') {\n    throw new Error('exclude_outside can be set to 1 only when mode is CUBIC.');\n  }\n\n  const useNearest2xOptimization =\n    opset < 11 ? true : mode === 'nearest' && coordinateTransformMode === 'asymmetric' && nearestMode === 'floor';\n\n  let roiInputIdx = 0;\n  let scalesInputIdx = 0;\n  let sizesInputIdx = 0;\n\n  if (opset > 10) {\n    // handle when roiInput is not given\n    if (node.inputs.length > 2) {\n      roiInputIdx = 1;\n      scalesInputIdx = 2;\n      sizesInputIdx = 3;\n    } else {\n      scalesInputIdx = 1;\n      sizesInputIdx = 2;\n    }\n  } else if (opset === 9) {\n    scalesInputIdx = 1;\n  }\n\n  return createAttributeWithCacheKey({\n    opset,\n    isResize,\n    mode,\n    scales,\n    extrapolationValue,\n    coordinateTransformMode,\n    useExtrapolation,\n    needRoiInput,\n    nearestMode,\n    cubicCoefficientA,\n    excludeOutside,\n    useNearest2xOptimization,\n    roiInputIdx,\n    scalesInputIdx,\n    sizesInputIdx,\n  });\n};\n\nconst createUpsampleProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: UpsampleAttributes,\n): ProgramInfo => {\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const [inputWidth, inputHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    inputs[0].dims,\n    TextureType.unpacked,\n  );\n\n  const outputShape = inputs[0].dims.map((dim, i) => Math.floor(dim * attributes.scales[i]));\n  const [outputWidth, outputHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    outputShape,\n    TextureType.unpacked,\n  );\n  const dim = outputShape.length;\n\n  const outputPitches = new Array<number>(dim);\n  const inputPitches = new Array<number>(dim);\n  let precalculatedPitches = `\n      int output_pitches[${dim}];\n      int input_pitches[${dim}];\n      `;\n  for (let d = dim - 1; d >= 0; d--) {\n    outputPitches[d] = d === dim - 1 ? 1 : outputPitches[d + 1] * outputShape[d + 1];\n    inputPitches[d] = d === dim - 1 ? 1 : inputPitches[d + 1] * inputs[0].dims[d + 1];\n\n    precalculatedPitches += `\n        output_pitches[${d}] = ${outputPitches[d]};\n        input_pitches[${d}] = ${inputPitches[d]};\n        `;\n  }\n  const getInputFloatFunction = `\n      float getInputFloat(int index) {\n        vec2 coords = offsetToCoords(index, ${inputWidth}, ${inputHeight});\n        float value = getColorAsFloat(${glsl.texture2D}(X, coords));\n        return value;\n      }\n      `;\n\n  const shaderSource =\n    attributes.mode === 'nearest'\n      ? // nearest\n        `\n    ${getInputFloatFunction}\n    float process(int indices[${dim}]) {\n      int input_index = 0;\n      int output_index = coordsToOffset(TexCoords, ${outputWidth}, ${outputHeight});\n\n      ${precalculatedPitches}\n\n      int d, m;\n      for (int dim = 0; dim < ${dim}; ++dim) {\n        d = output_index / output_pitches[dim];\n        m = output_index - d * output_pitches[dim];\n        output_index = m;\n\n        if (scales[dim] != 1 && d > 0) {\n          int d2 = d / scales[dim];\n          m = d - d2 * scales[dim];\n          d = d2;\n        }\n        input_index += input_pitches[dim] * d;\n      }\n\n      return getInputFloat(input_index);\n    }`\n      : dim === 4\n        ? // bilinear 4D\n          `\n    ${getInputFloatFunction}\n    float process(int indices[4]) {\n      int input_index = 0;\n      int output_index = coordsToOffset(TexCoords, ${outputWidth}, ${outputHeight});\n\n      ${precalculatedPitches}\n\n      int m;\n      int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n      index_of_dim0 = output_index / output_pitches[0];\n      m = output_index - index_of_dim0 * output_pitches[0];\n      index_of_dim1 = m / output_pitches[1];\n      m = m - index_of_dim1 * output_pitches[1];\n      index_of_dim2 = m / output_pitches[2];\n      m = m - index_of_dim2 * output_pitches[2];\n      index_of_dim3 = m;\n\n      int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n      index_of_input_dim2 = index_of_dim2 / scales[2];\n      y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n      index_of_input_dim3 = index_of_dim3 / scales[3];\n      x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n      input_index = index_of_dim0 * input_pitches[0] +\n            index_of_dim1 * input_pitches[1] +\n            index_of_input_dim2 * input_pitches[2] +\n            index_of_input_dim3;\n\n      float x00 = getInputFloat(input_index);\n      float x10, x01, x11;\n\n      bool end_of_dim2 = false;\n      if (index_of_input_dim2 == (${inputs[0].dims[2]} - 1)) {\n        // It's the end in dimension 2\n        x01 = x00;\n        end_of_dim2 = true;\n      } else {\n        x01 = getInputFloat(input_index + input_pitches[2]);\n      }\n\n      if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n        // It's the end in dimension 3\n        x10 = x00;\n        x11 = x01;\n      }\n      else {\n        x10 = getInputFloat(input_index + 1);\n        x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n      }\n\n      float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n      float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n      return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n    }`\n        : // bilinear 2D\n          `\n    ${getInputFloatFunction}\n    float process(int indices[2]) {\n      int input_index = 0;\n      int output_index = coordsToOffset(TexCoords, ${outputWidth}, ${outputHeight});\n\n      ${precalculatedPitches}\n\n      int m;\n      int index_of_dim0, index_of_dim1;\n      index_of_dim0 = output_index / output_pitches[0];\n      m = output_index - index_of_dim0 * output_pitches[0];\n      index_of_dim1 = m;\n\n      int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n      index_of_input_dim0 = index_of_dim0 / scales[0];\n      y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n      index_of_input_dim1 = index_of_dim1 / scales[1];\n      x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n      input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n      float x00 = getInputFloat(input_index);\n      float x10, x01, x11;\n\n      bool end_of_dim0 = false;\n      if (index_of_input_dim0 == (${inputs[0].dims[0]} - 1)) {\n        // It's the end in dimension 0\n        x01 = x00;\n        end_of_dim0 = true;\n      } else {\n        x01 = getInputFloat(input_index + input_pitches[0]);\n      }\n\n      if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n        // It's the end in dimension 1\n        x10 = x00;\n        x11 = x01;\n      }\n      else {\n        x10 = getInputFloat(input_index + 1);\n        x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n      }\n\n      float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n      float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n      return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n    }`;\n  return {\n    ...upsampleProgramMetadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n    variables: [\n      {\n        name: 'scales',\n        type: 'int',\n        arrayLength: attributes.scales.length,\n        data: attributes.scales.map((x) => Math.ceil(x)),\n      },\n    ],\n  };\n};\n\nexport const validateInputs = (inputs: Tensor[], attribute: UpsampleAttributes): void => {\n  if (\n    !inputs ||\n    (attribute.opset < 9 && inputs.length !== 1) ||\n    (attribute.opset >= 9 && attribute.opset < 11 && inputs.length !== 2) ||\n    (attribute.opset >= 11 && inputs.length < 2)\n  ) {\n    throw new Error('invalid inputs.');\n  }\n\n  if (attribute.scales.length > 0 && inputs[0].dims.length !== attribute.scales.length) {\n    throw new Error('Invalid input shape.');\n  }\n\n  if (inputs[0].type === 'string') {\n    throw new Error('Invalid input tensor types.');\n  }\n};\n\nexport const scalesValidation = (scales: number[], mode: string, isResize: boolean): void => {\n  if (!isResize) {\n    for (const scale of scales) {\n      if (scale < 1) {\n        throw new Error('Scale value should be greater than or equal to 1.');\n      }\n    }\n  } else {\n    for (const scale of scales) {\n      if (scale <= 0) {\n        throw new Error('Scale value should be greater than 0.');\n      }\n    }\n  }\n  if (mode === 'linear' || mode === 'cubic') {\n    if (scales.length !== 2 && (scales.length !== 4 || scales[0] !== 1 || scales[1] !== 1)) {\n      throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') \\\n        or 4-D inputs with the corresponding outermost 2 scale values being 1 \\\n        in the ${isResize ? 'Resize' : 'Upsample'} opeartor.`);\n    }\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\nimport { getCoordsDataType } from '../utils';\n\nimport { unpackFromChannel } from './packing-utils';\nimport { parseUpsampleAttributes, scalesValidation, UpsampleAttributes, validateInputs } from './upsample';\n\nconst resizeProgramMetadata = {\n  name: 'Resize',\n  inputNames: ['A'],\n  inputTypes: [TextureType.packed],\n};\n\nexport const resize: OperatorImplementation<UpsampleAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: UpsampleAttributes,\n): Tensor[] => {\n  validateInputs(inputs, attributes);\n  const output = inferenceHandler.run(\n    {\n      ...resizeProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createPackedResizeProgramInfo(inferenceHandler, inputs, attributes),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseResizeAttributesV10: OperatorInitialization<UpsampleAttributes> = (\n  node: Graph.Node,\n): UpsampleAttributes => parseUpsampleAttributes(node, 10);\n\nexport const parseResizeAttributesV11: OperatorInitialization<UpsampleAttributes> = (\n  node: Graph.Node,\n): UpsampleAttributes => parseUpsampleAttributes(node, 11);\n\nconst createPackedResizeProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: UpsampleAttributes,\n): ProgramInfo => {\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const [scales, outputShape] = prepareInputs(inputs, attributes);\n\n  const isSame = scales.every((s: number) => s === 1) && attributes.coordinateTransformMode !== 'tf_crop_and_resize';\n  if (isSame) {\n    return {\n      ...resizeProgramMetadata,\n      output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.packed },\n      hasMain: true,\n      shaderSource: `void main() {\n                    vec4 v = ${glsl.texture2D}(X, TexCoords);\n                    ${glsl.output} = v;\n                }`,\n    };\n  }\n\n  const dim = outputShape.length;\n  if (dim < 2) {\n    throw new Error(`output dimension should be at least 2, but got ${dim}`);\n  }\n\n  const outputHeight = outputShape[dim - 2];\n  const outputWidth = outputShape[dim - 1];\n\n  const inputShape = inputs[0].dims;\n  if (dim !== inputShape.length) {\n    throw new Error(`output dimension should match input ${inputShape.length}, but got ${dim}`);\n  }\n  const inputHeight = inputShape[dim - 2];\n  const inputWidth = inputShape[dim - 1];\n\n  const scalesHeight = scales[dim - 2];\n  const scalesWidth = scales[dim - 1];\n\n  let getSourceFracIndex = '';\n\n  if (attributes.mode !== 'linear') {\n    // TODO: support other modes\n    throw new Error(`resize (packed) does not support mode: '${attributes.mode}'`);\n  }\n  switch (attributes.coordinateTransformMode) {\n    case 'asymmetric':\n      getSourceFracIndex = `\n                    vec4 getSourceFracIndex(ivec4 coords) {\n                        return vec4(coords) / scaleWHWH;\n                    }\n                `;\n      break;\n    case 'half_pixel':\n      getSourceFracIndex = `\n                    vec4 getSourceFracIndex(ivec4 coords) {\n                        return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n                    }\n                `;\n      break;\n    case 'pytorch_half_pixel':\n      getSourceFracIndex = `\n                    vec4 getSourceFracIndex(ivec4 coords) {\n                        vec4 fcoords = vec4(coords);\n                        return vec4(\n                            ${outputWidth}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n                            ${outputHeight}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n                            ${outputWidth}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n                            ${outputHeight}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n                          );\n                    }\n                `;\n      break;\n    case 'align_corners':\n      getSourceFracIndex = `\n                    vec4 getSourceFracIndex(ivec4 coords) {\n                        vec4 resized = vec4(${outputWidth}.0 - 1.0, ${outputHeight}.0 - 1.0, ${outputWidth}.0 - 1.0,\n                            ${outputHeight}.0 - 1.0);\n                        vec4 original = vec4(${inputWidth}.0 - 1.0, ${inputHeight}.0 - 1.0, ${inputWidth}.0 - 1.0,\n                            ${inputHeight}.0 - 1.0);\n                        vec4 new_scale = original / resized;\n                        return vec4(coords) * new_scale;\n                    }\n                `;\n      break;\n    default:\n      // TODO:supporting other coordinateTransformModes\n      throw new Error(`resize (packed) does not support coordinateTransformMode: \\\n                                '${attributes.coordinateTransformMode}'`);\n  }\n\n  const coordsDataType = getCoordsDataType(dim);\n  const unpackChannel = unpackFromChannel();\n  const shaderSource = `\n            const vec2 inputWH = vec2(${inputHeight}.0, ${inputWidth}.0);\n            const vec4 scaleWHWH = vec4(float(${scalesHeight}), float(${scalesWidth}), float(${scalesHeight}), float(${\n              scalesWidth\n            }));\n            ${unpackChannel}\n            ${getSourceFracIndex}\n            float getAValue(int x10, int r, int c, int d) {\n                return getChannel(getA(x10, r, c, d), vec2(c, d));\n            }\n            void main() {\n                ${coordsDataType} rc = getOutputCoords();\n\n                int batch = rc[0];\n                int depth = rc[1];\n\n                // retrieve the 4 coordinates that is used in the 4 packed output values.\n                ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n                // calculate the source index in fraction\n                vec4 sourceFrac = getSourceFracIndex(coords);\n\n                // get the lower and upper bound of the 4 values that will be packed into one texel.\n                ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n                ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n                ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n                ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n                bool hasNextRow = rc.w < ${outputHeight - 1};\n                bool hasNextCol = rc.z < ${outputWidth - 1};\n\n                // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n                vec4 topLeft = vec4(\n                    getAValue(batch, depth, x00.x, x00.y),\n                    hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n                    hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n                    (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n                // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n                vec4 topRight = vec4(\n                    getAValue(batch, depth, x00.x, x00.w),\n                    hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n                    hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n                    (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n                // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n                vec4 bottomLeft = vec4(\n                    getAValue(batch, depth, x00.z, x00.y),\n                    hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n                    hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n                    (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n                // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n                vec4 bottomRight = vec4(\n                    getAValue(batch, depth, x00.z, x00.w),\n                    hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n                    hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n                    (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n                // calculate the interpolation fraction on u and v direction\n                vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n                vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n                vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n                vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n                vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n                ${glsl.output} = vec4(newValue);\n            }\n        `;\n  return {\n    ...resizeProgramMetadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.packed },\n    hasMain: true,\n    shaderSource,\n  };\n};\n\nconst prepareInputs = (inputs: Tensor[], attributes: UpsampleAttributes): [readonly number[], readonly number[]] => {\n  const x = inputs[0];\n  const xDims = x.dims;\n\n  let scales = attributes.scales;\n  let outputSizes: number[] | undefined;\n  if (scales.length === 0) {\n    const scalesTensor = inputs[attributes.scalesInputIdx];\n    if (scalesTensor && scalesTensor.size !== 0) {\n      if (inputs[attributes.sizesInputIdx]) {\n        throw new Error('Only one of scales or sizes must be provided as input.');\n      }\n      scales = parseScalesData(scalesTensor, attributes.mode, attributes.isResize);\n    } else {\n      const sizesTensor = inputs[attributes.sizesInputIdx];\n      if (!sizesTensor || sizesTensor.size === 0) {\n        throw new Error('Either scales or sizes MUST be provided as input.');\n      }\n\n      outputSizes = Array.from(sizesTensor.integerData);\n      scales = parseScalesDataFromOutputSize(outputSizes, xDims, attributes.mode, attributes.isResize);\n    }\n  } else {\n    if (inputs[attributes.sizesInputIdx]) {\n      throw new Error('Only one of scales or sizes must be provided as input.');\n    }\n  }\n\n  const yDims = outputSizes || xDims.map((dim, i) => Math.floor(dim * scales[i]));\n\n  return [scales, yDims];\n};\n\nconst parseScalesData = (scale: Tensor, mode: string, isResize: boolean): number[] => {\n  const scales = Array.from(scale.floatData);\n  scalesValidation(scales, mode, isResize);\n  return scales;\n};\n\nconst parseScalesDataFromOutputSize = (\n  yDims: readonly number[],\n  xDims: readonly number[],\n  mode: string,\n  isResize: boolean,\n): number[] => {\n  const length = xDims.length;\n  const scales = new Array<number>(length);\n\n  for (let i = 0, end = length; i < end; i++) {\n    if (xDims[i] === 0) {\n      if (yDims[i] !== 0) {\n        throw new Error('Input dim is zero but required output dim is non-zero.');\n      }\n      scales[i] = 1;\n    } else {\n      scales[i] = yDims[i] / xDims[i];\n    }\n  }\n  scalesValidation(scales, mode, isResize);\n  return scales;\n};\n\n// roi data is not used yet. but leave here for future usage.\n// const getRoi = (inputs: Tensor[], attributes: UpsampleAttributes) : number[] => {\n//     let roi: number[] = [];\n//     if (attributes.needRoiInput) {\n//         if (attributes.roiInputIdx <= 0) {\n//             throw new Error('Invalid roi input index.');\n//         }\n//         const roiTensor = inputs[attributes.roiInputIdx];\n//         roi = roiTensor.size > 0 ? Array.from(roiTensor.floatData) : [];\n//     } else {\n//         roi = new Array(inputs[0].dims.length * 2).fill(0);\n//     }\n//     return roi;\n// };\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nexport const shape = (_inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputs(inputs);\n  return [new Tensor([inputs[0].dims.length], 'int32', undefined, undefined, new Int32Array(inputs[0].dims))];\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Shape requires 1 input.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { NUMBER_TYPES, OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nexport interface SliceAttributes extends AttributeWithCacheKey {\n  readonly axes: number[];\n  readonly ends: number[];\n  readonly starts: number[];\n}\n\nconst sliceProgramMetadata = {\n  name: 'Slice',\n  inputNames: ['A'],\n  inputTypes: [TextureType.unpacked],\n};\n\nexport const slice: OperatorImplementation<SliceAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: SliceAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n  const output = inferenceHandler.run(\n    {\n      ...sliceProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createSliceProgramInfo(inferenceHandler, inputs[0], attributes),\n    },\n    inputs,\n  );\n  return [output];\n};\n\nexport const parseSliceAttributes: OperatorInitialization<SliceAttributes> = (node: Graph.Node): SliceAttributes => {\n  const starts = node.attributes.getInts('starts');\n  const ends = node.attributes.getInts('ends');\n  const axes = node.attributes.getInts('axes', []);\n  return createAttributeWithCacheKey({ starts, ends, axes });\n};\n\nconst createSliceProgramInfo = (\n  _inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  attributes: SliceAttributes,\n): ProgramInfo => {\n  const axes = attributes.axes.length === 0 ? input.dims.slice(0).map((_val, i) => i) : attributes.axes;\n  const normalizedAxes = ShapeUtil.normalizeAxes(axes, input.dims.length);\n  const starts = attributes.starts.map((start, i) => {\n    if (start > input.dims[normalizedAxes[i]] - 1) {\n      return input.dims[normalizedAxes[i]];\n    }\n    return ShapeUtil.normalizeAxis(start, input.dims[normalizedAxes[i]]);\n  });\n  const ends = attributes.ends.map((end, i) => {\n    if (end > input.dims[normalizedAxes[i]] - 1) {\n      return input.dims[normalizedAxes[i]];\n    }\n    return ShapeUtil.normalizeAxis(end, input.dims[normalizedAxes[i]]);\n  });\n\n  const outputShape = input.dims.slice();\n\n  const sliceOps: string[] = [];\n  for (let i = 0; i < normalizedAxes.length; i++) {\n    outputShape[normalizedAxes[i]] = ends[i] - starts[i];\n    if (starts[i] > 0) {\n      sliceOps.push(`outputIdx[${normalizedAxes[i]}] += ${starts[i]};`);\n    } // else { sliceOps.push(`outputIdx[${normalizedAxes[i]}] += 0;`); }\n  }\n\n  const rank = outputShape.length;\n  const shaderSource = `\n      float process(int outputIdx[${rank}]) {\n        ${sliceOps.join('\\n      ')}\n        return _A(outputIdx);\n      }`;\n  return {\n    ...sliceProgramMetadata,\n    output: { dims: outputShape, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Slice requires 1 input.');\n  }\n  if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n    throw new Error('Invalid input type.');\n  }\n};\n\nexport const sliceV10 = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputsV10(inputs);\n  const attributes = generateSliceAttributesFromInputs(inferenceHandler, inputs);\n  const output = inferenceHandler.run(\n    {\n      ...sliceProgramMetadata,\n      cacheHint: attributes.cacheKey,\n      get: () => createSliceProgramInfo(inferenceHandler, inputs[0], attributes),\n    },\n    [inputs[0]],\n  );\n  return [output];\n};\n\nconst generateSliceAttributesFromInputs = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n): SliceAttributes => {\n  if (\n    !inferenceHandler.session.isInitializer(inputs[1].dataId) ||\n    !inferenceHandler.session.isInitializer(inputs[2].dataId) ||\n    (inputs.length >= 4 && !inferenceHandler.session.isInitializer(inputs[3].dataId)) ||\n    (inputs.length >= 5 && !inferenceHandler.session.isInitializer(inputs[4].dataId))\n  ) {\n    throw new Error('dynamic slice attributes are not allowed');\n  }\n\n  if (inputs.length >= 5 && inputs[4].integerData.some((i: number) => i !== 1)) {\n    throw new Error('currently non-1 steps is not supported for Slice');\n  }\n\n  const starts = Array.from(inputs[1].integerData);\n  const ends = Array.from(inputs[2].integerData);\n  const axes = inputs.length >= 4 ? Array.from(inputs[3].integerData) : [];\n  const cacheKey = `${axes};${starts};${ends}`;\n  return { starts, ends, axes, cacheKey };\n};\n\nconst validateInputsV10 = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length < 3 || inputs.length > 5) {\n    throw new Error('Invalid input number.');\n  }\n  if (inputs[1].type !== 'int32' || inputs[1].dims.length !== 1) {\n    throw new Error('Invalid input type.');\n  }\n  if (inputs[2].type !== 'int32' || inputs[2].dims.length !== 1) {\n    throw new Error('Invalid input type.');\n  }\n  if (inputs.length >= 4 && (inputs[3].type !== 'int32' || inputs[3].dims.length !== 1)) {\n    throw new Error('Invalid input type.');\n  }\n  if (inputs.length >= 5 && (inputs[4].type !== 'int32' || inputs[4].dims.length !== 1)) {\n    throw new Error('Invalid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nimport { transpose, TransposeAttributes } from './transpose';\n\nexport interface SoftmaxAttributes extends AttributeWithCacheKey {\n  readonly axis: number;\n}\n\nconst softmaxComputeMaxProgramMetadata = {\n  name: 'SoftmaxComputeMax',\n  inputNames: ['A'],\n  inputTypes: [TextureType.unpacked],\n};\n\nconst softmaxComputeScaleProgramMetadata = {\n  name: 'SoftmaxComputeScale',\n  inputNames: ['A', 'Max'],\n  inputTypes: [TextureType.unpacked, TextureType.unpacked],\n};\n\nconst softmaxProgramMetadata = {\n  name: 'SoftMax',\n  inputNames: ['A', 'Max', 'Norm'],\n  inputTypes: [TextureType.unpacked, TextureType.unpacked, TextureType.unpacked],\n};\n\nexport const softmax: OperatorImplementation<SoftmaxAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: SoftmaxAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  const inputShape = inputs[0].dims.slice();\n  const axis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);\n  const logicalRowCount = ShapeUtil.sizeToDimension(inputShape, axis);\n  const featureCount = ShapeUtil.sizeFromDimension(inputShape, axis);\n\n  const output = computeSoftmax(inferenceHandler, inputs, attributes, logicalRowCount, featureCount);\n  return output;\n};\n\nexport const parseSoftmaxAttributes: OperatorInitialization<SoftmaxAttributes> = (\n  node: Graph.Node,\n): SoftmaxAttributes => createAttributeWithCacheKey({ axis: node.attributes.getInt('axis', 1) });\n\nexport const parseSoftmaxAttributesV13: OperatorInitialization<SoftmaxAttributes> = (\n  node: Graph.Node,\n): SoftmaxAttributes => createAttributeWithCacheKey({ axis: node.attributes.getInt('axis', -1) });\n\n// The \"semantic\" meaning of axis has changed in opset-13.\n// Please compare: https://github.com/onnx/onnx/blob/main/docs/Operators.md#Softmax\n// with https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Softmax-11 for detailed explanations\n// To account for the opset-13 behavior, our plan will be to transpose the \"axis\" dim to the innermost dim\n// and perform softmax and then reverse the transpose. We can skip the transposing aspect if the axis is already\n// the innermost dim\nexport const softmaxV13: OperatorImplementation<SoftmaxAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: SoftmaxAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  const inputShape = inputs[0].dims.slice();\n  const axis = ShapeUtil.normalizeAxis(attributes.axis, inputShape.length);\n  const rank = inputShape.length;\n\n  const isTransposeRequired = axis !== rank - 1 ? true : false;\n  const transposedInputShape: number[] = [];\n  let perm: number[] = [];\n  let transposedInputs: Tensor[] = [];\n  let transposeAttribute: TransposeAttributes;\n\n  if (isTransposeRequired) {\n    perm = Array.from({ length: rank }).map((_, i) => i);\n\n    // swap the innermost dim with the dim corresponding to axis\n    perm[axis] = rank - 1;\n    perm[rank - 1] = axis;\n\n    perm.map((p) => transposedInputShape.push(inputShape[p]));\n\n    transposeAttribute = createAttributeWithCacheKey({ perm });\n    transposedInputs = transpose(inferenceHandler, inputs, transposeAttribute);\n  }\n\n  const logicalRowCount = isTransposeRequired\n    ? ShapeUtil.sizeToDimension(transposedInputShape, rank - 1)\n    : ShapeUtil.sizeToDimension(inputShape, rank - 1);\n  const featureCount = isTransposeRequired\n    ? ShapeUtil.sizeFromDimension(transposedInputShape, rank - 1)\n    : ShapeUtil.sizeFromDimension(inputShape, rank - 1);\n\n  const output = computeSoftmax(\n    inferenceHandler,\n    isTransposeRequired ? transposedInputs : inputs,\n    attributes,\n    logicalRowCount,\n    featureCount,\n  );\n\n  if (isTransposeRequired) {\n    const reversedOutput = transpose(inferenceHandler, output, transposeAttribute!);\n    return reversedOutput;\n  } else {\n    return output;\n  }\n};\n\nconst computeSoftmax = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: SoftmaxAttributes,\n  logicalRowCount: number,\n  featureCount: number,\n): Tensor[] => {\n  const computeMaxProgramInfo = createComputeMaxProgramInfo(\n    inferenceHandler,\n    inputs[0],\n    logicalRowCount,\n    featureCount,\n    [logicalRowCount],\n  );\n  const max = inferenceHandler.run(\n    { ...softmaxComputeMaxProgramMetadata, cacheHint: attributes.cacheKey, get: () => computeMaxProgramInfo },\n    inputs,\n  );\n\n  const computeScaleProgramInfo = createComputScaleProgramInfo(\n    inferenceHandler,\n    inputs[0],\n    logicalRowCount,\n    featureCount,\n    computeMaxProgramInfo.output.dims,\n    [logicalRowCount],\n  );\n  const scale = inferenceHandler.run(\n    { ...softmaxComputeScaleProgramMetadata, cacheHint: attributes.cacheKey, get: () => computeScaleProgramInfo },\n    [inputs[0], max],\n  );\n\n  const softMaxProgramInfo = createSoftMaxProgramInfo(\n    inferenceHandler,\n    inputs[0],\n    logicalRowCount,\n    featureCount,\n    computeMaxProgramInfo.output.dims,\n    computeScaleProgramInfo.output.dims,\n  );\n  const output = inferenceHandler.run(\n    { ...softmaxProgramMetadata, cacheHint: attributes.cacheKey, get: () => softMaxProgramInfo },\n    [inputs[0], max, scale],\n  );\n  return [output];\n};\n\n/**\n * Create a texture that contains the maximum value of each of the 'N' rows\n */\nconst createComputeMaxProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  logicalRowCount: number,\n  featureCount: number,\n  outputShape: number[],\n): ProgramInfo => {\n  const [textureWidth, textureHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    input.dims,\n    TextureType.unpacked,\n  );\n  const rank = outputShape.length;\n\n  if (logicalRowCount < 1 || featureCount < 1) {\n    throw new Error('Logical row count N and feature count D must be greater than or equal to 1');\n  }\n\n  if (outputShape.length !== 1) {\n    throw new Error('Dimensionality of the output should be 1');\n  }\n\n  if (outputShape[0] !== logicalRowCount) {\n    throw new Error('Shape of the output should be equal to logical row count');\n  }\n\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const shaderSource = `\n      float process(int[${rank}] indices) {\n        int logical_row_start_offset = indices[0] * ${featureCount};\n\n        float max = getColorAsFloat(${glsl.texture2D}(A, offsetToCoords(logical_row_start_offset, ${textureWidth},\n        ${textureHeight} )));\n        for(int i=1; i<${featureCount}; ++i)\n        {\n          float current = getColorAsFloat(${glsl.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n            ${textureWidth}, ${textureHeight})));\n          if(current > max)\n          max = current;\n        }\n\n        return max;\n      }`;\n  return {\n    ...softmaxComputeMaxProgramMetadata,\n    output: { dims: outputShape, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\n/**\n * Create a texture that contains the normalization factor for each of the 'N' rows\n */\nconst createComputScaleProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  logicalRowCount: number,\n  featureCount: number,\n  maxElementPerLogicalRow: readonly number[],\n  outputShape: number[],\n): ProgramInfo => {\n  const [textureWidth, textureHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    input.dims,\n    TextureType.unpacked,\n  );\n  const rank = outputShape.length;\n\n  if (logicalRowCount < 1 || featureCount < 1) {\n    throw new Error('Logical row count N and feature count D must be greater than or equal to 1');\n  }\n\n  if (outputShape.length !== 1) {\n    throw new Error('Dimensionality of the output should be 1');\n  }\n\n  if (outputShape[0] !== logicalRowCount) {\n    throw new Error('Shape of the output should be equal to logical row count');\n  }\n\n  if (maxElementPerLogicalRow.length !== 1) {\n    throw new Error('Dimensionality of the intermediate results should be 1');\n  }\n\n  if (maxElementPerLogicalRow[0] !== logicalRowCount) {\n    throw new Error('Shape of the intermediate results should be equal to logical row count');\n  }\n\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const shaderSource = `\n      float process(int[${rank}] indices) {\n        int logical_row_start_offset = indices[0] * ${featureCount};\n\n        float norm_factor = 0.0;\n        float max = _Max(indices);\n        for(int i=0; i<${featureCount}; ++i)\n        {\n          norm_factor += exp(getColorAsFloat(${glsl.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n            ${textureWidth}, ${textureHeight}))) - max);\n        }\n\n        return norm_factor;\n      }`;\n  return {\n    ...softmaxComputeScaleProgramMetadata,\n    output: { dims: outputShape, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst createSoftMaxProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  logicalRowCount: number,\n  featureCount: number,\n  maxElementPerLogicalRow: readonly number[],\n  normalizationPerLogicalRow: readonly number[],\n): ProgramInfo => {\n  const [textureWidth, textureHeight] = inferenceHandler.calculateTextureWidthAndHeight(\n    input.dims,\n    TextureType.unpacked,\n  );\n  const rank = input.dims.length;\n\n  if (logicalRowCount < 1 || featureCount < 1) {\n    throw new Error('Logical row count N and feature count D must be greater than or equal to 1');\n  }\n\n  if (maxElementPerLogicalRow.length !== 1 || normalizationPerLogicalRow.length !== 1) {\n    throw new Error('Dimensionality of the intermediate results should be 1');\n  }\n\n  if (maxElementPerLogicalRow[0] !== logicalRowCount || normalizationPerLogicalRow[0] !== logicalRowCount) {\n    throw new Error('Shape of the intermediate results should be equal to logical row count');\n  }\n\n  const shaderSource = `\n      float process(int[${rank}] indices) {\n\n      // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n      int offset = coordsToOffset(TexCoords, ${textureWidth}, ${textureHeight});\n\n      //determine the logical row for this index\n      int logical_row_index[1];\n      logical_row_index[0] = offset / ${featureCount};\n\n      float norm_factor = _Norm(logical_row_index);\n\n      // avoid possible division by 0\n      // if norm_facor is 0, all elements are zero\n      // if so, return 0\n      if(norm_factor == 0.0)\n        return 0.0;\n\n      return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n    }`;\n  return {\n    ...softmaxProgramMetadata,\n    output: { dims: input.dims, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Softmax requires 1 input.');\n  }\n\n  if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n    throw new Error('Invalid input type');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { AttributeWithCacheKey, createAttributeWithCacheKey } from '../../../attribute-with-cache-key';\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil, SplitUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, TextureType } from '../types';\n\nexport interface SplitAttributes extends AttributeWithCacheKey {\n  readonly axis: number;\n  readonly split: number[];\n  readonly numOutputs: number;\n}\n\nconst splitProgramMetadata = {\n  name: 'Split',\n  inputNames: ['A'],\n  inputTypes: [TextureType.unpacked],\n};\n\nexport const split: OperatorImplementation<SplitAttributes> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  attributes: SplitAttributes,\n): Tensor[] => {\n  validateInputs(inputs);\n\n  const axis = ShapeUtil.normalizeAxis(attributes.axis, inputs[0].dims.length);\n  const count = getProgramCount(inferenceHandler, inputs, axis, attributes);\n  const output: Tensor[] = [];\n  for (let i = 0; i < count; ++i) {\n    output.push(\n      inferenceHandler.run(\n        {\n          ...splitProgramMetadata,\n          cacheHint: `${attributes.cacheKey};${i}`,\n          get: () => createSplitProgramInfo(inferenceHandler, inputs[0], attributes, axis, i),\n        },\n        inputs,\n      ),\n    );\n  }\n\n  return output;\n};\n\nexport const parseSplitAttributes: OperatorInitialization<SplitAttributes> = (node: Graph.Node): SplitAttributes => {\n  const axis = node.attributes.getInt('axis', 0);\n  const split = node.attributes.getInts('split', []);\n  const numOutputs = node.outputs.length;\n  return createAttributeWithCacheKey({ axis, split, numOutputs });\n};\n\nconst getProgramCount = (\n  _inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  axis: number,\n  attributes: SplitAttributes,\n): number => {\n  const [, offsets] = SplitUtil.splitShape(inputs[0].dims, axis, attributes.split, attributes.numOutputs);\n  return offsets.length;\n};\n\nconst createSplitProgramInfo = (\n  _inferenceHandler: WebGLInferenceHandler,\n  input: Tensor,\n  attributes: SplitAttributes,\n  axis: number,\n  index: number,\n): ProgramInfo => {\n  const [shapes, offsets] = SplitUtil.splitShape(input.dims, axis, attributes.split, attributes.numOutputs);\n  const offset = offsets[index];\n  const outputShape = shapes[index];\n  const rank = outputShape.length;\n  const shaderSource = `\n      float process(int indices[${rank}]) {\n        indices[${axis}] += ${offset};\n        return _A(indices);\n      }\n    `;\n  return {\n    ...splitProgramMetadata,\n    cacheHint: `${attributes.cacheKey}:${index}`,\n    output: { dims: outputShape, type: input.type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Split requires one input.');\n  }\n\n  if (\n    inputs[0].type !== 'int8' &&\n    inputs[0].type !== 'uint8' &&\n    inputs[0].type !== 'int16' &&\n    inputs[0].type !== 'uint16' &&\n    inputs[0].type !== 'int32' &&\n    inputs[0].type !== 'uint32' &&\n    inputs[0].type !== 'float32' &&\n    inputs[0].type !== 'float64' &&\n    inputs[0].type !== 'bool'\n  ) {\n    throw new Error('Invalid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nexport const squeeze: OperatorImplementation<number[]> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  axes: number[],\n): Tensor[] => {\n  validateInputs(inputs);\n  const outputShape = ShapeUtil.squeezeShape(inputs[0].dims, axes);\n  const output = inferenceHandler.reshapeUnpacked(inputs[0], outputShape);\n  return [output];\n};\n\nexport const squeezeV13 = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputsV13(inputs);\n  return squeeze(inferenceHandler, [inputs[0]], Array.from(inputs[1].integerData));\n};\n\nexport const parseSqueezeAttributes: OperatorInitialization<number[]> = (node: Graph.Node): number[] =>\n  node.attributes.getInts('axes');\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Squeeze requires 1 input.');\n  }\n\n  if (inputs[0].type === 'string') {\n    throw new Error('invalid input tensor types.');\n  }\n};\n\nconst validateInputsV13 = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 2) {\n    throw new Error('Squeeze requires 2 inputs.');\n  }\n\n  if (inputs[1].type !== 'int32') {\n    throw new Error('Invalid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from '../../../tensor';\nimport { getGlsl } from '../glsl-source';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramMetadata, TextureType } from '../types';\n\nexport const sum = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputs(inputs);\n\n  const sumProgramMetadata = {\n    name: 'Sum',\n    inputNames: inputs.map((_v, i) => `X${i}`),\n    inputTypes: new Array(inputs.length).fill(TextureType.unpacked),\n  };\n\n  const output = inferenceHandler.run(\n    { ...sumProgramMetadata, get: () => createSumProgramInfo(inferenceHandler, inputs, sumProgramMetadata) },\n    inputs,\n  );\n  return [output];\n};\n\nconst createSumProgramInfo = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  sumProgramMetadata: ProgramMetadata,\n): ProgramInfo => {\n  const glsl = getGlsl(inferenceHandler.session.backend.glContext.version);\n  const outputShape = inputs[0].dims.slice();\n  const sumLine = inputs.map((_v, i) => `${glsl.texture2D}(X${i},TexCoords)`).join(' + ');\n  const shaderSource = `\n      void main() {\n        vec4 result = ${sumLine};\n        ${glsl.output} = result;\n      }\n    `;\n  return {\n    ...sumProgramMetadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    hasMain: true,\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length === 0) {\n    throw new Error('Sum requires inputs.');\n  }\n\n  const length = inputs[0].dims.length;\n  for (let i = 1; i < inputs.length; i++) {\n    if (length !== inputs[i].dims.length) {\n      throw new Error('Input shapes are mismatched.');\n    }\n\n    for (let j = 0; j < length; j++) {\n      if (inputs[0].dims[j] !== inputs[i].dims[j]) {\n        throw new Error('Input shapes are not matched.');\n      }\n    }\n  }\n\n  if (inputs[0].type !== 'float32' && inputs[0].type !== 'float64') {\n    throw new Error('Invalid input type.');\n  }\n  for (let i = 1; i < inputs.length; i++) {\n    if (inputs[0].type !== inputs[i].type) {\n      throw new Error('Input types are not matched.');\n    }\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { NUMBER_TYPES } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { WebGLInferenceHandler } from '../inference-handler';\nimport { ProgramInfo, ProgramMetadata, TextureType } from '../types';\n\nexport const tile = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputs(inputs);\n\n  const tileProgramMetadata = {\n    name: 'Tile',\n    inputNames: ['A'],\n    inputTypes: [TextureType.unpacked],\n  };\n\n  const output = inferenceHandler.run(\n    { ...tileProgramMetadata, get: () => createTileProgramInfo(inferenceHandler, inputs, tileProgramMetadata) },\n    inputs,\n  );\n  return [output];\n};\n\nconst createTileProgramInfo = (\n  _handler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  tileProgramMetadata: ProgramMetadata,\n): ProgramInfo => {\n  const inputShape = inputs[0].dims.slice();\n  const outputShape = new Array(inputShape.length);\n\n  const tileOps: string[] = [];\n  for (let i = 0; i < inputShape.length; i++) {\n    outputShape[i] = inputShape[i] * inputs[1].numberData[i];\n    tileOps.push(`inputIdx[${i}] = int(mod(float(outputIdx[${i}]), ${inputShape[i]}.));`);\n  }\n\n  const rank = outputShape.length;\n  const shaderSource = `\n      float process(int outputIdx[${rank}]) {\n        int inputIdx[${rank}];\n        ${tileOps.join('\\n')}\n        return _A(inputIdx);\n      }\n    `;\n  return {\n    ...tileProgramMetadata,\n    output: { dims: outputShape, type: inputs[0].type, textureType: TextureType.unpacked },\n    shaderSource,\n  };\n};\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 2) {\n    throw new Error('Tile requires 2 input.');\n  }\n  if (inputs[1].dims.length !== 1) {\n    throw new Error('The second input shape must 1 dimension.');\n  }\n  if (inputs[1].dims[0] !== inputs[0].dims.length) {\n    throw new Error('Invalid input shape.');\n  }\n  if (NUMBER_TYPES.indexOf(inputs[0].type) === -1) {\n    throw new Error('Invalid input type.');\n  }\n  if (inputs[1].type !== 'int32' && inputs[1].type !== 'int16') {\n    throw new Error('Invalid repeat type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Graph } from '../../../graph';\nimport { OperatorImplementation, OperatorInitialization } from '../../../operators';\nimport { Tensor } from '../../../tensor';\nimport { ShapeUtil } from '../../../util';\nimport { WebGLInferenceHandler } from '../inference-handler';\n\nexport const unsqueeze: OperatorImplementation<number[]> = (\n  inferenceHandler: WebGLInferenceHandler,\n  inputs: Tensor[],\n  axes: number[],\n): Tensor[] => {\n  validateInputs(inputs);\n  const outputShape = ShapeUtil.unsqueezeShape(inputs[0].dims, axes);\n  const output = inferenceHandler.reshapeUnpacked(inputs[0], outputShape);\n  return [output];\n};\n\nexport const unsqueezeV13 = (inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] => {\n  validateInputsV13(inputs);\n  return unsqueeze(inferenceHandler, [inputs[0]], Array.from(inputs[1].integerData));\n};\n\nexport const parseUnsqueezeAttributes: OperatorInitialization<number[]> = (node: Graph.Node): number[] =>\n  node.attributes.getInts('axes');\n\nconst validateInputs = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 1) {\n    throw new Error('Unsqueeze requires 1 input.');\n  }\n\n  if (inputs[0].type === 'string') {\n    throw new Error('invalid input tensor types.');\n  }\n};\n\nconst validateInputsV13 = (inputs: Tensor[]): void => {\n  if (!inputs || inputs.length !== 2) {\n    throw new Error('Unsqueeze requires 2 inputs.');\n  }\n\n  if (inputs[1].type !== 'int32') {\n    throw new Error('Invalid input type.');\n  }\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { OpSet } from '../../opset';\n\nimport { batchNormalization, parseBatchNormalizationAttributes } from './ops/batch-normalization';\nimport * as binaryOps from './ops/binary-op';\nimport { cast, parseCastAttributes } from './ops/cast';\nimport { concat, parseConcatAttributes } from './ops/concat';\nimport { conv, parseConvAttributes } from './ops/conv';\nimport { convTranspose, parseConvTransposeAttributes } from './ops/conv-transpose';\nimport { depthToSpace, parseDepthToSpaceAttributes } from './ops/depth-to-space';\nimport { flatten, parseFlattenAttributes } from './ops/flatten';\nimport { gather, parseGatherAttributes } from './ops/gather';\nimport { gemm, parseGemmAttributesV11, parseGemmAttributesV7 } from './ops/gemm';\nimport { imageScaler, parseImageScalerAttributes } from './ops/image-scaler';\nimport { instanceNormalization, parseInstanceNormalizationAttributes } from './ops/instance-normalization';\nimport { lrn, parseLrnAttributes } from './ops/lrn';\nimport { matMul, parseMatMulAttributes } from './ops/matmul';\nimport { padV11, padV2, parsePadAttributesV11, parsePadAttributesV2 } from './ops/pad';\nimport {\n  averagePool,\n  globalAveragePool,\n  globalMaxPool,\n  maxPool,\n  parseAveragePoolAttributes,\n  parseGlobalAveragePoolAttributes,\n  parseMaxPoolAttributes,\n} from './ops/pool';\nimport {\n  parseReduceAttributes,\n  reduceLogSum,\n  reduceLogSumSquare,\n  reduceMax,\n  reduceMean,\n  reduceMin,\n  reduceProd,\n  reduceSum,\n} from './ops/reduce';\nimport { reshape } from './ops/reshape';\nimport { parseResizeAttributesV10, parseResizeAttributesV11, resize } from './ops/resize-packed';\nimport { shape } from './ops/shape';\nimport { parseSliceAttributes, slice, sliceV10 } from './ops/slice';\nimport { parseSoftmaxAttributes, parseSoftmaxAttributesV13, softmax, softmaxV13 } from './ops/softmax';\nimport { parseSplitAttributes, split } from './ops/split';\nimport { parseSqueezeAttributes, squeeze, squeezeV13 } from './ops/squeeze';\nimport { sum } from './ops/sum';\nimport { tile } from './ops/tile';\nimport { parseTransposeAttributes, transpose } from './ops/transpose';\nimport * as unaryOps from './ops/unary-op';\nimport { parseUnsqueezeAttributes, unsqueeze, unsqueezeV13 } from './ops/unsqueeze';\nimport { parseUpsampleAttributesV7, parseUpsampleAttributesV9, upsample } from './ops/upsample';\n\nexport const WEBGL_OP_RESOLVE_RULES: readonly OpSet.ResolveRule[] = [\n  ['Abs', '', '6+', unaryOps.abs],\n  ['Acos', '', '7+', unaryOps.acos],\n  ['Add', '', '7+', binaryOps.add],\n  ['And', '', '7+', binaryOps.and],\n  ['Asin', '', '7+', unaryOps.asin],\n  ['Atan', '', '7+', unaryOps.atan],\n  // TODO: support new attributes for AveragePool-10\n  ['AveragePool', '', '7+', averagePool, parseAveragePoolAttributes],\n  ['BatchNormalization', '', '7+', batchNormalization, parseBatchNormalizationAttributes],\n  ['Cast', '', '6+', cast, parseCastAttributes],\n  ['Ceil', '', '6+', unaryOps.ceil],\n  ['Clip', '', '6-10', unaryOps.clip, unaryOps.parseClipAttributes],\n  ['Clip', '', '11+', unaryOps.clipV11],\n  ['Concat', '', '4+', concat, parseConcatAttributes],\n  ['Conv', '', '1+', conv, parseConvAttributes],\n  ['ConvTranspose', '', '1+', convTranspose, parseConvTransposeAttributes],\n  ['Cos', '', '7+', unaryOps.cos],\n  ['Div', '', '7+', binaryOps.div],\n  ['Dropout', '', '7+', unaryOps.identity],\n  ['DepthToSpace', '', '1+', depthToSpace, parseDepthToSpaceAttributes],\n  ['Equal', '', '7+', binaryOps.equal],\n  ['Elu', '', '6+', unaryOps.elu, unaryOps.parseEluAttributes],\n  ['Exp', '', '6+', unaryOps.exp],\n  ['Flatten', '', '1+', flatten, parseFlattenAttributes],\n  ['Floor', '', '6+', unaryOps.floor],\n  ['FusedConv', 'com.microsoft', '1+', conv, parseConvAttributes],\n  ['Gather', '', '1+', gather, parseGatherAttributes],\n  ['Gemm', '', '7-10', gemm, parseGemmAttributesV7],\n  ['Gemm', '', '11+', gemm, parseGemmAttributesV11],\n  ['GlobalAveragePool', '', '1+', globalAveragePool, parseGlobalAveragePoolAttributes],\n  ['GlobalMaxPool', '', '1+', globalMaxPool],\n  ['Greater', '', '7+', binaryOps.greater],\n  ['Identity', '', '1+', unaryOps.identity],\n  ['ImageScaler', '', '1+', imageScaler, parseImageScalerAttributes],\n  ['InstanceNormalization', '', '6+', instanceNormalization, parseInstanceNormalizationAttributes],\n  ['LeakyRelu', '', '6+', unaryOps.leakyRelu, unaryOps.parseLeakyReluAttributes],\n  ['Less', '', '7+', binaryOps.less],\n  ['LRN', '', '1+', lrn, parseLrnAttributes],\n  ['Log', '', '6+', unaryOps.log],\n  ['MatMul', '', '1+', matMul, parseMatMulAttributes],\n  // TODO: support new attributes for MaxPool-8 and MaxPool-10\n  ['MaxPool', '', '1+', maxPool, parseMaxPoolAttributes],\n  ['Mul', '', '7+', binaryOps.mul],\n  ['Neg', '', '6+', unaryOps.neg],\n  ['Not', '', '1+', unaryOps.not],\n  ['Or', '', '7+', binaryOps.or],\n  ['Pad', '', '2-10', padV2, parsePadAttributesV2],\n  ['Pad', '', '11+', padV11, parsePadAttributesV11],\n  ['Pow', '', '7+', binaryOps.pow],\n  ['PRelu', '', '7+', binaryOps.pRelu],\n  ['ReduceLogSum', '', '1+', reduceLogSum, parseReduceAttributes],\n  ['ReduceMax', '', '1+', reduceMax, parseReduceAttributes],\n  ['ReduceMean', '', '1+', reduceMean, parseReduceAttributes],\n  ['ReduceMin', '', '1+', reduceMin, parseReduceAttributes],\n  ['ReduceProd', '', '1+', reduceProd, parseReduceAttributes],\n  ['ReduceSum', '', '1-12', reduceSum, parseReduceAttributes],\n  ['ReduceSumSquare', '', '1+', reduceLogSumSquare, parseReduceAttributes],\n  ['Relu', '', '6+', unaryOps.relu],\n  ['Reshape', '', '5+', reshape],\n  ['Resize', '', '10', resize, parseResizeAttributesV10],\n  ['Resize', '', '11+', resize, parseResizeAttributesV11],\n  ['Shape', '', '1+', shape],\n  ['Sigmoid', '', '6+', unaryOps.sigmoid],\n  ['Sin', '', '7+', unaryOps.sin],\n  ['Slice', '', '10+', sliceV10], // TODO: support 'steps' for Slice-10\n  ['Slice', '', '1-9', slice, parseSliceAttributes],\n  // The \"semantic\" meaning of axis has changed in opset-13.\n  ['Softmax', '', '1-12', softmax, parseSoftmaxAttributes],\n  ['Softmax', '', '13+', softmaxV13, parseSoftmaxAttributesV13],\n  // 'Split' operator has an optional attribute 'split'\n  // this attribute determines how the specified axis of input data is split.\n  // When the attribute is missing, we need the count of number of outputs\n  // so that we can determine the 'split' attribute from the runtime input to the Operator\n  ['Split', '', '2-12', split, parseSplitAttributes],\n  ['Sqrt', '', '6+', unaryOps.sqrt],\n  ['Squeeze', '', '1-12', squeeze, parseSqueezeAttributes],\n  ['Squeeze', '', '13+', squeezeV13],\n  ['Sub', '', '7+', binaryOps.sub],\n  ['Sum', '', '6+', sum],\n  ['Tan', '', '7+', unaryOps.tan],\n  ['Tanh', '', '6+', unaryOps.tanh],\n  ['Tile', '', '6+', tile],\n  ['Transpose', '', '1+', transpose, parseTransposeAttributes],\n  ['Upsample', '', '7-8', upsample, parseUpsampleAttributesV7],\n  ['Upsample', '', '9', upsample, parseUpsampleAttributesV9],\n  ['Unsqueeze', '', '1-12', unsqueeze, parseUnsqueezeAttributes],\n  ['Unsqueeze', '', '13+', unsqueezeV13],\n  ['Xor', '', '7+', binaryOps.xor],\n];\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nconst INLINE_FUNC_DEF_REGEX = /@inline[\\s\\n\\r]+(\\w+)[\\s\\n\\r]+([0-9a-zA-Z_]+)\\s*\\(([^)]*)\\)\\s*{(([^}]|[\\n\\r])*)}/gm;\nconst FUNC_CALL_REGEX = '(\\\\w+)?\\\\s+([_0-9a-zA-Z]+)\\\\s+=\\\\s+__FUNC__\\\\((.*)\\\\)\\\\s*;';\n/**\n * GLSL preprocessor responsible for resolving @inline directives\n */\nexport function replaceInlines(script: string): string {\n  const inlineDefs: { [name: string]: { params: Array<{ type: string; name: string } | null>; body: string } } = {};\n  let match;\n  while ((match = INLINE_FUNC_DEF_REGEX.exec(script)) !== null) {\n    const params = match[3]\n      .split(',')\n      .map((s) => {\n        const tokens = s.trim().split(' ');\n        if (tokens && tokens.length === 2) {\n          return { type: tokens[0], name: tokens[1] };\n        }\n        return null;\n      })\n      .filter((v) => v !== null);\n    inlineDefs[match[2]] = { params, body: match[4] };\n  }\n  for (const name in inlineDefs) {\n    const regexString = FUNC_CALL_REGEX.replace('__FUNC__', name);\n    const regex = new RegExp(regexString, 'gm');\n    while ((match = regex.exec(script)) !== null) {\n      const type = match[1];\n      const variable = match[2];\n      const params = match[3].split(',');\n      const declLine = type ? `${type} ${variable};` : '';\n      let newBody: string = inlineDefs[name].body;\n      let paramRedecLine = '';\n      inlineDefs[name].params.forEach((v, i) => {\n        if (v) {\n          paramRedecLine += `${v.type} ${v.name} = ${params[i]};\\n`;\n        }\n      });\n      newBody = `${paramRedecLine}\\n ${newBody}`;\n      newBody = newBody.replace('return', `${variable} = `);\n      const replacement = `\n      ${declLine}\n      {\n        ${newBody}\n      }\n      `;\n      script = script.replace(match[0], replacement);\n    }\n  }\n  script = script.replace(INLINE_FUNC_DEF_REGEX, '');\n  return script;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Logger } from '../../instrument';\nimport { assert } from '../../util';\n\n/** Layout preferences */\nexport interface WidthHeightPrefs {\n  breakAxis?: number;\n  isPacked?: boolean;\n  reverseWH?: boolean;\n}\n/**\n * TextureLayoutStrategy is an abstraction for different plans\n * for mapping n-dimensional arrays to 2D textures (and back)\n */\nexport interface TextureLayoutStrategy {\n  computeTextureWH(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number];\n}\n\n/**\n * This strategy try to find the minimal max(W,H) that fulfills (W * H == totalSize)\n */\nexport class AlwaysKeepOriginalSizeStrategy implements TextureLayoutStrategy {\n  constructor(public maxTextureSize: number) {}\n  computeTextureWH(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number] {\n    // scalar tensor\n    if (shape.length === 0) {\n      return [1, 1];\n    }\n    const maxTextureSize = this.maxTextureSize;\n    if (prefs && prefs.breakAxis !== undefined) {\n      // check to see if dims fit\n      const wsize = prefs.breakAxis >= shape.length ? 1 : shape.slice(prefs.breakAxis).reduce((a, b) => a * b);\n      const hsize = prefs.breakAxis <= 0 ? 1 : shape.slice(0, prefs.breakAxis).reduce((a, b) => a * b);\n      if (wsize > maxTextureSize || hsize > maxTextureSize) {\n        // ignore preferences\n        // continue with default layout\n        Logger.verbose(\n          'TextureLayout',\n          `Given width/height preferences were unattainable: shape:${shape}, breakAxis:${prefs.breakAxis}`,\n        );\n      } else {\n        return [wsize, hsize];\n      }\n    }\n    const totalSize = shape.reduce((a, b) => a * b);\n\n    let width = Math.floor(Math.sqrt(totalSize));\n\n    for (; width < maxTextureSize && width < totalSize; width++) {\n      if (totalSize % width === 0) {\n        break;\n      }\n    }\n\n    if (width >= maxTextureSize || totalSize % width !== 0) {\n      throw new Error(`The given dimensions are outside this GPU's boundaries: ${shape}`);\n    }\n    return [width, totalSize / width];\n  }\n}\n\nexport class PreferLogicalStrategy implements TextureLayoutStrategy {\n  constructor(public maxTextureSize: number) {}\n  computeTextureWH(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number] {\n    const wh = this.computeTexture(shape, prefs);\n    if (prefs && prefs.isPacked) {\n      wh[0] /= 2;\n      wh[1] /= 2;\n    }\n    if (prefs && prefs.reverseWH) {\n      return [wh[1], wh[0]];\n    }\n    return wh;\n  }\n\n  computeTexture(shape: readonly number[], prefs?: WidthHeightPrefs): [number, number] {\n    const isPacked = prefs && prefs.isPacked;\n    // scalar tensor\n    if (shape.length === 0) {\n      return isPacked ? [2, 2] : [1, 1];\n    }\n    let maxTextureSize = this.maxTextureSize;\n    if (prefs && prefs.breakAxis !== undefined) {\n      // check to see if dims fit\n      const wsize = prefs.breakAxis >= shape.length ? 1 : shape.slice(prefs.breakAxis).reduce((a, b) => a * b);\n      const hsize = prefs.breakAxis <= 0 ? 1 : shape.slice(0, prefs.breakAxis).reduce((a, b) => a * b);\n      if (wsize > maxTextureSize || hsize > maxTextureSize) {\n        // ignore preferences\n        // continue with default layout\n        Logger.verbose(\n          'TextureLayout',\n          `Given width/height preferences were unattainable: shape:${shape}, breakAxis:${prefs.breakAxis}`,\n        );\n      } else {\n        return [wsize, hsize];\n      }\n    }\n    let logShape = shape.slice(0);\n    if (isPacked) {\n      maxTextureSize = maxTextureSize * 2;\n\n      // This logic ensures we accurately count the number of packed texels needed\n      // to accommodate the tensor. We can only pack values in the same texel if\n      // they are from adjacent pairs of rows/cols within the same batch. So if a\n      // tensor has 3 rows, we pretend it has 4 rows in order to account for the\n      // fact that the texels containing the third row are half empty.\n      logShape = logShape.map((_d, i) =>\n        i >= logShape.length - 2 ? (logShape[i] % 2 === 0 ? logShape[i] : logShape[i] + 1) : logShape[i],\n      );\n\n      // Packed texture height is at least 2 (the channel height of a single\n      // texel).\n      if (logShape.length === 1) {\n        logShape = [2, logShape[0]];\n      }\n    }\n\n    // If logical shape is 2, we don't squeeze, since we want to match physical.\n    if (logShape.length !== 2) {\n      const squeezeResult = squeezeShape(logShape);\n      logShape = squeezeResult.newShape;\n    }\n\n    const size = sizeFromShape(logShape);\n    if (logShape.length <= 1 && size <= maxTextureSize) {\n      return [1, size];\n    } else if (logShape.length === 2 && logShape[0] <= maxTextureSize && logShape[1] <= maxTextureSize) {\n      return logShape as [number, number];\n    } else if (logShape.length === 3 && logShape[0] * logShape[1] <= maxTextureSize && logShape[2] <= maxTextureSize) {\n      return [logShape[0] * logShape[1], logShape[2]];\n    } else if (logShape.length === 3 && logShape[0] <= maxTextureSize && logShape[1] * logShape[2] <= maxTextureSize) {\n      return [logShape[0], logShape[1] * logShape[2]];\n    } else if (\n      logShape.length === 4 &&\n      logShape[0] * logShape[1] * logShape[2] <= maxTextureSize &&\n      logShape[3] <= maxTextureSize\n    ) {\n      return [logShape[0] * logShape[1] * logShape[2], logShape[3]];\n    } else if (\n      logShape.length === 4 &&\n      logShape[0] <= maxTextureSize &&\n      logShape[1] * logShape[2] * logShape[3] <= maxTextureSize\n    ) {\n      return [logShape[0], logShape[1] * logShape[2] * logShape[3]];\n    } else {\n      if (isPacked) {\n        // For packed textures size equals the number of channels required to\n        // accommodate the texture data. However in order to squarify such that\n        // inner dimensions stay even, we rewrite size to equal the number of\n        // texels. Then in the return statement we rehydrate the squarified\n        // dimensions to channel units.\n        return sizeToSquarishShape(size / 4).map((d) => d * 2) as [number, number];\n      }\n      return sizeToSquarishShape(size);\n    }\n  }\n}\n\nexport function squeezeShape(shape: number[], axis?: number[]): { newShape: number[]; keptDims: number[] } {\n  const newShape: number[] = [];\n  const keptDims: number[] = [];\n  const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;\n  const axes = axis == null || isEmptyArray ? null : parseAxisParam(axis, shape).sort();\n  let j = 0;\n  for (let i = 0; i < shape.length; ++i) {\n    if (axes != null) {\n      if (axes[j] === i && shape[i] !== 1) {\n        throw new Error(`Can't squeeze axis ${i} since its dim '${shape[i]}' is not 1`);\n      }\n      if ((axes[j] == null || axes[j] > i) && shape[i] === 1) {\n        newShape.push(shape[i]);\n        keptDims.push(i);\n      }\n      if (axes[j] <= i) {\n        j++;\n      }\n    }\n    if (shape[i] !== 1) {\n      newShape.push(shape[i]);\n      keptDims.push(i);\n    }\n  }\n  return { newShape, keptDims };\n}\n\nexport function parseAxisParam(axis: number | number[], shape: number[]): number[] {\n  const rank = shape.length;\n\n  // Normalize input\n  axis = axis == null ? shape.map((_s, i) => i) : ([] as number[]).concat(axis);\n\n  // Check for valid range\n  assert(\n    axis.every((ax) => ax >= -rank && ax < rank),\n    () => `All values in axis param must be in range [-${rank}, ${rank}) but ` + `got axis ${axis}`,\n  );\n\n  // Check for only integers\n  assert(axis.every(isInt), () => 'All values in axis param must be integers but ' + `got axis ${axis}`);\n\n  // Handle negative axis.\n  return axis.map((a) => (a < 0 ? rank + a : a));\n}\nexport function isInt(a: number): boolean {\n  return a % 1 === 0;\n}\nexport function sizeFromShape(shape: number[]): number {\n  if (shape.length === 0) {\n    // Scalar.\n    return 1;\n  }\n  let size = shape[0];\n  for (let i = 1; i < shape.length; i++) {\n    size *= shape[i];\n  }\n  return size;\n}\nexport function getRowsCols(shape: number[]): [number, number] {\n  if (shape.length === 0) {\n    throw Error('Cannot get rows and columns of an empty shape array.');\n  }\n\n  return [shape.length > 1 ? shape[shape.length - 2] : 1, shape[shape.length - 1]];\n}\nexport function sizeToSquarishShape(size: number): [number, number] {\n  const width = Math.ceil(Math.sqrt(size));\n  return [width, Math.ceil(size / width)];\n}\nexport function getBatchDim(shape: number[], dimsToSkip = 2): number {\n  return sizeFromShape(shape.slice(0, shape.length - dimsToSkip));\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { ArrayUtil, BroadcastUtil, ShapeUtil } from '../../util';\n\nimport { GlslContext, GlslLib, GlslLibRoutine } from './glsl-definitions';\nimport { getGlsl } from './glsl-source';\nimport { squeezeShape } from './texture-layout-strategy';\nimport { TextureLayout } from './types';\nimport {\n  generateShaderFuncNameFromInputSamplerName,\n  generateShaderFuncNameFromInputSamplerNameAtOutCoords,\n  getCoordsDataType,\n  getGlChannels,\n  getSqueezedParams,\n  squeezeInputShape,\n} from './utils';\n\n/**\n * GLSL Library responsible for data types and routines for manipulating\n * coordinates and mapping to/from tensor indices\n */\nexport class CoordsGlslLib extends GlslLib {\n  returnType: string;\n\n  constructor(context: GlslContext) {\n    super(context);\n  }\n  getFunctions(): { [name: string]: GlslLibRoutine } {\n    return {\n      ...this.offsetToCoords(),\n      ...this.coordsToOffset(),\n      ...this.toVec(),\n      ...this.valueFrom(),\n      // TODO return these only when packing is enabled.\n      ...this.getCommonUtilFuncs(),\n      ...this.getInputsSamplingSnippets(),\n      ...this.getOutputSamplingSnippet(),\n    };\n  }\n  getCustomTypes() {\n    return {};\n  }\n  /**\n   * Produces a function that can map from\n   * 2D normalzied coordinates (s,t) to a flat offset\n   */\n  protected offsetToCoords(): { [name: string]: GlslLibRoutine } {\n    const funcName = 'offsetToCoords';\n    return {\n      offsetToCoords: new GlslLibRoutine(`\n      vec2 ${funcName}(int offset, int width, int height) {\n        int t = offset / width;\n        int s = offset - t*width;\n        vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n        return coords;\n      }\n      `),\n    };\n  }\n\n  /**\n   * Produces a function that can map from\n   * 2D normalzied coordinates (s,t) to a flat offset\n   */\n  protected coordsToOffset(): { [name: string]: GlslLibRoutine } {\n    const funcName = 'coordsToOffset';\n    return {\n      coordsToOffset: new GlslLibRoutine(`\n      int ${funcName}(vec2 coords, int width, int height) {\n        float s = coords.s * float(width);\n        float t = coords.t * float(height);\n        int offset = int(t) * width + int(s);\n        return offset;\n      }\n      `),\n    };\n  }\n\n  /**\n   * Generates code for output sampler.\n   */\n\n  protected getOutputSamplingSnippet(): { [name: string]: GlslLibRoutine } {\n    const outputLayout = this.context.outputTextureLayout;\n    if (outputLayout.isPacked) {\n      return this.getPackedOutputSamplingSnippet(outputLayout);\n    } else {\n      return this.getUnpackedOutputSamplingSnippet(outputLayout);\n    }\n  }\n\n  /**\n   * Generates code for packed output sampler.\n   */\n  protected getPackedOutputSamplingSnippet(outputLayout: TextureLayout): { [name: string]: GlslLibRoutine } {\n    const outShape = outputLayout.unpackedShape;\n    const outTexShape = [outputLayout.width, outputLayout.height];\n    const result: { [name: string]: GlslLibRoutine } = {};\n    const funcName = 'getOutputCoords';\n    switch (outShape.length) {\n      case 0:\n        result[funcName] = this.getOutputScalarCoords();\n        break;\n      case 1:\n        result[funcName] = this.getOutputPacked1DCoords(outShape as [number], outTexShape as [number, number]);\n        break;\n      case 2:\n        result[funcName] = this.getOutputPacked2DCoords(outShape as [number, number], outTexShape as [number, number]);\n        break;\n      case 3:\n        result[funcName] = this.getOutputPacked3DCoords(\n          outShape as [number, number, number],\n          outTexShape as [number, number],\n        );\n        break;\n      default:\n        result[funcName] = this.getOutputPackedNDCoords(outShape, outTexShape as [number, number]);\n    }\n    const glsl = getGlsl(this.context.glContext.version);\n    // TODO we need this to properly return a packed vec4 from kernels.\n    // Replace all '{glsl.output} = result' with 'setOutput(result)' in all kernels.\n    const floatTextureSetRGBASource = `\n      void setOutput(vec4 val) {\n        ${glsl.output} = val;\n      }\n    `;\n    const floatTextureSetRGBAFuncName = 'floatTextureSetRGBA';\n    result[floatTextureSetRGBAFuncName] = new GlslLibRoutine(floatTextureSetRGBASource);\n    return result;\n  }\n\n  /**\n   * Generates code for unpacked output sampler.\n   */\n  protected getUnpackedOutputSamplingSnippet(outputLayout: TextureLayout): { [name: string]: GlslLibRoutine } {\n    const outShape = outputLayout.unpackedShape;\n    const outTexShape = [outputLayout.width, outputLayout.height];\n    const result: { [name: string]: GlslLibRoutine } = {};\n    const funcName = 'getOutputCoords';\n    switch (outShape.length) {\n      case 0:\n        result[funcName] = this.getOutputScalarCoords();\n        break;\n      case 1:\n        result[funcName] = this.getOutputUnpacked1DCoords(outShape as [number], outTexShape as [number, number]);\n        break;\n      case 2:\n        result[funcName] = this.getOutputUnpacked2DCoords(\n          outShape as [number, number],\n          outTexShape as [number, number],\n        );\n        break;\n      case 3:\n        result[funcName] = this.getOutputUnpacked3DCoords(\n          outShape as [number, number, number],\n          outTexShape as [number, number],\n        );\n        break;\n      case 4:\n        result[funcName] = this.getOutputUnpacked4DCoords(\n          outShape as [number, number, number, number],\n          outTexShape as [number, number],\n        );\n        break;\n      case 5:\n        result[funcName] = this.getOutputUnpacked5DCoords(\n          outShape as [number, number, number, number, number],\n          outTexShape as [number, number],\n        );\n        break;\n      case 6:\n        result[funcName] = this.getOutputUnpacked6DCoords(\n          outShape as [number, number, number, number, number, number],\n          outTexShape as [number, number],\n        );\n        break;\n      default:\n        throw new Error(`Unsupported output dimensionality: ${outShape.length}`);\n    }\n    const glsl = getGlsl(this.context.glContext.version);\n    // TODO we need this to properly return a packed vec4 from kernels.\n    // Replace all '{glsl.output} = result' with 'setOutput(result)' in all kernels.\n    const floatTextureSetRSource = `\n        void setOutput(float val) {\n          ${glsl.output} = vec4(val, 0, 0, 0);\n        }\n    `;\n    const floatTextureSetRFuncName = 'floatTextureSetR';\n    result[floatTextureSetRFuncName] = new GlslLibRoutine(floatTextureSetRSource);\n    return result;\n  }\n\n  /**\n   * Scalar output coordinates.\n   */\n  protected getOutputScalarCoords(): GlslLibRoutine {\n    return new GlslLibRoutine(`\n      int getOutputCoords() {\n        return 0;\n      }\n    `);\n  }\n\n  /**\n   * 1D packed output coordinates.\n   */\n  protected getOutputPacked1DCoords(_shape: [number], texShape: [number, number]): GlslLibRoutine {\n    const packedTexShape = texShape;\n    let source = '';\n    if (packedTexShape[0] === 1) {\n      source = `\n          int getOutputCoords() {\n            return 2 * int(TexCoords.y * ${packedTexShape[1]}.0);\n          }\n        `;\n      return new GlslLibRoutine(source);\n    }\n\n    if (packedTexShape[1] === 1) {\n      source = `\n          int getOutputCoords() {\n            return 2 * int(TexCoords.x * ${packedTexShape[0]}.0);\n          }\n        `;\n      return new GlslLibRoutine(source);\n    }\n\n    source = `\n        int getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                 vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n          return 2 * (resTexRC.y * ${packedTexShape[0]} + resTexRC.x);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * 2D packed output coordinates.\n   */\n  protected getOutputPacked2DCoords(shape: [number, number], texShape: [number, number]): GlslLibRoutine {\n    let source = '';\n    if (ArrayUtil.arraysEqual(shape, texShape)) {\n      source = `\n        ivec2 getOutputCoords() {\n          return 2 * ivec2(TexCoords.xy * vec2(${texShape[0]}, ${texShape[1]}));\n        }\n      `;\n      return new GlslLibRoutine(source);\n    }\n\n    const packedTexShape = texShape;\n    // texels needed to accommodate a logical row\n    const texelsInLogicalRow = Math.ceil(shape[1] / 2);\n\n    /**\n     * getOutputCoords\n     *\n     * resTexRC: The rows and columns of the texels. If you move over one\n     * texel to the right in the packed texture, you are moving over one column\n     * (not two).\n     *\n     * index: The texel index\n     */\n    source = `\n        ivec2 getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n\n          int index = resTexRC.y * ${packedTexShape[0]} + resTexRC.x;\n\n          // reverse r and c order for packed texture\n          int r = imod(index, ${texelsInLogicalRow}) * 2;\n          int c = 2 * (index / ${texelsInLogicalRow});\n\n          return ivec2(r, c);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * 3D packed output coordinates.\n   */\n  protected getOutputPacked3DCoords(shape: [number, number, number], texShape: [number, number]): GlslLibRoutine {\n    const packedTexShape = [texShape[0], texShape[1]];\n    const texelsInLogicalRow = Math.ceil(shape[2] / 2);\n    const texelsInBatch = texelsInLogicalRow * Math.ceil(shape[1] / 2);\n    const source = `\n        ivec3 getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n          int index = resTexRC.y * ${packedTexShape[0]} + resTexRC.x;\n\n          int b = index / ${texelsInBatch};\n          index -= b * ${texelsInBatch};\n\n          // reverse r and c order for packed texture\n          int r = imod(index, ${texelsInLogicalRow}) * 2;\n          int c = 2 * (index / ${texelsInLogicalRow});\n\n          return ivec3(b, r, c);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * ND packed output coordinates.\n   */\n  protected getOutputPackedNDCoords(shape: readonly number[], texShape: [number, number]): GlslLibRoutine {\n    const packedTexShape = [texShape[0], texShape[1]];\n\n    const texelsInLogicalRow = Math.ceil(shape[shape.length - 1] / 2);\n    const texelsInBatch = texelsInLogicalRow * Math.ceil(shape[shape.length - 2] / 2);\n    let texelsInBatchN = texelsInBatch;\n    let batches = '';\n    let coords = 'b, r, c';\n\n    for (let b = 2; b < shape.length - 1; b++) {\n      texelsInBatchN *= shape[shape.length - b - 1];\n      batches =\n        `\n      int b${b} = index / ${texelsInBatchN};\n      index -= b${b} * ${texelsInBatchN};\n    ` + batches;\n      coords = `b${b}, ` + coords;\n    }\n    const source = `\n      ivec${shape.length} getOutputCoords() {\n        ivec2 resTexRC = ivec2(TexCoords.xy *\n                              vec2(${packedTexShape[0]}, ${packedTexShape[1]}));\n        int index = resTexRC.y * ${packedTexShape[0]} + resTexRC.x;\n\n        ${batches}\n\n        int b = index / ${texelsInBatch};\n        index -= b * ${texelsInBatch};\n\n        // reverse r and c order for packed texture\n        int r = imod(index, ${texelsInLogicalRow}) * 2;\n        int c = 2 * (index / ${texelsInLogicalRow});\n\n        return ivec${shape.length}(${coords});\n      }\n    `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked 1D output coordinates.\n   */\n  protected getOutputUnpacked1DCoords(_shape: [number], texShape: [number, number]): GlslLibRoutine {\n    const source = `\n        int getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${texShape[0]}, ${texShape[1]}));\n          return resTexRC.y * ${texShape[0]} + resTexRC.x;\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked 2D output coordinates.\n   */\n  protected getOutputUnpacked2DCoords(shape: [number, number], texShape: [number, number]): GlslLibRoutine {\n    const source = `\n        ivec2 getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${texShape[0]}, ${texShape[1]}));\n          int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n          int r = index / ${shape[1]};\n          int c = index - r * ${shape[1]};\n          return ivec2(r, c);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked 3D output coordinates.\n   */\n  protected getOutputUnpacked3DCoords(shape: [number, number, number], texShape: [number, number]): GlslLibRoutine {\n    let source = '';\n    const rank = shape.length;\n\n    let strides = null;\n    if (rank < 2) {\n      strides = [];\n    }\n\n    strides = new Array(rank - 1);\n    strides[rank - 2] = shape[rank - 1];\n    for (let i = rank - 3; i >= 0; --i) {\n      strides[i] = strides[i + 1] * shape[i + 1];\n    }\n    const coordsToCompute = ['r', 'c', 'd'];\n    const coordsFromIndexSnippet = strides\n      .map((stride, i) => {\n        const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n        const line2 =\n          i === strides.length - 1\n            ? `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}`\n            : `index -= ${coordsToCompute[i]} * ${stride}`;\n        return `${line1}; ${line2};`;\n      })\n      .join('');\n\n    source = `\n        ivec3 getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${texShape[0]}, ${texShape[1]}));\n          int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n          ${coordsFromIndexSnippet}\n          return ivec3(r, c, d);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked 4D output coordinates.\n   */\n  protected getOutputUnpacked4DCoords(\n    shape: [number, number, number, number],\n    texShape: [number, number],\n  ): GlslLibRoutine {\n    let source = '';\n    const rank = shape.length;\n\n    let strides = null;\n    if (rank < 2) {\n      strides = [];\n    }\n\n    strides = new Array(rank - 1);\n    strides[rank - 2] = shape[rank - 1];\n    for (let i = rank - 3; i >= 0; --i) {\n      strides[i] = strides[i + 1] * shape[i + 1];\n    }\n    const coordsToCompute = ['r', 'c', 'd', 'd2'];\n    const coordsFromIndexSnippet = strides\n      .map((stride, i) => {\n        const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n        const line2 =\n          i === strides.length - 1\n            ? `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}`\n            : `index -= ${coordsToCompute[i]} * ${stride}`;\n        return `${line1}; ${line2};`;\n      })\n      .join('');\n\n    source = `\n      ivec4 getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${texShape[0]}, ${texShape[1]}));\n          int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n          ${coordsFromIndexSnippet}\n          return ivec4(r, c, d, d2);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked 5D output coordinates.\n   */\n  protected getOutputUnpacked5DCoords(\n    shape: [number, number, number, number, number],\n    texShape: [number, number],\n  ): GlslLibRoutine {\n    let source = '';\n    const rank = shape.length;\n\n    let strides = null;\n    if (rank < 2) {\n      strides = [];\n    }\n\n    strides = new Array(rank - 1);\n    strides[rank - 2] = shape[rank - 1];\n    for (let i = rank - 3; i >= 0; --i) {\n      strides[i] = strides[i + 1] * shape[i + 1];\n    }\n    const coordsToCompute = ['r', 'c', 'd', 'd2', 'd3'];\n    const coordsFromIndexSnippet = strides\n      .map((stride, i) => {\n        const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n        const line2 =\n          i === strides.length - 1\n            ? `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}`\n            : `index -= ${coordsToCompute[i]} * ${stride}`;\n        return `${line1}; ${line2};`;\n      })\n      .join('');\n\n    source = `\n      ivec5 getOutputCoords() {\n          ivec2 resTexRC = ivec2(TexCoords.xy *\n                                vec2(${texShape[0]}, ${texShape[1]}));\n          int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n          ${coordsFromIndexSnippet}\n          return ivec5(r, c, d, d2, d3);\n        }\n      `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked 6D output coordinates.\n   */\n  protected getOutputUnpacked6DCoords(\n    shape: [number, number, number, number, number, number],\n    texShape: [number, number],\n  ): GlslLibRoutine {\n    let source = '';\n    const rank = shape.length;\n\n    let strides = null;\n    if (rank < 2) {\n      strides = [];\n    }\n\n    strides = new Array(rank - 1);\n    strides[rank - 2] = shape[rank - 1];\n    for (let i = rank - 3; i >= 0; --i) {\n      strides[i] = strides[i + 1] * shape[i + 1];\n    }\n    const coordsToCompute = ['r', 'c', 'd', 'd2', 'd3', 'd4'];\n    const coordsFromIndexSnippet = strides\n      .map((stride, i) => {\n        const line1 = `int ${coordsToCompute[i]} = index / ${stride}`;\n        const line2 =\n          i === strides.length - 1\n            ? `int ${coordsToCompute[i + 1]} = index - ${coordsToCompute[i]} * ${stride}`\n            : `index -= ${coordsToCompute[i]} * ${stride}`;\n        return `${line1}; ${line2};`;\n      })\n      .join('');\n\n    source = `\n     ivec6 getOutputCoords() {\n         ivec2 resTexRC = ivec2(TexCoords.xy *\n                               vec2(${texShape[0]}, ${texShape[1]}));\n         int index = resTexRC.y * ${texShape[0]} + resTexRC.x;\n         ${coordsFromIndexSnippet}\n         return ivec6(r, c, d, d2, d3, d4);\n       }\n     `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Generates code for common UV coords computation utility functions.\n   */\n  protected getCommonUtilFuncs(): { [name: string]: GlslLibRoutine } {\n    const result: { [name: string]: GlslLibRoutine } = {};\n    let funcName = 'uvFromFlat';\n    result[funcName] = new GlslLibRoutine(`\n    vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n      int texC = index / texNumR;\n      int texR = index - texC * texNumR;\n      // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n      //       v.\n      return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n    }\n    `);\n    funcName = 'packedUVfrom1D';\n    result[funcName] = new GlslLibRoutine(`\n      vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n        int texelIndex = index / 2;\n        int texR = texelIndex / texNumC;\n        int texC = texelIndex - texR * texNumC;\n        return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n      }\n      `);\n    funcName = 'packedUVfrom2D';\n    result[funcName] = new GlslLibRoutine(`\n      vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n        int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n        int texR = texelIndex / texNumC;\n        int texC = texelIndex - texR * texNumC;\n        return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n      }\n      `);\n    funcName = 'packedUVfrom3D';\n    result[funcName] = new GlslLibRoutine(`\n      vec2 packedUVfrom3D(int texNumR, int texNumC,\n          int texelsInBatch, int texelsInLogicalRow, int b,\n          int row, int col) {\n        int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n        int texR = index / texNumC;\n        int texC = index - texR * texNumC;\n        return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n      }\n      `);\n    funcName = 'sampleTexture';\n    const glsl = getGlsl(this.context.glContext.version);\n    result[funcName] = new GlslLibRoutine(`\n        float sampleTexture(sampler2D textureSampler, vec2 uv) {\n            return ${glsl.texture2D}(textureSampler, uv).r;\n        }`);\n    return result;\n  }\n\n  /**\n   * Constructing snippets for inputs\n   */\n  protected getInputsSamplingSnippets(): { [name: string]: GlslLibRoutine } {\n    const result: { [name: string]: GlslLibRoutine } = {};\n    const outputLayout = this.context.outputTextureLayout;\n    this.context.programInfo.inputNames.forEach((samplerName, i) => {\n      const inputLayout = this.context.inputTextureLayouts[i];\n      const funcName = generateShaderFuncNameFromInputSamplerName(samplerName);\n      if (inputLayout.isPacked) {\n        result[funcName] = this.getPackedSamplerFromInput(funcName, samplerName, inputLayout);\n      } else {\n        result[funcName] = this.getUnpackedSamplerFromInput(funcName, samplerName, inputLayout);\n      }\n\n      const outCoordFuncName = generateShaderFuncNameFromInputSamplerNameAtOutCoords(samplerName);\n      if (inputLayout.unpackedShape.length <= outputLayout.unpackedShape.length) {\n        if (inputLayout.isPacked) {\n          result[outCoordFuncName] = this.getPackedSamplerAtOutputCoords(\n            outCoordFuncName,\n            inputLayout,\n            outputLayout,\n            samplerName,\n          );\n        } else {\n          result[outCoordFuncName] = this.getUnpackedSamplerAtOutputCoords(\n            outCoordFuncName,\n            inputLayout,\n            outputLayout,\n            samplerName,\n          );\n        }\n      }\n    });\n\n    return result;\n  }\n\n  /**\n   * Constructing snippets for output coordinates of samplers\n   */\n  protected getPackedSamplerAtOutputCoords(\n    funcName: string,\n    inputLayout: TextureLayout,\n    outputLayout: TextureLayout,\n    name: string,\n  ): GlslLibRoutine {\n    const inShape = inputLayout.unpackedShape;\n    const outShape = outputLayout.unpackedShape;\n    const texName = name;\n    const texFuncSnippet = generateShaderFuncNameFromInputSamplerName(texName);\n\n    const inRank = inShape.length;\n    const outRank = outShape.length;\n\n    const broadcastDims = BroadcastUtil.getBroadcastDims(inShape, outShape);\n\n    const type = getCoordsDataType(outRank);\n    const rankDiff = outRank - inRank;\n    let coordsSnippet: string;\n    const fields = getGlChannels();\n\n    if (inRank === 0) {\n      coordsSnippet = '';\n    } else if (outRank < 2 && broadcastDims.length >= 1) {\n      coordsSnippet = 'coords = 0;';\n    } else {\n      coordsSnippet = broadcastDims.map((d) => `coords.${fields[d + rankDiff]} = 0;`).join('\\n');\n    }\n    let unpackedCoordsSnippet = '';\n    if (outRank < 2 && inRank > 0) {\n      unpackedCoordsSnippet = 'coords';\n    } else {\n      unpackedCoordsSnippet = inShape.map((_s, i) => `coords.${fields[i + rankDiff]}`).join(', ');\n    }\n\n    let output = 'return outputValue;';\n    const inSize = ShapeUtil.size(inShape);\n    const isInputScalar = inSize === 1;\n    const outSize = ShapeUtil.size(outShape);\n    const isOutputScalar = outSize === 1;\n\n    if (inRank === 1 && !isInputScalar && !isOutputScalar) {\n      output = `\n        return vec4(outputValue.xy, outputValue.xy);\n      `;\n    } else if (isInputScalar && !isOutputScalar) {\n      if (outRank === 1) {\n        output = `\n          return vec4(outputValue.x, outputValue.x, 0., 0.);\n        `;\n      } else {\n        output = `\n          return vec4(outputValue.x);\n        `;\n      }\n    } else if (broadcastDims.length) {\n      const rows = inRank - 2;\n      const cols = inRank - 1;\n\n      if (broadcastDims.indexOf(rows) > -1 && broadcastDims.indexOf(cols) > -1) {\n        output = 'return vec4(outputValue.x);';\n      } else if (broadcastDims.indexOf(rows) > -1) {\n        output = 'return vec4(outputValue.x, outputValue.y, ' + 'outputValue.x, outputValue.y);';\n      } else if (broadcastDims.indexOf(cols) > -1) {\n        output = 'return vec4(outputValue.xx, outputValue.zz);';\n      }\n    }\n\n    const swapLastDimsSnippet = `\n        int lastDim = coords.${fields[outRank - 1]};\n        coords.${fields[outRank - 1]} = coords.${fields[outRank - 2]};\n        coords.${fields[outRank - 2]} = lastDim;\n      `;\n    const source = `\n      vec4 ${funcName}() {\n        ${type} coords = getOutputCoords();\n        ${swapLastDimsSnippet}\n        ${coordsSnippet}\n        vec4 outputValue = ${texFuncSnippet}(${unpackedCoordsSnippet});\n        ${output}\n      }\n    `;\n    return new GlslLibRoutine(source, ['coordinates.getOutputCoords']);\n  }\n\n  /**\n   * Constructing snippets for unpacked output coordinates of samplers\n   */\n  protected getUnpackedSamplerAtOutputCoords(\n    funcName: string,\n    inputLayout: TextureLayout,\n    outputLayout: TextureLayout,\n    name: string,\n  ): GlslLibRoutine {\n    const outTexShape = [outputLayout.width, outputLayout.height];\n    const inTexShape = [inputLayout.width, inputLayout.height];\n    const inRank = inputLayout.unpackedShape.length;\n    const outRank = outputLayout.unpackedShape.length;\n    const inShape = inputLayout.unpackedShape;\n    const outShape = outputLayout.unpackedShape;\n    const texFuncSnippet = generateShaderFuncNameFromInputSamplerName(name);\n\n    if (inRank === outRank && ArrayUtil.arraysEqual(inTexShape, outTexShape)) {\n      const source = `\n          float ${funcName}() {\n            return sampleTexture(${name}, TexCoords);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n\n    const type = getCoordsDataType(outRank);\n    const broadcastDims = BroadcastUtil.getBroadcastDims(inShape, outShape);\n    const rankDiff = outRank - inRank;\n    let coordsSnippet: string;\n    const fields = getGlChannels();\n\n    if (inRank === 0) {\n      coordsSnippet = '';\n    } else if (outRank < 2 && broadcastDims.length >= 1) {\n      coordsSnippet = 'coords = 0;';\n    } else {\n      coordsSnippet = broadcastDims.map((d) => `coords.${fields[d + rankDiff]} = 0;`).join('\\n');\n    }\n    let unpackedCoordsSnippet = '';\n    if (outRank < 2 && inRank > 0) {\n      unpackedCoordsSnippet = 'coords';\n    } else {\n      unpackedCoordsSnippet = inputLayout.unpackedShape.map((_s, i) => `coords.${fields[i + rankDiff]}`).join(', ');\n    }\n    const source = `\n        float ${funcName}() {\n          ${type} coords = getOutputCoords();\n          ${coordsSnippet}\n          return ${texFuncSnippet}(${unpackedCoordsSnippet});\n        }\n      `;\n    return new GlslLibRoutine(source, ['coordinates.getOutputCoords']);\n  }\n\n  /**\n   * Constructing snippets for packed operations.\n   */\n  protected getPackedSamplerFromInput(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    switch (inputLayout.unpackedShape.length) {\n      case 0:\n        return this.getPackedSamplerScalar(funcName, name);\n      case 1:\n        return this.getPackedSampler1D(funcName, name, inputLayout);\n      case 2:\n        return this.getPackedSampler2D(funcName, name, inputLayout);\n      case 3:\n        return this.getPackedSampler3D(funcName, name, inputLayout);\n      default:\n        return this.getPackedSamplerND(funcName, name, inputLayout);\n    }\n  }\n\n  /**\n   * Constructing snippets for unpacked operations.\n   */\n  protected getUnpackedSamplerFromInput(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    switch (shape.length) {\n      case 0:\n        return this.getUnpackedSamplerScalar(funcName, name, inputLayout);\n      case 1:\n        return this.getUnpackedSampler1D(funcName, name, inputLayout);\n      case 2:\n        return this.getUnpackedSampler2D(funcName, name, inputLayout);\n      case 3:\n        return this.getUnpackedSampler3D(funcName, name, inputLayout);\n      case 4:\n        return this.getUnpackedSampler4D(funcName, name, inputLayout);\n      case 5:\n        return this.getUnpackedSampler5D(funcName, name, inputLayout);\n      case 6:\n        return this.getUnpackedSampler6D(funcName, name, inputLayout);\n      default:\n        // TODO support more dimensionalities\n        throw new Error(`Unsupported dimension ${shape.length}-D`);\n    }\n  }\n\n  /**\n   * Packed scalar snippet.\n   */\n  protected getPackedSamplerScalar(funcName: string, name: string): GlslLibRoutine {\n    const glsl = getGlsl(this.context.glContext.version);\n    const source = `\n          vec4 ${funcName}() {\n            return ${glsl.texture2D}(${name}, halfCR);\n          }\n        `;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Packed 1D snippet.\n   */\n  protected getPackedSampler1D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const texShape = [inputLayout.width, inputLayout.height];\n    const packedTexShape = [texShape[1], texShape[0]];\n    const glsl = getGlsl(this.context.glContext.version);\n\n    const packedSampler = `vec4 ${funcName}(int index) {\n      vec2 uv = packedUVfrom1D(\n      ${packedTexShape[0]}, ${packedTexShape[1]}, index);\n      return ${glsl.texture2D}(${name}, uv);\n    }`;\n    const source = packedSampler;\n    return new GlslLibRoutine(source, ['coordinates.packedUVfrom1D']);\n  }\n\n  /**\n   * Packed 2D snippet.\n   */\n  protected getPackedSampler2D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const texShape = [inputLayout.width, inputLayout.height];\n    const glsl = getGlsl(this.context.glContext.version);\n    const texNumR = texShape[0];\n    const texNumC = texShape[1];\n\n    if (texShape != null && ArrayUtil.arraysEqual(shape, texShape)) {\n      const packedSampler = `vec4 ${funcName}(int row, int col) {\n        vec2 uv = (vec2(col, row) + halfCR) / vec2(${texNumC}.0, ${texNumR}.0);\n        return ${glsl.texture2D}(${name}, uv);\n      }`;\n\n      return new GlslLibRoutine(packedSampler);\n    }\n    const packedTexShape = texShape;\n    const valuesPerRow = Math.ceil(shape[1] / 2);\n    const packedSampler = `vec4 ${funcName}(int row, int col) {\n      vec2 uv = packedUVfrom2D(${packedTexShape[1]}, ${packedTexShape[0]}, ${valuesPerRow}, row, col);\n      return ${glsl.texture2D}(${name}, uv);\n    }`;\n    const source = packedSampler;\n    return new GlslLibRoutine(source, ['coordinates.packedUVfrom2D']);\n  }\n\n  /**\n   * Packed 3D snippet.\n   */\n  protected getPackedSampler3D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const texShape = [inputLayout.width, inputLayout.height];\n    const packedTexShape = [texShape[0], texShape[1]];\n    const glsl = getGlsl(this.context.glContext.version);\n\n    if (shape[0] === 1) {\n      const squeezedShape = shape.slice(1);\n      const keptDims = [1, 2];\n      const newInputShape = squeezeInputShape(shape, squeezedShape);\n      const params = ['b', 'row', 'col'];\n      // Deep copy of input texture layout.\n      const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n      newInputLayout.unpackedShape = newInputShape;\n      const samplerRoutine = this.getPackedSamplerFromInput(funcName, name, newInputLayout);\n      const packedSampler = `${samplerRoutine.routineBody}\n      vec4 ${funcName}(int b, int row, int col) {\n        return ${funcName}(${getSqueezedParams(params, keptDims)});\n      } `;\n      const source = packedSampler;\n      return new GlslLibRoutine(source, samplerRoutine.dependencies);\n    }\n    const texNumR = packedTexShape[0];\n    const texNumC = packedTexShape[1];\n\n    const valuesPerRow = Math.ceil(shape[2] / 2);\n    const texelsInBatch = valuesPerRow * Math.ceil(shape[1] / 2);\n\n    const packedSampler = `vec4 ${funcName}(int b, int row, int col) {\n      vec2 uv = packedUVfrom3D(\n        ${texNumC}, ${texNumR}, ${texelsInBatch}, ${valuesPerRow}, b, row, col);\n      return ${glsl.texture2D}(${name}, uv);}`;\n    const source = packedSampler;\n    return new GlslLibRoutine(source, ['coordinates.packedUVfrom3D']);\n  }\n  /*\n   * Packed ND snippet.\n   */\n  protected getPackedSamplerND(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const rank = shape.length;\n    const texShape = [inputLayout.width, inputLayout.height];\n    const glsl = getGlsl(this.context.glContext.version);\n\n    const packedTexShape = [texShape[0], texShape[1]];\n    const texNumR = packedTexShape[1];\n    const texNumC = packedTexShape[0];\n    const valuesPerRow = Math.ceil(shape[rank - 1] / 2);\n    let texelsInBatch = valuesPerRow * Math.ceil(shape[rank - 2] / 2);\n    let params = 'int b, int row, int col';\n    let index = `b * ${texelsInBatch} + (row / 2) * ${valuesPerRow} + (col / 2)`;\n    for (let b = 2; b < rank - 1; b++) {\n      params = `int b${b}, ` + params;\n      texelsInBatch *= shape[rank - b - 1];\n      index = `b${b} * ${texelsInBatch} + ` + index;\n    }\n    const packedSampler = `vec4 ${funcName}(${params}) {\n      int index = ${index};\n      int texR = index / ${texNumC};\n      int texC = index - texR * ${texNumC};\n      vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${texNumC}, ${texNumR});\n      return ${glsl.texture2D}(${name}, uv);\n    }`;\n    const source = packedSampler;\n    return new GlslLibRoutine(source);\n  }\n\n  /**\n   * Unpacked scalar snippet.\n   */\n  protected getUnpackedSamplerScalar(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const [texNumR, texNumC] = [inputLayout.width, inputLayout.height];\n    if (texNumR === 1 && texNumC === 1) {\n      const source = `\n          float ${funcName}() {\n            return sampleTexture(${name}, halfCR);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n\n    const source = `\n        float ${funcName}() {\n          int offset_${name} = coordsToOffset(TexCoords, ${texNumR}, ${texNumC});\n          vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, offset_${name});\n          return sampleTexture(${name}, uv);\n        }\n      `;\n    return new GlslLibRoutine(source, [\n      'coordinates.uvFromFlat',\n      'coordinates.sampleTexture',\n      'coordinates.coordsToOffset',\n    ]);\n  }\n\n  /**\n   * Unpacked 1D snippet.\n   */\n  protected getUnpackedSampler1D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const tNumR = inputLayout.width;\n    const tNumC = inputLayout.height;\n\n    if (tNumC === 1 && tNumR === 1) {\n      const source = `\n        float ${funcName}(int index) {\n          return sampleTexture(${name}, halfCR);\n        }\n      `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n\n    if (tNumC === 1) {\n      const source = `\n          float ${funcName}(int index) {\n            vec2 uv = vec2((float(index) + 0.5) / ${tNumR}.0, 0.5);\n            return sampleTexture(${name}, uv);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n    if (tNumR === 1) {\n      const source = `\n          float ${funcName}(int index) {\n            vec2 uv = vec2(0.5, (float(index) + 0.5) / ${tNumC}.0);\n            return sampleTexture(${name}, uv);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n    const source = `\n        float ${funcName}(int index) {\n          vec2 uv = uvFromFlat(${tNumR}, ${tNumC}, index);\n          return sampleTexture(${name}, uv);\n        }\n      `;\n    return new GlslLibRoutine(source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture']);\n  }\n\n  /**\n   * Unpacked 2D snippet.\n   */\n\n  protected getUnpackedSampler2D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n\n    // TODO: modify row/col order for other dimensions.\n    const texShape = [inputLayout.height, inputLayout.width];\n\n    if (texShape != null && ArrayUtil.arraysEqual(shape, texShape)) {\n      const texNumR = texShape[1];\n      const texNumC = texShape[0];\n      const source = `\n          float ${funcName}(int row, int col) {\n            vec2 uv = (vec2(row, col) + halfCR) / vec2(${texNumR}.0, ${texNumC}.0);\n            return sampleTexture(${name}, uv);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n\n    const { newShape, keptDims } = squeezeShape(shape as number[]);\n    const squeezedShape = newShape;\n    if (squeezedShape.length < shape.length) {\n      const newInputShape = squeezeInputShape(shape, squeezedShape);\n      // Deep copy of input texture layout.\n      const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n      newInputLayout.unpackedShape = newInputShape;\n\n      const params = ['col', 'row'];\n      const source = `\n          ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n          float ${funcName}(int row, int col) {\n            return ${funcName}(${getSqueezedParams(params, keptDims)});\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture']);\n    }\n\n    const texNumR = texShape[1];\n    const texNumC = texShape[0];\n    if (texNumC === 1) {\n      const source = `\n          float ${funcName}(int row, int col) {\n            int offset_${name} = coordsToOffset(TexCoords, ${texNumR}, ${texNumC});\n            float index = dot(vec3(row, col, offset_${name}), vec3(${shape[1]}, 1, 1));\n            vec2 uv = vec2(0.5, (index + 0.5) / ${texNumR}.0);\n            return sampleTexture(${name}, uv);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n    }\n\n    if (texNumR === 1) {\n      const source = `\n          float ${funcName}(int row, int col) {\n            int offset_${name} = coordsToOffset(TexCoords, ${texNumR}, ${texNumC});\n            float index = dot(vec3(row, col, offset_${name}), vec3(${shape[1]}, 1, 1));\n            vec2 uv = vec2((index + 0.5) / ${texNumC}.0, 0.5);\n            return sampleTexture(${name}, uv);\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n    }\n\n    const source = `\n        float ${funcName}(int row, int col) {\n          int index = col * ${shape[1]} + row;\n          vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n          return sampleTexture(${name}, uv);\n        }\n      `;\n    return new GlslLibRoutine(source, [\n      'coordinates.uvFromFlat',\n      'coordinates.sampleTexture',\n      'coordinates.coordsToOffset',\n    ]);\n  }\n\n  /**\n   * Unpacked 3D snippet.\n   */\n\n  protected getUnpackedSampler3D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const stride0 = shape[1] * shape[2];\n    const stride1 = shape[2];\n\n    const { newShape, keptDims } = squeezeShape(shape as number[]);\n    const squeezedShape = newShape;\n    if (squeezedShape.length < shape.length) {\n      const newInputShape = squeezeInputShape(shape, squeezedShape);\n      const params = ['batch', 'col', 'row'];\n      // Deep copy of input texture layout.\n      const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n      newInputLayout.unpackedShape = newInputShape;\n      const routine = this.getUnpackedSamplerFromInput(funcName, name, newInputLayout);\n      // TODO: revisit the logic here to make it simpler\n      const revDims = keptDims.reverse();\n      const source = `\n          ${routine.routineBody}\n          float ${funcName}(int batch, int row, int col) {\n            return ${funcName}(${getSqueezedParams(params, revDims)});\n          }\n        `;\n      return new GlslLibRoutine(source, routine.dependencies);\n    }\n\n    const texNumR = inputLayout.width;\n    const texNumC = inputLayout.height;\n    const source = `\n          float ${funcName}(int depth, int row, int col) {\n            // Explicitly use integer operations as dot() only works on floats.\n            int index = depth * ${stride0} + col * ${stride1} + row;\n            vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n            return sampleTexture(${name}, uv);\n          }\n      `;\n    return new GlslLibRoutine(source, [\n      'coordinates.uvFromFlat',\n      'coordinates.sampleTexture',\n      'coordinates.coordsToOffset',\n    ]);\n  }\n\n  /**\n   * Unpacked 4D snippet.\n   */\n\n  protected getUnpackedSampler4D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const stride2 = shape[3];\n    const stride1 = shape[2] * stride2;\n    const stride0 = shape[1] * stride1;\n\n    //\n    // TODO: re-enable this shortcut once the index calculation bug is fixed.\n    //\n    // const {newShape, keptDims} = squeezeShape(shape as number[]);\n    // if (newShape.length < shape.length) {\n    //   const newInputShape = squeezeInputShape(shape, newShape);\n    //   const params = ['row', 'col', 'depth', 'depth2'];\n    //   // Deep copy of input texture layout.\n    //   const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n    //   newInputLayout.unpackedShape = newInputShape;\n    //   const source = `\n    //       ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n    //       float ${funcName}(int row, int col, int depth, int depth2) {\n    //         return ${funcName}(${getSqueezedParams(params, keptDims)});\n    //       }\n    //     `;\n    //   return new GlslLibRoutine(\n    //       source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture', 'coordinates.coordsToOffset']);\n    // }\n\n    const texNumR = inputLayout.width;\n    const texNumC = inputLayout.height;\n    const source = `\n        float ${funcName}(int row, int col, int depth, int depth2) {\n          int index = row * ${stride0} + col * ${stride1} +\n              depth2 * ${stride2} + depth;\n          vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n          return sampleTexture(${name}, uv);\n        }\n      `;\n    return new GlslLibRoutine(source, ['coordinates.uvFromFlat', 'coordinates.sampleTexture']);\n  }\n\n  /**\n   * Unpacked 5D snippet.\n   */\n  protected getUnpackedSampler5D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const stride3 = shape[4];\n    const stride2 = shape[3] * stride3;\n    const stride1 = shape[2] * stride2;\n    const stride0 = shape[1] * stride1;\n\n    const { newShape, keptDims } = squeezeShape(shape as number[]);\n    if (newShape.length < shape.length) {\n      const newInputShape = squeezeInputShape(shape, newShape);\n      const params = ['row', 'col', 'depth', 'depth2', 'depth3'];\n      // Deep copy of input texture layout.\n      const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n      newInputLayout.unpackedShape = newInputShape;\n\n      const source = `\n          ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n          float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n            return ${funcName}(${getSqueezedParams(params, keptDims)});\n          }\n        `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.uvFromFlat']);\n    }\n\n    const texNumR = inputLayout.width;\n    const texNumC = inputLayout.height;\n    const source = `\n        float ${funcName}(int row, int col, int depth, int depth2, int depth3) {\n          int index = row * ${stride0} + col * ${stride1} + depth * ${stride2} +\n          depth3 * ${stride3} + depth2;\n          vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n          return sampleTexture(${name}, uv);\n        }\n      `;\n    return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.uvFromFlat']);\n  }\n\n  /**\n   * Unpacked 6D snippet.\n   */\n  protected getUnpackedSampler6D(funcName: string, name: string, inputLayout: TextureLayout): GlslLibRoutine {\n    const shape = inputLayout.unpackedShape;\n    const stride4 = shape[5];\n    const stride3 = shape[4] * stride4;\n    const stride2 = shape[3] * stride3;\n    const stride1 = shape[2] * stride2;\n    const stride0 = shape[1] * stride1;\n\n    const { newShape, keptDims } = squeezeShape(shape as number[]);\n    if (newShape.length < shape.length) {\n      const newInputShape = squeezeInputShape(shape, newShape);\n      const params = ['row', 'col', 'depth', 'depth2', 'depth3', 'depth4'];\n      // Deep copy of input texture layout.\n      const newInputLayout: TextureLayout = JSON.parse(JSON.stringify(inputLayout));\n      newInputLayout.unpackedShape = newInputShape;\n\n      const source = `\n            ${this.getUnpackedSamplerFromInput(funcName, name, newInputLayout).routineBody}\n            float ${funcName}(int row, int col, int depth,\n              int depth2, int depth3, int depth4) {\n              return ${funcName}(${getSqueezedParams(params, keptDims)});\n            }\n          `;\n      return new GlslLibRoutine(source, ['coordinates.sampleTexture', 'coordinates.uvFromFlat']);\n    }\n\n    const texNumR = inputLayout.width;\n    const texNumC = inputLayout.height;\n    const source = `\n          float ${funcName}(int row, int col, int depth,\n            int depth2, int depth3, int depth4) {\n            int index = row * ${stride0} + col * ${stride1} + depth * ${stride2} +\n            depth2 * ${stride3} + depth3 * ${stride4} + depth4;\n            vec2 uv = uvFromFlat(${texNumR}, ${texNumC}, index);\n            return sampleTexture(${name}, uv);\n          }\n        `;\n    return new GlslLibRoutine(source, [\n      'coordinates.uvFromFlat',\n      'coordinates.sampleTexture',\n      'coordinates.coordsToOffset',\n    ]);\n  }\n\n  /**\n   * This is the main function to map from the given texture coordinates (s,t)\n   * to logical indices for the output\n   * There will only be one single variation of this\n   * Also see coordsToOffset and offsetToIndices for input-specific versions\n   */\n  protected toVec(): { [name: string]: GlslLibRoutine } {\n    const output = this.context.outputTextureLayout;\n    const rank = output.shape.length;\n    const strides = output.strides;\n    const xScale = output.width;\n    const yScale = output.height;\n\n    const stridesBlock = [];\n    for (let i = 0; i < rank - 1; ++i) {\n      stridesBlock.push(`\n        c[${i}] = offset / ${strides[i]};`);\n      stridesBlock.push(`\n        offset -= c[${i}] * ${strides[i]};`);\n    }\n    stridesBlock.push(`\n        c[${rank - 1}] = offset;`);\n    const body = `\n      void toVec(vec2 texCoords, out int c[${rank}]) {\n        int offset = coordsToOffset(texCoords, ${xScale}, ${yScale});\n        ${stridesBlock.join('')}\n      }\n      void toVec(int offset, out int c[${rank}]) {\n        ${stridesBlock.join('')}\n      }\n    `;\n    return { toVec: new GlslLibRoutine(body, ['coordinates.coordsToOffset']) };\n  }\n  /**\n   * These are value getter functions generated for each input\n   * Each function is hardwired to the name and dimensions of the input\n   * An '_T' variation is also produced which accesses values as if the\n   * input was transposed\n   */\n  protected valueFrom(): { [name: string]: GlslLibRoutine } {\n    const result: { [name: string]: GlslLibRoutine } = {};\n    this.context.programInfo.inputNames.forEach((name, i) => {\n      const layout = this.context.inputTextureLayouts[i];\n      const shape = layout.unpackedShape.length > 0 ? layout.unpackedShape : layout.shape;\n      const rank = shape.length;\n      let funcName = `_${name}`;\n      result[funcName] = new GlslLibRoutine(this.getValueFromSingle(name, rank, layout.width, layout.height, false), [\n        `shapeUtils.indicesToOffset${funcName}`,\n        'coordinates.offsetToCoords',\n        'fragcolor.getColorAsFloat',\n      ]);\n      funcName = funcName + '_T';\n      result[funcName] = new GlslLibRoutine(this.getValueFromSingle(name, rank, layout.width, layout.height, true), [\n        `shapeUtils.indicesToOffset${funcName}`,\n        'coordinates.offsetToCoords',\n        'fragcolor.getColorAsFloat',\n      ]);\n    });\n    return result;\n  }\n  /**\n   * Produces one value getter function for the name and rank given\n   * If a transpose is set proper offsetToCoords mapping will be used\n   * @param name name of the function\n   * @param rank rank of the input\n   * @param transpose whether or not should generate a transpose variation\n   */\n  protected getValueFromSingle(\n    varName: string,\n    rank: number,\n    width: number,\n    height: number,\n    transpose: boolean,\n  ): string {\n    let name = `_${varName}`;\n    if (transpose) {\n      name = name + '_T';\n    }\n    const glsl = getGlsl(this.context.glContext.version);\n    return `\n        float ${name}(int m[${rank}]) {\n          int offset = indicesToOffset${name}(m);\n          vec2 coords = offsetToCoords(offset, ${width}, ${height});\n          float value = getColorAsFloat(${glsl.texture2D}(${varName}, coords));\n          return value;\n        }\n        `;\n  }\n\n  /**\n   * Produces a packed value getter function for the name and rank given\n   * If a transpose is set proper offsetToCoords mapping will be used\n   * @param name name of the function\n   * @param rank rank of the input\n   * @param transpose whether or not should generate a transpose variation\n   */\n  protected getPackedValueFrom(\n    varName: string,\n    rank: number,\n    width: number,\n    height: number,\n    transpose: boolean,\n  ): string {\n    let name = `_${varName}_Pack`;\n    if (transpose) {\n      name = name + '_T';\n    }\n    const glsl = getGlsl(this.context.glContext.version);\n    return `\n        vec4 ${name}(int m[${rank}]) {\n          int offset = indicesToOffset_${varName}(m);\n          vec2 coords = offsetToCoords(offset, ${width}, ${height});\n          return ${glsl.texture2D}(${varName}, coords);\n        }\n        `;\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { GlslContext, GlslLib, GlslLibRoutine } from './glsl-definitions';\n\n/**\n * This GLSL library handles routines converting\n * float32 to/from Unsigned byte or float 16\n */\nexport class EncodingGlslLib extends GlslLib {\n  constructor(context: GlslContext) {\n    super(context);\n  }\n  getFunctions(): { [name: string]: GlslLibRoutine } {\n    return { ...this.encodeFloat32(), ...this.decodeFloat32() };\n  }\n  getCustomTypes(): { [name: string]: string } {\n    return {};\n  }\n  protected encodeFloat32(): { [name: string]: GlslLibRoutine } {\n    return {\n      encode: new GlslLibRoutine(`highp vec4 encode(highp float f) {\n        return vec4(f, 0.0, 0.0, 0.0);\n      }\n        `),\n    };\n  }\n  protected decodeFloat32(): { [name: string]: GlslLibRoutine } {\n    return {\n      decode: new GlslLibRoutine(`highp float decode(highp vec4 rgba) {\n        return rgba.r;\n      }\n        `),\n    };\n  }\n  /**\n   * returns the routine to encode encode a 32bit float to a vec4 (of unsigned bytes)\n   * @credit: https://stackoverflow.com/questions/7059962/how-do-i-convert-a-vec4-rgba-value-to-a-float\n   */\n  protected encodeUint8(): { [name: string]: GlslLibRoutine } {\n    const endianness = EncodingGlslLib.isLittleEndian() ? 'rgba.rgba=rgba.abgr;' : '';\n    return {\n      encode: new GlslLibRoutine(`\n      highp vec4 encode(highp float f) {\n        highp float F = abs(f);\n        highp float Sign = step(0.0,-f);\n        highp float Exponent = floor(log2(F));\n        highp float Mantissa = (exp2(- Exponent) * F);\n        Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n        highp vec4 rgba;\n        rgba[0] = 128.0 * Sign  + floor(Exponent*exp2(-1.0));\n        rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n        rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n        rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n        ${endianness}\n        rgba = rgba / 255.0; // values need to be normalized to [0,1]\n        return rgba;\n    }\n        `),\n    };\n  }\n  /**\n   * returns the routine to encode a vec4 of unsigned bytes to float32\n   * @credit: https://stackoverflow.com/questions/7059962/how-do-i-convert-a-vec4-rgba-value-to-a-float\n   */\n  protected decodeUint8(): { [name: string]: GlslLibRoutine } {\n    const endianness = EncodingGlslLib.isLittleEndian() ? 'rgba.rgba=rgba.abgr;' : '';\n    return {\n      decode: new GlslLibRoutine(`\n        highp float decode(highp vec4 rgba) {\n          rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n          ${endianness}\n          highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n          highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n          highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n          highp float Result =  Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n          return Result;\n      }\n        `),\n    };\n  }\n  /**\n   * Determines if the machine is little endian or not\n   * @credit: https://gist.github.com/TooTallNate/4750953\n   */\n  static isLittleEndian(): boolean {\n    const b = new ArrayBuffer(4);\n    const a = new Uint32Array(b);\n    const c = new Uint8Array(b);\n    a[0] = 0xdeadbeef;\n    if (c[0] === 0xef) {\n      return true;\n    }\n    if (c[0] === 0xde) {\n      return false;\n    }\n    throw new Error('unknown endianness');\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { GlslContext, GlslLib, GlslLibRoutine } from './glsl-definitions';\nimport { getGlsl } from './glsl-source';\n\n/**\n * This GLSL library handles routines around reading a texlet and writing to it\n * Reading and writing could be more than just dealing with one channel\n * It may require encoding/decoding to/from 4 channels into one\n */\nexport class FragColorGlslLib extends GlslLib {\n  constructor(context: GlslContext) {\n    super(context);\n  }\n  getFunctions(): { [name: string]: GlslLibRoutine } {\n    return { ...this.setFragColor(), ...this.getColorAsFloat() };\n  }\n  getCustomTypes(): { [name: string]: string } {\n    return {};\n  }\n  protected setFragColor(): { [name: string]: GlslLibRoutine } {\n    const glsl = getGlsl(this.context.glContext.version);\n    return {\n      setFragColor: new GlslLibRoutine(\n        `\n        void setFragColor(float value) {\n            ${glsl.output} = encode(value);\n        }\n        `,\n        ['encoding.encode'],\n      ),\n    };\n  }\n  protected getColorAsFloat(): { [name: string]: GlslLibRoutine } {\n    return {\n      getColorAsFloat: new GlslLibRoutine(\n        `\n        float getColorAsFloat(vec4 color) {\n            return decode(color);\n        }\n        `,\n        ['encoding.decode'],\n      ),\n    };\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { GlslContext, GlslLib, GlslLibRoutine } from './glsl-definitions';\n\n/**\n * GLSL Library responsible for data types and routines for manipulating\n * coordinates and mapping to/from tensor indices\n */\nexport class ShapeUtilsGlslLib extends GlslLib {\n  constructor(context: GlslContext) {\n    super(context);\n  }\n  getFunctions(): { [name: string]: GlslLibRoutine } {\n    return {\n      ...this.bcastIndex(),\n      ...this.bcastMatmulIndex(),\n      ...this.offsetToIndices(),\n      ...this.indicesToOffset(),\n      ...this.incrementIndices(),\n    };\n  }\n  getCustomTypes() {\n    return {};\n  }\n  protected bcastIndex(): { [name: string]: GlslLibRoutine } {\n    const outputRank = this.context.outputTextureLayout.shape.length;\n    const result: { [name: string]: GlslLibRoutine } = {};\n    this.context.programInfo.inputNames.forEach((name, i) => {\n      const shape = this.context.inputTextureLayouts[i].unpackedShape;\n      if (shape.length <= outputRank) {\n        const rank = shape.length;\n        const dimOffset = outputRank - rank;\n        const funcName = `bcastIndices_${name}`;\n        let block = '';\n        for (let i = 0; i < rank; ++i) {\n          block += `\n          realIndices[${i}] = int( mod(float(bcastedIndices[${dimOffset + i}]), ${shape[i]}.0) );\n          `;\n        }\n        const body = `\n        void ${funcName} (int bcastedIndices[${outputRank}], out int realIndices[${rank}]) {\n          ${block}\n        }\n        `;\n        result[funcName] = new GlslLibRoutine(body);\n      }\n    });\n    return result;\n  }\n  protected bcastMatmulIndex(): { [name: string]: GlslLibRoutine } {\n    const outputRank = this.context.outputTextureLayout.shape.length;\n    const result: { [name: string]: GlslLibRoutine } = {};\n    this.context.programInfo.inputNames.forEach((name, i) => {\n      const shape = this.context.inputTextureLayouts[i].shape;\n      if (!(shape.length < 2 || shape.length > outputRank)) {\n        const rank = shape.length;\n        const dimOffset = outputRank - rank;\n        const funcName = `bcastMatmulIndices_${name}`;\n        let block = '';\n        for (let i = 0; i < rank - 2; ++i) {\n          block += `\n          realIndices[${i}] = int( mod(float(bcastedIndices[${dimOffset + i}]), ${shape[i]}.0) );\n          `;\n        }\n        const body = `\n        void ${funcName}(int bcastedIndices[${outputRank}], out int realIndices[${rank}]) {\n          ${block}\n          realIndices[${rank - 1}] = bcastedIndices[${outputRank - 1}];\n          realIndices[${rank - 2}] = bcastedIndices[${outputRank - 2}];\n        }\n        `;\n        result[funcName] = new GlslLibRoutine(body);\n      }\n    });\n    return result;\n  }\n  protected indicesToOffset(): { [name: string]: GlslLibRoutine } {\n    const result: { [name: string]: GlslLibRoutine } = {};\n    this.context.programInfo.inputNames.forEach((name, i) => {\n      const shape = this.context.inputTextureLayouts[i].shape;\n      const strides = this.context.inputTextureLayouts[i].strides;\n      const rank = shape.length;\n      let funcName = `indicesToOffset_${name}`;\n      result[funcName] = new GlslLibRoutine(ShapeUtilsGlslLib.indexToOffsetSingle(funcName, rank, strides));\n      funcName = `indicesToOffset_${name}_T`;\n      result[funcName] = new GlslLibRoutine(\n        ShapeUtilsGlslLib.indexToOffsetSingle(funcName, rank, strides.slice().reverse()),\n      );\n    });\n    return result;\n  }\n  static indexToOffsetSingle(name: string, rank: number, strides: readonly number[]): string {\n    let block = '';\n    for (let i = rank - 1; i >= 0; --i) {\n      block += `\n        offset += indices[${i}] * ${strides[i]};\n        `;\n    }\n    return `\n      int ${name}(int indices[${rank}]) {\n        int offset = 0;\n        ${block}\n        return offset;\n      }\n      `;\n  }\n  protected offsetToIndices(): { [name: string]: GlslLibRoutine } {\n    const result: { [name: string]: GlslLibRoutine } = {};\n    this.context.programInfo.inputNames.forEach((name, i) => {\n      const shape = this.context.inputTextureLayouts[i].shape;\n      const strides = this.context.inputTextureLayouts[i].strides;\n      const rank = shape.length;\n      let funcName = `offsetToIndices_${name}`;\n      result[funcName] = new GlslLibRoutine(ShapeUtilsGlslLib.offsetToIndicesSingle(funcName, rank, strides));\n      funcName = `offsetToIndices_${name}_T`;\n      result[funcName] = new GlslLibRoutine(\n        ShapeUtilsGlslLib.offsetToIndicesSingle(funcName, rank, strides.slice().reverse()),\n      );\n    });\n    return result;\n  }\n  static offsetToIndicesSingle(name: string, rank: number, strides: readonly number[]): string {\n    const stridesBlock = [];\n    for (let i = 0; i < rank - 1; ++i) {\n      stridesBlock.push(`\n      indices[${i}] = offset / ${strides[i]};`);\n      stridesBlock.push(`\n        offset -= indices[${i}] * ${strides[i]};`);\n    }\n    stridesBlock.push(`\n      indices[${rank - 1}] = offset;`);\n    return `\n      void ${name}(int offset, out int indices[${rank}]) {\n        ${stridesBlock.join('')}\n      }\n      `;\n  }\n  protected incrementIndices(): { [name: string]: GlslLibRoutine } {\n    const result: { [name: string]: GlslLibRoutine } = {};\n    this.context.programInfo.inputNames.forEach((name, i) => {\n      const shape = this.context.inputTextureLayouts[i].shape;\n      const rank = shape.length;\n      const funcName = `incrementIndices_${name}`;\n      let shapeInit = '';\n      for (let i = 0; i < rank; ++i) {\n        shapeInit += `\n        shape[${i}] = ${shape[i]};`;\n      }\n      const body = `\n        void ${funcName}(int axis, out int indices[${rank}]) {\n          int shape[${rank}];\n          ${shapeInit};\n          for(int i = ${rank} -1 ; i >= 0; --i) {\n            if(i > axis) continue;\n            indices[i] += 1;\n            if(indices[i] < shape[i]) {\n              break;\n            }\n            indices[i] = 0;\n          }\n        }\n        `;\n      result[funcName] = new GlslLibRoutine(body);\n    });\n    return result;\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { GlslContext, GlslLib, GlslLibRoutine } from './glsl-definitions';\n\n/**\n * GLSL Library responsible for vec routines\n * Vec is an varible length int array. The length is fixed at the time of\n * generating the library functions from the dimensions of the output.\n */\nexport class VecGlslLib extends GlslLib {\n  constructor(context: GlslContext) {\n    super(context);\n  }\n  getCustomTypes(): { [name: string]: string } {\n    return {};\n  }\n  getFunctions(): { [name: string]: GlslLibRoutine } {\n    return { ...this.binaryVecFunctions(), ...this.copyVec(), ...this.setVecItem(), ...this.getVecItem() };\n  }\n  protected binaryVecFunctions(): { [name: string]: GlslLibRoutine } {\n    const outputLayout = this.context.outputTextureLayout;\n    const rank = outputLayout.shape.length;\n    const nameOp: { [name: string]: string } = { add: '+=', sub: '-=', mul: '*=', div: '/=' };\n    const result: { [name: string]: GlslLibRoutine } = {};\n    for (const name in nameOp) {\n      const fname = `${name}Vec`;\n      let assignmentBlock = '';\n      for (let i = 0; i < rank; ++i) {\n        assignmentBlock += `\n          dest[${i}] ${nameOp[name]} src[${i}];\n          `;\n      }\n      const body = `\n        void ${fname}(int src[${rank}], out int dest[${rank}]) {\n          ${assignmentBlock}\n        }\n        `;\n      result[fname] = new GlslLibRoutine(body);\n    }\n\n    return result;\n  }\n  protected copyVec(): { [name: string]: GlslLibRoutine } {\n    const outputLayout = this.context.outputTextureLayout;\n    const rank = outputLayout.shape.length;\n    let assignmentBlock = '';\n    for (let i = 0; i < rank; ++i) {\n      assignmentBlock += `\n        dest[${i}] = src[${i}];\n        `;\n    }\n    const body = `\n      void copyVec(int src[${rank}], out int dest[${rank}]) {\n        ${assignmentBlock}\n      }\n      `;\n    return { copyVec: new GlslLibRoutine(body) };\n  }\n\n  protected setVecItem(): { [name: string]: GlslLibRoutine } {\n    const outputLayout = this.context.outputTextureLayout;\n    const rank = outputLayout.shape.length;\n    let block = `\n        if(index < 0)\n            index =${rank} + index;\n        if (index == 0)\n            m[0] = value;\n        `;\n    for (let i = 1; i < rank - 1; ++i) {\n      block += `\n        else if (index == ${i})\n            m[${i}] = value;\n            `;\n    }\n    block += `\n        else\n            m[${rank - 1}] = value;\n        `;\n    const body = `\n      void setVecItem(out int m[${rank}], int index, int value) {\n        ${block}\n      }\n        `;\n    return { setVecItem: new GlslLibRoutine(body) };\n  }\n  protected getVecItem(): { [name: string]: GlslLibRoutine } {\n    const outputLayout = this.context.outputTextureLayout;\n    const rank = outputLayout.shape.length;\n    let block = `\n        if(index < 0)\n            index = ${rank} + index;\n        if (index == 0)\n            return m[0];\n      `;\n    for (let i = 1; i < rank - 1; ++i) {\n      block += `\n        else if (index == ${i})\n            return m[${i}];\n      `;\n    }\n    block += `\n        else\n            return m[${rank - 1}];\n        `;\n    const body = `\n      int getVecItem(int m[${rank}], int index) {\n        ${block}\n      }\n    `;\n    return { getVecItem: new GlslLibRoutine(body) };\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { CoordsGlslLib } from './glsl-coordinate-lib';\nimport { GlslContext, GlslLib } from './glsl-definitions';\nimport { EncodingGlslLib } from './glsl-encoding-lib';\nimport { FragColorGlslLib } from './glsl-fragcolor-lib';\nimport { ShapeUtilsGlslLib } from './glsl-shape-utils-lib';\nimport { VecGlslLib } from './glsl-vec-lib';\n\nexport const glslRegistry: { [name: string]: new (context: GlslContext) => GlslLib } = {\n  encoding: EncodingGlslLib,\n  fragcolor: FragColorGlslLib,\n  vec: VecGlslLib,\n  shapeUtils: ShapeUtilsGlslLib,\n  coordinates: CoordsGlslLib,\n  //  'arrays': ArrayGlslSLib\n};\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { GlslContext, GlslLib, GlslLibRoutineNode, TopologicalSortGlslRoutines } from './glsl-definitions';\nimport { replaceInlines } from './glsl-function-inliner';\nimport { glslRegistry } from './glsl-registered-libs';\nimport { getDefaultFragShaderMain, getFragShaderPreamble } from './glsl-source';\nimport { ProgramInfo, TextureLayout, VariableInfo } from './types';\nimport { WebGLContext } from './webgl-context';\n\n/**\n * Preprocessor for the additions to the GLSL language\n * It deals with:\n *  @include directives\n *  @inline\n *  Loop unrolling (not implemented)\n *  Macro resolution (not implemented)\n */\nexport class GlslPreprocessor {\n  readonly context: GlslContext;\n  readonly libs: { [name: string]: GlslLib } = {};\n  readonly glslLibRoutineDependencyGraph: { [routineName: string]: GlslLibRoutineNode } = {};\n\n  constructor(\n    glContext: WebGLContext,\n    programInfo: ProgramInfo,\n    inputTextureLayouts: TextureLayout[],\n    outputTextureLayout: TextureLayout,\n  ) {\n    this.context = new GlslContext(glContext, programInfo, inputTextureLayouts, outputTextureLayout);\n\n    // construct GlslLibs\n    Object.keys(glslRegistry).forEach((name: string) => {\n      const lib = new glslRegistry[name](this.context);\n      this.libs[name] = lib;\n    });\n\n    // construct GlslRoutineDependencyGraph\n    const map = this.glslLibRoutineDependencyGraph;\n    for (const libName in this.libs) {\n      const lib = this.libs[libName];\n      const routinesInLib = lib.getFunctions();\n      for (const routine in routinesInLib) {\n        const key = libName + '.' + routine;\n        let currentNode: GlslLibRoutineNode;\n        if (map[key]) {\n          currentNode = map[key];\n          currentNode.routineBody = routinesInLib[routine].routineBody;\n        } else {\n          currentNode = new GlslLibRoutineNode(key, routinesInLib[routine].routineBody);\n          map[key] = currentNode;\n        }\n        const dependencies = routinesInLib[routine].dependencies;\n        if (dependencies) {\n          for (let i = 0; i < dependencies.length; ++i) {\n            if (!map[dependencies[i]]) {\n              const node = new GlslLibRoutineNode(dependencies[i]);\n              map[dependencies[i]] = node;\n              currentNode.addDependency(node);\n            } else {\n              currentNode.addDependency(map[dependencies[i]]);\n            }\n          }\n        }\n      }\n    }\n  }\n\n  preprocess(): string {\n    const programInfo = this.context.programInfo;\n    let source = programInfo.shaderSource;\n\n    // append main() function\n    if (!this.context.programInfo.hasMain) {\n      source = `${source}\n      ${getDefaultFragShaderMain(this.context.glContext.version, this.context.outputTextureLayout.shape.length)}`;\n    }\n    // replace inlines\n    source = replaceInlines(source);\n\n    // concat final source string\n    return `${getFragShaderPreamble(this.context.glContext.version)}\n    ${this.getUniforms(programInfo.inputNames, programInfo.variables)}\n    ${this.getImports(source)}\n    ${source}`;\n  }\n\n  protected getImports(script: string): string {\n    const routinesIncluded = this.selectGlslLibRoutinesToBeIncluded(script);\n\n    if (routinesIncluded.length === 0) {\n      return '';\n    }\n\n    let routines = '';\n    for (let i = 0; i < routinesIncluded.length; ++i) {\n      if (routinesIncluded[i].routineBody) {\n        routines += routinesIncluded[i].routineBody + '\\n';\n      } else {\n        throw new Error(`Missing body for the Glsl Library routine: ${routinesIncluded[i].name}`);\n      }\n    }\n\n    return routines;\n  }\n  private selectGlslLibRoutinesToBeIncluded(script: string): GlslLibRoutineNode[] {\n    const nodes: GlslLibRoutineNode[] = [];\n\n    Object.keys(this.glslLibRoutineDependencyGraph).forEach((classAndRoutine) => {\n      const routine = classAndRoutine.split('.')[1];\n      if (script.indexOf(routine) !== -1) {\n        nodes.push(this.glslLibRoutineDependencyGraph[classAndRoutine]);\n      }\n    });\n\n    return TopologicalSortGlslRoutines.returnOrderedNodes(nodes);\n  }\n\n  protected getUniforms(samplers?: string[], variables?: VariableInfo[]): string {\n    const uniformLines: string[] = [];\n    if (samplers) {\n      for (const sampler of samplers) {\n        uniformLines.push(`uniform sampler2D ${sampler};`);\n      }\n    }\n    if (variables) {\n      for (const variable of variables) {\n        uniformLines.push(\n          `uniform ${variable.type} ${variable.name}${variable.arrayLength ? `[${variable.arrayLength}]` : ''};`,\n        );\n      }\n    }\n    return uniformLines.join('\\n');\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { env } from 'onnxruntime-common';\n\nimport { Logger, Profiler } from '../../instrument';\n\nimport { GlslPreprocessor } from './glsl-preprocessor';\nimport { getVertexShaderSource } from './glsl-source';\nimport { TextureLayoutStrategy } from './texture-layout-strategy';\nimport { Artifact, ProgramInfo, ProgramVariable, TextureData, TextureLayout, VariableInfo } from './types';\nimport { WebGLContext } from './webgl-context';\n\n/**\n * ProgramManager is the main class behind running computations\n * It builds ProgramInfo's into Artifacts\n * It compiles given ProgramInfo's into WebGL Prorams (cached as Artifacts)\n * Uses the artifact to run the computation by calling Draw on\n * the WebGL drawing buffer\n * ProgramManager automatically maps (binds) input variables to their\n * corresponding Location's in the binary program\n */\nexport class ProgramManager {\n  repo: Map<unknown, Artifact>; // this should be per-session object\n  vertexShader: WebGLShader;\n  attributesBound: boolean;\n\n  constructor(\n    public profiler: Readonly<Profiler>,\n    public glContext: WebGLContext,\n    public textureLayoutStrategy: TextureLayoutStrategy,\n  ) {\n    this.repo = new Map();\n    this.attributesBound = false;\n  }\n  getArtifact(key: unknown): Artifact | undefined {\n    return this.repo.get(key);\n  }\n  setArtifact(key: unknown, artifact: Artifact): void {\n    this.repo.set(key, artifact);\n  }\n  run(buildArtifact: Artifact, inputs: TextureData[], output: TextureData): void {\n    this.profiler.event(\n      'op',\n      `ProgramManager.run ${buildArtifact.programInfo.name ?? 'unknown kernel'}`,\n      () => {\n        const gl = this.glContext.gl;\n        const program = buildArtifact.program;\n        gl.useProgram(program);\n        try {\n          this.bindOutput(output);\n          if (!this.attributesBound) {\n            this.bindAttributes(buildArtifact.attribLocations);\n          }\n          this.bindUniforms(buildArtifact.uniformLocations, buildArtifact.programInfo.variables ?? [], inputs);\n        } catch (err) {\n          Logger.error('ProgramManager', buildArtifact.programInfo.shaderSource);\n          throw err;\n        }\n        this.profiler.event('backend', 'GlContext.draw()', () => {\n          this.glContext.draw();\n        });\n      },\n      this.glContext,\n    );\n  }\n  dispose(): void {\n    if (this.vertexShader) {\n      this.glContext.deleteShader(this.vertexShader);\n    }\n    this.repo.forEach((a) => this.glContext.deleteProgram(a.program));\n  }\n  build(programInfo: ProgramInfo, inputTextureLayouts: TextureLayout[], outputTextureLayout: TextureLayout): Artifact {\n    return this.profiler.event('backend', 'ProgramManager.build', () => {\n      const preprocessor = new GlslPreprocessor(this.glContext, programInfo, inputTextureLayouts, outputTextureLayout);\n      const fragScript = preprocessor.preprocess();\n      const program = this.compile(fragScript);\n      const artifact = {\n        programInfo,\n        program,\n        uniformLocations: this.getUniformLocations(\n          program,\n          preprocessor.context.programInfo.inputNames,\n          preprocessor.context.programInfo.variables,\n        ),\n        attribLocations: this.getAttribLocations(program),\n      };\n      return artifact;\n    });\n  }\n  protected compile(fragShaderScript: string): WebGLProgram {\n    if (!this.vertexShader) {\n      Logger.verbose('ProrgramManager', 'Compiling and caching Vertex shader for the first time');\n      const vertexShaderScript = getVertexShaderSource(this.glContext.version);\n      this.vertexShader = this.glContext.compileShader(vertexShaderScript, this.glContext.gl.VERTEX_SHADER);\n    }\n    if (env.debug) {\n      Logger.verbose(\n        'ProrgramManager',\n        `FragShader:\n${fragShaderScript}\n`,\n      );\n    }\n    const fragShader = this.glContext.compileShader(fragShaderScript, this.glContext.gl.FRAGMENT_SHADER);\n    const program = this.glContext.createProgram(this.vertexShader, fragShader);\n    this.glContext.deleteShader(fragShader);\n    return program;\n  }\n  bindOutput(td: TextureData): void {\n    const width = td.width;\n    const height = td.height;\n    Logger.verbose(\n      'ProrgramManager',\n      `Binding output texture to Framebuffer: w/h=${width}/${height}, shape=${td.shape}, type=${td.tensor.type}`,\n    );\n    this.glContext.attachFramebuffer(td.texture, width, height);\n  }\n  bindAttributes(attribLocations: Artifact.AttribLocations): void {\n    const positionHandle = attribLocations.position;\n    const textureCoordHandle = attribLocations.textureCoord;\n    this.glContext.setVertexAttributes(positionHandle, textureCoordHandle);\n    this.attributesBound = true;\n  }\n  bindUniforms(\n    uniformLocations: Artifact.UniformLocations,\n    variables: ProgramVariable[],\n    textures: TextureData[],\n  ): void {\n    const gl = this.glContext.gl;\n    let texturePosition = 0;\n    for (const { name, type, location, arrayLength } of uniformLocations) {\n      const value = variables.find((v) => v.name === name)?.data;\n      if (type !== 'sampler2D' && !value) {\n        throw new Error(`variable '${name}' does not have data defined in program info`);\n      }\n      switch (type) {\n        case 'sampler2D':\n          this.bindTexture(textures[texturePosition], location, texturePosition);\n          texturePosition++;\n          break;\n        case 'float':\n          if (arrayLength) {\n            gl.uniform1fv(location, value as number[]);\n          } else {\n            gl.uniform1f(location, value as number);\n          }\n          break;\n        case 'int':\n          if (arrayLength) {\n            gl.uniform1iv(location, value as number[]);\n          } else {\n            gl.uniform1i(location, value as number);\n          }\n          break;\n        default:\n          throw new Error(`Uniform not implemented: ${type}`);\n      }\n    }\n  }\n  bindTexture(td: TextureData, uniformHandle: WebGLUniformLocation, position: number): void {\n    this.glContext.bindTextureToUniform(td.texture, position, uniformHandle);\n  }\n  getAttribLocations(program: WebGLProgram): Artifact.AttribLocations {\n    return {\n      position: this.getAttribLocation(program, 'position'),\n      textureCoord: this.getAttribLocation(program, 'textureCoord'),\n    };\n  }\n  getUniformLocations(\n    program: WebGLProgram,\n    samplers?: string[],\n    variables?: VariableInfo[],\n  ): Artifact.UniformLocations {\n    const uniformLocations: Artifact.UniformLocations = [];\n    if (samplers) {\n      for (const sampler of samplers) {\n        uniformLocations.push({\n          name: sampler,\n          type: 'sampler2D',\n          location: this.getUniformLocation(program, sampler),\n        });\n      }\n    }\n    if (variables) {\n      for (const variable of variables) {\n        uniformLocations.push({ ...variable, location: this.getUniformLocation(program, variable.name) });\n      }\n    }\n    return uniformLocations;\n  }\n  getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation {\n    const gl = this.glContext.gl;\n    const reference = gl.getUniformLocation(program, name);\n    if (reference === null) {\n      throw new Error(`Uniform ${name} not found.`);\n    }\n    return reference;\n  }\n  getAttribLocation(program: WebGLProgram, name: string): number {\n    const gl = this.glContext.gl;\n    const attributeLocation: number = gl.getAttribLocation(program, name);\n    return attributeLocation;\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Logger, Profiler } from '../../instrument';\nimport { Tensor } from '../../tensor';\n\nimport { Encoder, EncoderUsage } from './texture-data-encoder';\nimport { TextureLayoutStrategy } from './texture-layout-strategy';\nimport { TextureData, TextureLayout } from './types';\nimport { WebGLContext } from './webgl-context';\n\nexport interface TextureManagerConfig {\n  reuseTextures?: boolean;\n}\n\n/**\n * TextureManager is the mainly responsible for caching Textures\n * Textures are cached in 2 levels:\n *   1. the texures which are associated with a dataId (from Tensor)\n *    Caching these is crucial to performance. These are In-use Textures\n *   2. textures which are not in use by any current ProgramInfo/Tensor\n *     These are called Free Textures\n * TextureManager is also used to help creating textures. For this it\n * uses WebGLContext and TextureLayoutStrategy\n */\nexport class TextureManager {\n  private readonly inUseTextures: Map<string, WebGLTexture[]>;\n  private readonly idleTextures: Map<string, WebGLTexture[]>;\n  private readonly textureLookup: Map<WebGLTexture, string>;\n  private readonly pendingRead: Map<Tensor.Id, Array<(arr: Tensor.NumberType) => void>> = new Map();\n\n  constructor(\n    public glContext: WebGLContext,\n    public layoutStrategy: TextureLayoutStrategy,\n    public profiler: Readonly<Profiler>,\n    private config: TextureManagerConfig,\n  ) {\n    if (config.reuseTextures) {\n      this.inUseTextures = new Map();\n      this.idleTextures = new Map();\n      this.textureLookup = new Map();\n    }\n  }\n  createTextureFromLayout(\n    dataType: Tensor.DataType,\n    layout: TextureLayout,\n    data?: Tensor.NumberType,\n    usage?: EncoderUsage,\n  ) {\n    const textureDataType = this.toEncoderType(dataType);\n\n    const encoder = this.glContext.getEncoder(textureDataType, layout.channels || 1, usage);\n    if (layout.isPacked && usage === EncoderUsage.UploadOnly) {\n      throw new Error('not implemented');\n    }\n    const width = layout.width;\n    const height = layout.height;\n\n    let key: string | undefined;\n    let inUseTextures: WebGLTexture[] | undefined;\n    if (this.config.reuseTextures) {\n      key = `${width}x${height}_${encoder.format}_${encoder.internalFormat}_${encoder.textureType}`;\n      inUseTextures = this.inUseTextures.get(key);\n      if (!inUseTextures) {\n        inUseTextures = [];\n        this.inUseTextures.set(key, inUseTextures);\n      }\n\n      const idleTextures = this.idleTextures.get(key);\n      if (idleTextures && idleTextures.length > 0) {\n        const texture = idleTextures.pop()!;\n        inUseTextures.push(texture);\n        if (usage === EncoderUsage.UploadOnly) {\n          this.glContext.updateTexture(texture, width, height, encoder, this.toTextureData(dataType, data)!);\n        }\n        return texture;\n      }\n    }\n\n    Logger.verbose('TextureManager', `Creating new texture of size ${layout.width}x${layout.height}`);\n    const texture = this.glContext.allocateTexture(width, height, encoder, this.toTextureData(dataType, data));\n\n    if (this.config.reuseTextures) {\n      inUseTextures!.push(texture);\n      this.textureLookup.set(texture, key!);\n    }\n    return texture;\n  }\n  readTexture(td: TextureData, dataType: Tensor.DataType, channels?: number): Tensor.NumberType {\n    if (!channels) {\n      channels = 1;\n    }\n    return this.profiler.event('backend', 'TextureManager.readTexture', () => {\n      const dataSize = td.shape.reduce((a, b) => a * b) * channels!;\n      const data = this.glContext.readTexture(\n        td.texture,\n        td.width,\n        td.height,\n        dataSize,\n        this.toEncoderType(dataType),\n        channels!,\n      );\n      return this.toTensorData(dataType, data);\n    });\n  }\n  async readTextureAsync(td: TextureData, dataType: Tensor.DataType, channels?: number): Promise<Tensor.NumberType> {\n    const dataId = td.tensor.dataId;\n    if (!channels) {\n      channels = 1;\n    }\n    if (this.pendingRead.has(dataId)) {\n      const subscribers = this.pendingRead.get(dataId);\n      return new Promise<Tensor.NumberType>((resolve) => subscribers?.push(resolve));\n    }\n    return this.profiler.event('backend', 'TextureManager.readTextureAsync', async () => {\n      this.pendingRead.set(dataId, []);\n      const dataSize = td.shape.reduce((a, b) => a * b) * channels!;\n      // add a fence waiting for the data to be ready\n      await this.glContext.createAndWaitForFence();\n      const data = this.glContext.readTexture(\n        td.texture,\n        td.width,\n        td.height,\n        dataSize,\n        this.toEncoderType(dataType),\n        channels!,\n      );\n      const tensorData = this.toTensorData(dataType, data);\n      const subscribers = this.pendingRead.get(dataId);\n      this.pendingRead.delete(dataId);\n      subscribers?.forEach((resolve) => resolve(tensorData));\n      return tensorData;\n    });\n  }\n  readUint8TextureAsFloat(td: TextureData): Float32Array {\n    return this.profiler.event('backend', 'TextureManager.readUint8TextureAsFloat', () => {\n      const dataSize = td.shape.reduce((a, b) => a * b);\n      const data = this.glContext.readTexture(td.texture, td.width, td.height, dataSize * 4, 'byte', 4);\n      return new Float32Array(data.buffer, data.byteOffset, dataSize);\n    });\n  }\n  releaseTexture(textureData: TextureData, deleteTexture?: boolean): void {\n    let key: string | undefined;\n    if (this.config.reuseTextures) {\n      key = this.textureLookup.get(textureData.texture);\n      if (key) {\n        if (deleteTexture) {\n          this.textureLookup.delete(key);\n        }\n        const inUseTextures = this.inUseTextures.get(key);\n        if (inUseTextures) {\n          const index = inUseTextures.indexOf(textureData.texture);\n          if (index !== -1) {\n            inUseTextures.splice(index, 1);\n            let idleTextures = this.idleTextures.get(key);\n            if (!idleTextures) {\n              idleTextures = [];\n              this.idleTextures.set(key, idleTextures);\n            }\n            idleTextures.push(textureData.texture);\n          }\n        }\n      }\n    }\n\n    if (!key || deleteTexture) {\n      Logger.verbose('TextureManager', `Deleting texture of size ${textureData.width}x${textureData.height}`);\n      this.glContext.deleteTexture(textureData.texture);\n    }\n  }\n  toTensorData(dataType: Tensor.DataType, data: Encoder.DataArrayType): Tensor.NumberType {\n    switch (dataType) {\n      case 'int16':\n        return data instanceof Int16Array ? data : Int16Array.from(data);\n      case 'int32':\n        return data instanceof Int32Array ? data : Int32Array.from(data);\n      case 'int8':\n        return data instanceof Int8Array ? data : Int8Array.from(data);\n      case 'uint16':\n        return data instanceof Uint16Array ? data : Uint16Array.from(data);\n      case 'uint32':\n        return data instanceof Uint32Array ? data : Uint32Array.from(data);\n      case 'uint8':\n      case 'bool':\n        return data instanceof Uint8Array ? data : Uint8Array.from(data);\n      case 'float32':\n        return data instanceof Float32Array ? data : Float32Array.from(data);\n      case 'float64':\n        return data instanceof Float64Array ? data : Float64Array.from(data);\n      default:\n        throw new Error(`TensorData type ${dataType} is not supported`);\n    }\n  }\n  toTextureData(_dataType: Tensor.DataType, data: Tensor.NumberType | undefined): Encoder.DataArrayType | undefined {\n    if (!data) {\n      return undefined;\n    }\n    return data instanceof Float32Array ? data : new Float32Array(data);\n    /*\n    switch (dataType) {\n      case 'int16':\n      case 'int32':\n      case 'uint16':\n      case 'uint32':\n        return (data.constructor === Uint32Array) ? data as Uint32Array : new Uint32Array(data);\n      case 'int8':\n      case 'uint8':\n      case 'bool':\n        return (data.constructor === Uint8Array) ? data as Uint8Array : new Uint8Array(data);\n      case 'float32':\n      case 'float64':\n        return (data.constructor === Float32Array) ? data as Float32Array : new Float32Array(data);\n      default:\n        throw new Error(`TensorData type ${dataType} is not supported`);\n    }\n    */\n  }\n  toEncoderType(_dataType: Tensor.DataType): Encoder.DataType {\n    return 'float';\n    // switch (dataType) {\n    //   case 'int16':\n    //   case 'int32':\n    //   case 'uint16':\n    //   case 'uint32':\n    //     return 'int';\n    //   case 'uint8':\n    //   case 'bool':\n    //     return 'byte';\n    //   case 'float32':\n    //   case 'float64':\n    //     return 'float';\n    //   default:\n    //     throw new Error(`TensorData type ${dataType} is not supported`);\n    // }\n  }\n  clearActiveTextures(): void {\n    this.glContext.clearActiveTextures();\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { SessionHandler } from '../../backend';\nimport { Graph } from '../../graph';\nimport { Logger } from '../../instrument';\nimport { Operator } from '../../operators';\nimport { OpSet, resolveOperator } from '../../opset';\nimport { Session } from '../../session';\nimport { Tensor } from '../../tensor';\nimport { WebGLBackend } from '../backend-webgl';\n\nimport { WebGLInferenceHandler } from './inference-handler';\nimport { WEBGL_OP_RESOLVE_RULES } from './op-resolve-rules';\nimport { ProgramManager } from './program-manager';\nimport { PreferLogicalStrategy, TextureLayoutStrategy } from './texture-layout-strategy';\nimport { TextureManager } from './texture-manager';\nimport { TextureData } from './types';\n\nexport class WebGLSessionHandler implements SessionHandler {\n  programManager: ProgramManager;\n  textureManager: TextureManager;\n  layoutStrategy: TextureLayoutStrategy;\n  packedTextureDataCache: Map<Tensor.Id, TextureData>;\n  unpackedTextureDataCache: Map<Tensor.Id, TextureData>;\n  pack2unpackMap: Map<Tensor.Id, Tensor.Id>;\n  unpack2packMap: Map<Tensor.Id, Tensor.Id>;\n  initializers: Set<Tensor.Id>;\n  pack?: boolean;\n\n  constructor(\n    public readonly backend: WebGLBackend,\n    public readonly context: Session.Context,\n  ) {\n    this.layoutStrategy = new PreferLogicalStrategy(backend.glContext.maxTextureSize);\n    this.programManager = new ProgramManager(this.context.profiler, backend.glContext, this.layoutStrategy);\n    this.textureManager = new TextureManager(backend.glContext, this.layoutStrategy, this.context.profiler, {\n      reuseTextures: backend.textureCacheMode === 'full',\n    });\n    this.packedTextureDataCache = new Map();\n    this.unpackedTextureDataCache = new Map();\n    this.pack = backend.pack;\n    this.pack2unpackMap = new Map();\n    this.unpack2packMap = new Map();\n  }\n\n  createInferenceHandler() {\n    return new WebGLInferenceHandler(this);\n  }\n  onGraphInitialized(graph: Graph): void {\n    const initializers = graph\n      .getValues()\n      .filter((v) => v.from === -1 && v.tensor)\n      .map((v) => v.tensor!.dataId);\n    this.initializers = new Set(initializers);\n  }\n  isInitializer(tensorId: Tensor.Id): boolean {\n    return this.initializers ? this.initializers.has(tensorId) : false;\n  }\n  addInitializer(tensorId: Tensor.Id): void {\n    this.initializers.add(tensorId);\n  }\n  getTextureData(tensorId: Tensor.Id, isPacked: boolean): TextureData | undefined {\n    if (isPacked) {\n      return this.packedTextureDataCache.get(tensorId);\n    } else {\n      return this.unpackedTextureDataCache.get(tensorId);\n    }\n  }\n  setTextureData(tensorId: Tensor.Id, textureData: TextureData, isPacked = false): void {\n    Logger.verbose('WebGLSessionHandler', 'Storing Texture data in cache');\n    if (isPacked) {\n      this.packedTextureDataCache.set(tensorId, textureData);\n    } else {\n      this.unpackedTextureDataCache.set(tensorId, textureData);\n    }\n  }\n  dispose(): void {\n    this.programManager.dispose();\n    this.textureManager.clearActiveTextures();\n    this.packedTextureDataCache.forEach((td) => this.textureManager.releaseTexture(td, true));\n    this.packedTextureDataCache = new Map();\n    this.unpackedTextureDataCache.forEach((td) => this.textureManager.releaseTexture(td, true));\n    this.unpackedTextureDataCache = new Map();\n  }\n  resolve(node: Graph.Node, opsets: readonly OpSet[], graph: Graph): Operator {\n    const op = resolveOperator(node, opsets, WEBGL_OP_RESOLVE_RULES);\n    return { impl: op.opImpl, context: op.opInit ? op.opInit(node, graph) : node };\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { env } from 'onnxruntime-common';\n\nimport * as DataEncoders from './texture-data-encoder';\nimport { DataEncoder, Encoder, EncoderUsage } from './texture-data-encoder';\nimport { repeatedTry } from './utils';\n\nexport interface FenceContext {\n  query: WebGLSync | null;\n  isFencePassed(): boolean;\n}\n\ntype PollItem = {\n  isDoneFn: () => boolean;\n  resolveFn: () => void;\n};\n\nexport function linearSearchLastTrue(arr: Array<() => boolean>): number {\n  let i = 0;\n  for (; i < arr.length; ++i) {\n    const isDone = arr[i]();\n    if (!isDone) {\n      break;\n    }\n  }\n  return i - 1;\n}\n\n/**\n * Abstraction and wrapper around WebGLRenderingContext and its operations\n */\nexport class WebGLContext {\n  gl: WebGLRenderingContext;\n  version: 1 | 2;\n\n  private vertexbuffer: WebGLBuffer;\n  private framebuffer: WebGLFramebuffer;\n\n  // WebGL flags and vital parameters\n  private isFloatTextureAttachableToFrameBuffer: boolean;\n  isFloat32DownloadSupported: boolean;\n  isRenderFloat32Supported: boolean;\n  isBlendSupported: boolean;\n  maxTextureSize: number;\n  // private maxCombinedTextureImageUnits: number;\n  private maxTextureImageUnits: number;\n  // private maxCubeMapTextureSize: number;\n  // private shadingLanguageVersion: string;\n  // private webglVendor: string;\n  // private webglVersion: string;\n\n  // WebGL2 flags and vital parameters\n  // private max3DTextureSize: number;\n  // private maxArrayTextureLayers: number;\n  // private maxColorAttachments: number;\n  // private maxDrawBuffers: number;\n\n  // WebGL extensions\n  // eslint-disable-next-line camelcase\n  textureFloatExtension: OES_texture_float | null;\n  // eslint-disable-next-line camelcase\n  textureHalfFloatExtension: OES_texture_half_float | null;\n\n  // WebGL2 extensions\n  colorBufferFloatExtension: unknown | null;\n  // eslint-disable-next-line @typescript-eslint/naming-convention\n  disjointTimerQueryWebgl2Extension: { TIME_ELAPSED_EXT: GLenum; GPU_DISJOINT_EXT: GLenum } | null;\n\n  private disposed: boolean;\n  private frameBufferBound = false;\n\n  constructor(gl: WebGLRenderingContext, version: 1 | 2) {\n    this.gl = gl;\n    this.version = version;\n\n    this.getExtensions();\n    this.vertexbuffer = this.createVertexbuffer();\n    this.framebuffer = this.createFramebuffer();\n    this.queryVitalParameters();\n  }\n\n  allocateTexture(width: number, height: number, encoder: DataEncoder, data?: Encoder.DataArrayType): WebGLTexture {\n    const gl = this.gl;\n    // create the texture\n    const texture = gl.createTexture();\n    // bind the texture so the following methods effect this texture.\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    const buffer = data ? encoder.encode(data, width * height) : null;\n    gl.texImage2D(\n      gl.TEXTURE_2D,\n      0, // Level of detail.\n      encoder.internalFormat,\n      width,\n      height,\n      0, // Always 0 in OpenGL ES.\n      encoder.format,\n      encoder.textureType,\n      buffer,\n    );\n    this.checkError();\n    return texture as WebGLTexture;\n  }\n  updateTexture(\n    texture: WebGLTexture,\n    width: number,\n    height: number,\n    encoder: DataEncoder,\n    data: Encoder.DataArrayType,\n  ): void {\n    const gl = this.gl;\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    const buffer = encoder.encode(data, width * height);\n    gl.texSubImage2D(\n      gl.TEXTURE_2D,\n      0, // level\n      0, // xoffset\n      0, // yoffset\n      width,\n      height,\n      encoder.format,\n      encoder.textureType,\n      buffer,\n    );\n    this.checkError();\n  }\n  attachFramebuffer(texture: WebGLTexture, width: number, height: number): void {\n    const gl = this.gl;\n    // Make it the target for framebuffer operations - including rendering.\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); // 0, we aren't using MIPMAPs\n    this.checkError();\n    gl.viewport(0, 0, width, height);\n    gl.scissor(0, 0, width, height);\n  }\n  readTexture(\n    texture: WebGLTexture,\n    width: number,\n    height: number,\n    dataSize: number,\n    dataType: Encoder.DataType,\n    channels: number,\n  ): Encoder.DataArrayType {\n    const gl = this.gl;\n    if (!channels) {\n      channels = 1;\n    }\n    if (!this.frameBufferBound) {\n      this.attachFramebuffer(texture, width, height);\n    }\n    const encoder = this.getEncoder(dataType, channels);\n    const buffer = encoder.allocate(width * height);\n    // bind texture to framebuffer\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); // 0, we aren't using MIPMAPs\n    // TODO: Check if framebuffer is ready\n    gl.readPixels(0, 0, width, height, gl.RGBA, encoder.textureType, buffer);\n    this.checkError();\n    // unbind FB\n    return encoder.decode(buffer, dataSize);\n  }\n\n  isFramebufferReady(): boolean {\n    // TODO: Implement logic to check if the framebuffer is ready\n    return true;\n  }\n  getActiveTexture(): string {\n    const gl = this.gl;\n    const n = gl.getParameter(this.gl.ACTIVE_TEXTURE);\n    return `TEXTURE${n - gl.TEXTURE0}`;\n  }\n  getTextureBinding(): WebGLTexture {\n    return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D);\n  }\n  getFramebufferBinding(): WebGLFramebuffer {\n    return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING);\n  }\n  setVertexAttributes(positionHandle: number, textureCoordHandle: number): void {\n    const gl = this.gl;\n    gl.vertexAttribPointer(positionHandle, 3, gl.FLOAT, false, 20, 0);\n    gl.enableVertexAttribArray(positionHandle);\n    if (textureCoordHandle !== -1) {\n      gl.vertexAttribPointer(textureCoordHandle, 2, gl.FLOAT, false, 20, 12);\n      gl.enableVertexAttribArray(textureCoordHandle);\n    }\n    this.checkError();\n  }\n  createProgram(vertexShader: WebGLShader, fragShader: WebGLShader): WebGLProgram {\n    const gl = this.gl;\n    const program = gl.createProgram()!;\n\n    // the program consists of our shaders\n    gl.attachShader(program, vertexShader);\n    gl.attachShader(program, fragShader);\n    gl.linkProgram(program);\n    return program;\n  }\n  compileShader(shaderSource: string, shaderType: number): WebGLShader {\n    const gl = this.gl;\n    const shader = gl.createShader(shaderType);\n    if (!shader) {\n      throw new Error(`createShader() returned null with type ${shaderType}`);\n    }\n\n    gl.shaderSource(shader, shaderSource);\n    gl.compileShader(shader);\n    if (gl.getShaderParameter(shader, gl.COMPILE_STATUS) === false) {\n      throw new Error(`Failed to compile shader: ${gl.getShaderInfoLog(shader)}\nShader source:\n${shaderSource}`);\n    }\n    return shader;\n  }\n  deleteShader(shader: WebGLShader): void {\n    this.gl.deleteShader(shader);\n  }\n  bindTextureToUniform(texture: WebGLTexture, position: number, uniformHandle: WebGLUniformLocation): void {\n    const gl = this.gl;\n    gl.activeTexture(gl.TEXTURE0 + position);\n    this.checkError();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    this.checkError();\n    gl.uniform1i(uniformHandle, position);\n    this.checkError();\n  }\n  draw(): void {\n    this.gl.drawArrays(this.gl.TRIANGLE_STRIP, 0, 4);\n    this.checkError();\n  }\n  checkError(): void {\n    if (env.debug) {\n      const gl = this.gl;\n      const error = gl.getError();\n      let label = '';\n      switch (error) {\n        case gl.NO_ERROR:\n          return;\n        case gl.INVALID_ENUM:\n          label = 'INVALID_ENUM';\n          break;\n        case gl.INVALID_VALUE:\n          label = 'INVALID_VALUE';\n          break;\n        case gl.INVALID_OPERATION:\n          label = 'INVALID_OPERATION';\n          break;\n        case gl.INVALID_FRAMEBUFFER_OPERATION:\n          label = 'INVALID_FRAMEBUFFER_OPERATION';\n          break;\n        case gl.OUT_OF_MEMORY:\n          label = 'OUT_OF_MEMORY';\n          break;\n        case gl.CONTEXT_LOST_WEBGL:\n          label = 'CONTEXT_LOST_WEBGL';\n          break;\n        default:\n          label = `Unknown WebGL Error: ${error.toString(16)}`;\n      }\n      throw new Error(label);\n    }\n  }\n  deleteTexture(texture: WebGLTexture): void {\n    this.gl.deleteTexture(texture);\n  }\n  deleteProgram(program: WebGLProgram): void {\n    this.gl.deleteProgram(program);\n  }\n  getEncoder(dataType: Encoder.DataType, channels: number, usage: EncoderUsage = EncoderUsage.Default): DataEncoder {\n    if (this.version === 2) {\n      return new DataEncoders.RedFloat32DataEncoder(this.gl as WebGL2RenderingContext, channels);\n    }\n\n    switch (dataType) {\n      case 'float':\n        if (usage === EncoderUsage.UploadOnly || this.isRenderFloat32Supported) {\n          return new DataEncoders.RGBAFloatDataEncoder(this.gl, channels);\n        } else {\n          return new DataEncoders.RGBAFloatDataEncoder(\n            this.gl,\n            channels,\n            this.textureHalfFloatExtension!.HALF_FLOAT_OES,\n          );\n        }\n      case 'int':\n        throw new Error('not implemented');\n      case 'byte':\n        return new DataEncoders.Uint8DataEncoder(this.gl, channels);\n      default:\n        throw new Error(`Invalid dataType: ${dataType}`);\n    }\n  }\n  clearActiveTextures(): void {\n    const gl = this.gl;\n    for (let unit = 0; unit < this.maxTextureImageUnits; ++unit) {\n      gl.activeTexture(gl.TEXTURE0 + unit);\n      gl.bindTexture(gl.TEXTURE_2D, null);\n    }\n  }\n  dispose(): void {\n    if (this.disposed) {\n      return;\n    }\n    const gl = this.gl;\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n    gl.deleteFramebuffer(this.framebuffer);\n    gl.bindBuffer(gl.ARRAY_BUFFER, null);\n    gl.deleteBuffer(this.vertexbuffer);\n    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n    gl.finish();\n    this.disposed = true;\n  }\n\n  private createDefaultGeometry(): Float32Array {\n    // Sets of x,y,z(=0),s,t coordinates.\n    return new Float32Array([\n      -1.0,\n      1.0,\n      0.0,\n      0.0,\n      1.0, // upper left\n      -1.0,\n      -1.0,\n      0.0,\n      0.0,\n      0.0, // lower left\n      1.0,\n      1.0,\n      0.0,\n      1.0,\n      1.0, // upper right\n      1.0,\n      -1.0,\n      0.0,\n      1.0,\n      0.0, // lower right\n    ]);\n  }\n  private createVertexbuffer(): WebGLBuffer {\n    const gl = this.gl;\n    const buffer = gl.createBuffer();\n    if (!buffer) {\n      throw new Error('createBuffer() returned null');\n    }\n    const geometry = this.createDefaultGeometry();\n    gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n    gl.bufferData(gl.ARRAY_BUFFER, geometry, gl.STATIC_DRAW);\n    this.checkError();\n    return buffer;\n  }\n  private createFramebuffer(): WebGLFramebuffer {\n    const fb = this.gl.createFramebuffer();\n    if (!fb) {\n      throw new Error('createFramebuffer returned null');\n    }\n    return fb;\n  }\n\n  private queryVitalParameters(): void {\n    const gl = this.gl;\n\n    this.isFloatTextureAttachableToFrameBuffer = this.checkFloatTextureAttachableToFrameBuffer();\n    this.isRenderFloat32Supported = this.checkRenderFloat32();\n    this.isFloat32DownloadSupported = this.checkFloat32Download();\n\n    if (this.version === 1 && !this.textureHalfFloatExtension && !this.isRenderFloat32Supported) {\n      throw new Error('both float32 and float16 TextureType are not supported');\n    }\n\n    this.isBlendSupported = !this.isRenderFloat32Supported || this.checkFloat32Blend();\n\n    // this.maxCombinedTextureImageUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n    this.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n    this.maxTextureImageUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n    // this.maxCubeMapTextureSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n    // this.shadingLanguageVersion = gl.getParameter(gl.SHADING_LANGUAGE_VERSION);\n    // this.webglVendor = gl.getParameter(gl.VENDOR);\n    // this.webglVersion = gl.getParameter(gl.VERSION);\n\n    if (this.version === 2) {\n      // this.max3DTextureSize = gl.getParameter(WebGL2RenderingContext.MAX_3D_TEXTURE_SIZE);\n      // this.maxArrayTextureLayers = gl.getParameter(WebGL2RenderingContext.MAX_ARRAY_TEXTURE_LAYERS);\n      // this.maxColorAttachments = gl.getParameter(WebGL2RenderingContext.MAX_COLOR_ATTACHMENTS);\n      // this.maxDrawBuffers = gl.getParameter(WebGL2RenderingContext.MAX_DRAW_BUFFERS);\n    }\n  }\n  private getExtensions(): void {\n    if (this.version === 2) {\n      this.colorBufferFloatExtension = this.gl.getExtension('EXT_color_buffer_float');\n      this.disjointTimerQueryWebgl2Extension = this.gl.getExtension('EXT_disjoint_timer_query_webgl2');\n    } else {\n      this.textureFloatExtension = this.gl.getExtension('OES_texture_float');\n      this.textureHalfFloatExtension = this.gl.getExtension('OES_texture_half_float');\n    }\n  }\n\n  private checkFloatTextureAttachableToFrameBuffer(): boolean {\n    // test whether Float32 texture is supported:\n    // STEP.1 create a float texture\n    const gl = this.gl;\n    const texture = gl.createTexture();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    // eslint-disable-next-line @typescript-eslint/naming-convention\n    const internalFormat = this.version === 2 ? (gl as unknown as { RGBA32F: number }).RGBA32F : gl.RGBA;\n    gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n    // STEP.2 bind a frame buffer\n    const frameBuffer = gl.createFramebuffer();\n    gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n    // STEP.3 attach texture to framebuffer\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n    // STEP.4 test whether framebuffer is complete\n    const isComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;\n    gl.bindTexture(gl.TEXTURE_2D, null);\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n    gl.deleteTexture(texture);\n    gl.deleteFramebuffer(frameBuffer);\n    return isComplete;\n  }\n\n  private checkRenderFloat32(): boolean {\n    if (this.version === 2) {\n      if (!this.colorBufferFloatExtension) {\n        return false;\n      }\n    } else {\n      if (!this.textureFloatExtension) {\n        return false;\n      }\n    }\n    return this.isFloatTextureAttachableToFrameBuffer;\n  }\n\n  private checkFloat32Download(): boolean {\n    if (this.version === 2) {\n      if (!this.colorBufferFloatExtension) {\n        return false;\n      }\n    } else {\n      if (!this.textureFloatExtension) {\n        return false;\n      }\n      if (!this.gl.getExtension('WEBGL_color_buffer_float')) {\n        return false;\n      }\n    }\n    return this.isFloatTextureAttachableToFrameBuffer;\n  }\n\n  /**\n   * Check whether GL_BLEND is supported\n   */\n  private checkFloat32Blend(): boolean {\n    // it looks like currently (2019-05-08) there is no easy way to detect whether BLEND is supported\n    // https://github.com/microsoft/onnxjs/issues/145\n\n    const gl = this.gl;\n\n    let texture: WebGLTexture | null | undefined;\n    let frameBuffer: WebGLFramebuffer | null | undefined;\n    let vertexShader: WebGLShader | null | undefined;\n    let fragmentShader: WebGLShader | null | undefined;\n    let program: WebGLProgram | null | undefined;\n\n    try {\n      texture = gl.createTexture();\n      frameBuffer = gl.createFramebuffer();\n      gl.bindTexture(gl.TEXTURE_2D, texture);\n\n      // eslint-disable-next-line @typescript-eslint/naming-convention\n      const internalFormat = this.version === 2 ? (gl as unknown as { RGBA32F: number }).RGBA32F : gl.RGBA;\n      gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);\n\n      gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n      gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n      gl.enable(gl.BLEND);\n\n      vertexShader = gl.createShader(gl.VERTEX_SHADER);\n      if (!vertexShader) {\n        return false;\n      }\n      gl.shaderSource(vertexShader, 'void main(){}');\n      gl.compileShader(vertexShader);\n\n      fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n      if (!fragmentShader) {\n        return false;\n      }\n      gl.shaderSource(fragmentShader, 'precision highp float;void main(){gl_FragColor=vec4(0.5);}');\n      gl.compileShader(fragmentShader);\n\n      program = gl.createProgram();\n      if (!program) {\n        return false;\n      }\n      gl.attachShader(program, vertexShader);\n      gl.attachShader(program, fragmentShader);\n      gl.linkProgram(program);\n      gl.useProgram(program);\n\n      gl.drawArrays(gl.POINTS, 0, 1);\n      return gl.getError() === gl.NO_ERROR;\n    } finally {\n      gl.disable(gl.BLEND);\n\n      if (program) {\n        gl.deleteProgram(program);\n      }\n      if (vertexShader) {\n        gl.deleteShader(vertexShader);\n      }\n      if (fragmentShader) {\n        gl.deleteShader(fragmentShader);\n      }\n      if (frameBuffer) {\n        gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n        gl.deleteFramebuffer(frameBuffer);\n      }\n      if (texture) {\n        gl.bindTexture(gl.TEXTURE_2D, null);\n        gl.deleteTexture(texture);\n      }\n    }\n  }\n\n  beginTimer(): WebGLQuery {\n    if (this.version === 2 && this.disjointTimerQueryWebgl2Extension) {\n      const gl2 = this.gl as WebGL2RenderingContext;\n      const ext = this.disjointTimerQueryWebgl2Extension;\n\n      const query = gl2.createQuery() as WebGLQuery;\n      gl2.beginQuery(ext.TIME_ELAPSED_EXT, query);\n      return query;\n    } else {\n      // TODO: add webgl 1 handling.\n      throw new Error('WebGL1 profiling currently not supported.');\n    }\n  }\n\n  endTimer() {\n    if (this.version === 2 && this.disjointTimerQueryWebgl2Extension) {\n      const gl2 = this.gl as WebGL2RenderingContext;\n      const ext = this.disjointTimerQueryWebgl2Extension;\n      gl2.endQuery(ext.TIME_ELAPSED_EXT);\n      return;\n    } else {\n      // TODO: add webgl 1 handling.\n      throw new Error('WebGL1 profiling currently not supported');\n    }\n  }\n\n  isTimerResultAvailable(query: WebGLQuery): boolean {\n    let available = false,\n      disjoint = false;\n    if (this.version === 2 && this.disjointTimerQueryWebgl2Extension) {\n      const gl2 = this.gl as WebGL2RenderingContext;\n      const ext = this.disjointTimerQueryWebgl2Extension;\n\n      available = gl2.getQueryParameter(query, gl2.QUERY_RESULT_AVAILABLE);\n      disjoint = gl2.getParameter(ext.GPU_DISJOINT_EXT);\n    } else {\n      // TODO: add webgl 1 handling.\n      throw new Error('WebGL1 profiling currently not supported');\n    }\n\n    return available && !disjoint;\n  }\n\n  getTimerResult(query: WebGLQuery): number {\n    let timeElapsed = 0;\n    if (this.version === 2) {\n      const gl2 = this.gl as WebGL2RenderingContext;\n      timeElapsed = gl2.getQueryParameter(query, gl2.QUERY_RESULT);\n      gl2.deleteQuery(query);\n    } else {\n      // TODO: add webgl 1 handling.\n      throw new Error('WebGL1 profiling currently not supported');\n    }\n    // return miliseconds\n    return timeElapsed / 1000000;\n  }\n\n  async waitForQueryAndGetTime(query: WebGLQuery): Promise<number> {\n    await repeatedTry(() => this.isTimerResultAvailable(query));\n    return this.getTimerResult(query);\n  }\n\n  public async createAndWaitForFence(): Promise<void> {\n    const fenceContext = this.createFence(this.gl);\n    return this.pollFence(fenceContext);\n  }\n\n  private createFence(gl: WebGLRenderingContext): FenceContext {\n    let isFencePassed: () => boolean;\n    const gl2 = gl as WebGL2RenderingContext;\n    const query = gl2.fenceSync(gl2.SYNC_GPU_COMMANDS_COMPLETE, 0);\n    gl.flush();\n    if (query === null) {\n      isFencePassed = () => true;\n    } else {\n      isFencePassed = () => {\n        const status = gl2.clientWaitSync(query, 0, 0);\n        return status === gl2.ALREADY_SIGNALED || status === gl2.CONDITION_SATISFIED;\n      };\n    }\n    return { query, isFencePassed };\n  }\n\n  async pollFence(fenceContext: FenceContext) {\n    return new Promise<void>((resolve) => {\n      void this.addItemToPoll(\n        () => fenceContext.isFencePassed(),\n        () => resolve(),\n      );\n    });\n  }\n\n  private itemsToPoll: PollItem[] = [];\n\n  pollItems(): void {\n    // Find the last query that has finished.\n    const index = linearSearchLastTrue(this.itemsToPoll.map((x) => x.isDoneFn));\n    for (let i = 0; i <= index; ++i) {\n      const { resolveFn } = this.itemsToPoll[i];\n      resolveFn();\n    }\n    this.itemsToPoll = this.itemsToPoll.slice(index + 1);\n  }\n\n  private async addItemToPoll(isDoneFn: () => boolean, resolveFn: () => void) {\n    this.itemsToPoll.push({ isDoneFn, resolveFn });\n    if (this.itemsToPoll.length > 1) {\n      // We already have a running loop that polls.\n      return;\n    }\n    // Start a new loop that polls.\n    await repeatedTry(() => {\n      this.pollItems();\n      // End the loop if no more items to poll.\n      return this.itemsToPoll.length === 0;\n    });\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Logger } from '../../instrument';\n\nimport { WebGLContext } from './webgl-context';\n\nconst cache: { [contextId: string]: WebGLContext } = {};\n\n/**\n * This factory function creates proper WebGLRenderingContext based on\n * the current browsers capabilities\n * The order is from higher/most recent versions to most basic\n */\nexport function createWebGLContext(contextId?: 'webgl' | 'webgl2'): WebGLContext {\n  let context: WebGLContext | undefined;\n  if ((!contextId || contextId === 'webgl2') && 'webgl2' in cache) {\n    context = cache.webgl2;\n  } else if ((!contextId || contextId === 'webgl') && 'webgl' in cache) {\n    context = cache.webgl;\n  }\n\n  if (!context) {\n    try {\n      // try to create webgl context from an offscreen canvas\n      const offscreenCanvas = createOffscreenCanvas();\n      context = createNewWebGLContext(offscreenCanvas, contextId);\n    } catch (e) {\n      // if failed, fallback to try to use a normal canvas element\n      const canvas = createCanvas();\n      context = createNewWebGLContext(canvas, contextId);\n    }\n  }\n\n  contextId = contextId || context.version === 1 ? 'webgl' : 'webgl2';\n  const gl = context.gl;\n\n  cache[contextId] = context;\n\n  if (gl.isContextLost()) {\n    delete cache[contextId];\n    return createWebGLContext(contextId);\n  }\n\n  gl.disable(gl.DEPTH_TEST);\n  gl.disable(gl.STENCIL_TEST);\n  gl.disable(gl.BLEND);\n  gl.disable(gl.DITHER);\n  gl.disable(gl.POLYGON_OFFSET_FILL);\n  gl.disable(gl.SAMPLE_COVERAGE);\n  gl.enable(gl.SCISSOR_TEST);\n  gl.enable(gl.CULL_FACE);\n  gl.cullFace(gl.BACK);\n\n  return context;\n}\n\nexport function createNewWebGLContext(canvas: HTMLCanvasElement, contextId?: 'webgl' | 'webgl2'): WebGLContext {\n  const contextAttributes: WebGLContextAttributes = {\n    alpha: false,\n    depth: false,\n    antialias: false,\n    stencil: false,\n    preserveDrawingBuffer: false,\n    premultipliedAlpha: false,\n    failIfMajorPerformanceCaveat: false,\n  };\n  let gl: WebGLRenderingContext | null;\n  const ca = contextAttributes;\n  if (!contextId || contextId === 'webgl2') {\n    gl = canvas.getContext('webgl2', ca);\n    if (gl) {\n      try {\n        return new WebGLContext(gl, 2);\n      } catch (err) {\n        Logger.warning('GlContextFactory', `failed to create WebGLContext using contextId 'webgl2'. Error: ${err}`);\n      }\n    }\n  }\n  if (!contextId || contextId === 'webgl') {\n    gl = canvas.getContext('webgl', ca) || (canvas.getContext('experimental-webgl', ca) as WebGLRenderingContext);\n    if (gl) {\n      try {\n        return new WebGLContext(gl, 1);\n      } catch (err) {\n        Logger.warning(\n          'GlContextFactory',\n          `failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${err}`,\n        );\n      }\n    }\n  }\n\n  throw new Error('WebGL is not supported');\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare let OffscreenCanvas: { new (width: number, height: number): HTMLCanvasElement };\n\nfunction createCanvas(): HTMLCanvasElement {\n  if (typeof document === 'undefined') {\n    throw new TypeError('failed to create canvas: document is not supported');\n  }\n  const canvas: HTMLCanvasElement = document.createElement('canvas');\n  canvas.width = 1;\n  canvas.height = 1;\n  return canvas;\n}\n\nfunction createOffscreenCanvas(): HTMLCanvasElement {\n  if (typeof OffscreenCanvas === 'undefined') {\n    throw new TypeError('failed to create offscreen canvas: OffscreenCanvas is not supported');\n  }\n  return new OffscreenCanvas(1, 1);\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { env } from 'onnxruntime-common';\n\nimport { Backend, SessionHandler } from '../backend';\nimport { Logger } from '../instrument';\nimport { Session } from '../session';\n\nimport { WebGLSessionHandler } from './webgl/session-handler';\nimport { WebGLContext } from './webgl/webgl-context';\nimport { createWebGLContext } from './webgl/webgl-context-factory';\n\n/**\n * WebGLBackend is the entry point for all WebGL opeartions\n * When it starts it created the WebGLRenderingContext\n * and other main framework components such as Program and Texture Managers\n */\nexport class WebGLBackend implements Backend {\n  glContext: WebGLContext;\n\n  get contextId(): 'webgl' | 'webgl2' | undefined {\n    return env.webgl.contextId;\n  }\n  set contextId(value: 'webgl' | 'webgl2' | undefined) {\n    env.webgl.contextId = value;\n  }\n\n  get matmulMaxBatchSize(): number | undefined {\n    return env.webgl.matmulMaxBatchSize;\n  }\n  set matmulMaxBatchSize(value: number | undefined) {\n    env.webgl.matmulMaxBatchSize = value;\n  }\n\n  get textureCacheMode(): 'initializerOnly' | 'full' | undefined {\n    return env.webgl.textureCacheMode;\n  }\n  set textureCacheMode(value: 'initializerOnly' | 'full' | undefined) {\n    env.webgl.textureCacheMode = value;\n  }\n\n  get pack(): boolean | undefined {\n    return env.webgl.pack;\n  }\n  set pack(value: boolean | undefined) {\n    env.webgl.pack = value;\n  }\n\n  get async(): boolean | undefined {\n    return env.webgl.async;\n  }\n  set async(value: boolean | undefined) {\n    env.webgl.async = value;\n  }\n\n  initialize(): boolean {\n    try {\n      this.glContext = createWebGLContext(this.contextId);\n      if (typeof this.matmulMaxBatchSize !== 'number') {\n        this.matmulMaxBatchSize = 16;\n      }\n      if (typeof this.textureCacheMode !== 'string') {\n        this.textureCacheMode = 'full';\n      }\n      if (typeof this.pack !== 'boolean') {\n        this.pack = false;\n      }\n      if (typeof this.async !== 'boolean') {\n        this.async = false;\n      }\n\n      Logger.setWithEnv(env);\n\n      if (!env.webgl.context) {\n        Object.defineProperty(env.webgl, 'context', { value: this.glContext.gl });\n      }\n\n      Logger.verbose(\n        'WebGLBackend',\n        `Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${\n          this.matmulMaxBatchSize\n        }; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`,\n      );\n      return true;\n    } catch (e) {\n      Logger.warning('WebGLBackend', `Unable to initialize WebGLBackend. ${e}`);\n      return false;\n    }\n  }\n  createSessionHandler(context: Session.Context): SessionHandler {\n    return new WebGLSessionHandler(this, context);\n  }\n  dispose(): void {\n    this.glContext.dispose();\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { WebGLBackend } from './backends/backend-webgl';\nimport { Graph } from './graph';\nimport { Operator } from './operators';\nimport { OpSet } from './opset';\nimport { Session } from './session';\n\nexport interface InferenceHandler {\n  /**\n   * dispose the inference handler. it will be called as the last step in Session.run()\n   */\n  dispose(): void;\n}\n\nexport interface SessionHandler {\n  /**\n   * transform the graph at initialization time\n   * @param graphTransformer the graph transformer to manipulate the model graph\n   */\n  transformGraph?(graphTransformer: Graph.Transformer): void;\n\n  /**\n   * create an instance of InferenceHandler to use in a Session.run() call\n   */\n  createInferenceHandler(): InferenceHandler;\n\n  /**\n   * dispose the session handler. it will be called when a session is being disposed explicitly\n   */\n  dispose(): void;\n\n  /**\n   * Resolves the operator from the name and opset version; backend specific\n   * @param node the node to resolve\n   * @param opsets a list of opsets that exported from the model\n   * @param graph the completely initialized graph\n   */\n  resolve(node: Graph.Node, opsets: readonly OpSet[], graph: Graph): Operator;\n\n  /**\n   * This method let's the sessionHandler know that the graph initialization is complete\n   * @param graph the completely initialized graph\n   */\n  onGraphInitialized?(graph: Graph): void;\n\n  /**\n   * a reference to the corresponding backend\n   */\n  readonly backend: Backend;\n\n  /**\n   * a reference to the session context\n   */\n  readonly context: Session.Context;\n}\n\nexport interface Backend {\n  /**\n   * initialize the backend. will be called only once, when the first time the\n   * backend it to be used\n   */\n  initialize(): boolean | Promise<boolean>;\n\n  /**\n   * create an instance of SessionHandler to use in a Session object's lifecycle\n   */\n  createSessionHandler(context: Session.Context): SessionHandler;\n\n  /**\n   * dispose the backend. currently this will not be called\n   */\n  dispose(): void;\n}\n\n// caches all initialized backend instances\nconst backendsCache: Map<string, Backend> = new Map();\n\nexport const backend: { [name: string]: Backend } = {\n  webgl: new WebGLBackend(),\n};\n\n/**\n * Resolve a reference to the backend. If a hint is specified, the corresponding\n * backend will be used.\n */\nexport async function resolveBackend(hint?: string | readonly string[]): Promise<Backend> {\n  if (!hint) {\n    return resolveBackend(['webgl']);\n  } else {\n    const hints = typeof hint === 'string' ? [hint] : hint;\n\n    for (const backendHint of hints) {\n      const cache = backendsCache.get(backendHint);\n      if (cache) {\n        return cache;\n      }\n\n      const backend = await tryLoadBackend(backendHint);\n      if (backend) {\n        return backend;\n      }\n    }\n  }\n\n  throw new Error('no available backend to use');\n}\n\nasync function tryLoadBackend(backendHint: string): Promise<Backend | undefined> {\n  const backendObj = backend;\n\n  if (typeof backendObj[backendHint] !== 'undefined' && isBackend(backendObj[backendHint])) {\n    const backend = backendObj[backendHint];\n    let init = backend.initialize();\n    if (typeof init === 'object' && 'then' in init) {\n      init = await init;\n    }\n    if (init) {\n      backendsCache.set(backendHint, backend);\n      return backend;\n    }\n  }\n\n  return undefined;\n}\n\nfunction isBackend(obj: unknown) {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const o = obj as any;\n\n  // check if an object is a Backend instance\n  if (\n    'initialize' in o &&\n    typeof o.initialize === 'function' && // initialize()\n    'createSessionHandler' in o &&\n    typeof o.createSessionHandler === 'function' && // createSessionHandler()\n    'dispose' in o &&\n    typeof o.dispose === 'function' // dispose()\n  ) {\n    return true;\n  }\n\n  return false;\n}\n\nexport type BackendType = Backend;\nexport type SessionHandlerType = ReturnType<BackendType['createSessionHandler']>;\nexport type InferenceHandlerType = ReturnType<SessionHandlerType['createInferenceHandler']>;\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { SessionHandler } from './backend';\nimport { Graph } from './graph';\nimport { Logger, Profiler } from './instrument';\nimport { Operator } from './operators';\nimport { Tensor } from './tensor';\n\nclass KernelOp {\n  constructor(\n    public op: Operator,\n    public node: Graph.Node,\n  ) {}\n}\n\nexport class ExecutionPlan {\n  constructor(\n    private graph: Graph,\n    ops: Operator[],\n    private profiler: Readonly<Profiler>,\n  ) {\n    this.initialize(ops);\n  }\n\n  initialize(ops: Operator[]) {\n    this.profiler.event('session', 'ExecutionPlan.initialize', () => {\n      const graphNodes = this.graph.getNodes();\n      if (graphNodes.length !== ops.length) {\n        throw new Error('The size of nodes and OPs do not match.');\n      }\n\n      this._ops = ops.map((op, i) => new KernelOp(op, graphNodes[i]));\n      this.reset();\n\n      // look for starter node(s)\n      this._starter = [];\n      this._ops.forEach((op, i) => {\n        let resolved = true;\n        for (const input of op.node.inputs) {\n          if (\n            !this._values[input] && // not an initialized input\n            this.graph.getInputIndices().indexOf(input) === -1 // not model input\n          ) {\n            resolved = false;\n            break;\n          }\n        }\n        if (resolved) {\n          this._starter.push(i);\n        }\n      });\n    });\n  }\n\n  reset() {\n    this._values = this.graph.getValues().map((i) => i.tensor);\n  }\n\n  async execute(sessionHandler: SessionHandler, modelInputs: Tensor[]): Promise<Tensor[]> {\n    return this.profiler.event('session', 'ExecutionPlan.execute', async () => {\n      // reset mediem result\n      this.reset();\n\n      // create inference handler\n      const inferenceHandler = sessionHandler.createInferenceHandler();\n\n      // populate inputs value\n      const graphInputs = this.graph.getInputIndices();\n      if (modelInputs.length !== graphInputs.length) {\n        throw new Error(\n          `number of input tensors don't match the number of inputs to the model: actual: ${\n            modelInputs.length\n          } expected: ${graphInputs.length}`,\n        );\n      }\n\n      modelInputs.forEach((input, i) => {\n        const index = graphInputs[i];\n        this._values[index] = input;\n      });\n\n      // prepare running sequence\n      const sequence: number[] = this._starter.slice(0);\n\n      // execution iterations\n      const graphValues = this.graph.getValues();\n      const graphNodes = this.graph.getNodes();\n\n      let rear = 0;\n      while (rear < sequence.length) {\n        const thisOpIndex = sequence[rear++];\n        const thisOp = this._ops[thisOpIndex];\n\n        // check input\n        const inputList = thisOp.node.inputs.map((i) => this._values[i]);\n        if (inputList.indexOf(undefined) !== -1) {\n          throw new Error(`unresolved input detected: op: ${thisOp.node}`);\n        }\n\n        // run\n        const inputTensors = inputList as Tensor[];\n        Logger.verbose(\n          'ExecPlan',\n          `Running op:${thisOp.node.name} (${inputTensors\n            .map((t, i) => `'${thisOp.node.inputs[i]}': ${t.type}[${t.dims.join(',')}]`)\n            .join(', ')})`,\n        );\n\n        const outputList = await this.profiler.event('node', thisOp.node.name, async () =>\n          thisOp.op.impl(inferenceHandler, inputTensors, thisOp.op.context),\n        );\n\n        // check output\n        if (outputList.length !== thisOp.node.outputs.length) {\n          throw new Error('the size of output does not match model definition.');\n        }\n\n        // fill value\n        outputList.forEach((output, i) => {\n          const j = thisOp.node.outputs[i];\n          if (this._values[j]) {\n            throw new Error(`output [${j}] already has value: op:${thisOp.node.name}`);\n          }\n          this._values[j] = output;\n        });\n\n        // resolve downstream nodes\n        const downstreamNodes = new Set<number>();\n        outputList.forEach((_output, i) => {\n          const j = thisOp.node.outputs[i];\n          for (const currentDownstreamNodeIndex of graphValues[j].to) {\n            const currentDownstreamNode = graphNodes[currentDownstreamNodeIndex];\n            let resolved = true;\n            for (const k of currentDownstreamNode.inputs) {\n              if (!this._values[k]) {\n                resolved = false;\n                break;\n              }\n            }\n            if (resolved) {\n              downstreamNodes.add(currentDownstreamNodeIndex);\n            }\n          }\n        });\n        sequence.push(...downstreamNodes);\n      }\n\n      const output: Tensor[] = [];\n      for (let i = 0; i < this.graph.getOutputIndices().length; i++) {\n        const outputIndex = this.graph.getOutputIndices()[i];\n        const outputTensor = this._values[outputIndex];\n        if (outputTensor === undefined) {\n          throw new Error(`required output [${outputIndex}] does not have value`);\n        }\n        if (outputIndex === 0) {\n          await outputTensor.getData();\n        } else {\n          // eslint-disable-next-line no-unused-expressions\n          outputTensor.data;\n        }\n        output.push(outputTensor);\n      }\n      Logger.verbose('ExecPlan', 'disposing of inferenceHandler');\n      inferenceHandler.dispose();\n      return output;\n    });\n  }\n\n  _values: Array<Tensor | undefined>;\n  _ops: KernelOp[];\n  _starter: number[];\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport Long from 'long';\n\nimport * as ortFbs from './ort-schema/flatbuffers/ort-generated';\nimport { onnx } from './ort-schema/protobuf/onnx';\nimport { Tensor } from './tensor';\nimport { decodeUtf8String, LongUtil } from './util';\n\nexport declare namespace Attribute {\n  export interface DataTypeMap {\n    float: number;\n    int: number;\n    string: string;\n    tensor: Tensor;\n    floats: number[];\n    ints: number[];\n    strings: string[];\n    tensors: Tensor[];\n  }\n\n  export type DataType = keyof DataTypeMap;\n}\n\ntype ValueTypes = Attribute.DataTypeMap[Attribute.DataType];\n\ntype Value = [ValueTypes, Attribute.DataType];\n\nexport class Attribute {\n  constructor(attributes: onnx.IAttributeProto[] | ortFbs.Attribute[] | null | undefined) {\n    this._attributes = new Map();\n    if (attributes !== null && attributes !== undefined) {\n      for (const attr of attributes) {\n        if (attr instanceof onnx.AttributeProto) {\n          this._attributes.set(attr.name, [Attribute.getValue(attr), Attribute.getType(attr)]);\n        } else if (attr instanceof ortFbs.Attribute) {\n          this._attributes.set(attr.name()!, [Attribute.getValue(attr), Attribute.getType(attr)]);\n        }\n      }\n      if (this._attributes.size < attributes.length) {\n        throw new Error('duplicated attribute names');\n      }\n    }\n  }\n\n  set(key: string, type: Attribute.DataType, value: ValueTypes): void {\n    this._attributes.set(key, [value, type]);\n  }\n  delete(key: string): void {\n    this._attributes.delete(key);\n  }\n  getFloat(key: string, defaultValue?: Attribute.DataTypeMap['float']) {\n    return this.get(key, 'float', defaultValue);\n  }\n\n  getInt(key: string, defaultValue?: Attribute.DataTypeMap['int']) {\n    return this.get(key, 'int', defaultValue);\n  }\n\n  getString(key: string, defaultValue?: Attribute.DataTypeMap['string']) {\n    return this.get(key, 'string', defaultValue);\n  }\n\n  getTensor(key: string, defaultValue?: Attribute.DataTypeMap['tensor']) {\n    return this.get(key, 'tensor', defaultValue);\n  }\n\n  getFloats(key: string, defaultValue?: Attribute.DataTypeMap['floats']) {\n    return this.get(key, 'floats', defaultValue);\n  }\n\n  getInts(key: string, defaultValue?: Attribute.DataTypeMap['ints']) {\n    return this.get(key, 'ints', defaultValue);\n  }\n\n  getStrings(key: string, defaultValue?: Attribute.DataTypeMap['strings']) {\n    return this.get(key, 'strings', defaultValue);\n  }\n\n  getTensors(key: string, defaultValue?: Attribute.DataTypeMap['tensors']) {\n    return this.get(key, 'tensors', defaultValue);\n  }\n\n  private get<V extends Attribute.DataTypeMap[Attribute.DataType]>(\n    key: string,\n    type: Attribute.DataType,\n    defaultValue?: V,\n  ): V {\n    const valueAndType = this._attributes.get(key);\n    if (valueAndType === undefined) {\n      if (defaultValue !== undefined) {\n        return defaultValue;\n      }\n      throw new Error(`required attribute not found: ${key}`);\n    }\n    if (valueAndType[1] !== type) {\n      throw new Error(`type mismatch: expected ${type} but got ${valueAndType[1]}`);\n    }\n    return valueAndType[0] as V;\n  }\n\n  private static getType(attr: onnx.IAttributeProto | ortFbs.Attribute): Attribute.DataType {\n    const type = attr instanceof onnx.AttributeProto ? attr.type : (attr as ortFbs.Attribute).type();\n    switch (type) {\n      case onnx.AttributeProto.AttributeType.FLOAT:\n        return 'float';\n      case onnx.AttributeProto.AttributeType.INT:\n        return 'int';\n      case onnx.AttributeProto.AttributeType.STRING:\n        return 'string';\n      case onnx.AttributeProto.AttributeType.TENSOR:\n        return 'tensor';\n      case onnx.AttributeProto.AttributeType.FLOATS:\n        return 'floats';\n      case onnx.AttributeProto.AttributeType.INTS:\n        return 'ints';\n      case onnx.AttributeProto.AttributeType.STRINGS:\n        return 'strings';\n      case onnx.AttributeProto.AttributeType.TENSORS:\n        return 'tensors';\n      default:\n        throw new Error(`attribute type is not supported yet: ${onnx.AttributeProto.AttributeType[type]}`);\n    }\n  }\n\n  private static getValue(attr: onnx.IAttributeProto | ortFbs.Attribute) {\n    const attrType = attr instanceof onnx.AttributeProto ? attr.type : (attr as ortFbs.Attribute).type();\n    if (attrType === onnx.AttributeProto.AttributeType.GRAPH || attrType === onnx.AttributeProto.AttributeType.GRAPHS) {\n      throw new Error('graph attribute is not supported yet');\n    }\n\n    const value = this.getValueNoCheck(attr);\n\n    // cast LONG to number\n    if (attrType === onnx.AttributeProto.AttributeType.INT && LongUtil.isLong(value)) {\n      return LongUtil.longToNumber(value as bigint | Long);\n    }\n\n    // cast LONG[] to number[]\n    if (attrType === onnx.AttributeProto.AttributeType.INTS) {\n      const arr = value as Array<number | Long | bigint>;\n      const numberValue: number[] = new Array<number>(arr.length);\n\n      for (let i = 0; i < arr.length; i++) {\n        const maybeLong = arr[i];\n        numberValue[i] = LongUtil.longToNumber(maybeLong);\n      }\n\n      return numberValue;\n    }\n\n    // cast onnx.TensorProto to onnxjs.Tensor\n    if (attrType === onnx.AttributeProto.AttributeType.TENSOR) {\n      return attr instanceof onnx.AttributeProto\n        ? Tensor.fromProto(value as onnx.ITensorProto)\n        : Tensor.fromOrtTensor(value as ortFbs.Tensor);\n    }\n\n    // cast onnx.TensorProto[] to onnxjs.Tensor[]\n    if (attrType === onnx.AttributeProto.AttributeType.TENSORS) {\n      if (attr instanceof onnx.AttributeProto) {\n        const tensorProtos = value as onnx.ITensorProto[];\n        return tensorProtos.map((value) => Tensor.fromProto(value));\n      } else if (attr instanceof ortFbs.Attribute) {\n        const tensorProtos = value as ortFbs.Tensor[];\n        return tensorProtos.map((value) => Tensor.fromOrtTensor(value));\n      }\n    }\n\n    // cast Uint8Array to string\n    if (attrType === onnx.AttributeProto.AttributeType.STRING) {\n      // string in onnx attribute is of uint8array type, so we need to convert it to string below. While in ort format,\n      // string attributes are returned as string, so no conversion is needed.\n      if (attr instanceof onnx.AttributeProto) {\n        const utf8String = value as Uint8Array;\n        return decodeUtf8String(utf8String);\n      }\n    }\n\n    // cast Uint8Array[] to string[]\n    if (attrType === onnx.AttributeProto.AttributeType.STRINGS) {\n      // strings in onnx attribute is returned as uint8array[], so we need to convert it to string[] below. While in ort\n      // format strings attributes are returned as string[], so no conversion is needed.\n      if (attr instanceof onnx.AttributeProto) {\n        const utf8Strings = value as Uint8Array[];\n        return utf8Strings.map(decodeUtf8String);\n      }\n    }\n\n    return value as ValueTypes;\n  }\n\n  private static getValueNoCheck(attr: onnx.IAttributeProto | ortFbs.Attribute) {\n    return attr instanceof onnx.AttributeProto\n      ? this.getValueNoCheckFromOnnxFormat(attr)\n      : this.getValueNoCheckFromOrtFormat(attr as ortFbs.Attribute);\n  }\n\n  private static getValueNoCheckFromOnnxFormat(attr: onnx.IAttributeProto) {\n    switch (attr.type!) {\n      case onnx.AttributeProto.AttributeType.FLOAT:\n        return attr.f;\n      case onnx.AttributeProto.AttributeType.INT:\n        return attr.i;\n      case onnx.AttributeProto.AttributeType.STRING:\n        return attr.s;\n      case onnx.AttributeProto.AttributeType.TENSOR:\n        return attr.t;\n      case onnx.AttributeProto.AttributeType.GRAPH:\n        return attr.g;\n      case onnx.AttributeProto.AttributeType.FLOATS:\n        return attr.floats;\n      case onnx.AttributeProto.AttributeType.INTS:\n        return attr.ints;\n      case onnx.AttributeProto.AttributeType.STRINGS:\n        return attr.strings;\n      case onnx.AttributeProto.AttributeType.TENSORS:\n        return attr.tensors;\n      case onnx.AttributeProto.AttributeType.GRAPHS:\n        return attr.graphs;\n      default:\n        throw new Error(`unsupported attribute type: ${onnx.AttributeProto.AttributeType[attr.type!]}`);\n    }\n  }\n\n  private static getValueNoCheckFromOrtFormat(attr: ortFbs.Attribute) {\n    switch (attr.type()) {\n      case ortFbs.AttributeType.FLOAT:\n        return attr.f();\n      case ortFbs.AttributeType.INT:\n        return attr.i();\n      case ortFbs.AttributeType.STRING:\n        return attr.s();\n      case ortFbs.AttributeType.TENSOR:\n        return attr.t();\n      case ortFbs.AttributeType.GRAPH:\n        return attr.g();\n      case ortFbs.AttributeType.FLOATS:\n        return attr.floatsArray();\n      case ortFbs.AttributeType.INTS: {\n        const ints = [];\n        for (let i = 0; i < attr.intsLength(); i++) {\n          ints.push(attr.ints(i)!);\n        }\n        return ints;\n      }\n      case ortFbs.AttributeType.STRINGS: {\n        const strings = [];\n        for (let i = 0; i < attr.stringsLength(); i++) {\n          strings.push(attr.strings(i));\n        }\n        return strings;\n      }\n      case ortFbs.AttributeType.TENSORS: {\n        const tensors = [];\n        for (let i = 0; i < attr.tensorsLength(); i++) {\n          tensors.push(attr.tensors(i)!);\n        }\n        return tensors;\n      }\n      // case ortFbs.AttributeType.GRAPHS:\n      // TODO: Subgraph not supported yet.\n      // const graphs = [];\n      // for (let i = 0; i < attr.graphsLength(); i++) {\n      //   graphs.push(attr.graphs(i)!);\n      // }\n      // return graphs;\n      default:\n        throw new Error(`unsupported attribute type: ${ortFbs.AttributeType[attr.type()]}`);\n    }\n  }\n\n  protected _attributes: Map<string, Value>;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Attribute } from './attribute';\nimport * as ortFbs from './ort-schema/flatbuffers/ort-generated';\nimport { onnx } from './ort-schema/protobuf/onnx';\nimport { Tensor } from './tensor';\nimport { LongUtil, MAX_CLIP, MIN_CLIP, ProtoUtil } from './util';\n\nexport declare namespace Graph {\n  export interface Shape {\n    readonly dims: readonly number[];\n  }\n  export interface ValueType {\n    readonly tensorType: Tensor.DataType;\n    readonly shape: Shape;\n  }\n  export interface Value {\n    // the tensor data. empty for non-initialized inputs\n    readonly tensor?: Tensor;\n\n    // index to the Node where the value comes from. -1 for initializer.\n    readonly from: number;\n\n    // indices to the Nodes where the values go to.\n    readonly to: readonly number[];\n\n    // value type specification. empty for non-input values.\n    readonly type?: ValueType;\n  }\n  export interface Node {\n    // name of the node\n    readonly name: string;\n\n    // the operator type\n    readonly opType: string;\n\n    // indices to the Values where the inputs come from.\n    readonly inputs: readonly number[];\n\n    // indices to the Values where the outpus go to.\n    readonly outputs: readonly number[];\n\n    // the attributes that used by the operator\n    readonly attributes: Attribute;\n  }\n\n  /**\n   * a Transformer is an instance that allows all possible transformation operations that applied to a graph\n   */\n  export interface Transformer {\n    removeAllIdentityNodes(): void;\n    removeAllDropoutNodes(): void;\n    fuseConvActivationNodes(): void;\n    // TODO: add generic functions to manipulate the graph\n  }\n\n  // an initializer can use transformer to transform the graph\n  export interface Initializer {\n    transformGraph(transformer: Transformer): void;\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport interface Graph {\n  getInputIndices(): readonly number[];\n  getInputNames(): readonly string[];\n  getOutputIndices(): readonly number[];\n  getOutputNames(): readonly string[];\n  getValues(): readonly Graph.Value[];\n  getNodes(): readonly Graph.Node[];\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-redeclare\nexport const Graph = {\n  /**\n   * construct a graph from a graph protobuf type\n   */\n  from: (graphProto: onnx.IGraphProto | ortFbs.Graph, initializer?: Graph.Initializer) =>\n    new GraphImpl(graphProto, initializer),\n};\n\nclass Value implements Graph.Value {\n  constructor(valueInfo?: onnx.IValueInfoProto) {\n    this._from = undefined;\n    this._to = [];\n    this.tensor = undefined;\n    this.type = undefined;\n\n    if (valueInfo) {\n      this.type = ProtoUtil.tensorValueTypeFromProto(valueInfo.type!.tensorType!);\n    }\n  }\n\n  _from?: number; // -1 represent from initializer\n  get from() {\n    return this._from!;\n  }\n  _to: number[];\n  get to() {\n    return this._to;\n  }\n  type?: Graph.ValueType;\n  tensor?: Tensor;\n}\n\nclass Node implements Graph.Node {\n  constructor(_nodeProto: onnx.INodeProto | ortFbs.Node, name?: string) {\n    if (_nodeProto instanceof onnx.NodeProto) {\n      this.name = _nodeProto.name;\n      this.opType = _nodeProto.opType;\n      this.attributes = new Attribute(_nodeProto.attribute);\n    } else if (_nodeProto instanceof ortFbs.Node) {\n      this.name = name ?? _nodeProto.name()!;\n      this.opType = _nodeProto.opType()!;\n      this.attributes = new Attribute(ProtoUtil.tensorAttributesFromORTFormat(_nodeProto));\n    }\n\n    this.inputs = [];\n    this.outputs = [];\n    this.executeNode = true;\n  }\n\n  name: string;\n  opType: string;\n  inputs: number[];\n  outputs: number[];\n  attributes: Attribute;\n  executeNode: boolean;\n}\n\nclass GraphImpl implements Graph, Graph.Transformer {\n  private _allData: Value[];\n\n  private _allInputIndices: number[];\n  private _allInputNames: string[];\n\n  private _allOutputIndices: number[];\n  private _allOutputNames: string[];\n\n  private _nodes: Node[];\n\n  constructor(graph: onnx.IGraphProto | ortFbs.Graph, graphInitializer?: Graph.Initializer) {\n    if (!graph) {\n      throw new TypeError('graph is empty');\n    }\n\n    // build the graph - will throw exceptions if something fatal is detected\n    this.buildGraph(graph);\n\n    // execute any transformation logic for the graph (if applicable)\n    this.transformGraph(graphInitializer);\n\n    // check for cycles and other inconsistencies - will throw exceptions if something fatal is detected\n    this.checkIsAcyclic();\n  }\n\n  getInputIndices(): readonly number[] {\n    return this._allInputIndices;\n  }\n\n  getInputNames(): readonly string[] {\n    return this._allInputNames;\n  }\n\n  getOutputIndices(): readonly number[] {\n    return this._allOutputIndices;\n  }\n\n  getOutputNames(): readonly string[] {\n    return this._allOutputNames;\n  }\n\n  getValues(): readonly Graph.Value[] {\n    return this._allData;\n  }\n\n  getNodes(): readonly Graph.Node[] {\n    return this._nodes;\n  }\n\n  private buildGraph(graph: onnx.IGraphProto | ortFbs.Graph) {\n    // build the graph - will throw exceptions if something fatal is detected\n    if (graph instanceof onnx.GraphProto) {\n      this.buildGraphFromOnnxFormat(graph);\n    } else if (graph instanceof ortFbs.Graph) {\n      this.buildGraphFromOrtFormat(graph);\n    } else {\n      throw new TypeError('Graph type is not supported.');\n    }\n  }\n  private buildGraphFromOnnxFormat(graph: onnx.IGraphProto) {\n    const dataIndices = new Map<string, number>();\n    this._allData = [];\n\n    this._allInputIndices = [];\n    this._allInputNames = [];\n\n    this._allOutputIndices = [];\n    this._allOutputNames = [];\n\n    this._nodes = [];\n\n    const nodesIndices = new Map<string, number>();\n\n    // scan all inputs\n    if (!graph.input) {\n      throw new Error('missing information in graph: input');\n    }\n    const inputValueNames = [];\n    for (const i of graph.input) {\n      if (dataIndices.has(i.name!)) {\n        throw new Error(`duplicated input name: ${i.name}`);\n      }\n      const currentIndex = this._allData.push(new Value(i)) - 1;\n      dataIndices.set(i.name!, currentIndex);\n      inputValueNames.push(i.name!);\n    }\n\n    // scan all initializers\n    if (!graph.initializer) {\n      throw new Error('missing information in graph: initializer');\n    }\n    for (const i of graph.initializer) {\n      let index = dataIndices.get(i.name!);\n      if (index === undefined) {\n        const value = new Value();\n        value.type = {\n          shape: { dims: ProtoUtil.tensorDimsFromProto(i.dims!) },\n          tensorType: ProtoUtil.tensorDataTypeFromProto(i.dataType!),\n        };\n        index = this._allData.push(value) - 1;\n        dataIndices.set(i.name!, index);\n      }\n      this._allData[index]._from = -1;\n      this._allData[index].tensor = Tensor.fromProto(i);\n    }\n\n    // filter out input indices\n    for (let i = 0; i < this._allData.length; i++) {\n      if (!this._allData[i].tensor) {\n        this._allInputIndices.push(i);\n        this._allInputNames.push(inputValueNames[i]);\n      }\n    }\n\n    // scan all outputs\n    if (!graph.output) {\n      throw new Error('missing information in graph: output');\n    }\n    for (const i of graph.output) {\n      if (dataIndices.has(i.name!)) {\n        throw new Error(`duplicated output name: ${i.name}`);\n      }\n      const currentIndex = this._allData.push(new Value(i)) - 1;\n      dataIndices.set(i.name!, currentIndex);\n      this._allOutputIndices.push(currentIndex);\n      this._allOutputNames.push(i.name!);\n    }\n\n    // scan all nodes\n    if (!graph.node) {\n      throw new Error('missing information in graph: node');\n    }\n    for (const nodeProto of graph.node) {\n      if (!nodeProto.name) {\n        // assign a name to the node if it doesn't have one\n        for (let pick = 0; ; pick++) {\n          const name = `unnamed_${nodeProto.opType}_${pick}`;\n          if (!nodesIndices.has(name)) {\n            nodeProto.name = name;\n            break;\n          }\n        }\n      }\n\n      if (nodesIndices.has(nodeProto.name)) {\n        throw new Error(`duplicated node name: ${nodeProto.name}`);\n      }\n      const currentIndex = this._nodes.push(new Node(nodeProto)) - 1;\n      nodesIndices.set(nodeProto.name, currentIndex);\n    }\n\n    // scan node's outputs\n    for (let i = 0; i < this._nodes.length; i++) {\n      const node = this._nodes[i];\n      const nodeProto = graph.node[i];\n      if (!nodeProto.output) {\n        throw new Error(`missing output for node: ${nodeProto.name}`);\n      }\n      for (const output of nodeProto.output) {\n        let dataIndex = dataIndices.get(output);\n        if (typeof dataIndex === 'undefined') {\n          dataIndex = this._allData.push(new Value()) - 1;\n          dataIndices.set(output, dataIndex);\n        }\n        node.outputs.push(dataIndex);\n\n        if (this._allData[dataIndex]._from !== undefined) {\n          throw new Error(`multiple nodes output to one data value: ${dataIndex}`);\n        }\n        this._allData[dataIndex]._from = i;\n\n        // for the 'Constant' operator, just create a new edge in the graph corresponding to the 'output' of the\n        // operator and ignore the node from the graph\n        if (nodeProto.opType === 'Constant') {\n          if (!nodeProto.attribute || nodeProto.attribute.length !== 1 || !nodeProto.attribute[0].t) {\n            throw new Error('missing attributes or missing tensor value in attributes for this Constant operator');\n          }\n          if (!nodeProto.output || nodeProto.output.length !== 1) {\n            throw new Error('missing output or incorrect number of outputs for this Constant operator');\n          }\n          node.outputs.pop();\n          node.executeNode = false;\n\n          this._allData[dataIndex]._from = -1;\n          this._allData[dataIndex].tensor = Tensor.fromProto(nodeProto.attribute[0].t);\n        }\n      }\n    }\n\n    // scan node's inputs\n    for (let i = 0; i < this._nodes.length; i++) {\n      const node = this._nodes[i];\n      const nodeProto = graph.node[i];\n\n      if (!nodeProto.input) {\n        throw new Error(`missing input for node: ${nodeProto.name}`);\n      }\n      for (const input of nodeProto.input) {\n        const dataIndex = dataIndices.get(input);\n        if (typeof dataIndex === 'undefined') {\n          // handle exception when opset > 9 and roi / scales not given\n          if (\n            input === '' &&\n            (nodeProto.input.length === 3 || nodeProto.input.length === 4) &&\n            nodeProto.opType === 'Resize'\n          ) {\n            continue;\n          }\n          throw new Error(`unrecognized input '${input}' for node: ${nodeProto.name}`);\n        }\n        node.inputs.push(dataIndex);\n\n        this._allData[dataIndex]._to.push(i);\n      }\n    }\n\n    return true;\n  }\n\n  private buildGraphFromOrtFormat(graph: ortFbs.Graph) {\n    const dataIndices = new Map<string, number>();\n    this._allData = [];\n\n    this._allInputIndices = [];\n    this._allInputNames = [];\n\n    this._allOutputIndices = [];\n    this._allOutputNames = [];\n\n    this._nodes = [];\n\n    const nodesIndices = new Map<string, number>();\n\n    // scan all inputs\n    const inputValueNames = [];\n    for (let i = 0; i < graph.inputsLength(); i++) {\n      const inputName = graph.inputs(i);\n      if (dataIndices.has(inputName)) {\n        throw new Error(`duplicated input name: ${inputName}`);\n      }\n      // Find the input typeInfo from nodeargs\n      for (let j = 0; j < graph.nodeArgsLength(); j++) {\n        if (graph.nodeArgs(j)?.name() === inputName) {\n          const value = new Value();\n          const valueType = graph.nodeArgs(j)?.type()?.valueType();\n          if (valueType !== ortFbs.TypeInfoValue.tensor_type) {\n            throw new Error('Unexpected value type for the nodeArg.');\n          }\n          const valueInfo = graph.nodeArgs(j)!.type()!.value(new ortFbs.TensorTypeAndShape())!;\n          const type = ProtoUtil.tensorDataTypeFromProto(valueInfo.elemType());\n          const shape = valueInfo.shape()!;\n          const dims = [];\n          for (let k = 0; k < shape.dimLength()!; k++) {\n            dims.push(LongUtil.longToNumber(shape.dim(k)!.value()!.dimValue()!));\n          }\n          value.type = { shape: { dims }, tensorType: type };\n          const currentIndex = this._allData.push(value) - 1;\n          dataIndices.set(inputName, currentIndex);\n          inputValueNames.push(inputName);\n        }\n      }\n    }\n    // check initializers\n    for (let i = 0; i < graph.initializersLength(); i++) {\n      const initializer = graph.initializers(i)!;\n      let index = dataIndices.get(initializer.name()!);\n      if (index === undefined) {\n        const value = new Value();\n        const dims = ProtoUtil.tensorDimsFromORTFormat(initializer);\n        const type = ProtoUtil.tensorDataTypeFromProto(initializer.dataType());\n        value.type = { shape: { dims }, tensorType: type };\n        index = this._allData.push(value) - 1;\n        dataIndices.set(initializer.name()!, index);\n      }\n      this._allData[index]._from = -1;\n      this._allData[index].tensor = Tensor.fromOrtTensor(initializer);\n    }\n\n    // filter out input indices\n    for (let i = 0; i < this._allData.length; i++) {\n      if (!this._allData[i].tensor) {\n        this._allInputIndices.push(i);\n        this._allInputNames.push(inputValueNames[i]);\n      }\n    }\n\n    // scan all outputs\n    for (let i = 0; i < graph.outputsLength(); i++) {\n      const outputName = graph.outputs(i);\n      if (dataIndices.has(outputName)) {\n        throw new Error(`duplicated output name: ${outputName}`);\n      }\n      const currentIndex = this._allData.push(new Value()) - 1;\n      dataIndices.set(outputName, currentIndex);\n      this._allOutputIndices.push(currentIndex);\n      this._allOutputNames.push(outputName);\n    }\n\n    // scan all nodes\n    if (!graph.nodes) {\n      throw new Error('missing information in graph: node');\n    }\n    for (let i = 0; i < graph.nodesLength(); i++) {\n      const nodeProto = graph.nodes(i);\n      let name = nodeProto!.name();\n      if (!name) {\n        // assign a name to the node if it doesn't have one\n        for (let pick = 0; ; pick++) {\n          name = `unnamed_${nodeProto!.opType()}_${pick}`;\n          if (!nodesIndices.has(name)) {\n            // an unique name is found. break.\n            break;\n          }\n        }\n      }\n\n      if (nodesIndices.has(name)) {\n        throw new Error(`duplicated node name: ${name}`);\n      }\n      const currentIndex = this._nodes.push(new Node(nodeProto!, name)) - 1;\n      nodesIndices.set(name, currentIndex);\n    }\n\n    // scan node's outputs\n    for (let i = 0; i < this._nodes.length; i++) {\n      const node = this._nodes[i];\n      const nodeProto = graph.nodes(i);\n      if (nodeProto == null) {\n        throw new Error(`No node exists at index ${i}`);\n      }\n      if (nodeProto?.outputsLength() === 0) {\n        throw new Error(`missing output for node: ${nodeProto.name}`);\n      }\n      for (let j = 0; j < nodeProto?.outputsLength(); j++) {\n        const output = nodeProto?.outputs(j);\n        let dataIndex = dataIndices.get(output);\n        if (typeof dataIndex === 'undefined') {\n          dataIndex = this._allData.push(new Value()) - 1;\n          dataIndices.set(output, dataIndex);\n        }\n        node.outputs.push(dataIndex);\n\n        if (this._allData[dataIndex]._from !== undefined) {\n          throw new Error(`multiple nodes output to one data value: ${dataIndex}`);\n        }\n        this._allData[dataIndex]._from = i;\n\n        // for the 'Constant' operator, just create a new edge in the graph corresponding to the 'output' of the\n        // operator and ignore the node from the graph\n        if (nodeProto.opType() === 'Constant') {\n          if (nodeProto.attributesLength() !== 1 || !nodeProto.attributes(0)!.t()) {\n            throw new Error('missing attributes or missing tensor value in attributes for this Constant operator');\n          }\n          if (nodeProto.outputsLength() !== 1) {\n            throw new Error('missing output or incorrect number of outputs for this Constant operator');\n          }\n          node.outputs.pop();\n          node.executeNode = false;\n\n          this._allData[dataIndex]._from = -1;\n          this._allData[dataIndex].tensor = Tensor.fromOrtTensor(nodeProto.attributes(0)!.t()!);\n        }\n      }\n    }\n\n    // scan node's inputs\n    for (let i = 0; i < this._nodes.length; i++) {\n      const node = this._nodes[i];\n      const nodeProto = graph.nodes(i)!;\n\n      if (nodeProto.inputsLength() === 0) {\n        throw new Error(`missing input for node: ${nodeProto.name}`);\n      }\n      for (let j = 0; j < nodeProto.inputsLength()!; j++) {\n        const input = nodeProto.inputs(j)!;\n        const dataIndex = dataIndices.get(input);\n        if (typeof dataIndex === 'undefined') {\n          throw new Error(`unrecognized input '${input}' for node: ${nodeProto!.name()}`);\n        }\n        node.inputs.push(dataIndex);\n\n        this._allData[dataIndex]._to.push(i);\n      }\n    }\n  }\n\n  private checkIsAcyclic() {\n    // go through the graph and check for cycles or other fatal inconsistencies\n    const starters: Set<number> = new Set<number>();\n    this._allInputIndices.forEach((i) => {\n      const data = this._allData[i];\n      data._to.forEach((j) => {\n        starters.add(j);\n      });\n    });\n\n    // Iterative DFS to check for cycles\n    const nodesStack = Array.from(starters);\n    const nodesState = new Array<string>(this._nodes.length).fill('white');\n\n    while (nodesStack.length > 0) {\n      const nodeIndex = nodesStack.pop()!;\n      // this node has now been processed completely. Mark this node 'black' to denote this.\n      if (nodesState[nodeIndex] === 'gray') {\n        nodesState[nodeIndex] = 'black';\n      } else {\n        // this node is under processing stage. mark this node 'gray' to denote this.\n        nodesStack.push(nodeIndex);\n        nodesState[nodeIndex] = 'gray';\n\n        this._nodes[nodeIndex].outputs.forEach((outgoingEdgeIndex) => {\n          const data = this._allData[outgoingEdgeIndex];\n          if (typeof data.tensor !== 'undefined') {\n            throw new Error('node outputs should not be initialized');\n          }\n          if (data._from !== nodeIndex) {\n            throw new Error(\"from property of the Value object doesn't match index of Node being processed\");\n          }\n          data._to.forEach((downstreamNodeIndex) => {\n            // back edge found - cyclic\n            if (nodesState[downstreamNodeIndex] === 'gray') {\n              throw new Error('model graph is cyclic');\n            }\n            // tree edge found - continue processing by adding it to stack\n            else if (nodesState[downstreamNodeIndex] === 'white') {\n              nodesStack.push(downstreamNodeIndex);\n            }\n          });\n        });\n      }\n    }\n  }\n\n  private transformGraph(graphInitializer?: Graph.Initializer): void {\n    // apply common transform\n    this.removeAllIdentityNodes();\n    this.removeAllDropoutNodes();\n    this.fuseConvActivationNodes();\n    // apply initializer specific transform\n    if (graphInitializer) {\n      graphInitializer.transformGraph(this);\n    }\n\n    // finalize graph\n    this.finalizeGraph();\n  }\n\n  /**\n   * finalize the graph.\n   *\n   * this function should be called after all the transformation completed.\n   * this function removes all unnecessary nodes and values from the graph\n   */\n  finalizeGraph() {\n    let offset = 0;\n    // delete all nodes that are not being executed\n    // The graph is represented using these two arrays\n    // this._nodes - Array holding the kernels to execute - each entry is a kernel pointing to this._allData\n    // this._allData - hold 2 fields - to [] & from - these feileds hold the graph map for inputs and outputs per node\n    // newIndices - remapping the graph after reading the flag 'executeNode'\n    const newIndices = new Array<number>(this._nodes.length, 0);\n    let nodePossition = 0;\n\n    for (let i = 0; i < this._nodes.length; i++) {\n      // giving new indexes to the nodes based on execution flag\n      newIndices[i] = nodePossition;\n      if (this._nodes[i].executeNode) {\n        if (nodePossition !== i) {\n          this._nodes[nodePossition] = this._nodes[i];\n        }\n        nodePossition++;\n      } else {\n        // delete all output values\n        this._nodes[i].outputs.forEach((ind) => {\n          this._allData[ind]._from = -2;\n        });\n      }\n    }\n\n    // removing the unused nodes\n    this._nodes.splice(nodePossition, this._nodes.length - nodePossition);\n\n    // Updating this._allData according to the new this._nodes\n    for (let i = 0; i < this._allData.length; i++) {\n      const currentData = this._allData[i];\n      if (currentData._from !== undefined && currentData._from !== -1 && currentData._from !== -2) {\n        currentData._from = newIndices[currentData._from];\n      }\n\n      for (let j = 0; j < currentData._to.length; j++) {\n        if (currentData._to[j] >= 0) {\n          currentData._to[j] = newIndices[currentData._to[j]];\n        } else {\n          throw new Error('Trying to update a removed node');\n        }\n      }\n    }\n\n    offset = 0;\n    // delete all values that are not being referenced\n    for (let i = 0; i < this._allData.length; i++) {\n      // if current value is neither linked to next node, nor an output value, remove it.\n      if (this._allData[i].from === -2 && this._allOutputIndices.indexOf(i + offset) === -1) {\n        offset++;\n        this._allData.splice(i, 1);\n        i--;\n        continue;\n      }\n      if (offset > 0) {\n        let ind = -1;\n        // if current value is neither an input value nor an initializer, find the node it's\n        // coming from and update the corresponding node output\n        if (this._allData[i].from !== undefined && this._allData[i].from !== -1) {\n          ind = this._nodes[this._allData[i].from].outputs.indexOf(i + offset);\n          if (ind !== -1) {\n            this._nodes[this._allData[i].from].outputs[ind] = i;\n          }\n        } else {\n          // if current value is an input value, update its reference in inputIndices\n          ind = this._allInputIndices.indexOf(i + offset);\n          if (ind !== -1) {\n            this._allInputIndices[ind] = i;\n          }\n        }\n\n        // find the node that the current value is linking to and update its input reference\n        this._allData[i].to.forEach((node) => {\n          ind = this._nodes[node].inputs.indexOf(i + offset);\n          if (ind !== -1) {\n            this._nodes[node].inputs[ind] = i;\n          }\n        });\n        if (this._allData[i].to.length === 0) {\n          // if current value is a graph output, update its reference in outputIndices\n          ind = this._allOutputIndices.indexOf(i + offset);\n          if (ind !== -1) {\n            this._allOutputIndices[ind] = i;\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Delete the specified node. Assume the node has one incoming input and the first output connected to other nodes.\n   * An input validation must be done before calling this function.\n   * @param nodeIndex The index of node to be deleted\n   */\n  private deleteNode(nodeIndex: number) {\n    const node = this._nodes[nodeIndex];\n    if (node.outputs.length > 1) {\n      for (let i = 1; i < node.outputs.length; i++) {\n        if (this._allData[node.outputs[i]].to.length > 0) {\n          throw new Error('Node deletion with more than one output connected to other nodes is not supported. ');\n        }\n      }\n    }\n\n    // this node wil not be executed\n    node.executeNode = false;\n    const inputValueIndex = node.inputs[0];\n    const outputValueIndex = node.outputs[0];\n    const nodesConsumingOutput = this._allData[outputValueIndex].to;\n\n    // remove this node from the to property of the input Value\n    for (let i = 0; i < node.inputs.length; i++) {\n      const delIndex = this._allData[node.inputs[i]].to.indexOf(nodeIndex);\n      // should not happen\n      if (delIndex === -1) {\n        throw new Error(\"The Value object doesn't have the current Node in it's 'to' property \");\n      }\n      this._allData[node.inputs[i]].to.splice(delIndex, 1);\n    }\n\n    // clear node indices consuming this output Value\n    this._allData[outputValueIndex]._to = [];\n\n    // if the output of this node is a graph output, adjust the index appropriately\n    const index = this._allOutputIndices.indexOf(outputValueIndex);\n    if (index !== -1) {\n      this._allOutputIndices[index] = inputValueIndex;\n    }\n\n    // override the inputs for nodes consuming this node's output with the input to this node\n    if (nodesConsumingOutput && nodesConsumingOutput.length > 0) {\n      for (const nodeIndex of nodesConsumingOutput) {\n        const replaceIndex = this._nodes[nodeIndex].inputs.indexOf(outputValueIndex);\n        // should not happen\n        if (replaceIndex === -1) {\n          throw new Error(\"The Node object doesn't have the output Value in it's 'inputs' property \");\n        }\n        this._nodes[nodeIndex].inputs[replaceIndex] = inputValueIndex;\n        this._allData[inputValueIndex].to.push(nodeIndex);\n      }\n    }\n  }\n\n  removeAllDropoutNodes() {\n    let nodeIndex = 0;\n    for (const node of this._nodes) {\n      // weed out 'Dropout' nodes so that no time is wasted in execution\n      if (node.opType === 'Dropout') {\n        // the node should have exactly 1 input and 1 or 2 outputs\n        if (node.inputs.length !== 1) {\n          throw new Error('Dropout nodes should only contain one input. ');\n        }\n        if (node.outputs.length !== 1 && node.outputs.length !== 2) {\n          throw new Error('Dropout nodes should contain either 1 or 2 output(s)');\n        }\n        // the second output should not be referenced by any other node\n        if (node.outputs.length === 2 && this._allData[node.outputs[1]]._to.length !== 0) {\n          throw new Error(\"Dropout nodes's second output should not be referenced by other nodes\");\n        }\n        this.deleteNode(nodeIndex);\n      }\n      nodeIndex++;\n    }\n  }\n\n  removeAllIdentityNodes() {\n    let nodeIndex = 0;\n    for (const node of this._nodes) {\n      // weed out 'Identity' nodes so that no time is wasted in execution\n      if (node.opType === 'Identity') {\n        this.deleteNode(nodeIndex);\n      }\n      nodeIndex++;\n    }\n  }\n\n  isActivation(n: Node): boolean {\n    switch (n.opType) {\n      // TODO: add other activation methods\n      case 'Relu':\n      case 'Sigmoid':\n      case 'Clip':\n        return true;\n      default:\n        return false;\n    }\n  }\n\n  fuseConvActivationNodes() {\n    for (const node of this._nodes) {\n      if (node.opType === 'Conv') {\n        const next = this._allData[node.outputs[0]]._to;\n        if (next.length === 1 && this.isActivation(this._nodes[next[0]])) {\n          const child = this._nodes[next[0]];\n          if (child.opType === 'Clip') {\n            if (child.inputs.length === 1) {\n              try {\n                node.attributes.set('activation_params', 'floats', [\n                  child.attributes.getFloat('min'),\n                  child.attributes.getFloat('max'),\n                ]);\n              } catch (e) {\n                node.attributes.set('activation_params', 'floats', [MIN_CLIP, MAX_CLIP]);\n              }\n            } else if (\n              child.inputs.length >= 3 &&\n              this._allData[child.inputs[1]].tensor !== undefined &&\n              this._allData[child.inputs[2]].tensor !== undefined\n            ) {\n              node.attributes.set('activation_params', 'floats', [\n                this._allData[child.inputs[1]].tensor!.floatData[0],\n                this._allData[child.inputs[2]].tensor!.floatData[0],\n              ]);\n            } else {\n              // Skip fusion with clip node since clip min and clip max are not coming from initializer\n              continue;\n            }\n          }\n          node.attributes.set('activation', 'string', child.opType);\n          this.deleteNode(next[0]);\n        }\n      }\n    }\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport * as flatbuffers from 'flatbuffers';\n\nimport { Graph } from './graph';\nimport { OpSet } from './opset';\nimport * as ortFbs from './ort-schema/flatbuffers/ort-generated';\nimport { onnx } from './ort-schema/protobuf/onnx';\nimport { LongUtil } from './util';\n\nexport class Model {\n  // empty model\n  constructor() {}\n\n  load(buf: Uint8Array, graphInitializer?: Graph.Initializer, isOrtFormat?: boolean): void {\n    let onnxError: Error | undefined;\n    if (!isOrtFormat) {\n      // isOrtFormat === false || isOrtFormat === undefined\n      try {\n        this.loadFromOnnxFormat(buf, graphInitializer);\n        return;\n      } catch (e) {\n        if (isOrtFormat !== undefined) {\n          throw e;\n        }\n        onnxError = e;\n      }\n    }\n\n    try {\n      this.loadFromOrtFormat(buf, graphInitializer);\n    } catch (e) {\n      if (isOrtFormat !== undefined) {\n        throw e;\n      }\n      // Tried both formats and failed (when isOrtFormat === undefined)\n      throw new Error(`Failed to load model as ONNX format: ${onnxError}\\nas ORT format: ${e}`);\n    }\n  }\n\n  private loadFromOnnxFormat(buf: Uint8Array, graphInitializer?: Graph.Initializer): void {\n    const modelProto = onnx.ModelProto.decode(buf);\n    const irVersion = LongUtil.longToNumber(modelProto.irVersion);\n    if (irVersion < 3) {\n      throw new Error('only support ONNX model with IR_VERSION>=3');\n    }\n\n    this._opsets = modelProto.opsetImport.map((i) => ({\n      domain: i.domain as string,\n      version: LongUtil.longToNumber(i.version!),\n    }));\n\n    this._graph = Graph.from(modelProto.graph!, graphInitializer);\n  }\n\n  private loadFromOrtFormat(buf: Uint8Array, graphInitializer?: Graph.Initializer): void {\n    const fb = new flatbuffers.ByteBuffer(buf);\n    const ortModel = ortFbs.InferenceSession.getRootAsInferenceSession(fb).model()!;\n    const irVersion = LongUtil.longToNumber(ortModel.irVersion());\n    if (irVersion < 3) {\n      throw new Error('only support ONNX model with IR_VERSION>=3');\n    }\n    this._opsets = [];\n    for (let i = 0; i < ortModel.opsetImportLength(); i++) {\n      const opsetId = ortModel.opsetImport(i)!;\n      this._opsets.push({ domain: opsetId?.domain() as string, version: LongUtil.longToNumber(opsetId.version()!) });\n    }\n\n    this._graph = Graph.from(ortModel.graph()!, graphInitializer);\n  }\n\n  private _graph: Graph;\n  get graph(): Graph {\n    return this._graph;\n  }\n\n  private _opsets: OpSet[];\n  get opsets(): readonly OpSet[] {\n    return this._opsets;\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { resolveBackend, SessionHandlerType } from './backend';\nimport { ExecutionPlan } from './execution-plan';\nimport { Graph } from './graph';\nimport { Profiler } from './instrument';\nimport { Model } from './model';\nimport { Operator } from './operators';\nimport { Tensor } from './tensor';\n\nexport declare namespace Session {\n  export interface Config {\n    backendHint?: string;\n    profiler?: Profiler.Config;\n  }\n\n  export interface Context {\n    profiler: Readonly<Profiler>;\n    graphInputTypes?: Tensor.DataType[];\n    graphInputDims?: Array<readonly number[]>;\n  }\n}\n\nexport class Session {\n  constructor(config: Session.Config = {}) {\n    this._initialized = false;\n    this.backendHint = config.backendHint;\n    this.profiler = Profiler.create(config.profiler);\n    this.context = { profiler: this.profiler, graphInputTypes: [], graphInputDims: [] };\n  }\n\n  get inputNames(): readonly string[] {\n    return this._model.graph.getInputNames();\n  }\n  get outputNames(): readonly string[] {\n    return this._model.graph.getOutputNames();\n  }\n\n  startProfiling() {\n    this.profiler.start();\n  }\n\n  endProfiling() {\n    this.profiler.stop();\n  }\n\n  async loadModel(uri: string): Promise<void>;\n  async loadModel(buffer: ArrayBuffer, byteOffset?: number, length?: number): Promise<void>;\n  async loadModel(buffer: Uint8Array): Promise<void>;\n  async loadModel(arg: string | ArrayBuffer | Uint8Array, byteOffset?: number, length?: number): Promise<void> {\n    await this.profiler.event('session', 'Session.loadModel', async () => {\n      // resolve backend and session handler\n      const backend = await resolveBackend(this.backendHint);\n      this.sessionHandler = backend.createSessionHandler(this.context);\n\n      this._model = new Model();\n      if (typeof arg === 'string') {\n        const isOrtFormat = arg.endsWith('.ort');\n        if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n          // node\n          const { readFile } = require('node:fs/promises');\n          const buf = await readFile(arg);\n          this.initialize(buf, isOrtFormat);\n        } else {\n          // browser\n          const response = await fetch(arg);\n          const buf = await response.arrayBuffer();\n          this.initialize(new Uint8Array(buf), isOrtFormat);\n        }\n      } else if (!ArrayBuffer.isView(arg)) {\n        // load model from ArrayBuffer\n        const arr = new Uint8Array(arg, byteOffset || 0, length || arg.byteLength);\n        this.initialize(arr);\n      } else {\n        // load model from Uint8array\n        this.initialize(arg);\n      }\n    });\n  }\n\n  private initialize(modelProtoBlob: Uint8Array, isOrtFormat?: boolean): void {\n    if (this._initialized) {\n      throw new Error('already initialized');\n    }\n\n    this.profiler.event('session', 'Session.initialize', () => {\n      // load graph\n      const graphInitializer = this.sessionHandler.transformGraph\n        ? (this.sessionHandler as Graph.Initializer)\n        : undefined;\n      this._model.load(modelProtoBlob, graphInitializer, isOrtFormat);\n\n      // graph is completely initialzied at this stage , let the interested handlers know\n      if (this.sessionHandler.onGraphInitialized) {\n        this.sessionHandler.onGraphInitialized(this._model.graph);\n      }\n      // initialize each operator in the graph\n      this.initializeOps(this._model.graph);\n\n      // instantiate an ExecutionPlan object to be used by the Session object\n      this._executionPlan = new ExecutionPlan(this._model.graph, this._ops, this.profiler);\n    });\n\n    this._initialized = true;\n  }\n\n  async run(inputs: Map<string, Tensor> | Tensor[]): Promise<Map<string, Tensor>> {\n    if (!this._initialized) {\n      throw new Error('session not initialized yet');\n    }\n\n    return this.profiler.event('session', 'Session.run', async () => {\n      const inputTensors = this.normalizeAndValidateInputs(inputs);\n\n      const outputTensors = await this._executionPlan.execute(this.sessionHandler, inputTensors);\n\n      return this.createOutput(outputTensors);\n    });\n  }\n\n  private normalizeAndValidateInputs(inputs: Map<string, Tensor> | Tensor[]): Tensor[] {\n    const modelInputNames = this._model.graph.getInputNames();\n\n    // normalize inputs\n    // inputs: Tensor[]\n    if (Array.isArray(inputs)) {\n      if (inputs.length !== modelInputNames.length) {\n        throw new Error(`incorrect input array length: expected ${modelInputNames.length} but got ${inputs.length}`);\n      }\n    }\n    // convert map to array\n    // inputs: Map<string, Tensor>\n    else {\n      if (inputs.size !== modelInputNames.length) {\n        throw new Error(`incorrect input map size: expected ${modelInputNames.length} but got ${inputs.size}`);\n      }\n\n      const sortedInputs = new Array<Tensor>(inputs.size);\n      let sortedInputsIndex = 0;\n      for (let i = 0; i < modelInputNames.length; ++i) {\n        const tensor = inputs.get(modelInputNames[i]);\n        if (!tensor) {\n          throw new Error(`missing input tensor for: '${name}'`);\n        }\n        sortedInputs[sortedInputsIndex++] = tensor;\n      }\n\n      inputs = sortedInputs;\n    }\n\n    // validate dims requirements\n    // First session run - graph input data is not cached for the session\n    if (\n      !this.context.graphInputTypes ||\n      this.context.graphInputTypes.length === 0 ||\n      !this.context.graphInputDims ||\n      this.context.graphInputDims.length === 0\n    ) {\n      const modelInputIndices = this._model.graph.getInputIndices();\n      const modelValues = this._model.graph.getValues();\n\n      const graphInputDims = new Array<readonly number[]>(modelInputIndices.length);\n\n      for (let i = 0; i < modelInputIndices.length; ++i) {\n        const graphInput = modelValues[modelInputIndices[i]];\n        graphInputDims[i] = graphInput.type!.shape.dims;\n\n        // cached for second and subsequent runs.\n        // Some parts of the framework works on the assumption that the graph and types and shapes are static\n        this.context.graphInputTypes!.push(graphInput.type!.tensorType);\n        this.context.graphInputDims!.push(inputs[i].dims);\n      }\n\n      this.validateInputTensorDims(graphInputDims, inputs, true);\n    }\n\n    // Second and subsequent session runs - graph input data is cached for the session\n    else {\n      this.validateInputTensorDims(this.context.graphInputDims, inputs, false);\n    }\n\n    // validate types requirement\n    this.validateInputTensorTypes(this.context.graphInputTypes!, inputs);\n\n    return inputs;\n  }\n\n  private validateInputTensorTypes(graphInputTypes: Tensor.DataType[], givenInputs: Tensor[]) {\n    for (let i = 0; i < givenInputs.length; i++) {\n      const expectedType = graphInputTypes[i];\n      const actualType = givenInputs[i].type;\n      if (expectedType !== actualType) {\n        throw new Error(`input tensor[${i}] check failed: expected type '${expectedType}' but got ${actualType}`);\n      }\n    }\n  }\n\n  private validateInputTensorDims(\n    graphInputDims: Array<readonly number[]>,\n    givenInputs: Tensor[],\n    noneDimSupported: boolean,\n  ) {\n    for (let i = 0; i < givenInputs.length; i++) {\n      const expectedDims = graphInputDims[i];\n      const actualDims = givenInputs[i].dims;\n      if (!this.compareTensorDims(expectedDims, actualDims, noneDimSupported)) {\n        throw new Error(\n          `input tensor[${i}] check failed: expected shape '[${expectedDims.join(',')}]' but got [${actualDims.join(\n            ',',\n          )}]`,\n        );\n      }\n    }\n  }\n\n  private compareTensorDims(\n    expectedDims: readonly number[],\n    actualDims: readonly number[],\n    noneDimSupported: boolean,\n  ): boolean {\n    if (expectedDims.length !== actualDims.length) {\n      return false;\n    }\n\n    for (let i = 0; i < expectedDims.length; ++i) {\n      if (expectedDims[i] !== actualDims[i] && (!noneDimSupported || expectedDims[i] !== 0)) {\n        // data shape mis-match AND not a 'None' dimension.\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  private createOutput(outputTensors: Tensor[]): Map<string, Tensor> {\n    const modelOutputNames = this._model.graph.getOutputNames();\n    if (outputTensors.length !== modelOutputNames.length) {\n      throw new Error('expected number of outputs do not match number of generated outputs');\n    }\n\n    const output = new Map<string, Tensor>();\n    for (let i = 0; i < modelOutputNames.length; ++i) {\n      output.set(modelOutputNames[i], outputTensors[i]);\n    }\n\n    return output;\n  }\n\n  private initializeOps(graph: Graph): void {\n    const nodes = graph.getNodes();\n    this._ops = new Array(nodes.length);\n\n    for (let i = 0; i < nodes.length; i++) {\n      this._ops[i] = this.sessionHandler.resolve(nodes[i], this._model.opsets, graph);\n    }\n  }\n\n  private _model: Model;\n  private _initialized: boolean;\n\n  private _ops: Operator[];\n  private _executionPlan: ExecutionPlan;\n\n  private backendHint?: string;\n\n  private sessionHandler: SessionHandlerType;\n  private context: Session.Context;\n  private profiler: Readonly<Profiler>;\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { InferenceSession, InferenceSessionHandler, SessionHandler, Tensor } from 'onnxruntime-common';\n\nimport { Session } from './session';\nimport { Tensor as OnnxjsTensor } from './tensor';\n\nexport class OnnxjsSessionHandler implements InferenceSessionHandler {\n  constructor(private session: Session) {\n    this.inputNames = this.session.inputNames;\n    this.outputNames = this.session.outputNames;\n  }\n\n  get inputMetadata(): readonly InferenceSession.ValueMetadata[] {\n    throw new Error('Getting model metadata is not supported in webgl backend.');\n  }\n\n  get outputMetadata(): readonly InferenceSession.ValueMetadata[] {\n    throw new Error('Getting model metadata is not supported in webgl backend.');\n  }\n\n  async dispose(): Promise<void> {}\n  inputNames: readonly string[];\n  outputNames: readonly string[];\n  async run(\n    feeds: SessionHandler.FeedsType,\n    _fetches: SessionHandler.FetchesType,\n    _options: InferenceSession.RunOptions,\n  ): Promise<SessionHandler.ReturnType> {\n    const inputMap = new Map<string, OnnxjsTensor>();\n    for (const name in feeds) {\n      if (Object.hasOwnProperty.call(feeds, name)) {\n        const feed = feeds[name];\n        inputMap.set(\n          name,\n          new OnnxjsTensor(\n            feed.dims,\n            feed.type as OnnxjsTensor.DataType,\n            undefined,\n            undefined,\n            feed.data as OnnxjsTensor.NumberType,\n          ),\n        );\n      }\n    }\n    const outputMap = await this.session.run(inputMap);\n    const output: SessionHandler.ReturnType = {};\n    outputMap.forEach((tensor, name) => {\n      output[name] = new Tensor(tensor.type, tensor.data, tensor.dims);\n    });\n    return output;\n  }\n  startProfiling(): void {\n    this.session.startProfiling();\n  }\n  endProfiling(): void {\n    this.session.endProfiling();\n  }\n}\n", "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/* eslint-disable import/no-internal-modules */\nimport { Backend, InferenceSession, InferenceSessionHandler } from 'onnxruntime-common';\n\nimport { Session } from './onnxjs/session';\nimport { OnnxjsSessionHandler } from './onnxjs/session-handler-inference';\n\nclass OnnxjsBackend implements Backend {\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  async init(): Promise<void> {}\n\n  async createInferenceSessionHandler(\n    pathOrBuffer: string | Uint8Array,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSessionHandler> {\n    // NOTE: Session.Config(from onnx.js) is not compatible with InferenceSession.SessionOptions(from\n    // onnxruntime-common).\n    //       In future we should remove Session.Config and use InferenceSession.SessionOptions.\n    //       Currently we allow this to happen to make test runner work.\n    const session = new Session(options as unknown as Session.Config);\n\n    // typescript cannot merge method override correctly (so far in 4.2.3). need if-else to call the method.\n    if (typeof pathOrBuffer === 'string') {\n      await session.loadModel(pathOrBuffer);\n    } else {\n      await session.loadModel(pathOrBuffer);\n    }\n\n    return new OnnxjsSessionHandler(session);\n  }\n}\n\nexport const onnxjsBackend = new OnnxjsBackend();\n", "// 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\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 = require('./backend-wasm').wasmBackend;\n  if (!BUILD_DEFS.DISABLE_JSEP) {\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.22.0-dev.20250409-89f8206ba4';\n"],
  "mappings": ";;;;;8pBAAA,IAgBMA,GACAC,GAYOC,GAwCPC,GAwCOC,GA7GbC,GAAAC,EAAA,kBAgBMN,GAAqC,IAAI,IACzCC,GAAqC,CAAA,EAY9BC,GAAkB,CAACK,EAAcC,EAAkBC,IAA0B,CACxF,GAAID,GAAW,OAAOA,EAAQ,MAAS,YAAc,OAAOA,EAAQ,+BAAkC,WAAY,CAChH,IAAME,EAAiBV,GAAS,IAAIO,CAAI,EACxC,GAAIG,IAAmB,OACrBV,GAAS,IAAIO,EAAM,CAAE,QAAAC,EAAS,SAAAC,CAAQ,CAAE,MACnC,IAAIC,EAAe,SAAWD,EAEnC,OACK,GAAIC,EAAe,WAAaD,GACjCC,EAAe,UAAYF,EAC7B,MAAM,IAAI,MAAM,4BAA4BD,CAAI,oBAAoBE,CAAQ,EAAE,EAIlF,GAAIA,GAAY,EAAG,CACjB,IAAME,EAAIV,GAAyB,QAAQM,CAAI,EAC3CI,IAAM,IACRV,GAAyB,OAAOU,EAAG,CAAC,EAGtC,QAAS,EAAI,EAAG,EAAIV,GAAyB,OAAQ,IACnD,GAAID,GAAS,IA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,CAAY,EAG/B,IAAII,GAAqBF,CAAO,CACzC,CACF,EAEaR,GAAgB,IAAIC,KCzBjCU,KACAA,KAGAA,KCPO,IAAMC,GAAU,iCDKvB,IAAOC,GAAQC,GAKgB,CAC7B,IAAMC,EAAgB,cAA4B,cAClDC,GAAgB,QAASD,EAAe,GAAG,CAC7C,CAYA,OAAO,eAAeE,EAAI,SAAU,MAAO,CAAE,MAAOC,GAAS,WAAY,EAAK,CAAC",
  "names": ["backends", "backendsSortedByPriority", "registerBackend", "tryResolveAndInitializeBackend", "resolveBackendAndExecutionProviders", "init_backend_impl", "__esmMin", "name", "backend", "priority", "currentBackend", "i", "backendName", "backendInfo", "isInitializing", "options", "eps", "backendHints", "backendNames", "errors", "availableBackendNames", "resolveResult", "e", "err", "filteredEps", "target", "prop", "init_backend", "__esmMin", "init_backend_impl", "version", "init_version", "__esmMin", "logLevelValue", "env", "init_env_impl", "__esmMin", "init_version", "version", "value", "env", "init_env", "__esmMin", "init_env_impl", "tensorToDataURL", "tensorToImageData", "init_tensor_conversion_impl", "__esmMin", "tensor", "options", "canvas", "pixels2DContext", "width", "height", "inputformat", "norm", "normMean", "normBias", "stride", "rTensorPointer", "gTensorPointer", "bTensorPointer", "aTensorPointer", "i", "j", "R", "G", "B", "A", "image", "channels", "step", "rImagePointer", "gImagePointer", "bImagePointer", "aImagePointer", "bufferToTensor", "tensorFromImage", "tensorFromTexture", "tensorFromGpuBuffer", "tensorFromMLTensor", "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", "mlTensor", "type", "NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP", "NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP", "isTypedArrayChecked", "checkTypedArray", "init_tensor_impl_type_mapping", "__esmMin", "isBigInt64ArrayAvailable", "isBigUint64ArrayAvailable", "Float16Array", "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", "mlTensor", "tensorFromMLTensor", "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", "esm_exports", "__export", "InferenceSession", "TRACE", "TRACE_FUNC_BEGIN", "TRACE_FUNC_END", "Tensor", "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", "log", "arg0", "arg1", "arg2", "arg3", "createCategorizedLogger", "logInternal", "category", "severity", "content", "_stack", "config", "LOGGER_CONFIG_MAP", "SEVERITY_VALUE", "LOGGER_PROVIDER_MAP", "NoOpLoggerProvider", "ConsoleLoggerProvider", "LOGGER_DEFAULT_CONFIG", "Logger", "Event", "EventRecord", "Profiler", "now", "init_instrument", "__esmMin", "_severity", "_content", "_category", "verbose", "info", "warning", "error", "fatal", "reset", "set", "previousConfig", "setWithEnv", "env", "name", "startTime", "endCallback", "timer", "ctx", "endTime", "maxNumberEvents", "flushBatchSize", "flushIntervalInMilliseconds", "func", "event", "isPromise", "res", "resolve", "reject", "value", "reason", "eventRes", "e", "currentTime", "previousPointer", "resolveOperator", "node", "opsets", "rules", "rule", "opType", "domain", "versionSelector", "opImpl", "opInit", "opset", "matchSelector", "set", "version", "selector", "rangeStart", "pair", "rangeEnd", "init_opset", "__esmMin", "require_guid", "__commonJSMin", "exports", "Guid", "guid", "value", "count", "out", "i", "other", "Long", "low", "high", "unsigned", "isLong", "obj", "ctz32", "value", "c", "fromInt", "cachedObj", "cache", "UINT_CACHE", "fromBits", "INT_CACHE", "fromNumber", "UZERO", "ZERO", "TWO_PWR_64_DBL", "MAX_UNSIGNED_VALUE", "TWO_PWR_63_DBL", "MIN_VALUE", "MAX_VALUE", "TWO_PWR_32_DBL", "lowBits", "highBits", "fromString", "str", "radix", "p", "radixToPower", "pow_dbl", "result", "i", "size", "power", "fromValue", "val", "wasm", "TWO_PWR_16_DBL", "TWO_PWR_24_DBL", "TWO_PWR_24", "ONE", "UONE", "NEG_ONE", "LongPrototype", "long_default", "init_long", "__esmMin", "radixLong", "div", "rem1", "rem", "remDiv", "intval", "digits", "bit", "other", "thisNeg", "otherNeg", "addend", "a48", "a32", "a16", "a00", "b48", "b32", "b16", "b00", "c48", "c32", "c16", "c00", "subtrahend", "multiplier", "divisor", "approx", "res", "halfThis", "log2", "delta", "approxRes", "approxRem", "numBits", "b", "le", "hi", "lo", "bytes", "ArgType", "exports", "require_constants", "__commonJSMin", "exports", "require_utils", "__commonJSMin", "exports", "require_encoding", "__commonJSMin", "exports", "Encoding", "require_byte_buffer", "__commonJSMin", "exports", "constants_js_1", "utils_js_1", "encoding_js_1", "ByteBuffer", "_ByteBuffer", "bytes_", "byte_size", "position", "offset", "value", "result", "i", "bb_pos", "vtable_offset", "vtable", "opt_encoding", "length", "utf8bytes", "o", "ident", "listAccessor", "listLength", "ret", "val", "require_builder", "__commonJSMin", "exports", "byte_buffer_js_1", "constants_js_1", "Builder", "_Builder", "opt_initial_size", "initial_size", "forceDefaults", "size", "additional_bytes", "align_size", "old_buf_size", "byte_size", "i", "value", "voffset", "defaultValue", "obj", "bb", "new_buf_size", "nbb", "offset", "numfields", "vtableloc", "trimmed_size", "standard_fields", "len", "existing_vtable", "vt1", "outer_loop", "vt2", "j", "root_table", "opt_file_identifier", "opt_size_prefix", "size_prefix", "file_identifier", "table", "field", "table_start", "vtable_start", "elem_size", "num_elems", "alignment", "s", "utf8", "v", "list", "ret", "val", "startFunc", "require_flatbuffers", "__commonJSMin", "exports", "constants_js_1", "constants_js_2", "constants_js_3", "constants_js_4", "utils_js_1", "encoding_js_1", "builder_js_1", "byte_buffer_js_1", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "arg_type_js_1", "ArgTypeAndIndex", "_ArgTypeAndIndex", "i", "bb", "obj", "flatbuffers", "offset", "builder", "argType", "AttributeType", "exports", "NodeType", "exports", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "node_type_js_1", "Node", "_Node", "i", "bb", "obj", "flatbuffers", "offset", "optionalEncoding", "index", "attribute_js_1", "builder", "nameOffset", "docStringOffset", "domainOffset", "sinceVersion", "opTypeOffset", "type", "executionProviderTypeOffset", "inputsOffset", "data", "numElems", "outputsOffset", "attributesOffset", "inputArgCountsOffset", "implicitInputsOffset", "EdgeEnd", "i", "bb", "builder", "node_index", "src_arg_index", "dst_arg_index", "exports", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "edge_end_js_1", "NodeEdge", "_NodeEdge", "i", "bb", "obj", "flatbuffers", "offset", "index", "builder", "nodeIndex", "inputEdgesOffset", "numElems", "outputEdgesOffset", "o", "v", "exports", "mod", "result", "k", "__createBinding", "flatbuffers", "__importStar", "NodesToOptimizeIndices", "_NodesToOptimizeIndices", "i", "bb", "obj", "index", "offset", "builder", "nodeIndicesOffset", "data", "numElems", "numInputs", "numOutputs", "hasVariadicInput", "hasVariadicOutput", "numVariadicInputs", "o", "v", "mod", "result", "k", "__createBinding", "__setModuleDefault", "exports", "__importStar", "nodes_to_optimize_indices_js_1", "RuntimeOptimizationRecord", "_RuntimeOptimizationRecord", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "index", "builder", "actionIdOffset", "nodesToOptimizeIndicesOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "runtime_optimization_record_js_1", "RuntimeOptimizationRecordContainerEntry", "_RuntimeOptimizationRecordContainerEntry", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "index", "builder", "optimizerNameOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "runtime_optimization_record_container_entry_js_1", "RuntimeOptimizations", "_RuntimeOptimizations", "i", "bb", "obj", "flatbuffers", "index", "offset", "builder", "recordsOffset", "data", "TensorDataType", "exports", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "tensor_data_type_js_1", "Tensor", "_Tensor", "i", "bb", "obj", "flatbuffers", "offset", "optionalEncoding", "index", "builder", "nameOffset", "docStringOffset", "dimsOffset", "data", "numElems", "dataType", "rawDataOffset", "stringDataOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "tensor_js_1", "SparseTensor", "_SparseTensor", "i", "bb", "obj", "flatbuffers", "offset", "index", "builder", "valuesOffset", "indicesOffset", "dimsOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "type_info_js_1", "MapType", "_MapType", "i", "bb", "obj", "flatbuffers", "offset", "tensor_data_type_js_1", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "type_info_js_1", "SequenceType", "_SequenceType", "i", "bb", "obj", "flatbuffers", "offset", "DimensionValueType", "exports", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "dimension_value_type_js_1", "DimensionValue", "_DimensionValue", "i", "bb", "obj", "flatbuffers", "offset", "optionalEncoding", "builder", "dimType", "dimValue", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "dimension_value_js_1", "Dimension", "_Dimension", "i", "bb", "obj", "flatbuffers", "offset", "optionalEncoding", "builder", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "dimension_js_1", "Shape", "_Shape", "i", "bb", "obj", "flatbuffers", "offset", "index", "builder", "dimOffset", "data", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "tensor_data_type_js_1", "TensorTypeAndShape", "_TensorTypeAndShape", "i", "bb", "obj", "flatbuffers", "offset", "map_type_js_1", "sequence_type_js_1", "tensor_type_and_shape_js_1", "TypeInfoValue", "exports", "unionToTypeInfoValue", "type", "accessor", "unionListToTypeInfoValue", "index", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "type_info_value_js_1", "TypeInfo", "_TypeInfo", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "builder", "denotationOffset", "valueType", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "type_info_js_1", "ValueInfo", "_ValueInfo", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "flatbuffers", "node_edge_js_1", "runtime_optimizations_js_1", "value_info_js_1", "Graph", "_Graph", "i", "bb", "obj", "index", "offset", "tensor_js_1", "node_js_1", "optionalEncoding", "sparse_tensor_js_1", "builder", "initializersOffset", "data", "numElems", "nodeArgsOffset", "nodesOffset", "maxNodeIndex", "nodeEdgesOffset", "inputsOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "flatbuffers", "tensor_js_1", "Attribute", "_Attribute", "i", "bb", "obj", "offset", "optionalEncoding", "attribute_type_js_1", "graph_js_1", "index", "builder", "nameOffset", "docStringOffset", "type", "f", "sOffset", "tOffset", "gOffset", "floatsOffset", "data", "numElems", "intsOffset", "stringsOffset", "tensorsOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "flatbuffers", "DeprecatedKernelCreateInfos", "_DeprecatedKernelCreateInfos", "i", "bb", "obj", "index", "offset", "builder", "nodeIndicesOffset", "data", "numElems", "kernelDefHashesOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "flatbuffers", "DeprecatedNodeIndexAndKernelDefHash", "_DeprecatedNodeIndexAndKernelDefHash", "i", "bb", "obj", "offset", "builder", "nodeIndex", "o", "v", "exports", "mod", "result", "k", "__createBinding", "flatbuffers", "__importStar", "deprecated_session_state_js_1", "DeprecatedSubGraphSessionState", "_DeprecatedSubGraphSessionState", "i", "bb", "obj", "optionalEncoding", "offset", "o", "v", "__importStar", "mod", "result", "k", "__createBinding", "__setModuleDefault", "exports", "deprecated_kernel_create_infos_js_1", "deprecated_sub_graph_session_state_js_1", "DeprecatedSessionState", "_DeprecatedSessionState", "i", "bb", "obj", "flatbuffers", "offset", "index", "builder", "kernelsOffset", "subGraphSessionStatesOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "arg_type_and_index_js_1", "KernelTypeStrArgsEntry", "_KernelTypeStrArgsEntry", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "index", "builder", "kernelTypeStrOffset", "argsOffset", "data", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "kernel_type_str_args_entry_js_1", "OpIdKernelTypeStrArgsEntry", "_OpIdKernelTypeStrArgsEntry", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "index", "builder", "opIdOffset", "kernelTypeStrArgsOffset", "data", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "op_id_kernel_type_str_args_entry_js_1", "KernelTypeStrResolver", "_KernelTypeStrResolver", "i", "bb", "obj", "flatbuffers", "index", "offset", "builder", "opKernelTypeStrArgsOffset", "data", "o", "v", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "flatbuffers", "__importStar", "OperatorSetId", "_OperatorSetId", "i", "bb", "obj", "optionalEncoding", "offset", "builder", "domainOffset", "o", "v", "exports", "mod", "result", "k", "__createBinding", "__setModuleDefault", "flatbuffers", "__importStar", "StringStringEntry", "_StringStringEntry", "i", "bb", "obj", "optionalEncoding", "offset", "builder", "keyOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "flatbuffers", "string_string_entry_js_1", "Model", "_Model", "i", "bb", "obj", "offset", "index", "operator_set_id_js_1", "optionalEncoding", "graph_js_1", "builder", "irVersion", "opsetImportOffset", "data", "numElems", "producerNameOffset", "producerVersionOffset", "domainOffset", "modelVersion", "docStringOffset", "graphOffset", "o", "v", "__importStar", "exports", "mod", "result", "k", "__createBinding", "model_js_1", "InferenceSession", "_InferenceSession", "i", "bb", "obj", "flatbuffers", "optionalEncoding", "offset", "kernel_type_str_resolver_js_1", "builder", "ortVersionOffset", "import_arg_type", "import_arg_type_and_index", "import_attribute", "import_attribute_type", "import_deprecated_kernel_create_infos", "import_deprecated_node_index_and_kernel_def_hash", "import_deprecated_session_state", "import_deprecated_sub_graph_session_state", "import_dimension", "import_dimension_value", "import_dimension_value_type", "import_edge_end", "import_graph", "import_inference_session", "import_kernel_type_str_args_entry", "import_kernel_type_str_resolver", "import_map_type", "import_model", "import_node", "import_node_edge", "import_node_type", "import_nodes_to_optimize_indices", "import_op_id_kernel_type_str_args_entry", "import_operator_set_id", "import_runtime_optimization_record", "import_runtime_optimization_record_container_entry", "import_runtime_optimizations", "import_sequence_type", "import_shape", "import_sparse_tensor", "import_string_string_entry", "import_tensor", "import_tensor_data_type", "import_tensor_type_and_shape", "import_type_info", "import_type_info_value", "import_value_info", "init_fbs", "__esmMin", "init_ort_generated", "__esmMin", "init_fbs", "require_aspromise", "__commonJSMin", "exports", "module", "asPromise", "fn", "ctx", "params", "offset", "index", "pending", "resolve", "reject", "err", "require_base64", "__commonJSMin", "exports", "base64", "string", "p", "n", "b64", "s64", "i", "buffer", "start", "end", "parts", "chunk", "j", "t", "b", "invalidEncoding", "offset", "c", "require_eventemitter", "__commonJSMin", "exports", "module", "EventEmitter", "evt", "fn", "ctx", "listeners", "i", "args", "require_float", "__commonJSMin", "exports", "module", "factory", "f32", "f8b", "le", "writeFloat_f32_cpy", "val", "buf", "pos", "writeFloat_f32_rev", "readFloat_f32_cpy", "readFloat_f32_rev", "writeFloat_ieee754", "writeUint", "sign", "exponent", "mantissa", "writeUintLE", "writeUintBE", "readFloat_ieee754", "readUint", "uint", "readUintLE", "readUintBE", "f64", "writeDouble_f64_cpy", "writeDouble_f64_rev", "readDouble_f64_cpy", "readDouble_f64_rev", "writeDouble_ieee754", "off0", "off1", "readDouble_ieee754", "lo", "hi", "require_inquire", "__commonJSMin", "e", "require_utf8", "__commonJSMin", "exports", "utf8", "string", "len", "c", "i", "buffer", "start", "end", "parts", "chunk", "t", "offset", "c1", "c2", "require_pool", "__commonJSMin", "exports", "module", "pool", "alloc", "slice", "size", "SIZE", "MAX", "slab", "offset", "buf", "require_longbits", "__commonJSMin", "exports", "module", "LongBits", "util", "lo", "hi", "zero", "zeroHash", "value", "sign", "unsigned", "charCodeAt", "hash", "mask", "part0", "part1", "part2", "require_minimal", "__commonJSMin", "exports", "util", "value", "obj", "prop", "Buffer", "sizeOrArray", "hash", "unsigned", "bits", "merge", "dst", "src", "ifNotSet", "keys", "i", "str", "newError", "name", "CustomError", "message", "properties", "fieldNames", "fieldMap", "encoding", "size", "require_writer", "__commonJSMin", "exports", "module", "Writer", "util", "BufferWriter", "LongBits", "base64", "utf8", "Op", "fn", "len", "val", "noop", "State", "writer", "create", "size", "writeByte", "buf", "pos", "writeVarint32", "VarintOp", "value", "writeVarint64", "bits", "writeFixed32", "writeBytes", "i", "head", "tail", "BufferWriter_", "require_writer_buffer", "__commonJSMin", "exports", "module", "BufferWriter", "Writer", "util", "val", "buf", "pos", "i", "value", "len", "writeStringBuffer", "require_reader", "__commonJSMin", "exports", "module", "Reader", "util", "BufferReader", "LongBits", "utf8", "indexOutOfRange", "reader", "writeLength", "buffer", "create_array", "create", "value", "readLongVarint", "bits", "i", "readFixed32_end", "buf", "end", "readFixed64", "length", "start", "nativeBuffer", "bytes", "wireType", "BufferReader_", "fn", "require_reader_buffer", "__commonJSMin", "exports", "module", "BufferReader", "Reader", "util", "buffer", "len", "require_service", "__commonJSMin", "exports", "module", "Service", "util", "rpcImpl", "requestDelimited", "responseDelimited", "rpcCall", "method", "requestCtor", "responseCtor", "request", "callback", "self", "err", "response", "endedByRPC", "require_rpc", "__commonJSMin", "exports", "rpc", "require_roots", "__commonJSMin", "exports", "module", "require_index_minimal", "__commonJSMin", "exports", "protobuf", "configure", "require_minimal", "__commonJSMin", "exports", "module", "require_onnx", "__commonJSMin", "exports", "module", "$protobuf", "$Reader", "$Writer", "$util", "$root", "onnx", "valuesById", "values", "AttributeProto", "properties", "keys", "i", "message", "writer", "reader", "length", "end", "tag", "end2", "error", "object", "options", "long", "j", "typeUrlPrefix", "ValueInfoProto", "NodeProto", "TrainingInfoProto", "ModelProto", "StringStringEntryProto", "TensorAnnotation", "GraphProto", "TensorProto", "Segment", "SparseTensorProto", "TensorShapeProto", "Dimension", "$oneOfFields", "TypeProto", "Tensor", "Sequence", "Map", "Optional", "SparseTensor", "OperatorSetIdProto", "FunctionProto", "assert", "expr", "msg", "decodeUtf8String", "buffer", "import_onnx", "ArrayUtil", "MatMulUtil", "BroadcastUtil", "GemmUtil", "ProtoUtil", "LongUtil", "ShapeUtil", "SplitUtil", "PoolConvUtil", "MIN_CLIP", "MAX_CLIP", "init_util", "__esmMin", "init_long", "init_tensor", "n1", "n2", "i", "dimsA", "dimsB", "a", "b", "outputShape", "aRank", "bRank", "_BroadcastUtil", "adims", "bdims", "isMatMul", "arank", "brank", "crank", "cdims", "cShapeMatMul", "aLen", "bLen", "broadcastedIndices", "originalShape", "originalIndices", "dimOffset", "op", "inplace", "resultType", "size", "c", "Tensor", "outputIndices", "originalIndicesA", "originalIndicesB", "valA", "valB", "isAScalar", "isBScalar", "rest", "j", "shape", "finalShape", "inputRank", "finalRank", "inputShape", "inRank", "dims", "dim", "leftShape", "transLeft", "rightShape", "transRight", "biasShape", "M", "K", "N", "kDim", "_ProtoUtil", "typeProto", "type", "d", "long_default", "valueType", "tensor", "node", "attributes", "n", "_ShapeUtil", "axis", "start", "end", "rank", "strides", "indices", "offset", "tensorRank", "axes", "x", "index", "axisToIncrementOn", "k", "originalDims", "shapeHints", "nDims", "reshapedDims", "unknownDimension", "newTensorSize", "oldTensorSize", "perm", "v", "pad", "shape1", "shape2", "total", "y", "right", "outputDims", "inSqueezeList", "inputDimsIterator", "_SplitUtil", "split", "numOutputs", "shapes", "offsets", "numElementsAlongAxis", "_PoolConvUtil", "isGlobalOperator", "inputDims", "kernelShape", "dilations", "pads", "autoPad", "filterDims", "inSize", "stride", "dilation", "kernel", "padHeadIndex", "padTailIndex", "dkernel", "padNeeded", "sizeof", "type", "sizeofProto", "createView", "dataBuffer", "dataviewConstructor", "longToNumber", "i", "readProto", "view", "byteOffset", "long_default", "import_guid_typescript", "import_onnx", "Tensor", "init_tensor", "__esmMin", "init_long", "init_ort_generated", "init_util", "_Tensor", "dims", "dataProvider", "asyncDataProvider", "cache", "dataId", "ShapeUtil", "size", "empty", "constructor", "buf", "data", "indices", "value", "tensorProto", "ProtoUtil", "str", "decodeUtf8String", "dataDest", "dataSource", "elementSize", "length", "n", "array", "element", "ortTensor", "getGlsl", "version", "GLSL_ES_2_0", "GLSL_ES_3_0", "getVertexShaderSource", "glsl", "getFragShaderPreamble", "getDefaultFragShaderMain", "outputShapeLength", "init_glsl_source", "__esmMin", "init_types", "__esmMin", "repeatedTry", "checkFn", "delayFn", "_counter", "maxCounter", "resolve", "reject", "tryCount", "tryFn", "nextBackoff", "generateShaderFuncNameFromInputSamplerName", "samplerName", "assert", "generateShaderFuncNameFromInputSamplerNameAtOutCoords", "squeezeInputShape", "inputShape", "squeezedShape", "newInputShape", "getSqueezedParams", "params", "keptDims", "d", "getCoordsDataType", "rank", "getGlChannels", "init_utils", "__esmMin", "init_util", "getVecChannels", "name", "rank", "getGlChannels", "d", "getChannels", "unpackFromChannel", "init_packing_utils", "__esmMin", "init_utils", "getOutOfBoundsCondition", "rank", "shape", "dims", "cond", "i", "getOutput", "coord00", "coord01", "coord10", "coord11", "D", "getSetup", "rows", "cols", "packProgramMetadata", "createPackProgramInfo", "createPackProgramInfoLoader", "init_pack", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "handler", "input", "glsl", "getGlsl", "inputShape", "inputRank", "outputRank", "coordsDataType", "getCoordsDataType", "channels", "getChannels", "setup", "reversedInputWH", "outOfBoundsCondition", "output", "shaderSource", "processDims3D", "shape", "batch", "i", "isReshapeCheap", "dims", "reshapedDims", "isCheapReshape", "getReshapedInputCoords", "strides", "ShapeUtil", "coords", "index", "stride", "line1", "line2", "getFlattenedIndexFrom3D", "createPackedReshape3DProgramMetadata", "createPackedReshape3DProgramInfo", "createPackedReshape3DProgramInfoLoader", "init_reshape_packed", "__esmMin", "init_util", "init_glsl_source", "init_types", "init_packing_utils", "outputShape3D", "handler", "input3D", "metadata", "inputShape3D", "squeezedOutputShape", "mainLoop", "outputCoords", "glsl", "getGlsl", "shaderSource", "unpackFromChannel", "encodeAsUint8", "init_uint8_encode", "__esmMin", "init_glsl_source", "init_types", "inferenceHandler", "input", "outputShape", "glsl", "getGlsl", "shaderSource", "programInfo", "getSourceCoords", "rank", "dims", "coords", "i", "unpackProgramMetadata", "createUnpackProgramInfo", "createUnpackProgramInfoLoader", "init_unpack", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "handler", "input", "channels", "getChannels", "innerDims", "coordsDataType", "getCoordsDataType", "unpackChannel", "unpackFromChannel", "sourceCoords", "glsl", "getGlsl", "shaderSource", "RedFloat32DataEncoder", "RGBAFloatDataEncoder", "Uint8DataEncoder", "init_texture_data_encoder", "__esmMin", "init_instrument", "gl", "channels", "src", "textureSize", "result", "source", "Logger", "v", "i", "size", "buffer", "dataSize", "_value", "index", "textureType", "dest", "_textureSize", "createTextureLayoutFromTextureType", "calculateTextureWidthAndHeight", "createTextureLayoutFromShape", "init_texture_layout", "__esmMin", "init_util", "init_types", "textureLayoutStrategy", "shape", "textureType", "channel", "isPacked", "reverseWH", "breakAxis", "unpackedShape", "d", "i", "layout", "channels", "prefs", "width", "height", "rank", "inferredDims", "ShapeUtil", "getProgramInfoUniqueKey", "WebGLInferenceHandler", "init_inference_handler", "__esmMin", "init_instrument", "init_tensor", "init_util", "init_pack", "init_reshape_packed", "init_uint8_encode", "init_unpack", "init_texture_data_encoder", "init_texture_layout", "init_types", "programInfo", "inputTextureDatas", "inputs", "texture", "key", "session", "shape", "textureType", "calculateTextureWidthAndHeight", "program", "i", "artifact", "outputTextureLayout", "createTextureLayoutFromTextureType", "outputTextureData", "output", "tensor", "td", "layout", "adjustedKernelShape", "adjustedLayout", "buffer", "numFeatureMaps", "oldRowSize", "newRowSize", "newSize", "f", "oldOffset", "newOffset", "unpackedTextureLayout", "createTextureLayoutFromShape", "unpackedTextureData", "dataType", "data", "usage", "Logger", "input", "reshapedDims", "inputTD", "newTextureLayout", "ShapeUtil", "isReshapeCheap", "squeezedInputShape", "processDims3D", "squeezedOutputShape", "squeezedInputTensor", "squeezedOutputTensor", "createPackedReshape3DProgramInfoLoader", "type", "tensorId", "textureData", "Tensor", "_id", "isPacked", "encodeAsUint8", "createPackProgramInfoLoader", "createUnpackProgramInfoLoader", "AttributeWithCacheKeyImpl", "createAttributeWithCacheKey", "init_attribute_with_cache_key", "__esmMin", "attribute", "name", "batchNormalizationProgramMetadata", "batchNormalization", "parseBatchNormalizationAttributes", "createBatchNormalizationProgramInfo", "validateInputs", "init_batch_normalization", "__esmMin", "init_attribute_with_cache_key", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "attributes", "node", "epsilon", "momentum", "spatial", "createAttributeWithCacheKey", "glsl", "getGlsl", "rank", "scaleWidth", "scaleHeight", "shaderSource", "X", "scale", "B", "mean", "var_", "GlslContext", "GlslLib", "GlslLibRoutine", "GlslLibRoutineNode", "TopologicalSortGlslRoutines", "init_glsl_definitions", "__esmMin", "glContext", "programInfo", "inputTextureLayouts", "outputTextureLayout", "context", "routineBody", "dependencies", "name", "node", "nodes", "cycleCheck", "alreadyTraversed", "result", "graphNodes", "root", "i", "glslAdd", "name", "glslDiv", "glslMul", "glslSub", "glslEqual", "glslGreater", "glslLess", "glslAnd", "glslOr", "glslXor", "glslPow", "glslBuiltinBinary", "glslPRelu", "fname", "createBinaryProgramInfoLoader", "createBinaryProgramInfo", "add", "and", "div", "equal", "greater", "less", "mul", "or", "pow", "pRelu", "sub", "xor", "init_binary_op", "__esmMin", "init_util", "init_glsl_definitions", "init_glsl_source", "init_types", "handler", "inputs", "glslFunc", "outputTensorType", "cacheKey", "textureType", "isBroadcast", "ShapeUtil", "outputShape", "usePackedTexture", "calculatedShape", "BroadcastUtil", "outputRank", "aRank", "bRank", "aBcast", "bBcast", "glsl", "getGlsl", "shaderSource", "cast", "parseCastAttributes", "validateInputs", "init_cast", "__esmMin", "init_util", "handler", "inputs", "to", "node", "ProtoUtil", "createPackedConcatProgramMetadata", "createPackedConcatProgramInfo", "createPackedConcatProgramInfoLoader", "getShiftedChannelsSnippet", "init_concat_packed", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "inputCount", "cacheHint", "_v", "i", "handler", "metadata", "inputs", "axis", "inputShape", "outputShape", "dataNShape", "axisIndex", "rank", "coords", "getChannels", "dtype", "getCoordsDataType", "unpackChannel", "unpackFromChannel", "shapes", "channels", "getGlChannels", "offsets", "channel", "lastChannels", "allChannels", "getValueSnippet", "shift", "lastIndex", "glsl", "getGlsl", "shaderSource", "x", "attributes", "channelIdx", "c", "idx", "concat", "createUnpackedConcatProgramMetadata", "createUnpackedConcatProgramInfo", "createUnpackedConcatProgramInfoLoader", "getTextureIndexWhereDataResidesLinearSearch", "getTextureIndexWhereDataResidesBinarySearch", "getFetchDataFromCorrectTextureMethod", "getGetSizeInConcatAxisValueFromIndexMethod", "parseConcatAttributes", "validateInputs", "init_concat", "__esmMin", "init_attribute_with_cache_key", "init_types", "init_concat_packed", "inferenceHandler", "inputs", "attributes", "createPackedConcatProgramInfoLoader", "inputCount", "cacheHint", "_v", "i", "_handler", "metadata", "axis", "inputShape", "outputShape", "dataNShape", "axisIndex", "rank", "sizeInConcatAxis", "previousSum", "getTextureIndexWhereDataResidesMethod", "fetchDataFromCorrectTextureMethod", "getSizeInConcatAxisValueFromIndexMethod", "shaderSource", "handler", "size", "numberOfTensors", "tensorRank", "codeLines", "node", "createAttributeWithCacheKey", "inputType", "inputDimensionality", "input", "glslAbs", "glslBuiltinUnary", "glslAcos", "glslAsin", "glslAtan", "glslCeil", "glslCos", "glslElu", "alpha", "name", "glslExp", "glslFloor", "glslClip", "min", "max", "glslIdentity", "glslLeakyRelu", "glslLog", "glslNeg", "glslNot", "glslSin", "glslRelu", "glslSigmoid", "glslSqrt", "glslTan", "glslTanh", "createElementwiseProgramInfo", "createElementwiseProgramInfoLoader", "abs", "acos", "asin", "atan", "clip", "parseClipAttributes", "clipV11", "generateClipAttributesFromInputs", "ceil", "cos", "elu", "parseEluAttributes", "exp", "floor", "identity", "leakyRelu", "parseLeakyReluAttributes", "log", "neg", "not", "relu", "sigmoid", "sin", "sqrt", "tan", "tanh", "init_unary_op", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_glsl_definitions", "init_glsl_source", "init_types", "handler", "metadata", "input", "glslFunc", "textureType", "glsl", "getGlsl", "cacheKey", "inputs", "attributes", "node", "createAttributeWithCacheKey", "MIN_CLIP", "MAX_CLIP", "getActivationSnippet", "attributes", "func", "glslRelu", "glslSigmoid", "glslClip", "activationName", "activationFunction", "applyActivation", "parseInternalActivationAttributes", "init_fuse_utils", "__esmMin", "init_util", "init_unary_op", "activation", "clipMin", "clipMax", "MIN_CLIP", "MAX_CLIP", "createUnpackedGroupedConvProgramMetadata", "createUnpackedGroupedConvProgramInfo", "createUnpackedGroupedConvProgramInfoLoader", "init_conv_grouped", "__esmMin", "init_instrument", "init_glsl_source", "init_types", "init_conv", "init_fuse_utils", "hasBias", "cacheHint", "inferenceHandler", "inputs", "metadata", "attributes", "processBias", "xShape", "wShape", "outputChannelsPerGroup", "Logger", "outputShape", "calculateOutputShape", "glsl", "getGlsl", "activationFunction", "applyActivation", "getActivationSnippet", "shaderSource", "createPackedIm2ColProgramMetadata", "createPackedIm2ColProgramInfo", "createPackedIm2ColProgramInfoLoader", "init_im2col_pack", "__esmMin", "init_glsl_source", "init_types", "init_packing_utils", "cacheHint", "inferenceHandler", "metadata", "x", "w", "outputShape", "attributes", "xshape", "wshape", "rowDim", "colDim", "rank", "im2colShape", "kernelSize", "unpackChannel", "unpackFromChannel", "glsl", "getGlsl", "unrolled", "row", "col", "shaderSource", "createMatmulProgramInfo", "metadata", "inputs", "activationAttributes", "aShape", "bShape", "outputShape", "BroadcastUtil", "coordsDataType", "getCoordsDataType", "allGlChannels", "getGlChannels", "activationFunction", "applyActivation", "getActivationSnippet", "hasBias", "processBias", "getBiasForMatmulSnippet", "getBiasForMatmul", "rank", "arank", "brank", "sharedDim", "shaderSource", "createMatmulProgramInfoLoader", "createMatmulProgramMetadata", "inShape", "outShape", "isPacked", "unpackedCoordsSnippet", "inRank", "outRank", "rankDiff", "_s", "i", "coordsSnippet", "d", "isInputScalar", "ShapeUtil", "output", "matMul", "parseMatMulAttributes", "validateInputs", "init_matmul", "__esmMin", "init_util", "init_types", "init_utils", "init_fuse_utils", "init_matmul_pack", "inferenceHandler", "attributes", "createPackedMatmulProgramInfoLoader", "node", "parseInternalActivationAttributes", "cacheHint", "getBcastSamplerForMatmul", "coordsDataType", "allGlChannels", "inputs", "outShape", "unpackedACoordsSnippet", "unpackedBCoordsSnippet", "inAShape", "inBShape", "inARank", "inBRank", "outRank", "rankADiff", "rankBDiff", "_s", "i", "broadcastADims", "BroadcastUtil", "broadcastBDims", "coordsASnippet", "d", "coordsBSnippet", "swapDimSnippet", "getA", "rank", "res", "getB", "createPackedMatmulProgramMetadata", "createPackedMatmulProgramInfo", "createPackedMatmulProgramInfoLoader", "init_matmul_pack", "__esmMin", "init_util", "init_glsl_source", "init_types", "init_utils", "init_fuse_utils", "init_matmul", "hasBias", "cacheHint", "inferenceHandler", "metadata", "activationAttributes", "processBias", "aShape", "bShape", "outputShape", "isBroadcast", "ShapeUtil", "sharedDim", "sharedDimIndex", "aRank", "bRank", "glsl", "getGlsl", "getCoordsDataType", "getGlChannels", "activationFunction", "applyActivation", "getActivationSnippet", "getBiasForMatmulSnippet", "getBiasForMatmul", "getBcastedSamplerForMatmulSnippet", "getSamplerAInLoopSnippet", "getSamplerBInLoopSnippet", "getOutputCoordsSnippet", "shaderSource", "conv2DPacked", "init_conv_pack", "__esmMin", "init_conv", "init_im2col_pack", "init_matmul_pack", "inferenceHandler", "inputs", "attributes", "xshape", "kshape", "outputShape", "calculateOutputShape", "im2colOutput", "createPackedIm2ColProgramInfoLoader", "kernelReshaped", "matmulInputs", "matmulOutput", "createPackedMatmulProgramInfoLoader", "createIm2ColProgramMetadata", "createIm2ColProgramInfo", "createIm2ColProgramInfoLoader", "calculateIm2ColDims", "init_im2col", "__esmMin", "init_types", "cacheHint", "_inferenceHandler", "metadata", "x", "w", "outputShape", "attributes", "xshape", "wshape", "rank", "im2colDims", "shaderSource", "inferenceHandler", "inputShape", "kernelShape", "channels", "createDotProductProgramMetadata", "createDotProductProgramInfo", "createDotProductProgramInfoLoader", "init_dot_product", "__esmMin", "init_util", "init_glsl_source", "init_types", "init_fuse_utils", "init_im2col", "hasBias", "attributes", "inferenceHandler", "metadata", "inputs", "outputShape", "xshape", "kshape", "adjustedKernelShape", "im2colShape", "calculateIm2ColDims", "kWidth", "kHeight", "im2colStrides", "ShapeUtil", "im2colWidth", "im2colHeight", "rank", "initValue", "sharedDim", "activationFunction", "applyActivation", "getActivationSnippet", "glsl", "getGlsl", "shaderSource", "calculateOutputShape", "conv", "conv2d", "conv2DUnpackedPointwise", "conv2DUnpacked", "getAdjustedConvAttributes", "parseConvAttributes", "validateInputs", "init_conv", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_conv_grouped", "init_conv_pack", "init_dot_product", "init_fuse_utils", "init_im2col", "init_matmul", "inputShape", "kernelShape", "dilations", "adjustPads", "strides", "batchSize", "inputSpatialShape", "spatialRank", "outChannels", "dilatedKernelShape", "v", "i", "outputSpatialShape", "inferenceHandler", "inputs", "attributes", "adjustedAttributes", "packMode", "isPointwise", "createUnpackedGroupedConvProgramInfoLoader", "conv2DPacked", "xshape", "kshape", "outputShape", "reshapedX", "reshapedK", "matmulInputs", "matmulOutput", "createMatmulProgramInfoLoader", "xIm2Col", "createIm2ColProgramInfoLoader", "dotProductInputs", "createDotProductProgramInfoLoader", "pads", "PoolConvUtil", "newAttributes", "node", "activationAttributes", "parseInternalActivationAttributes", "autoPad", "group", "createAttributeWithCacheKey", "dataChannel", "filterInChannel", "computeTotalPad", "distributePadding", "calculateOutputShapeAndPads", "convTranspose", "convTranspose2d", "createConvTransposeProgramMetadata", "createUnpackedConvTransposeProgramInfo", "createUnpackedConvTransposeProgramInfoLoader", "convTranspose2DUnpacked", "getAdjustedConvTransposeAttributes", "parseConvTransposeAttributes", "validateInputs", "init_conv_transpose", "__esmMin", "init_attribute_with_cache_key", "init_glsl_source", "init_types", "init_fuse_utils", "inDim", "stride", "adj", "kernel", "dilation", "outSize", "totalPad", "autoPad", "pads", "head", "tail", "smallPad", "inputShape", "kernelShape", "dilations", "strides", "outputPadding", "outputShape", "spatialRank", "updateShape", "i", "inferenceHandler", "inputs", "attributes", "adjustedAttributes", "hasBias", "cacheHint", "metadata", "valueInit", "xShape", "wShape", "outputChannelsPerGroup", "inputChannelsPerGroup", "glsl", "getGlsl", "activationFunction", "applyActivation", "getActivationSnippet", "shaderSource", "newAttributes", "node", "activationAttributes", "parseInternalActivationAttributes", "group", "createAttributeWithCacheKey", "dataChannel", "filterInChannel", "featureMaps", "transposeProgramMetadata", "transpose", "parseTransposeAttributes", "createTransposeProgramInfo", "getAdjustedPerm", "getOutputShape", "getPermFunctionBody", "validateInputs", "init_transpose", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "createAttributeWithCacheKey", "_inferenceHandler", "input", "perm", "inputShape", "unpackedOutputShape", "rank", "shaderSource", "ShapeUtil", "name", "reverseFunc", "i", "depthToSpace", "parseDepthToSpaceAttributes", "validateInputs", "init_depth_to_space", "__esmMin", "init_transpose", "inferenceHandler", "inputs", "attributes", "blocksize", "blocksizeSqr", "transposePerm", "firstReshapeShape", "firstReshapedTensor", "transposeAttributes", "transposeOutput", "transpose", "secondReshapeShape", "node", "mode", "flatten", "parseFlattenAttributes", "validateInputs", "init_flatten", "__esmMin", "init_util", "inferenceHandler", "inputs", "axis", "outputDims", "ShapeUtil", "node", "r", "NUMBER_TYPES", "init_operators", "__esmMin", "gather", "parseGatherAttributes", "gatherProgramMetadata", "createGatherProgramInfo", "createGatherProgramInfoLoader", "validateInputs", "init_gather", "__esmMin", "init_attribute_with_cache_key", "init_operators", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "createAttributeWithCacheKey", "_handler", "metadata", "axis", "inputShape", "indexDataShape", "outputShape", "ShapeUtil", "indexCopyOps", "i", "orank", "irank", "iDrank", "shaderSource", "handler", "tensorRank", "NUMBER_TYPES", "gemm", "parseGemmAttributes", "parseGemmAttributesV7", "parseGemmAttributesV11", "createGemmProgramInfoLoader", "createGemmProgramInfo", "validateInputs", "init_gemm", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "isOptionalC", "transA", "transB", "alpha", "beta", "createAttributeWithCacheKey", "metadata", "aShape", "bShape", "M", "N", "GemmUtil", "outputShape", "sharedDim", "line", "rank", "declareC", "broadcastC", "calculateC", "shaderSource", "imageScaler", "parseImageScalerAttributes", "imageScalerProgramMetadata", "createImageScalerProgramInfo", "createImageScalerProgramInfoLoader", "createGetBiasMethod", "validateInputs", "init_image_scaler", "__esmMin", "init_attribute_with_cache_key", "init_types", "inferenceHandler", "inputs", "attributes", "node", "scale", "bias", "createAttributeWithCacheKey", "_handler", "metadata", "outputShape", "rank", "shaderSource", "handler", "numChannels", "codeLines", "i", "instanceNormalization", "parseInstanceNormalizationAttributes", "meanAndVarianceProgramMetadata", "createMeanAndVarianceProgramInfo", "createMeanAndVarianceProgramInfoLoader", "computeOutputProgramMetadata", "createComputeOutputProgramInfo", "createComputeOutputProgramInfoLoader", "validateInputs", "init_instance_normalization", "__esmMin", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "epsilon", "meanAndVariance", "node", "metadata", "input", "xDims", "channel", "channelSize", "outputShape", "shaderSource", "meanAndVarianceShape", "glsl", "getGlsl", "textureWidth", "textureHeight", "meanAndVarianceWidth", "meanAndVarianceHeight", "X", "scale", "B", "createLrnProgramInfo", "inputs", "attributes", "C", "rank", "from", "to", "alpha", "bias", "beta", "shaderSource", "lrnProgramMetadata", "createLrnProgramInfoLoader", "lrn", "parseLrnAttributes", "validateInputs", "init_lrn", "__esmMin", "init_attribute_with_cache_key", "init_types", "inferenceHandler", "node", "size", "createAttributeWithCacheKey", "padProgramMetadata", "padV2", "parsePadAttributesV2", "padV11", "parsePadAttributesV11", "generatePadAttributesFromInputs", "createPadProgramInfo", "validateInputsV2", "validateInputsV11", "getPadFunction", "getPadConstant", "getPadReflect", "getPadEdge", "init_pad", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "attributes", "node", "mode", "value", "pads", "createAttributeWithCacheKey", "attrubutes", "input", "outputShape", "ShapeUtil", "rank", "shaderSource", "glsl", "getGlsl", "width", "height", "strides", "shape", "block", "i", "averagePool", "parseAveragePoolAttributes", "createAveragePoolProgramInfo", "globalAveragePool", "parseGlobalAveragePoolAttributes", "maxPool", "parseMaxPoolAttributes", "createMaxPoolProgramInfo", "getAdjustedPoolAttributesAndOutputShape", "globalMaxPoolAttributes", "globalMaxPoolMetadata", "globalMaxPool", "validateInputs", "generatePoolingCode", "copyArray", "offsetToIndices", "init_pool", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "metadata", "node", "autoPad", "ceilMode", "countIncludePad", "kernelShape", "strides", "pads", "createAttributeWithCacheKey", "isGlobalOperator", "adjustedAttributes", "outputShape", "kernelSize", "ShapeUtil", "op1", "op2", "shaderSource", "storageOrder", "dilations", "inputShape", "hasDilations", "PoolConvUtil", "newAttributes", "inputDims", "start", "rank", "kw", "sw", "pwStart", "pwEnd", "dimW", "codeW", "codeH", "codeHEnd", "kh", "sh", "phStart", "phEnd", "dimH", "kernelStrides", "stridesRank", "padsRank", "offsetToIndicesFunction", "copyInputDims", "copyPads", "copyKernelStrides", "copyStrides", "hasPads", "sum", "cur", "padCode", "array", "arrayName", "block", "i", "reduce", "parseReduceAttributes", "createReduceProgramInfo", "validateInputs", "reduceSum", "reduceMean", "reduceMax", "reduceMin", "reduceProd", "reduceLogSum", "reduceLogSumSquare", "init_reduce", "__esmMin", "init_attribute_with_cache_key", "init_operators", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "name", "reduceOp", "reduceProgramMetadata", "node", "axes", "keepDims", "createAttributeWithCacheKey", "_handler", "_name", "outputShape", "iRank", "idxCopy", "ShapeUtil", "ops", "reduceOps", "k", "shaderSource", "NUMBER_TYPES", "size", "idxZero", "reshape", "init_reshape", "__esmMin", "init_util", "handler", "inputs", "reshapedDims", "ShapeUtil", "upsampleProgramMetadata", "upsample", "parseUpsampleAttributesV7", "parseUpsampleAttributesV9", "parseUpsampleAttributes", "createUpsampleProgramInfo", "validateInputs", "scalesValidation", "init_upsample", "__esmMin", "init_attribute_with_cache_key", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "attributes", "node", "opset", "isResize", "mode", "scales", "extrapolationValue", "coordinateTransformMode", "needRoiInput", "useExtrapolation", "nearestMode", "cubicCoefficientA", "excludeOutside", "useNearest2xOptimization", "roiInputIdx", "scalesInputIdx", "sizesInputIdx", "createAttributeWithCacheKey", "glsl", "getGlsl", "inputWidth", "inputHeight", "outputShape", "dim", "i", "outputWidth", "outputHeight", "outputPitches", "inputPitches", "precalculatedPitches", "d", "getInputFloatFunction", "shaderSource", "x", "attribute", "scale", "resizeProgramMetadata", "resize", "parseResizeAttributesV10", "parseResizeAttributesV11", "createPackedResizeProgramInfo", "prepareInputs", "parseScalesData", "parseScalesDataFromOutputSize", "init_resize_packed", "__esmMin", "init_glsl_source", "init_types", "init_utils", "init_packing_utils", "init_upsample", "inferenceHandler", "inputs", "attributes", "validateInputs", "node", "parseUpsampleAttributes", "glsl", "getGlsl", "scales", "outputShape", "s", "dim", "outputHeight", "outputWidth", "inputShape", "inputHeight", "inputWidth", "scalesHeight", "scalesWidth", "getSourceFracIndex", "coordsDataType", "getCoordsDataType", "unpackChannel", "unpackFromChannel", "shaderSource", "xDims", "outputSizes", "scalesTensor", "sizesTensor", "yDims", "i", "scale", "mode", "isResize", "scalesValidation", "length", "end", "shape", "validateInputs", "init_shape", "__esmMin", "init_tensor", "_inferenceHandler", "inputs", "Tensor", "sliceProgramMetadata", "slice", "parseSliceAttributes", "createSliceProgramInfo", "validateInputs", "sliceV10", "generateSliceAttributesFromInputs", "validateInputsV10", "init_slice", "__esmMin", "init_attribute_with_cache_key", "init_operators", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "node", "starts", "ends", "axes", "createAttributeWithCacheKey", "_inferenceHandler", "input", "_val", "i", "normalizedAxes", "ShapeUtil", "start", "end", "outputShape", "sliceOps", "shaderSource", "NUMBER_TYPES", "cacheKey", "softmaxComputeMaxProgramMetadata", "softmaxComputeScaleProgramMetadata", "softmaxProgramMetadata", "softmax", "parseSoftmaxAttributes", "parseSoftmaxAttributesV13", "softmaxV13", "computeSoftmax", "createComputeMaxProgramInfo", "createComputScaleProgramInfo", "createSoftMaxProgramInfo", "validateInputs", "init_softmax", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_glsl_source", "init_types", "init_transpose", "inferenceHandler", "inputs", "attributes", "inputShape", "axis", "ShapeUtil", "logicalRowCount", "featureCount", "node", "createAttributeWithCacheKey", "rank", "isTransposeRequired", "transposedInputShape", "perm", "transposedInputs", "transposeAttribute", "_", "i", "p", "transpose", "output", "computeMaxProgramInfo", "max", "computeScaleProgramInfo", "scale", "softMaxProgramInfo", "input", "outputShape", "textureWidth", "textureHeight", "glsl", "getGlsl", "shaderSource", "maxElementPerLogicalRow", "normalizationPerLogicalRow", "splitProgramMetadata", "split", "parseSplitAttributes", "getProgramCount", "createSplitProgramInfo", "validateInputs", "init_split", "__esmMin", "init_attribute_with_cache_key", "init_util", "init_types", "inferenceHandler", "inputs", "attributes", "axis", "ShapeUtil", "count", "output", "i", "node", "numOutputs", "createAttributeWithCacheKey", "_inferenceHandler", "offsets", "SplitUtil", "input", "index", "shapes", "offset", "outputShape", "shaderSource", "squeeze", "squeezeV13", "parseSqueezeAttributes", "validateInputs", "validateInputsV13", "init_squeeze", "__esmMin", "init_util", "inferenceHandler", "inputs", "axes", "outputShape", "ShapeUtil", "node", "sum", "createSumProgramInfo", "validateInputs", "init_sum", "__esmMin", "init_glsl_source", "init_types", "inferenceHandler", "inputs", "sumProgramMetadata", "_v", "glsl", "getGlsl", "outputShape", "shaderSource", "i", "length", "j", "tile", "createTileProgramInfo", "validateInputs", "init_tile", "__esmMin", "init_operators", "init_types", "inferenceHandler", "inputs", "tileProgramMetadata", "_handler", "inputShape", "outputShape", "tileOps", "i", "rank", "shaderSource", "NUMBER_TYPES", "unsqueeze", "unsqueezeV13", "parseUnsqueezeAttributes", "validateInputs", "validateInputsV13", "init_unsqueeze", "__esmMin", "init_util", "inferenceHandler", "inputs", "axes", "outputShape", "ShapeUtil", "node", "WEBGL_OP_RESOLVE_RULES", "init_op_resolve_rules", "__esmMin", "init_batch_normalization", "init_binary_op", "init_cast", "init_concat", "init_conv", "init_conv_transpose", "init_depth_to_space", "init_flatten", "init_gather", "init_gemm", "init_image_scaler", "init_instance_normalization", "init_lrn", "init_matmul", "init_pad", "init_pool", "init_reduce", "init_reshape", "init_resize_packed", "init_shape", "init_slice", "init_softmax", "init_split", "init_squeeze", "init_sum", "init_tile", "init_transpose", "init_unary_op", "init_unsqueeze", "init_upsample", "abs", "acos", "add", "and", "asin", "atan", "averagePool", "parseAveragePoolAttributes", "batchNormalization", "parseBatchNormalizationAttributes", "cast", "parseCastAttributes", "ceil", "clip", "parseClipAttributes", "clipV11", "concat", "parseConcatAttributes", "conv", "parseConvAttributes", "convTranspose", "parseConvTransposeAttributes", "cos", "div", "identity", "depthToSpace", "parseDepthToSpaceAttributes", "equal", "elu", "parseEluAttributes", "exp", "flatten", "parseFlattenAttributes", "floor", "gather", "parseGatherAttributes", "gemm", "parseGemmAttributesV7", "parseGemmAttributesV11", "globalAveragePool", "parseGlobalAveragePoolAttributes", "globalMaxPool", "greater", "imageScaler", "parseImageScalerAttributes", "instanceNormalization", "parseInstanceNormalizationAttributes", "leakyRelu", "parseLeakyReluAttributes", "less", "lrn", "parseLrnAttributes", "log", "matMul", "parseMatMulAttributes", "maxPool", "parseMaxPoolAttributes", "mul", "neg", "not", "or", "padV2", "parsePadAttributesV2", "padV11", "parsePadAttributesV11", "pow", "pRelu", "reduceLogSum", "parseReduceAttributes", "reduceMax", "reduceMean", "reduceMin", "reduceProd", "reduceSum", "reduceLogSumSquare", "relu", "reshape", "resize", "parseResizeAttributesV10", "parseResizeAttributesV11", "shape", "sigmoid", "sin", "sliceV10", "slice", "parseSliceAttributes", "softmax", "parseSoftmaxAttributes", "softmaxV13", "parseSoftmaxAttributesV13", "split", "parseSplitAttributes", "sqrt", "squeeze", "parseSqueezeAttributes", "squeezeV13", "sub", "sum", "tan", "tanh", "tile", "transpose", "parseTransposeAttributes", "upsample", "parseUpsampleAttributesV7", "parseUpsampleAttributesV9", "unsqueeze", "parseUnsqueezeAttributes", "unsqueezeV13", "xor", "replaceInlines", "script", "inlineDefs", "match", "INLINE_FUNC_DEF_REGEX", "params", "s", "tokens", "v", "name", "regexString", "FUNC_CALL_REGEX", "regex", "type", "variable", "declLine", "newBody", "paramRedecLine", "i", "replacement", "init_glsl_function_inliner", "__esmMin", "squeezeShape", "shape", "axis", "newShape", "keptDims", "isEmptyArray", "axes", "parseAxisParam", "j", "i", "rank", "_s", "assert", "ax", "isInt", "a", "sizeFromShape", "size", "sizeToSquarishShape", "width", "PreferLogicalStrategy", "init_texture_layout_strategy", "__esmMin", "init_instrument", "init_util", "maxTextureSize", "prefs", "wh", "isPacked", "wsize", "b", "hsize", "Logger", "logShape", "_d", "d", "CoordsGlslLib", "init_glsl_coordinate_lib", "__esmMin", "init_util", "init_glsl_definitions", "init_glsl_source", "init_texture_layout_strategy", "init_utils", "GlslLib", "context", "funcName", "GlslLibRoutine", "outputLayout", "outShape", "outTexShape", "result", "floatTextureSetRGBASource", "getGlsl", "floatTextureSetRGBAFuncName", "floatTextureSetRSource", "floatTextureSetRFuncName", "_shape", "texShape", "packedTexShape", "source", "shape", "ArrayUtil", "texelsInLogicalRow", "texelsInBatch", "texelsInBatchN", "batches", "coords", "b", "rank", "strides", "i", "coordsToCompute", "coordsFromIndexSnippet", "stride", "line1", "line2", "glsl", "samplerName", "inputLayout", "generateShaderFuncNameFromInputSamplerName", "outCoordFuncName", "generateShaderFuncNameFromInputSamplerNameAtOutCoords", "name", "inShape", "texFuncSnippet", "inRank", "outRank", "broadcastDims", "BroadcastUtil", "type", "getCoordsDataType", "rankDiff", "coordsSnippet", "fields", "getGlChannels", "d", "unpackedCoordsSnippet", "_s", "output", "isInputScalar", "ShapeUtil", "isOutputScalar", "rows", "cols", "swapLastDimsSnippet", "inTexShape", "texNumR", "texNumC", "packedSampler", "valuesPerRow", "squeezedShape", "keptDims", "newInputShape", "squeezeInputShape", "params", "newInputLayout", "samplerRoutine", "getSqueezedParams", "index", "tNumR", "tNumC", "newShape", "squeezeShape", "stride0", "stride1", "routine", "revDims", "stride2", "stride3", "stride4", "xScale", "yScale", "stridesBlock", "body", "layout", "varName", "width", "height", "transpose", "EncodingGlslLib", "init_glsl_encoding_lib", "__esmMin", "init_glsl_definitions", "_EncodingGlslLib", "GlslLib", "context", "GlslLibRoutine", "endianness", "b", "a", "c", "FragColorGlslLib", "init_glsl_fragcolor_lib", "__esmMin", "init_glsl_definitions", "init_glsl_source", "GlslLib", "context", "glsl", "getGlsl", "GlslLibRoutine", "ShapeUtilsGlslLib", "init_glsl_shape_utils_lib", "__esmMin", "init_glsl_definitions", "_ShapeUtilsGlslLib", "GlslLib", "context", "outputRank", "result", "name", "i", "shape", "rank", "dimOffset", "funcName", "block", "body", "GlslLibRoutine", "strides", "stridesBlock", "shapeInit", "VecGlslLib", "init_glsl_vec_lib", "__esmMin", "init_glsl_definitions", "GlslLib", "context", "rank", "nameOp", "result", "name", "fname", "assignmentBlock", "i", "body", "GlslLibRoutine", "block", "glslRegistry", "init_glsl_registered_libs", "__esmMin", "init_glsl_coordinate_lib", "init_glsl_encoding_lib", "init_glsl_fragcolor_lib", "init_glsl_shape_utils_lib", "init_glsl_vec_lib", "EncodingGlslLib", "FragColorGlslLib", "VecGlslLib", "ShapeUtilsGlslLib", "CoordsGlslLib", "GlslPreprocessor", "init_glsl_preprocessor", "__esmMin", "init_glsl_definitions", "init_glsl_function_inliner", "init_glsl_registered_libs", "init_glsl_source", "glContext", "programInfo", "inputTextureLayouts", "outputTextureLayout", "GlslContext", "glslRegistry", "name", "lib", "map", "libName", "routinesInLib", "routine", "key", "currentNode", "GlslLibRoutineNode", "dependencies", "i", "node", "source", "getDefaultFragShaderMain", "replaceInlines", "getFragShaderPreamble", "script", "routinesIncluded", "routines", "nodes", "classAndRoutine", "TopologicalSortGlslRoutines", "samplers", "variables", "uniformLines", "sampler", "variable", "ProgramManager", "init_program_manager", "__esmMin", "init_esm", "init_instrument", "init_glsl_preprocessor", "init_glsl_source", "profiler", "glContext", "textureLayoutStrategy", "key", "artifact", "buildArtifact", "inputs", "output", "gl", "program", "err", "Logger", "a", "programInfo", "inputTextureLayouts", "outputTextureLayout", "preprocessor", "GlslPreprocessor", "fragScript", "fragShaderScript", "vertexShaderScript", "getVertexShaderSource", "env", "fragShader", "td", "width", "height", "attribLocations", "positionHandle", "textureCoordHandle", "uniformLocations", "variables", "textures", "texturePosition", "name", "type", "location", "arrayLength", "value", "v", "uniformHandle", "position", "samplers", "sampler", "variable", "reference", "TextureManager", "init_texture_manager", "__esmMin", "init_instrument", "init_texture_data_encoder", "glContext", "layoutStrategy", "profiler", "config", "dataType", "layout", "data", "usage", "textureDataType", "encoder", "width", "height", "key", "inUseTextures", "idleTextures", "texture", "Logger", "td", "channels", "dataSize", "b", "dataId", "subscribers", "resolve", "a", "tensorData", "textureData", "deleteTexture", "index", "_dataType", "WebGLSessionHandler", "init_session_handler", "__esmMin", "init_instrument", "init_opset", "init_inference_handler", "init_op_resolve_rules", "init_program_manager", "init_texture_layout_strategy", "init_texture_manager", "backend", "context", "PreferLogicalStrategy", "ProgramManager", "TextureManager", "WebGLInferenceHandler", "graph", "initializers", "v", "tensorId", "isPacked", "textureData", "Logger", "td", "node", "opsets", "op", "resolveOperator", "WEBGL_OP_RESOLVE_RULES", "linearSearchLastTrue", "arr", "i", "WebGLContext", "init_webgl_context", "__esmMin", "init_esm", "init_texture_data_encoder", "init_utils", "gl", "version", "width", "height", "encoder", "data", "texture", "buffer", "dataSize", "dataType", "channels", "positionHandle", "textureCoordHandle", "vertexShader", "fragShader", "program", "shaderSource", "shaderType", "shader", "position", "uniformHandle", "env", "error", "label", "usage", "RedFloat32DataEncoder", "RGBAFloatDataEncoder", "Uint8DataEncoder", "unit", "geometry", "fb", "internalFormat", "frameBuffer", "isComplete", "fragmentShader", "gl2", "ext", "query", "available", "disjoint", "timeElapsed", "repeatedTry", "fenceContext", "isFencePassed", "status", "resolve", "index", "x", "resolveFn", "isDoneFn", "createWebGLContext", "contextId", "context", "cache", "offscreenCanvas", "createOffscreenCanvas", "createNewWebGLContext", "canvas", "createCanvas", "gl", "contextAttributes", "ca", "WebGLContext", "err", "Logger", "init_webgl_context_factory", "__esmMin", "init_instrument", "init_webgl_context", "WebGLBackend", "init_backend_webgl", "__esmMin", "init_esm", "init_instrument", "init_session_handler", "init_webgl_context_factory", "env", "value", "createWebGLContext", "Logger", "e", "context", "WebGLSessionHandler", "resolveBackend", "hint", "hints", "backendHint", "cache", "backendsCache", "backend", "tryLoadBackend", "backendObj", "isBackend", "init", "obj", "o", "init_backend", "__esmMin", "init_backend_webgl", "WebGLBackend", "KernelOp", "ExecutionPlan", "init_execution_plan", "__esmMin", "init_instrument", "op", "node", "graph", "ops", "profiler", "graphNodes", "i", "resolved", "input", "sessionHandler", "modelInputs", "inferenceHandler", "graphInputs", "index", "sequence", "graphValues", "rear", "thisOpIndex", "thisOp", "inputList", "inputTensors", "Logger", "t", "outputList", "output", "j", "downstreamNodes", "_output", "currentDownstreamNodeIndex", "currentDownstreamNode", "k", "outputIndex", "outputTensor", "import_onnx", "Attribute", "init_attribute", "__esmMin", "init_ort_generated", "init_tensor", "init_util", "_Attribute", "attributes", "attr", "key", "type", "value", "defaultValue", "valueAndType", "attrType", "LongUtil", "arr", "numberValue", "i", "maybeLong", "Tensor", "decodeUtf8String", "ints", "strings", "tensors", "import_onnx", "Graph", "Value", "Node", "GraphImpl", "init_graph", "__esmMin", "init_attribute", "init_ort_generated", "init_tensor", "init_util", "graphProto", "initializer", "valueInfo", "ProtoUtil", "_nodeProto", "name", "Attribute", "graph", "graphInitializer", "dataIndices", "nodesIndices", "inputValueNames", "currentIndex", "index", "value", "Tensor", "nodeProto", "pick", "node", "output", "dataIndex", "input", "inputName", "j", "type", "shape", "dims", "k", "LongUtil", "outputName", "starters", "i", "nodesStack", "nodesState", "nodeIndex", "outgoingEdgeIndex", "data", "downstreamNodeIndex", "offset", "newIndices", "nodePossition", "ind", "currentData", "inputValueIndex", "outputValueIndex", "nodesConsumingOutput", "delIndex", "replaceIndex", "n", "next", "child", "MIN_CLIP", "MAX_CLIP", "flatbuffers", "import_onnx", "Model", "init_model", "__esmMin", "init_graph", "init_ort_generated", "init_util", "buf", "graphInitializer", "isOrtFormat", "onnxError", "e", "modelProto", "LongUtil", "Graph", "fb", "ortModel", "i", "opsetId", "Session", "init_session", "__esmMin", "init_backend", "init_execution_plan", "init_instrument", "init_model", "config", "Profiler", "arg", "byteOffset", "length", "backend", "resolveBackend", "Model", "isOrtFormat", "buf", "arr", "modelProtoBlob", "graphInitializer", "ExecutionPlan", "inputs", "inputTensors", "outputTensors", "modelInputNames", "sortedInputs", "sortedInputsIndex", "tensor", "modelInputIndices", "modelValues", "graphInputDims", "i", "graphInput", "graphInputTypes", "givenInputs", "expectedType", "actualType", "noneDimSupported", "expectedDims", "actualDims", "modelOutputNames", "output", "graph", "nodes", "OnnxjsSessionHandler", "init_session_handler_inference", "__esmMin", "init_esm", "init_tensor", "session", "feeds", "_fetches", "_options", "inputMap", "name", "feed", "Tensor", "outputMap", "output", "tensor", "backend_onnxjs_exports", "__export", "onnxjsBackend", "OnnxjsBackend", "init_backend_onnxjs", "__esmMin", "init_session", "init_session_handler_inference", "pathOrBuffer", "options", "session", "Session", "OnnxjsSessionHandler", "init_esm", "version", "index_default", "esm_exports", "onnxjsBackend", "registerBackend", "env", "version"]
}
